:root {
  color-scheme: dark;
  --ink: #f5eddb;
  --muted: #9daabd;
  --faint: #6f7e91;
  --night: #02050d;
  --navy: #06101f;
  --navy-2: #09182b;
  --panel: rgba(7, 17, 32, 0.82);
  --panel-strong: rgba(8, 20, 38, 0.94);
  --gold: #e3b451;
  --gold-bright: #ffd77b;
  --gold-pale: #f7e5b4;
  --blue: #4da4d8;
  --line: rgba(230, 185, 88, 0.2);
  --line-soft: rgba(166, 189, 216, 0.13);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --font-sans: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -8%, rgba(31, 105, 159, 0.2), transparent 30rem),
    radial-gradient(circle at 87% 8%, rgba(189, 121, 26, 0.14), transparent 34rem),
    linear-gradient(145deg, #01040a 0%, #06101e 48%, #030711 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -4;
  content: "";
  opacity: 0.55;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(231,183,83,.65) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(110,175,214,.55) 0 1px, transparent 1.5px);
  background-position: 0 0, 43px 89px, 121px 37px;
  background-size: 173px 173px, 229px 229px, 311px 311px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.7) 45%, transparent 100%);
}

button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.cosmos {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.cosmos__orb {
  position: absolute;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .2;
}

.cosmos__orb--one {
  top: -22rem;
  right: -10rem;
  background: radial-gradient(circle, rgba(255,190,74,.75), rgba(177,103,18,.1) 50%, transparent 70%);
}

.cosmos__orb--two {
  bottom: -24rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(42,135,197,.72), rgba(26,83,130,.1) 55%, transparent 72%);
}

.cosmos__arc {
  position: absolute;
  top: 9vh;
  left: 50%;
  width: min(96vw, 86rem);
  aspect-ratio: 1;
  border: 1px solid rgba(227,180,81,.08);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 100px rgba(226,174,69,.035), inset 0 0 100px rgba(64,145,196,.025);
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 0 0 20px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .26em;
}

.eyebrow span { width: 30px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow span:last-child { transform: rotate(180deg); }
.eyebrow--left { justify-content: flex-start; }

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 56px 24px;
}

.login-stage {
  position: relative;
  display: grid;
  width: min(100%, 510px);
  justify-items: center;
}

.login-emblem { position: relative; display: grid; width: 184px; height: 184px; place-items: center; margin-bottom: 14px; }
.login-emblem img { position: relative; z-index: 2; width: 146px; height: 146px; object-fit: cover; border-radius: 50%; filter: drop-shadow(0 0 26px rgba(235,182,63,.25)); }

.login-emblem__halo {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(235,187,80,.28);
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgba(221,168,55,.1), 0 0 55px rgba(220,164,52,.08);
}

.login-emblem__halo::before,
.login-emblem__halo::after {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px solid rgba(88,164,210,.2);
  border-radius: 50%;
}

.login-emblem__halo::after { inset: -7px 54px; border-color: rgba(234,186,80,.18); }

.login-copy { text-align: center; }
.login-copy h1 { margin: 0; font: 600 clamp(34px, 7vw, 48px)/1.12 var(--font-serif); letter-spacing: .13em; text-indent: .13em; }
.login-copy > p:last-child { max-width: 430px; margin: 18px auto 30px; color: var(--muted); font-size: 14px; line-height: 1.85; }

.login-card {
  position: relative;
  width: 100%;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(12,27,49,.9), rgba(5,13,25,.94));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(24px);
}

.login-card::before {
  position: absolute;
  top: 0;
  left: 15%;
  width: 70%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-card label { display: block; margin-bottom: 10px; color: var(--gold-pale); font-size: 13px; font-weight: 650; letter-spacing: .08em; }

.password-field { position: relative; }
.password-field input {
  width: 100%;
  height: 54px;
  padding: 0 72px 0 17px;
  color: #fff8e7;
  border: 1px solid rgba(175,199,224,.19);
  border-radius: 13px;
  outline: none;
  background: rgba(1,7,15,.68);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.password-field input::placeholder { color: #607187; }
.password-field input:focus { border-color: rgba(231,187,91,.72); background: rgba(3,10,20,.92); box-shadow: 0 0 0 3px rgba(226,179,79,.1); }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 13px;
  padding: 6px 8px;
  color: var(--gold);
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  font-size: 12px;
}

.form-error { margin: 12px 2px 0; color: #ffc2ac; font-size: 13px; }

.primary-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding: 0 18px;
  color: #171006;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(100deg, #b8802d, #f0c66c 47%, #d49a3d);
  box-shadow: 0 10px 30px rgba(205,146,43,.2), inset 0 1px rgba(255,255,255,.35);
  cursor: pointer;
  font-weight: 760;
  letter-spacing: .06em;
  transition: transform .18s, filter .18s;
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button b { font-size: 20px; font-weight: 400; }

.privacy-note { display: flex; align-items: flex-start; gap: 8px; margin: 18px 2px 0; color: #708096; font-size: 11px; line-height: 1.65; }
.privacy-note span { color: var(--gold); font-size: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(2,7,14,.78);
  backdrop-filter: blur(20px);
}

.brand { display: inline-flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand img { width: 50px; height: 50px; object-fit: cover; border: 1px solid rgba(237,194,96,.3); border-radius: 50%; box-shadow: 0 0 24px rgba(225,173,62,.12); }
.brand span { display: grid; gap: 3px; }
.brand strong { font: 600 17px/1.2 var(--font-serif); letter-spacing: .14em; }
.brand small { color: var(--faint); font-size: 9px; letter-spacing: .12em; }

.ghost-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: #c7d1df;
  border: 1px solid rgba(162,185,213,.15);
  border-radius: 11px;
  background: rgba(8,19,35,.58);
  cursor: pointer;
  font-size: 12px;
}
.ghost-button:hover { color: var(--gold-pale); border-color: rgba(225,178,76,.38); }
.ghost-button i { color: var(--gold); font-style: normal; }

.archive-shell { width: min(calc(100% - 48px), 1440px); margin: 0 auto; }

.hero {
  position: relative;
  display: grid;
  min-height: 420px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero__content { position: relative; z-index: 2; padding: 72px 0 64px; }
.hero h1 { max-width: 760px; margin: 0; font: 600 clamp(44px, 6vw, 78px)/1.13 var(--font-serif); letter-spacing: .035em; }
.hero h1 em { color: var(--gold-bright); font-style: normal; text-shadow: 0 0 30px rgba(225,173,63,.15); }
.hero__content > p:not(.eyebrow) { max-width: 650px; margin: 24px 0 0; color: var(--muted); font-size: 15px; line-height: 1.9; }

.hero__metrics { display: flex; gap: 46px; margin-top: 38px; }
.hero__metrics div { position: relative; display: grid; gap: 4px; }
.hero__metrics div + div::before { position: absolute; top: 5px; bottom: 5px; left: -23px; width: 1px; content: ""; background: var(--line-soft); }
.hero__metrics strong { font: 600 25px/1 var(--font-serif); color: var(--gold-pale); }
.hero__metrics span { color: var(--faint); font-size: 10px; letter-spacing: .12em; }

.hero__seal { position: relative; display: grid; place-items: center; justify-self: end; width: min(34vw, 390px); aspect-ratio: 1; opacity: .76; }
.hero__seal img { width: 74%; height: 74%; object-fit: cover; border-radius: 50%; filter: drop-shadow(0 0 44px rgba(220,169,60,.2)); }
.hero__seal-ring { position: absolute; inset: 4%; border: 1px solid rgba(230,184,82,.21); border-radius: 50%; box-shadow: 0 0 80px rgba(218,157,42,.08), inset 0 0 80px rgba(56,148,207,.05); }
.hero__seal-ring::before, .hero__seal-ring::after { position: absolute; content: ""; border-radius: 50%; }
.hero__seal-ring::before { inset: 7%; border: 1px solid rgba(99,166,207,.14); }
.hero__seal-ring::after { inset: -4% 42%; border: 1px solid rgba(230,184,82,.2); }

.library { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 38px; padding: 48px 0 90px; }

.document-rail { align-self: start; }
.section-heading p, .content-heading p { margin: 0 0 7px; color: var(--gold); font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.section-heading h2, .content-heading h3 { margin: 0; font: 600 24px/1.3 var(--font-serif); letter-spacing: .06em; }

.document-nav { display: grid; gap: 10px; margin-top: 22px; }
.document-nav__item {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0,1fr) 20px;
  gap: 10px;
  align-items: center;
  padding: 16px 14px;
  text-align: left;
  border: 1px solid rgba(157,183,212,.1);
  border-radius: 15px;
  background: rgba(7,17,31,.55);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.document-nav__item:hover { border-color: rgba(225,178,75,.32); transform: translateX(2px); }
.document-nav__item[aria-current="true"] { border-color: rgba(226,179,80,.42); background: linear-gradient(110deg, rgba(174,117,34,.17), rgba(8,23,41,.82)); box-shadow: inset 3px 0 var(--gold); }
.document-nav__number { color: var(--gold); font: 500 12px/1 var(--font-serif); }
.document-nav__copy { display: grid; min-width: 0; gap: 5px; }
.document-nav__copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.document-nav__copy small { color: var(--faint); font-size: 10px; }
.document-nav__arrow { color: #6e8096; font-size: 13px; }
.document-nav__item[aria-current="true"] .document-nav__arrow { color: var(--gold); }

.scope-card { display: flex; gap: 12px; margin-top: 20px; padding: 16px; border: 1px solid rgba(66,142,189,.16); border-radius: 15px; background: rgba(5,25,41,.48); }
.scope-card__mark { color: #69b7e5; }
.scope-card strong { color: #cfe8f7; font-size: 11px; letter-spacing: .06em; }
.scope-card p { margin: 7px 0 0; color: #72899c; font-size: 10px; line-height: 1.65; }

.document-panel { min-width: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.toolbar > p { margin: 0; color: var(--faint); font-size: 11px; white-space: nowrap; }

.search-field { display: flex; width: min(100%, 570px); height: 48px; align-items: center; gap: 10px; padding: 0 13px; color: #7e90a7; border: 1px solid rgba(157,183,212,.13); border-radius: 13px; background: rgba(5,15,29,.68); }
.search-field:focus-within { border-color: rgba(229,183,82,.44); box-shadow: 0 0 0 3px rgba(224,177,74,.07); }
.search-field > span { color: var(--gold); font-size: 20px; }
.search-field input { min-width: 0; flex: 1; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-field input::placeholder { color: #607187; }
.search-field kbd { padding: 4px 7px; color: #7c8da2; border: 1px solid rgba(149,176,207,.14); border-radius: 6px; background: rgba(0,0,0,.16); font: 10px/1 var(--font-sans); }

.document-view { min-height: 560px; }
.document-heading { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 32px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: linear-gradient(135deg, rgba(13,31,54,.93), rgba(6,15,28,.92)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035); }
.document-heading::after { position: absolute; top: -80px; right: -45px; width: 220px; height: 220px; content: ""; border: 1px solid rgba(228,182,79,.12); border-radius: 50%; box-shadow: 0 0 70px rgba(229,177,64,.05); }
.document-heading__copy { position: relative; z-index: 2; }
.document-kicker { margin: 0 0 11px; color: var(--gold); font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.document-heading h2 { margin: 0; font: 600 clamp(27px, 4vw, 39px)/1.25 var(--font-serif); letter-spacing: .035em; }
.document-summary { max-width: 690px; margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.document-badge { position: relative; z-index: 2; display: grid; min-width: 190px; gap: 7px; padding-left: 20px; border-left: 1px solid var(--line); }
.document-badge span { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .2em; }
.document-badge strong { overflow: hidden; max-width: 260px; color: #aebacd; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.metric-card { display: grid; min-height: 126px; align-content: center; gap: 7px; padding: 20px; border: 1px solid var(--line-soft); border-radius: 17px; background: rgba(7,17,31,.66); }
.metric-card > span { color: var(--faint); font-size: 10px; letter-spacing: .08em; }
.metric-card strong { color: var(--gold-pale); font: 600 27px/1.1 var(--font-serif); }
.metric-card small { color: #64758b; font-size: 9px; line-height: 1.5; }

.content-section { margin-top: 14px; padding: 28px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: rgba(6,16,30,.68); }
.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.content-heading h3 { font-size: 20px; }

.inventory-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.inventory-tags span { padding: 8px 12px; color: #b9c8d8; border: 1px solid rgba(123,170,200,.16); border-radius: 999px; background: rgba(12,38,58,.5); font-size: 11px; }

.group-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.group-card { padding: 18px; border: 1px solid rgba(154,181,211,.1); border-radius: 15px; background: rgba(4,13,25,.52); transition: border-color .18s, transform .18s; }
.group-card:hover { border-color: rgba(224,178,76,.25); transform: translateY(-1px); }
.group-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.group-card h4 { margin: 0; color: #e7e1d3; font-size: 13px; font-weight: 650; }
.group-card__top strong { color: var(--gold); font: 600 17px/1 var(--font-serif); }
.group-card > p { margin: 10px 0 0; color: #718399; font-size: 10px; line-height: 1.65; }
.group-card__items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.group-card__items span { padding: 5px 8px; color: #90a6b9; border-radius: 7px; background: rgba(23,54,75,.52); font-size: 9px; }

.note-list { display: grid; gap: 0; }
.note-item { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; padding: 14px 0; border-top: 1px solid rgba(156,183,213,.09); }
.note-item:first-child { border-top: 0; }
.note-item span { color: var(--gold); font: 500 10px/1.8 var(--font-serif); }
.note-item p { margin: 0; color: #8d9db0; font-size: 11px; line-height: 1.75; }
.muted-copy { color: var(--faint); font-size: 12px; }

.loading-card { display: grid; gap: 15px; padding: 34px; border: 1px solid var(--line-soft); border-radius: var(--radius-xl); background: rgba(7,17,31,.58); }
.loading-card span { height: 18px; border-radius: 10px; background: linear-gradient(90deg, rgba(127,153,180,.06), rgba(224,178,76,.12), rgba(127,153,180,.06)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.loading-card span:nth-child(1) { width: 43%; height: 32px; }
.loading-card span:nth-child(2) { width: 86%; }
.loading-card span:nth-child(3) { width: 69%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state, .error-state { display: grid; min-height: 240px; place-items: center; align-content: center; text-align: center; }
.empty-state > span, .error-state > span { display: grid; width: 43px; height: 43px; place-items: center; color: var(--gold); border: 1px solid var(--line); border-radius: 50%; }
.empty-state strong, .error-state h2 { margin-top: 16px; }
.empty-state p, .error-state p { max-width: 430px; margin: 8px 0 0; color: var(--faint); font-size: 12px; line-height: 1.7; }
.error-state .primary-button { width: auto; min-width: 140px; }

.site-footer { display: flex; width: min(calc(100% - 48px), 1440px); justify-content: space-between; margin: 0 auto; padding: 24px 0 40px; color: #526177; border-top: 1px solid var(--line-soft); font-size: 9px; letter-spacing: .11em; }
.site-footer p { margin: 0; color: #77879a; }

@media (max-width: 980px) {
  .hero { min-height: 370px; grid-template-columns: 1fr 240px; }
  .hero__seal { width: 240px; }
  .library { grid-template-columns: 1fr; }
  .document-nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .scope-card { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .site-header { min-height: 72px; padding: 10px 17px; }
  .brand img { width: 44px; height: 44px; }
  .brand strong { font-size: 15px; }
  .brand small { display: none; }
  .ghost-button span { display: none; }
  .archive-shell, .site-footer { width: min(calc(100% - 30px), 1440px); }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero__content { padding: 58px 0 46px; }
  .hero__seal { position: absolute; top: 35px; right: -78px; width: 260px; opacity: .14; }
  .hero h1 { font-size: clamp(39px, 13vw, 58px); }
  .hero__metrics { gap: 28px; }
  .hero__metrics div + div::before { left: -14px; }
  .library { gap: 26px; padding: 34px 0 64px; }
  .document-nav { grid-template-columns: 1fr; }
  .document-nav__item { padding: 14px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar > p { padding-left: 3px; }
  .search-field { width: 100%; }
  .document-heading { align-items: flex-start; flex-direction: column; padding: 25px 22px; }
  .document-badge { width: 100%; padding: 13px 0 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-card { min-height: 112px; padding: 16px; }
  .metric-card strong { font-size: 22px; }
  .content-section { padding: 23px 20px; }
  .group-grid { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 440px) {
  .login-shell { padding: 36px 17px; }
  .login-emblem { width: 146px; height: 146px; }
  .login-emblem img { width: 118px; height: 118px; }
  .login-copy h1 { font-size: 34px; }
  .login-card { padding: 23px 19px; border-radius: 22px; }
  .hero__metrics { justify-content: space-between; gap: 10px; }
  .hero__metrics div + div::before { display: none; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .search-field kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
