/* ============================================================
   财神捕鱼棋牌 · 共享样式表 /assets/site.css
   深海青蓝底色 + 鎏金强调 + 财神红印章 + 珊瑚橙撞色
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--mist);
  background-color: var(--ink-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { display: block; }

img,
svg,
video { max-width: 100%; height: auto; }

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

ul, ol { margin: 0; padding: 0; }

hr { border: 0; }

/* ---------- 2. 变量 ---------- */
:root {
  /* 深海青蓝 */
  --ink-950: #061820;
  --ink-900: #0B2430;
  --ink-800: #12323F;
  --glass: #1D4654;
  --glass-soft: rgba(29, 70, 84, 0.55);

  /* 文字 */
  --mist: #E8F1EE;
  --mist-dim: rgba(232, 241, 238, 0.70);
  --mist-faint: rgba(232, 241, 238, 0.44);

  /* 强调 */
  --gold-500: #E0A84E;
  --gold-200: #F6D28B;
  --gold-line: rgba(224, 168, 78, 0.30);
  --red-600: #C8322B;
  --coral-500: #F0784A;
  --jade-500: #2E7D6E;

  /* 浅色阅读层 */
  --paper: #FBF4E6;
  --paper-ink: #122A31;

  /* 结构 */
  --shell: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --head-h: 66px;
  --radius-s: 4px;
  --radius-m: 10px;
  --radius-l: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* 字体 */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (min-width: 900px) {
  :root { --head-h: 94px; }
}

/* ---------- 3. 基础排版 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.005em;
  color: var(--mist);
  margin: 0 0 0.55em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: 1.04; }
h2 { font-size: clamp(1.8rem, 3.2vw, 3rem); }
h3 { font-size: clamp(1.2rem, 1.7vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; font-family: var(--font-body); }

p { margin: 0 0 1.1em; max-width: 38em; }

a {
  color: var(--gold-200);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--gold-500); }

strong { color: var(--gold-200); font-weight: 700; }

::selection {
  background: rgba(224, 168, 78, 0.32);
  color: #fff;
}

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

/* ---------- 4. 工具类 ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.rule {
  height: 1px;
  border: 0;
  margin: clamp(24px, 4vw, 48px) 0;
  background: linear-gradient(90deg, var(--gold-line), rgba(224, 168, 78, 0.04) 60%, transparent);
}

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

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--gold-500);
  color: #20160A;
  font-weight: 700;
  font-size: 0.85rem;
  transform: translateY(-180%);
  transition: transform 0.22s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: #20160A;
  outline: 2px solid var(--gold-200);
  outline-offset: 2px;
}

/* ---------- 6. 头部 ---------- */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: transparent;
  color: var(--mist);
  transition: background 0.35s var(--ease),
              box-shadow 0.35s var(--ease),
              backdrop-filter 0.35s var(--ease);
}

.site-head.is-stuck {
  background: rgba(6, 24, 32, 0.94);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--gold-line), 0 22px 50px -34px rgba(0, 0, 0, 0.95);
}

.head-rail {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.head-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand toggle";
  align-items: center;
  gap: 0 16px;
  padding: 11px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease);
}

.site-head.is-stuck .head-inner {
  border-bottom-color: rgba(224, 168, 78, 0.16);
}

/* 品牌 */
.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--mist);
  text-decoration: none;
}
.brand:hover { color: var(--mist); }

.brand__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(246, 210, 139, 0.45);
  background: linear-gradient(150deg, var(--red-600), #8E1F1A);
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22), 0 8px 18px -12px rgba(200, 50, 43, 0.95);
}

.brand__text { min-width: 0; }

.brand__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  line-height: 1.5;
  letter-spacing: 0.26em;
  color: var(--gold-500);
  white-space: nowrap;
}

/* 移动菜单按钮 */
.nav-toggle {
  grid-area: toggle;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(232, 241, 238, 0.22);
  border-radius: 999px;
  background: rgba(29, 70, 84, 0.5);
  color: var(--mist);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.nav-toggle:hover {
  border-color: var(--gold-500);
  background: rgba(29, 70, 84, 0.85);
}

.nav-toggle__box {
  display: grid;
  gap: 4px;
  width: 16px;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.site-head[data-open] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-head[data-open] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-head[data-open] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 导航面板 */
.head-nav {
  grid-area: nav;
  display: none;
  flex-direction: column;
  gap: 14px;
}

.site-head[data-open] .head-nav {
  display: flex;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 16px 14px 18px;
  border: 1px solid rgba(224, 168, 78, 0.24);
  border-radius: var(--radius-l);
  background: rgba(11, 36, 48, 0.985);
  box-shadow: 0 44px 80px -44px #000, inset 0 1px 0 rgba(246, 210, 139, 0.12);
  max-height: calc(100vh - var(--head-h) - 20px);
  overflow-y: auto;
  animation: drawer-in 0.26s var(--ease) both;
}

@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-9px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 主导航 */
.nav-primary { display: block; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  display: block;
  padding: 11px 6px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--mist-dim);
  border-bottom: 1px solid rgba(232, 241, 238, 0.08);
  transition: color 0.2s var(--ease), padding 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-link:hover { color: var(--mist); }

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s var(--ease);
}

.nav-link[aria-current="page"] {
  color: var(--gold-200);
  padding-left: 12px;
  border-left: 2px solid var(--red-600);
  background: linear-gradient(90deg, rgba(200, 50, 43, 0.22), transparent 70%);
}

/* 第二栏状态带 */
.nav-secondary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 168, 78, 0.2);
}

.version-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  align-self: flex-start;
  padding: 4px 11px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(224, 168, 78, 0.08);
  color: var(--gold-200);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.version-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral-500);
  box-shadow: 0 0 0 3px rgba(240, 120, 74, 0.18);
  animation: chip-pulse 2.6s ease-in-out infinite;
}

@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(240, 120, 74, 0.16); }
  50%      { box-shadow: 0 0 0 5px rgba(240, 120, 74, 0.05); }
}

.nav-shortcut {
  align-self: flex-start;
  color: var(--mist-dim);
  font-size: 0.86rem;
  border-bottom: 1px dashed rgba(232, 241, 238, 0.3);
  padding-bottom: 1px;
}
.nav-shortcut:hover {
  color: var(--gold-200);
  border-bottom-color: var(--gold-500);
}

.nav-cta { width: 100%; }

/* 阅读进度 */
.head-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(232, 241, 238, 0.07);
  overflow: hidden;
}

.head-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--red-600), var(--gold-500) 60%, var(--gold-200));
  will-change: transform;
}

/* ---------- 7. 桌面导航 ---------- */
@media (min-width: 900px) {
  .head-inner {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "brand nav";
    align-items: center;
    gap: 0 clamp(24px, 3.4vw, 56px);
    padding: 14px 0 12px;
  }

  .nav-toggle { display: none; }

  .head-nav {
    display: flex;
    grid-area: nav;
    position: static;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    gap: 7px;
    animation: none;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(12px, 1.9vw, 28px);
  }

  .nav-link {
    padding: 4px 1px 7px;
    font-size: 0.92rem;
    border-bottom: 0;
    border-left: 0;
    background: none;
    color: var(--mist-dim);
    white-space: nowrap;
  }

  .nav-link::after {
    height: 2px;
    border-radius: 2px;
    background: var(--gold-500);
  }

  .nav-link:hover::after { transform: scaleX(1); }

  .nav-link[aria-current="page"] {
    color: var(--gold-200);
    padding: 4px 1px 7px;
    border-left: 0;
    background: none;
  }

  .nav-link[aria-current="page"]::after {
    transform: scaleX(1);
    background: var(--red-600);
  }

  .nav-secondary {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid rgba(224, 168, 78, 0.16);
  }

  .version-chip { align-self: auto; }

  .nav-shortcut {
    align-self: auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .nav-cta {
    width: auto;
    margin-left: 4px;
    padding: 8px 18px;
    font-size: 0.85rem;
  }
}

@media (min-width: 1180px) {
  .nav-link { font-size: 0.96rem; }
}

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
              color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn--gold {
  background: var(--gold-500);
  color: #20160A;
  box-shadow: 0 10px 26px -16px rgba(224, 168, 78, 0.95);
}
.btn--gold:hover,
.btn--gold:focus-visible {
  background: var(--gold-200);
  color: #20160A;
  transform: translateY(-1px);
}

.btn--red {
  background: var(--red-600);
  color: var(--paper);
}
.btn--red:hover,
.btn--red:focus-visible {
  background: #E0413A;
  color: var(--paper);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(232, 241, 238, 0.28);
  color: var(--mist);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--gold-500);
  color: var(--gold-200);
  transform: translateY(-1px);
}

/* ---------- 9. 页脚 ---------- */
.site-foot {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--ink-950);
  color: var(--mist-dim);
  border-top: 1px solid rgba(224, 168, 78, 0.18);
  overflow: hidden;
}

.foot-trail {
  position: relative;
  height: 40px;
  overflow: hidden;
}

.foot-trail::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--gold-500) 0 9px, transparent 9px 24px);
  opacity: 0.32;
}

.foot-trail::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(246, 210, 139, 0.85) 0 1.5px, transparent 2.4px);
  background-size: 78px 16px;
  background-position: 0 50%;
  background-repeat: repeat-x;
  opacity: 0.55;
  animation: fish-swim 22s linear infinite;
}

@keyframes fish-swim {
  from { background-position: 0 50%; }
  to   { background-position: 78px 50%; }
}

.foot-inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 56px) var(--gutter) 0;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(26px, 4vw, 48px);
  padding-bottom: clamp(26px, 4vw, 44px);
}

@media (min-width: 620px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1000px) {
  .foot-grid { grid-template-columns: 1.5fr 0.85fr 1.25fr 0.8fr; }
}

.foot-col { min-width: 0; }

.brand--foot { margin-bottom: 14px; }
.brand--foot .brand__mark { width: 40px; height: 40px; font-size: 1.2rem; }
.brand--foot .brand__name { font-size: 1.05rem; }

.foot-blurb {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--mist-dim);
  max-width: 30em;
}

.foot-stamp {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--gold-500);
}

.foot-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gold-500);
}

.foot-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(224, 168, 78, 0.22);
}

.foot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 0.92rem;
}

.foot-list a {
  color: var(--mist-dim);
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.foot-list a:hover {
  color: var(--gold-200);
  padding-left: 3px;
}

.foot-list--contact { gap: 12px; }

.foot-list--contact li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 0.88rem;
  line-height: 1.65;
}

.foot-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--mist-faint);
  padding-top: 3px;
}

.foot-value {
  color: var(--mist);
  word-break: break-word;
}

.foot-note {
  margin: 14px 0 0;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--mist-faint);
  max-width: 32em;
}

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(232, 241, 238, 0.1);
  font-size: 0.78rem;
  color: var(--mist-faint);
}

.foot-copy { margin: 0; }

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot-legal a { color: var(--mist-faint); }
.foot-legal a:hover { color: var(--gold-200); }

.foot-icp {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* ---------- 10. 页面通用结构 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-block: clamp(40px, 6vw, 88px); }
.section--tight { padding-block: clamp(24px, 4vw, 48px); }

.main-offset { padding-top: calc(var(--head-h) + 24px); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold-500);
  flex: 0 0 auto;
}

.lede {
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.75;
  color: var(--mist-dim);
  max-width: 34em;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--mist-faint);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "/";
  color: rgba(224, 168, 78, 0.45);
}

.breadcrumb a { color: var(--mist-dim); }
.breadcrumb a:hover { color: var(--gold-200); }
.breadcrumb [aria-current="page"] { color: var(--gold-200); }

/* 卡片 */
.card {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid rgba(232, 241, 238, 0.12);
  border-radius: var(--radius-l);
  background: var(--ink-900);
  color: var(--mist);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
              background-color 0.25s var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 168, 78, 0.45);
}

.card--glass {
  background: linear-gradient(160deg, rgba(29, 70, 84, 0.55), rgba(11, 36, 48, 0.32));
  border-color: rgba(224, 168, 78, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card--solid {
  background: var(--ink-800);
  border-color: rgba(232, 241, 238, 0.16);
}

.card > :last-child { margin-bottom: 0; }

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(232, 241, 238, 0.08);
  color: var(--mist-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag--gold {
  background: rgba(224, 168, 78, 0.14);
  border-color: rgba(224, 168, 78, 0.36);
  color: var(--gold-200);
}

.tag--red {
  background: rgba(200, 50, 43, 0.2);
  border-color: rgba(200, 50, 43, 0.5);
  color: #F7CBC8;
}

.tag--coral {
  background: rgba(240, 120, 74, 0.16);
  border-color: rgba(240, 120, 74, 0.44);
  color: #FFD5C2;
}

.tag--jade {
  background: rgba(46, 125, 110, 0.2);
  border-color: rgba(46, 125, 110, 0.48);
  color: #B9E6DC;
}

/* 图片容器基础规则（页面阶段放置 <img> 或 .media__ph 占位） */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(232, 241, 238, 0.1);
  border-radius: var(--radius-m);
  background: var(--ink-800);
}

.media--wide { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 4 / 5; }

.media img,
.media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-align: center;
  color: rgba(232, 241, 238, 0.34);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(29, 70, 84, 0.55) 0 12px,
    rgba(11, 36, 48, 0.25) 12px 24px
  );
}

.media__caption {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--mist-faint);
}

/* 网格 */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
}

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

/* 横向轨道 */
.rail {
  display: flex;
  gap: clamp(14px, 2vw, 22px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 14px;
  scrollbar-color: rgba(224, 168, 78, 0.4) transparent;
  scrollbar-width: thin;
}

.rail > * {
  flex: 0 0 clamp(240px, 34vw, 340px);
  scroll-snap-align: start;
}

.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-track { background: rgba(232, 241, 238, 0.06); border-radius: 999px; }
.rail::-webkit-scrollbar-thumb { background: rgba(224, 168, 78, 0.38); border-radius: 999px; }

/* 粘性目录 */
.toc {
  position: sticky;
  top: calc(var(--head-h) + 22px);
  align-self: start;
}

.toc-link {
  display: block;
  padding: 8px 0 8px 14px;
  border-left: 2px solid rgba(232, 241, 238, 0.14);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--mist-dim);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.toc-link:hover {
  color: var(--mist);
  border-left-color: rgba(224, 168, 78, 0.55);
}

.toc-link.is-active,
.toc-link[aria-current="true"] {
  color: var(--gold-200);
  border-left-color: var(--gold-500);
  background: linear-gradient(90deg, rgba(224, 168, 78, 0.12), transparent 80%);
}

/* 浅色阅读层 */
.on-paper {
  background: var(--paper);
  color: var(--paper-ink);
}

.on-paper h1,
.on-paper h2,
.on-paper h3,
.on-paper h4 { color: #122A31; }

.on-paper p,
.on-paper .lede { color: rgba(18, 42, 49, 0.8); }

.on-paper a { color: #A32A24; }
.on-paper a:hover { color: #C8322B; }

.on-paper strong { color: #8E1F1A; }

.on-paper .eyebrow { color: #A32A24; }
.on-paper .eyebrow::before { background: #A32A24; }

.on-paper .rule {
  background: linear-gradient(90deg, rgba(200, 50, 43, 0.4), rgba(200, 50, 43, 0.05));
}

/* 入场动画（由 SITE_JS 添加 .reveal-pending） */
.reveal-pending {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-pending.is-visible {
  opacity: 1;
  transform: none;
}

/* 返回顶部 */
.to-top {
  position: fixed;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  z-index: 150;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(224, 168, 78, 0.4);
  border-radius: 50%;
  background: rgba(11, 36, 48, 0.92);
  color: var(--gold-200);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.2s var(--ease);
}

.to-top.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover { border-color: var(--gold-200); }

/* ---------- 11. 减少动效 ---------- */
@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;
  }

  .foot-trail::after { animation: none; }
  .version-chip__dot { animation: none; }

  .reveal-pending {
    opacity: 1;
    transform: none;
  }

  .card:hover,
  .btn:hover,
  .to-top { transform: none; }
}
