/* ==========================================================================
   传奇指南 · 共享样式 /assets/site.css
   框架式导航 + 手册型页脚 + 粗野主义卡片语言
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0B2B26;
  --ink-2: #123B33;
  --ink-3: #071E1A;
  --gold: #C9A45C;
  --gold-deep: #8C6B2F;
  --cyan: #3DE0D0;
  --orange: #F08A3C;
  --paper: #F4EFE3;
  --mint: #DCEBE6;
  --moss: #6F8C82;
  --line: #101714;

  --font-head: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shell: 1180px;
  --gutter: clamp(1rem, 4vw, 2.75rem);
  --frame: 3px;
  --shadow-hard: 8px 8px 0 rgba(16, 23, 20, 0.55);
  --shadow-deep: 6px 6px 0 rgba(16, 23, 20, 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.012em;
  color: var(--paper);
  background-color: var(--ink);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
h4 { font-size: 1.02rem; line-height: 1.35; }

p { text-wrap: pretty; }

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

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

/* ---------- 4. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -6rem;
  z-index: 200;
  display: inline-block;
  padding: 0.65rem 1.1rem;
  background: var(--cyan);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--line);
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 0.6rem; }

/* ---------- 5. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: var(--ink);
  color: var(--paper);
  border-bottom: var(--frame) solid var(--line);
  box-shadow: 0 10px 0 -6px rgba(201, 164, 92, 0.35);
}

.header-top {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(0.6rem, 1.6vw, 0.95rem) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem clamp(0.7rem, 1.8vw, 1.4rem);
}

.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-right: auto;
}
.brand-name {
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.13em;
  color: var(--paper);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--gold);
  white-space: nowrap;
}

.header-tagline {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  border-left: 1px solid rgba(201, 164, 92, 0.4);
  padding-left: 0.85rem;
  white-space: nowrap;
}

.header-quick {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.header-quick-link {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.07em;
  color: var(--mint);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.header-quick-link:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* 按钮体系 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.66rem 1.05rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--line);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}
.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--gold-deep);
  box-shadow: 4px 4px 0 rgba(16, 23, 20, 0.9);
}
.btn--ghost:hover {
  background: var(--ink-2);
  color: var(--cyan);
  border-color: var(--cyan);
}
.btn--cyan {
  background: var(--cyan);
  color: var(--ink);
}
.header-cta { white-space: nowrap; }

/* 移动目录按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  background: var(--ink-2);
  color: var(--paper);
  border: 2px solid var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background 0.2s var(--ease);
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.22s var(--ease), top 0.22s var(--ease);
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] { border-color: var(--cyan); color: var(--cyan); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* 导航索引尺 */
.site-nav {
  display: block;
  background: var(--ink-2);
  border-top: 1px solid rgba(201, 164, 92, 0.3);
}
.nav-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: var(--shell);
  margin: 0 auto;
}
.nav-item { min-width: 0; }
.nav-link {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.8rem clamp(0.45rem, 1.5vw, 1rem);
  border-left: 1px solid rgba(244, 239, 227, 0.12);
  color: var(--paper);
  font-size: 0.94rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.22s var(--ease), color 0.22s var(--ease);
}
.nav-item:first-child .nav-link { border-left: 0; }
.nav-item:last-child .nav-link { border-right: 1px solid rgba(244, 239, 227, 0.12); }
.nav-num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  opacity: 0.8;
}
.nav-label { white-space: nowrap; }
.nav-link:hover {
  background: rgba(61, 224, 208, 0.1);
  color: var(--cyan);
}
.nav-link:hover .nav-num { color: var(--cyan); opacity: 1; }

.nav-item--anchor .nav-link:not([aria-current="page"]) {
  background: linear-gradient(180deg, rgba(201, 164, 92, 0.2), rgba(201, 164, 92, 0.05));
  color: var(--gold);
}
.nav-item--anchor .nav-link:not([aria-current="page"]) .nav-num { color: var(--orange); opacity: 1; }
.nav-item--anchor .nav-link:hover { color: var(--cyan); background: rgba(61, 224, 208, 0.14); }

.nav-link[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 3px 0 var(--cyan);
}
.nav-link[aria-current="page"] .nav-num { color: var(--gold-deep); opacity: 1; }

/* 阅读进度 */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(244, 239, 227, 0.08);
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold) 70%, var(--orange));
  transition: width 0.12s linear;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  border-top: var(--frame) solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--cyan), var(--gold) 48%, var(--orange));
  opacity: 0.75;
}
.footer-shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.4rem, 6vw, 4.2rem) var(--gutter) 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.82fr 0.82fr 0.82fr;
  gap: clamp(1.5rem, 3vw, 2.6rem);
}
.footer-brand-name {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.11em;
}
.footer-brand-sub {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.26em;
  color: var(--gold);
}
.footer-summary {
  margin-top: 0.95rem;
  max-width: 36ch;
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--mint);
}
.footer-contact {
  display: grid;
  gap: 0.34rem;
  margin-top: 1.2rem;
}
.footer-contact li {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  letter-spacing: 0.03em;
  color: var(--mint);
  overflow-wrap: anywhere;
}
.footer-contact-key {
  display: inline-block;
  min-width: 3.2em;
  margin-right: 0.5rem;
  color: var(--gold);
}
.footer-note {
  margin-top: 0.95rem;
  max-width: 42ch;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--moss);
}
.footer-col-title {
  padding-bottom: 0.6rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  border-bottom: 1px solid rgba(201, 164, 92, 0.32);
}
.footer-links li { margin-bottom: 0.1rem; }
.footer-links a {
  display: inline-block;
  padding: 0.22rem 0;
  font-size: 0.92rem;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-links a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  padding-top: 1.15rem;
  border-top: 1px solid rgba(244, 239, 227, 0.14);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.05em;
  color: var(--moss);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}
.footer-legal a {
  color: var(--mint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-legal a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.footer-icp { white-space: nowrap; }

/* ---------- 7. 布局容器 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.75rem);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 8. 通用组件 ---------- */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.num {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
}
.rule {
  height: 2px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, var(--gold), rgba(201, 164, 92, 0));
}

.card {
  background: var(--ink-2);
  color: var(--paper);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-deep);
  padding: clamp(1rem, 2.4vw, 1.6rem);
}
.card--light {
  background: var(--mint);
  color: var(--ink);
}
.card--light .num,
.card--light .kicker { color: var(--gold-deep); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.14em;
  line-height: 1.5;
  color: var(--cyan);
  border: 1px solid currentColor;
}
.tag--gold { color: var(--gold); }
.tag--orange { color: var(--orange); }

.prose {
  max-width: 68ch;
  font-size: 1.01rem;
  line-height: 1.8;
}
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; list-style: revert; }
.prose li + li { margin-top: 0.4em; }
.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.lede {
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  line-height: 1.72;
  color: var(--mint);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.09em;
  color: var(--moss);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--gold-deep);
}
.breadcrumb a {
  color: var(--mint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.breadcrumb a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* 可展开内容组 */
.fold {
  border: 2px solid var(--line);
  background: var(--ink-2);
  box-shadow: var(--shadow-deep);
}
.fold + .fold { margin-top: 0.75rem; }
.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  cursor: pointer;
  list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.05rem;
  line-height: 1;
}
.fold[open] > summary { background: rgba(61, 224, 208, 0.08); }
.fold[open] > summary::after { content: "−"; }
.fold-body {
  padding: 0.15rem 1.1rem 1.15rem;
  color: var(--mint);
  font-size: 0.95rem;
}

/* 图片容器基础规则 */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  background-color: var(--ink-3);
  background-image:
    radial-gradient(120% 100% at 12% 0%, rgba(61, 224, 208, 0.24), transparent 56%),
    radial-gradient(95% 95% at 100% 100%, rgba(240, 138, 60, 0.18), transparent 62%),
    radial-gradient(80% 80% at 78% 8%, rgba(201, 164, 92, 0.16), transparent 60%),
    linear-gradient(150deg, var(--ink-2), var(--ink));
}
.media-frame img,
.media-frame svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--4x3 { aspect-ratio: 4 / 3; }
.media-frame--wide { aspect-ratio: 21 / 9; }

/* ---------- 9. 滚动落位 ---------- */
html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
html.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 10. 桌面框架竖线 ---------- */
@media (min-width: 1100px) {
  body::before,
  body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 6px;
    z-index: 55;
    pointer-events: none;
    background: linear-gradient(180deg, var(--gold-deep), rgba(140, 107, 47, 0.1) 38%, rgba(140, 107, 47, 0.1) 62%, var(--gold-deep));
  }
  body::before { left: 0; }
  body::after { right: 0; }
}

/* ---------- 11. 响应式 ---------- */
@media (max-width: 1100px) {
  .header-quick { gap: 0.7rem; }
}

@media (max-width: 980px) {
  .header-tagline { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; }
  .site-nav[data-open] {
    display: block;
    animation: nav-in 0.28s var(--ease) both;
  }
  .nav-list {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .nav-link {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(244, 239, 227, 0.12);
    padding: 0.85rem var(--gutter);
  }
  .nav-item:first-child .nav-link { border-top: 0; }
  .nav-item:last-child .nav-link { border-right: 0; }
  @keyframes nav-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
  }
}

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

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .brand-sub { display: none; }
  .header-quick { display: none; }
  .header-cta { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-base { justify-content: flex-start; }
  .lede { max-width: none; }
}

/* ---------- 12. 动效降级 ---------- */
@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;
  }
  html.reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .scroll-progress span { transition: none; }
}
