/* ============================================================
   永兴路线指南 · 共享样式 /assets/site.css
   精密档案室 × 路线图鉴：编号网格、框景、刻度、展览标签
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
  --ink-950: #06121D;
  --ink-900: #0B1B2B;
  --ink-800: #132A3F;
  --paper: #F4EFE3;
  --amber: #D99A2B;
  --amber-light: #F2C66D;
  --celadon: #7FB3A2;
  --celadon-mist: #B7D0C6;
  --slate: #8A97A6;
  --line: #2C4258;

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

  --fg: var(--paper);
  --fg-muted: var(--slate);
  --rule: var(--line);

  --radius-s: 4px;
  --radius-m: 10px;
  --radius-pill: 999px;

  --header-offset: clamp(84px, 9vw, 110px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 2. 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-offset) + 10px);
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }

kbd {
  font-family: var(--font-mono);
  font-size: .84em;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: rgba(244, 239, 227, .07);
  color: var(--celadon-mist);
}

::selection { background: var(--amber); color: #1A1204; }

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

/* ---------- 3. 中文排版与工具类 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.012em;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.02rem; font-weight: 700; }
p { line-height: 1.75; }

.vh {
  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;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}
.wrap--tight { max-width: 900px; }
.wrap--wide { max-width: 1440px; }

.mono { font-family: var(--font-mono); letter-spacing: .04em; }

.lede {
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.8;
  color: var(--fg-muted);
  max-width: 62ch;
}

.note {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .02em;
  color: var(--fg-muted);
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: clamp(24px, 3vw, 42px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: .75;
  flex: none;
}

/* ---------- 4. 背景分区 ---------- */
.band { position: relative; padding-block: clamp(46px, 6.5vw, 92px); }
.band--deep { background: var(--ink-950); }
.band--mid { background: var(--ink-800); }

.band--paper {
  background: var(--paper);
  color: var(--ink-950);
  --fg: var(--ink-950);
  --fg-muted: #4C5E71;
  --rule: rgba(6, 18, 29, .16);
}
.band--paper .eyebrow { color: #A26F12; }

#main-content {
  display: block;
  padding-top: var(--header-offset);
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .01em;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1A1204;
}
.btn--primary:hover {
  background: var(--amber-light);
  border-color: var(--amber-light);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--fg);
}
.btn--ghost:hover { border-color: var(--amber); color: var(--amber-light); }
.band--paper .btn--ghost:hover { border-color: #A26F12; color: #A26F12; }
.btn--sm { padding: 8px 16px; font-size: 13px; }

/* ---------- 6. 标签与状态点 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: rgba(244, 239, 227, .04);
}
.tag--live {
  background: rgba(127, 179, 162, .16);
  border-color: rgba(127, 179, 162, .5);
  color: var(--celadon);
}
.tag--amber {
  background: rgba(217, 154, 43, .14);
  border-color: rgba(217, 154, 43, .5);
  color: var(--amber-light);
}
.band--paper .tag--live {
  color: #2F6A58;
  border-color: rgba(47, 106, 88, .4);
  background: rgba(127, 179, 162, .2);
}
.band--paper .tag--amber {
  color: #8A5E06;
  border-color: rgba(138, 94, 6, .34);
  background: rgba(217, 154, 43, .16);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}
.dot--celadon {
  background: var(--celadon);
  box-shadow: 0 0 0 3px rgba(127, 179, 162, .18);
}

/* ---------- 7. 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--fg-muted);
}
.crumbs a { color: var(--fg-muted); transition: color .16s var(--ease); }
.crumbs a:hover { color: var(--amber-light); }
.crumbs .sep { opacity: .45; }
.crumbs [aria-current="page"] { color: var(--amber); }

/* ---------- 8. 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background-color: var(--ink-800);
  background-image:
    repeating-linear-gradient(90deg, rgba(244, 239, 227, .055) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(244, 239, 227, .055) 0 1px, transparent 1px 32px);
  aspect-ratio: 16 / 9;
}
.media-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--paper {
  background-color: var(--paper);
  border-color: rgba(6, 18, 29, .18);
  background-image:
    repeating-linear-gradient(90deg, rgba(6, 18, 29, .07) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(6, 18, 29, .07) 0 1px, transparent 1px 32px);
}
.media-cap,
.media-frame figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--fg-muted);
}

/* ---------- 9. 页头：悬浮胶囊浮岛 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: clamp(10px, 1.6vw, 18px) clamp(10px, 3vw, 32px);
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -180%);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--amber);
  color: #1A1204;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  pointer-events: auto;
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

.header-capsule {
  position: relative;
  pointer-events: auto;
  max-width: 1320px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 24px);
  padding: 9px 10px 9px clamp(12px, 1.6vw, 18px);
  border: 1px solid rgba(44, 66, 88, .9);
  border-radius: var(--radius-pill);
  background: rgba(11, 27, 43, .84);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow:
    0 18px 40px -28px rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(244, 239, 227, .07);
  transition: padding .22s var(--ease), background .22s var(--ease),
              border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.site-header[data-condensed="true"] .header-capsule {
  padding-block: 5px;
  background: rgba(6, 18, 29, .95);
  border-color: rgba(217, 154, 43, .38);
}

/* 品牌锁定组合 */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--paper);
}
.brand-seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  background: var(--amber);
  color: #1B1203;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}
.brand-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--slate);
}

/* 状态徽标区 */
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-right: 14px;
  border-right: 1px solid rgba(44, 66, 88, .95);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--celadon-mist);
  white-space: nowrap;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.chip--link:hover {
  border-color: var(--amber);
  color: var(--amber-light);
  background: rgba(217, 154, 43, .1);
}
.chip--live { color: var(--celadon-mist); }

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.nav-toggle:hover { border-color: var(--amber); color: var(--amber-light); }
.nav-toggle-bars {
  display: grid;
  gap: 4px;
  width: 16px;
}
.nav-toggle-bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.site-header[data-open="true"] .nav-toggle-bars span:first-child {
  transform: translateY(2.75px) rotate(45deg);
}
.site-header[data-open="true"] .nav-toggle-bars span:last-child {
  transform: translateY(-2.75px) rotate(-45deg);
}
.nav-toggle-text { font-size: 12.5px; letter-spacing: .04em; }

/* 主导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-item { display: block; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--celadon-mist);
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  color: rgba(138, 151, 166, .9);
  transition: color .18s var(--ease);
}
.nav-label { display: inline-block; }
.nav-link:hover {
  color: var(--paper);
  background: rgba(244, 239, 227, .07);
}
.nav-link:hover .nav-num { color: var(--amber-light); }
.nav-link[aria-current="page"] {
  background: var(--amber);
  border-color: var(--amber);
  color: #14202C;
  font-weight: 700;
}
.nav-link[aria-current="page"] .nav-num { color: rgba(20, 32, 44, .72); }

/* ---------- 10. 页脚：刻度收束 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 104px);
  background: var(--ink-950);
  border-top: 1px solid var(--line);
  color: var(--paper);
  --fg: var(--paper);
  --fg-muted: var(--slate);
  --rule: var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 1px, transparent 1px 20px);
  opacity: .34;
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .82fr) minmax(0, .82fr) minmax(0, 1.16fr);
  gap: clamp(24px, 3.5vw, 56px);
  padding-block: clamp(46px, 6vw, 78px) clamp(30px, 4vw, 48px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.brand-lockup--footer .brand-seal { width: 40px; height: 40px; font-size: 13px; }
.brand-lockup--footer .brand-title { font-size: 16px; }

.footer-note {
  font-size: 14px;
  line-height: 1.8;
  color: var(--slate);
  max-width: 32ch;
}
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--celadon-mist);
}
.footer-bookmark {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--slate);
  max-width: 34ch;
}

.footer-col { min-width: 0; }
.footer-col-title {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--celadon);
}
.footer-list { display: grid; gap: 10px; }
.footer-list a {
  display: inline-block;
  font-size: 14.5px;
  color: var(--paper);
  transition: color .16s var(--ease), transform .16s var(--ease);
}
.footer-list a:hover { color: var(--amber-light); transform: translateX(2px); }
.footer-list--contact li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate);
  word-break: break-word;
}
.footer-list--contact .footer-address { font-size: 13px; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 20px clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--slate);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.footer-legal a {
  color: var(--slate);
  transition: color .16s var(--ease);
}
.footer-legal a:hover { color: var(--amber-light); }
.footer-icp { color: var(--slate); }

/* ---------- 11. 滚动进度与返回顶部 ---------- */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 95;
  background: rgba(44, 66, 88, .45);
  pointer-events: none;
}
.route-progress__fill {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--celadon), var(--amber));
  transition: transform .09s linear;
}

.to-top {
  position: fixed;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(14px, 2.4vw, 28px);
  z-index: 70;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink-800);
  color: var(--amber-light);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .9);
  transition: opacity .2s var(--ease), transform .2s var(--ease),
              visibility .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover {
  border-color: var(--amber);
  background: var(--ink-900);
}

/* ---------- 12. 局部入场 ---------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1180px) and (min-width: 1025px) {
  .header-status { display: none; }
  .nav-link { padding: 8px 10px; font-size: 13.5px; }
  .brand-sub { display: none; }
}

@media (max-width: 1024px) {
  .site-header { padding: 10px; }
  .header-capsule {
    border-radius: 22px;
    padding: 9px 12px;
    gap: 10px;
  }
  .header-status { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(44, 66, 88, .95);
    border-radius: 18px;
    background: rgba(6, 18, 29, .97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .95);
    max-height: min(72vh, 540px);
    overflow-y: auto;
  }
  .site-header[data-open="true"] .site-nav { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link {
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
  }
  .nav-link[aria-current="page"] { border-radius: 12px; }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-note, .footer-bookmark { max-width: none; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .brand-seal { width: 30px; height: 30px; font-size: 10.5px; }
  .brand-title { font-size: 14px; }
  .brand-sub { display: none; }
  .footer-grid { gap: 28px; }
  .footer-base { font-size: 11.5px; }
  .to-top { width: 44px; height: 44px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 14. 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover, .footer-list a:hover { transform: none; }
}

/* ---------- 15. 打印友好 ---------- */
@media print {
  .site-header, .site-footer::before, .route-progress, .to-top { display: none !important; }
  body { background: #fff; color: #111; }
  #main-content { padding-top: 0; }
  .site-footer { background: #fff; color: #111; border-top: 1px solid #999; margin-top: 24px; }
  .site-footer .footer-list a, .site-footer .footer-col-title { color: #111; }
  a[href]::after { content: ""; }
}
