/* =========================================================
   贝投指南 · 共享样式表 /assets/site.css
   深海蓝基底 + 琥珀金行动色 + 薄荷绿状态色
   ========================================================= */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 132px;
}

body { margin: 0; padding: 0; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

img, svg, video, canvas { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

table { border-collapse: collapse; width: 100%; }

a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }

/* ---------- Tokens ---------- */
:root {
  --ink-950: #07131F;
  --ink-900: #0B1B2B;
  --ink-800: #12304A;
  --paper: #F2EFE7;
  --stone: #8C9AA3;
  --amber: #DDA43B;
  --coral: #E2684B;
  --mint: #7FD1AE;
  --moss: #7C8C6A;
  --clay: #B5715A;

  --line: rgba(140, 154, 163, 0.22);
  --line-strong: rgba(140, 154, 163, 0.44);
  --veil: rgba(242, 239, 231, 0.72);
  --veil-dim: rgba(242, 239, 231, 0.55);

  --shell: 1280px;
  --gutter: clamp(18px, 4vw, 56px);
  --rail-w: 288px;

  --font-display: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --shadow-soft: 0 1px 0 rgba(242, 239, 231, 0.03), 0 22px 44px -38px rgba(0, 0, 0, 0.95);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  font-size: clamp(15.5px, 15px + 0.16vw, 17px);
  line-height: 1.7;
  font-weight: 400;
  color: var(--paper);
  background-color: var(--ink-900);
  background-image: linear-gradient(180deg, rgba(18, 48, 74, 0.55), rgba(11, 27, 43, 0) 460px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

::selection { background: var(--amber); color: var(--ink-900); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: var(--gutter);
  z-index: 200;
  padding: 11px 20px;
  background: var(--amber);
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: top 0.16s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--ink-900);
  border-bottom: 1px solid var(--line);
}

.status-bar {
  background: var(--ink-950);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--stone);
}

.status-bar__inner {
  width: min(calc(100% - var(--gutter) * 2), var(--shell));
  margin-inline: auto;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.status-bar__scope {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(127, 209, 174, 0.16);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

.status-bar__meta { margin: 0; color: var(--stone); }
.status-bar__label {
  color: var(--amber);
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
}

.masthead {
  background: var(--ink-900);
}

.masthead__inner {
  width: min(calc(100% - var(--gutter) * 2), var(--shell));
  margin-inline: auto;
  padding-block: 16px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 32px);
}

.brand {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  flex: none;
}

.brand__text { display: block; }

.brand__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.brand__sub {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--stone);
}

.nav { display: flex; align-items: center; }

.nav__head { display: none; }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 30px);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--veil);
  transition: color 0.16s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.18s ease;
}

.nav__link:hover { color: var(--paper); }
.nav__link:hover::after { transform: scaleX(1); }

.nav__link[aria-current="page"] {
  color: var(--paper);
  font-weight: 600;
}
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: 1px solid rgba(221, 164, 59, 0.5);
  color: var(--amber);
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.cta-link:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink-900);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}

.nav-toggle__bar {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bar:nth-child(2) { top: 15px; }
.nav-toggle__bar:nth-child(3) { top: 21px; }
.nav-toggle__bar:nth-child(4) { top: 27px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(4) {
  transform: translateY(-6px) rotate(-45deg);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--coral));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Layout utilities ---------- */
.container {
  width: min(calc(100% - var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.layout-rail {
  display: grid;
  grid-template-columns: minmax(220px, var(--rail-w)) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.rail {
  display: grid;
  gap: 20px;
  align-content: start;
  position: sticky;
  top: 140px;
}

.rail__item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 4px;
}

.rail__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--stone);
  text-transform: uppercase;
}

.rail__value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

.section {
  padding-block: clamp(44px, 6.5vw, 92px);
  border-top: 1px solid var(--line);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--stone);
  text-transform: uppercase;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--amber);
}

.vertical-note {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--stone);
  text-transform: uppercase;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

.lede {
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.3rem);
  line-height: 1.7;
  color: var(--paper);
  max-width: 34em;
}

.prose {
  max-width: 62ch;
  font-size: 16.5px;
  line-height: 1.75;
  color: rgba(242, 239, 231, 0.85);
}
.prose p { margin-bottom: 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 1.6em 0 0.6em;
  color: var(--paper);
}
.prose h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  margin: 1.4em 0 0.5em;
  color: var(--paper);
}
.prose ul, .prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.2em;
  list-style: disc;
}
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--paper); font-weight: 700; }

/* ---------- Buttons ---------- */
.button-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.button:hover { background: #E8B154; border-color: #E8B154; }

.button--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--paper);
}
.button--ghost:hover {
  background: transparent;
  border-color: var(--amber);
  color: var(--amber);
}

.button--quiet {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.button--quiet:hover { background: transparent; color: var(--coral); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  background: rgba(140, 154, 163, 0.06);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--stone);
  white-space: nowrap;
}

.tag--stable {
  color: var(--mint);
  border-color: rgba(127, 209, 174, 0.42);
  background: rgba(127, 209, 174, 0.08);
}

.tag--alert {
  color: var(--coral);
  border-color: rgba(226, 104, 75, 0.45);
  background: rgba(226, 104, 75, 0.08);
}

.tag--note {
  color: var(--amber);
  border-color: rgba(221, 164, 59, 0.45);
  background: rgba(221, 164, 59, 0.08);
}

/* ---------- Grid & cards ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 30px);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(18px, 2.2vw, 28px);
  background: var(--ink-800);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.card__label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--stone);
}

.card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.card__text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--veil);
}

/* ---------- Media frame ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-800);
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-soft);
}

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }

.media-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 27, 43, 0) 48%, rgba(11, 27, 43, 0.55) 100%);
}

.media-frame__caption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--paper);
  text-transform: uppercase;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--stone);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.breadcrumb__link { transition: color 0.16s ease; }
.breadcrumb__link:hover { color: var(--amber); }

.breadcrumb__sep { color: rgba(140, 154, 163, 0.5); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(48px, 7vw, 110px);
  background: var(--ink-900);
  border-top: 1px solid var(--line);
}

.footer__top {
  background: var(--ink-800);
  border-bottom: 1px solid var(--line);
}

.footer__inner {
  width: min(calc(100% - var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.footer__top .footer__inner {
  padding-block: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--stone);
  text-transform: uppercase;
}

.footer__cta {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.01em;
  color: var(--amber);
  transition: color 0.16s ease;
}
.footer__cta:hover { color: var(--coral); }

.footer__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.35fr;
  gap: clamp(24px, 3vw, 48px);
  padding-block: clamp(36px, 5vw, 64px);
}

.footer__col { min-width: 0; }

.footer__brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.footer__brand-line {
  margin-top: 12px;
  max-width: 24em;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--veil);
}

.footer__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--stone);
  margin-bottom: 16px;
}

.footer__list {
  display: grid;
  gap: 10px;
}

.footer__link {
  font-size: 14.5px;
  color: var(--veil);
  transition: color 0.16s ease;
}
.footer__link:hover { color: var(--amber); }

.footer__list--plain { gap: 12px; }

.footer__meta-item {
  display: grid;
  gap: 3px;
  font-size: 14px;
  color: var(--veil);
  word-break: break-word;
}

.footer__meta-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--stone);
  text-transform: uppercase;
}

.footer__note {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--stone);
}

.footer__legal {
  border-top: 1px solid var(--line);
}

.footer__legal-inner {
  padding-block: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer__legal-line {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--stone);
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer__col:last-child { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .layout-rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .rail {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  :root { --rail-w: 100%; }

  .status-bar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding-block: 9px;
  }

  .masthead__inner {
    padding-block: 12px;
    gap: 12px;
  }

  .brand__sub { display: none; }

  .nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    width: min(86vw, 340px);
    display: flex;
    flex-direction: column;
    padding: 26px 24px 32px;
    overflow-y: auto;
    background: var(--ink-800);
    border-right: 1px solid var(--line-strong);
    box-shadow: 0 0 70px -24px rgba(0, 0, 0, 0.95);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1), visibility 0.32s ease;
  }

  .nav[data-open] {
    transform: translateX(0);
    visibility: visible;
  }

  .nav__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line-strong);
  }

  .nav__head-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.16em;
    color: var(--paper);
  }

  .nav__head-note {
    font-size: 10.5px;
    letter-spacing: 0.2em;
    color: var(--stone);
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__item + .nav__item { border-top: 1px solid var(--line); }

  .nav__link {
    display: block;
    padding: 16px 2px;
    font-size: 17px;
    color: var(--paper);
  }

  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] { color: var(--amber); }

  .nav-toggle { display: block; }

  body.nav-open { overflow: hidden; }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(7, 19, 31, 0.62);
    pointer-events: none;
  }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__col:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .cta-link { display: none; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .footer__col:last-child { grid-column: auto; }
  .footer__legal-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .status-dot { animation: none; }
}
