/* =========================================================
   天天娱乐会馆 — /assets/site.css
   共享外壳：左侧轨道导航 / 状态窄条 / 章节页脚 / 基础组件
   ========================================================= */

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

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

body, h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #061019;
  --ink-2: #0B1B28;
  --panel: #11293B;
  --grid: #1E3B50;
  --coral: #FF6B4A;
  --cyan: #2EE6D6;
  --gold: #F3C24E;
  --white: #EAF2F6;
  --mist: #9DB4C3;
  --alert: #FF5470;
  --paper: #EDF3F5;

  --rail-w: 72px;
  --strip-h: 32px;

  --font-body: "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 3. Base ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(30, 59, 80, .26) 1px, transparent 1px),
    linear-gradient(0deg, rgba(30, 59, 80, .20) 1px, transparent 1px),
    radial-gradient(120% 70% at 6% 0%, rgba(46, 230, 214, .07), transparent 62%),
    radial-gradient(90% 60% at 100% 34%, rgba(255, 107, 74, .06), transparent 66%);
  background-size: 96px 96px, 96px 96px, 100% 100%, 100% 100%;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
}

body.nav-open { overflow: hidden; }

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

/* ---------- 4. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  padding: 10px 18px;
  background: var(--coral);
  color: #07131D;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .12em;
  transform: translateY(-140%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 5. Header — 移动端默认 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10, 26, 39, .97);
  border-bottom: 1px solid var(--grid);
}

.header-rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 14px;
}

/* 品牌灯牌 */
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
}
.brand-icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: var(--coral);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 107, 74, .6));
}
.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--white);
}

/* 移动端抽屉 */
.rail-nav {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 16px 40px;
  background:
    linear-gradient(180deg, rgba(46, 230, 214, .05), transparent 42%),
    var(--ink-2);
  border-top: 1px solid var(--grid);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .32s var(--ease), visibility .32s var(--ease);
}
.rail-nav[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
}

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(17, 41, 59, .6);
  border: 1px solid var(--grid);
  color: var(--white);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.rail-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--nav-accent, var(--cyan));
  opacity: .7;
}
.rail-link:hover { border-color: var(--cyan); background: rgba(17, 41, 59, .95); }

.rail-link-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--mist);
}
.rail-link-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--nav-accent, var(--cyan));
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-link-label {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .12em;
}

.rail-link:nth-child(1) { --nav-accent: var(--coral); }
.rail-link:nth-child(2) { --nav-accent: var(--cyan); }
.rail-link:nth-child(3) { --nav-accent: var(--gold); }
.rail-link:nth-child(4) { --nav-accent: var(--coral); }
.rail-link:nth-child(5) { --nav-accent: var(--cyan); }
.rail-link:nth-child(6) { --nav-accent: var(--gold); }

.rail-link[aria-current="page"] {
  border-color: var(--coral);
  background: rgba(255, 107, 74, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 74, .25);
}
.rail-link[aria-current="page"] .rail-link-index { color: var(--coral); }
.rail-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: var(--coral);
  box-shadow: 0 0 10px rgba(255, 107, 74, .9);
}

/* 轨道 CTA — 移动端隐藏 */
.rail-cta { display: none; }

/* 移动导航按钮 */
.nav-toggle {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  flex: none;
  background: rgba(17, 41, 59, .7);
  border: 1px solid var(--grid);
  transition: border-color .2s var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan); }
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--cyan);
  transition: transform .22s var(--ease), opacity .18s var(--ease);
}
body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* 状态窄条 */
.header-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: rgba(11, 27, 40, .95);
  border-top: 1px solid rgba(30, 59, 80, .7);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--mist);
  overflow: hidden;
  transition: height .25s var(--ease);
}
.strip-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.strip-dot {
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(46, 230, 214, .9);
}
.strip-chapter { display: none; }
.strip-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .12s linear;
}

/* ---------- 6. Header — 桌面轨道 ---------- */
@media (min-width: 960px) {
  body { padding-left: var(--rail-w); padding-top: var(--strip-h); }

  .site-header {
    right: auto;
    bottom: 0;
    width: var(--rail-w);
    border-bottom: 0;
    border-right: 1px solid var(--grid);
    background: linear-gradient(180deg, #0A1A27 0%, #071420 100%);
  }

  .header-rail {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    padding: 16px 0 16px;
  }

  .brand-mark {
    flex-direction: column;
    gap: 10px;
    padding: 0 0 14px;
  }
  .brand-name {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 12px;
    letter-spacing: .3em;
  }

  .rail-nav {
    position: static;
    flex: 1 1 auto;
    z-index: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 8px 0;
    background: none;
    border-top: 0;
    overflow: visible;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .rail-link {
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 9px 0;
    background: none;
    border: 0;
    border-left: 3px solid transparent;
  }
  .rail-link:hover { background: rgba(46, 230, 214, .07); }
  .rail-link::before { display: none; }

  .rail-link-index { font-size: 9px; line-height: 1; opacity: .8; }
  .rail-link-icon { width: 20px; height: 20px; }
  .rail-link-label {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    padding: 4px 10px;
    background: var(--panel);
    border: 1px solid var(--grid);
    color: var(--white);
    font-size: 12px;
    letter-spacing: .12em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-6px);
    transition: opacity .18s var(--ease), transform .18s var(--ease);
    z-index: 8;
  }
  .rail-link:hover .rail-link-label,
  .rail-link:focus-visible .rail-link-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  .rail-link[aria-current="page"] {
    border-left-color: var(--coral);
    background: rgba(255, 107, 74, .1);
    box-shadow: none;
  }
  .rail-link[aria-current="page"]::after { display: none; }
  .rail-link[aria-current="page"] .rail-link-icon {
    stroke: var(--coral);
    filter: drop-shadow(0 0 6px rgba(255, 107, 74, .75));
  }

  .rail-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 104px;
    margin-top: 10px;
    padding: 8px 4px;
    background: var(--coral);
    color: #07131D;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
    writing-mode: vertical-rl;
    text-orientation: upright;
    box-shadow: 0 0 0 1px rgba(255, 107, 74, .55), 0 0 22px rgba(255, 107, 74, .32);
    transition: box-shadow .2s var(--ease), background .2s var(--ease);
  }
  .rail-cta:hover { background: #FF8163; box-shadow: 0 0 0 1px rgba(255, 107, 74, .9), 0 0 30px rgba(255, 107, 74, .55); }

  .nav-toggle { display: none; }

  .header-strip {
    position: fixed;
    top: 0;
    left: var(--rail-w);
    right: 0;
    justify-content: space-between;
    height: var(--strip-h);
    padding: 0 22px;
    border-top: 0;
    border-bottom: 1px solid var(--grid);
    font-size: 12px;
    letter-spacing: .1em;
  }
  .strip-chapter { display: inline-block; color: var(--cyan); }

  .header-strip.is-compact {
    height: 4px;
    border-bottom-color: transparent;
  }
  .header-strip.is-compact .strip-status,
  .header-strip.is-compact .strip-chapter { opacity: 0; }
  .strip-status,
  .strip-chapter { transition: opacity .18s var(--ease); }
}

/* 移动端头部占位高度 */
@media (max-width: 959px) {
  body { padding-top: 83px; }
  html { scroll-padding-top: 96px; }
  .header-strip.is-compact { height: 28px; }
}

/* ---------- 7. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 80px;
  background: linear-gradient(180deg, var(--ink-2) 0%, #071420 100%);
  border-top: 1px solid var(--grid);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 180px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(243, 194, 78, 0));
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px 28px;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding: 56px 20px 40px;
}
@media (min-width: 680px) {
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .footer-inner {
    grid-template-columns: 1.4fr .85fr .85fr .85fr 1.5fr;
    gap: 0 28px;
    padding-top: 68px;
  }
}

.footer-brand-mark {
  display: inline-block;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2em;
  color: var(--white);
  line-height: 1.4;
}
.footer-tag {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: .26em;
  color: var(--cyan);
}
.footer-since {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--mist);
}

.footer-col-title {
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .28em;
  color: var(--gold);
}
.footer-list li + li { margin-top: 10px; }
.footer-list a {
  display: inline-block;
  font-size: 14px;
  color: var(--mist);
  transition: color .18s var(--ease), padding-left .18s var(--ease);
}
.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--cyan);
  padding-left: 4px;
}

.footer-contact { min-width: 0; }
.footer-contact-item { margin-bottom: 12px; }
.footer-contact-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--cyan);
  opacity: .8;
}
.footer-contact-value {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  color: var(--white);
  overflow-wrap: anywhere;
}
.footer-contact-item:first-of-type .footer-contact-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
}
.footer-note {
  margin-top: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--grid);
  font-size: 12px;
  line-height: 1.75;
  color: var(--mist);
}

.footer-bottom {
  border-top: 1px solid var(--grid);
  background: rgba(6, 16, 25, .7);
}
.footer-bottom p {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--mist);
}

/* ---------- 8. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 85;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: rgba(17, 41, 59, .95);
  border: 1px solid var(--grid);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s var(--ease), border-color .2s var(--ease);
}
.to-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(46, 230, 214, .3); }

/* ---------- 9. 通用容器与网格 ---------- */
.page-wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}
.narrow { max-width: 68ch; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
@media (max-width: 780px) {
  .span-4, .span-6, .span-8 { grid-column: span 12; }
}

/* ---------- 10. 章节标记与注释 ---------- */
.section-marker {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  background: var(--panel);
  border: 1px solid var(--grid);
  box-shadow: inset 0 0 18px rgba(46, 230, 214, .1);
}
.section-marker-num {
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--cyan);
}

.vertical-note {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .32em;
  color: var(--mist);
}

/* ---------- 11. 面板 / 标签 / 按钮 ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--grid);
  padding: 26px 24px;
}
.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 42px;
  height: 2px;
  background: var(--cyan);
  opacity: .8;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--grid);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--mist);
  white-space: nowrap;
}
.tag--coral { border-color: rgba(255, 107, 74, .55); color: var(--coral); }
.tag--cyan { border-color: rgba(46, 230, 214, .55); color: var(--cyan); }
.tag--gold { border-color: rgba(243, 194, 78, .55); color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--grid);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--white);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(46, 230, 214, .25); }
.btn--coral {
  background: var(--coral);
  border-color: var(--coral);
  color: #07131D;
  box-shadow: 0 0 20px rgba(255, 107, 74, .3);
}
.btn--coral:hover { background: #FF8163; border-color: #FF8163; color: #07131D; box-shadow: 0 0 26px rgba(255, 107, 74, .5); }
.btn--cyan {
  background: rgba(46, 230, 214, .1);
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn--ghost { background: transparent; }
.btn--ghost:hover { color: var(--cyan); }

/* ---------- 12. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--mist);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "／"; color: var(--grid); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--white); }

/* ---------- 13. 图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--ink-2);
  border: 1px solid var(--grid);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(46, 230, 214, .14), transparent 46%),
    linear-gradient(340deg, rgba(255, 107, 74, .16), transparent 52%);
}
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ---------- 14. 入场 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), filter .5s var(--ease);
  filter: blur(8px);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* ---------- 15. 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .to-top { transform: none; }
}
