/* ==========================================================================
   纵横国际指南 — site.css
   窗口母题：框架导航 / 窗格面板 / 纸张叠层 / 矿物色分区
   ========================================================================== */

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

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

body { margin: 0; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

a { color: inherit; }

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

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

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

/* ---------- 2. Tokens ---------- */
:root {
  /* 矿物色体系 */
  --mist-blue: #DCE7EE;
  --glass-blue: #A9C2D3;
  --frame-blue: #5B7F94;
  --deep-green: #14312A;
  --moss: #3F5F52;
  --paper: #F5F2EA;
  --stone: #6E767B;
  --silver: #C9CFD4;
  --signal: #D9502A;
  --acid: #E4EE7A;
  --terracotta: #B0693F;
  --ink: #1B2429;

  /* 版面尺度 */
  --rail: 68px;
  --bar-h: 64px;
  --gutter: clamp(18px, 4vw, 56px);
  --shell: 1480px;

  /* 字体 */
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono",
    "IBM Plex Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* 叠层阴影 */
  --paper-lift: 7px 7px 0 -1px var(--mist-blue), 7px 7px 0 0 var(--silver);
  --soft-lift: 0 18px 40px -28px rgba(20, 49, 42, 0.45);
}

/* ---------- 3. Base typography ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail); }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

strong, b { font-weight: 700; }

main,
[id] { scroll-margin-top: calc(var(--bar-h) + 20px); }

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

/* ---------- 4. Focus & motion ---------- */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.site-footer :focus-visible,
.frame-nav :focus-visible {
  outline-color: var(--acid);
}

@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;
  }
}

/* ---------- 5. Utilities ---------- */
.container {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  width: min(100%, 880px);
}

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

.num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--stone);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--frame-blue);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 18px;
  height: 1px;
  background: var(--signal);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--silver);
  background: var(--paper);
  color: var(--moss);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.tag--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #FFFFFF;
}

.tag--acid {
  background: var(--acid);
  border-color: #C3CD52;
  color: var(--ink);
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.85rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary {
  background: var(--signal);
  border-color: var(--signal);
  color: #FFFFFF;
}

.btn--primary:hover {
  background: #B8401F;
  border-color: #B8401F;
  color: #FFFFFF;
}

.btn--light {
  border-color: rgba(245, 242, 234, 0.5);
  color: var(--paper);
  background: transparent;
}

.btn--light:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--deep-green);
}

/* ---------- 7. Skip link ---------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: 14px;
  z-index: 900;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 8. Header shell ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(245, 242, 234, 0.96);
  border-bottom: 1px solid var(--silver);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 26px);
  width: min(100%, 1620px);
  min-height: var(--bar-h);
  margin-inline: auto;
  padding: 0 clamp(14px, 3vw, 34px);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}

.brand-mark {
  position: relative;
  flex: none;
  width: 21px;
  height: 25px;
  border: 1.5px solid currentColor;
  background:
    linear-gradient(
      to right,
      transparent calc(50% - 0.5px),
      currentColor calc(50% - 0.5px),
      currentColor calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      to bottom,
      transparent calc(50% - 0.5px),
      currentColor calc(50% - 0.5px),
      currentColor calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
  background-clip: padding-box;
  opacity: 0.92;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

/* 节奏标签 */
.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px;
  border: 1px solid var(--frame-blue);
  background: var(--mist-blue);
  color: var(--deep-green);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.header-meta::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--signal);
}

.header-meta:hover {
  background: var(--glass-blue);
}

/* 右侧动作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* 移动端目录按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--silver);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--frame-blue);
  background: var(--mist-blue);
}

.nav-toggle__label { white-space: nowrap; }

.nav-toggle__icon {
  position: relative;
  flex: none;
  width: 14px;
  height: 10px;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transition: top 0.24s ease-out, transform 0.24s ease-out;
}

.nav-toggle__icon::before { top: 1px; }
.nav-toggle__icon::after { top: 8px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  top: 4.5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  top: 4.5px;
  transform: rotate(-45deg);
}

/* 滚动进度线 */
.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--signal), var(--terracotta));
  pointer-events: none;
}

/* ---------- 9. Frame nav（移动端：底部抽屉） ---------- */
.frame-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  padding: 10px 0 max(18px, env(safe-area-inset-bottom));
  background: var(--deep-green);
  border-top: 1px solid rgba(201, 207, 212, 0.22);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 400;
  transform: translateY(101%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.22, 0.7, 0.3, 1), visibility 0.32s;
}

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

.frame-nav__list {
  display: flex;
  flex-direction: column;
}

.frame-nav__item { display: block; }

.frame-nav__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px;
  border-bottom: 1px solid rgba(201, 207, 212, 0.14);
  color: rgba(245, 242, 234, 0.82);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.frame-nav__link::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  background: rgba(245, 242, 234, 0.28);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.frame-nav__link:hover {
  color: var(--paper);
  background: rgba(245, 242, 234, 0.05);
}

.frame-nav__link:hover::before { background: var(--glass-blue); }

.frame-nav__link[aria-current="page"] { color: var(--acid); }

.frame-nav__link[aria-current="page"]::before {
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(217, 80, 42, 0.24);
}

/* 遮罩 */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(20, 49, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s;
}

.nav-scrim[data-open] {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1023px) {
  html.nav-open body { overflow: hidden; }
}

/* 桌面端：左侧竖排框架导轨 */
@media (min-width: 1024px) {
  .frame-nav {
    top: 0;
    bottom: 0;
    right: auto;
    left: 0;
    width: var(--rail);
    max-height: none;
    padding: 26px 0;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-top: 0;
    border-right: 1px solid rgba(201, 207, 212, 0.16);
    overflow-y: auto;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .frame-nav__list {
    align-items: center;
    justify-content: center;
    gap: 2px;
  }

  .frame-nav__link {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: block;
    padding: 13px 6px;
    border-bottom: 0;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    line-height: 1;
    color: rgba(245, 242, 234, 0.64);
  }

  .frame-nav__link::before {
    position: absolute;
    top: 3px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
  }

  .frame-nav__link { position: relative; }

  .frame-nav__link:hover { background: none; }

  .nav-scrim { display: none; }

  .nav-toggle { display: none; }
}

/* 顶部节奏标签在小屏让位 */
@media (max-width: 1099px) {
  .header-meta { display: none; }
}

@media (max-width: 479px) {
  .brand-name { font-size: 0.92rem; }
  .brand-mark { width: 18px; height: 22px; }
  .btn { padding: 8px 11px; font-size: 0.68rem; letter-spacing: 0.1em; }
  .nav-toggle { padding: 8px 10px; font-size: 0.68rem; }
}

/* ---------- 10. Content components ---------- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 36px);
}

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

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

.panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 32px);
  border: 1px solid var(--silver);
  background: var(--paper);
}

.panel--glass {
  background: var(--mist-blue);
  border-color: var(--glass-blue);
}

.panel--dusk {
  background: var(--deep-green);
  border-color: var(--moss);
  color: var(--paper);
}

.panel--stacked {
  box-shadow: var(--paper-lift);
}

/* 图片容器基础规则 */
.image-frame {
  position: relative;
  padding: 8px;
  border: 1px solid var(--silver);
  background: var(--paper);
  overflow: hidden;
}

.image-frame > img,
.image-frame__media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background:
    linear-gradient(135deg, var(--mist-blue) 0%, var(--glass-blue) 100%);
}

.image-frame--tall > img,
.image-frame--tall > .image-frame__media { aspect-ratio: 3 / 4; }

.image-frame--square > img,
.image-frame--square > .image-frame__media { aspect-ratio: 1 / 1; }

.image-frame__caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 4px 2px;
  border-top: 1px solid var(--silver);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--stone);
}

/* 面包屑 */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--stone);
}

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

.breadcrumbs li + li::before {
  content: "/";
  color: var(--silver);
}

.breadcrumbs a {
  color: var(--stone);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover { color: var(--ink); }

.breadcrumbs [aria-current="page"] { color: var(--ink); }

/* 文档阅读区 */
.prose {
  max-width: 34em;
  font-size: 1rem;
  line-height: 1.85;
}

.prose p + p { margin-top: 1.2em; }

.prose h2 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.015em;
}

.prose h3 {
  margin-top: 1.7em;
  margin-bottom: 0.5em;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.prose ul {
  margin-top: 0.8em;
  padding-left: 0;
}

.prose li {
  position: relative;
  padding-left: 1.5em;
  margin-top: 0.5em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 9px;
  height: 1px;
  background: var(--frame-blue);
}

.prose a {
  color: var(--deep-green);
  text-decoration: none;
  border-bottom: 1px solid var(--frame-blue);
}

.prose a:hover { border-bottom-color: var(--signal); }

/* ---------- 11. Footer ---------- */
.site-footer {
  position: relative;
  background: var(--deep-green);
  color: var(--paper);
}

.footer-inner {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding: clamp(44px, 6vw, 84px) var(--gutter) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(30px, 4vw, 56px);
}

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.35fr;
    align-items: start;
  }
}

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

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.footer-note {
  max-width: 30ch;
  margin-bottom: 20px;
  color: rgba(245, 242, 234, 0.72);
  font-size: 0.92rem;
  line-height: 1.9;
}

.footer-col .btn { margin-top: 4px; }

.footer-col__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--glass-blue);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.footer-col__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(201, 207, 212, 0.24);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(245, 242, 234, 0.8);
  font-size: 0.92rem;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a::before {
  content: "";
  flex: none;
  width: 12px;
  height: 1px;
  background: var(--glass-blue);
  transition: width 0.2s ease, background 0.2s ease;
}

.footer-links a:hover { color: var(--acid); }
.footer-links a:hover::before { width: 20px; background: var(--acid); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-contact li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: rgba(245, 242, 234, 0.82);
  font-size: 0.9rem;
  line-height: 1.7;
  word-break: break-word;
}

.footer-contact__k {
  flex: none;
  min-width: 34px;
  color: var(--glass-blue);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  line-height: 2.1;
}

.footer-caveat {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 2px solid var(--terracotta);
  color: rgba(245, 242, 234, 0.58);
  font-size: 0.8rem;
  line-height: 1.8;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(36px, 5vw, 64px);
  padding: 20px 0 28px;
  border-top: 1px solid rgba(201, 207, 212, 0.18);
  color: rgba(245, 242, 234, 0.55);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.footer-copy,
.footer-icp { margin: 0; }

/* ---------- 12. Floating shortcuts ---------- */
.fab-stack {
  position: fixed;
  right: clamp(14px, 2vw, 26px);
  bottom: clamp(14px, 2vw, 26px);
  z-index: 360;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid rgba(245, 242, 234, 0.32);
  background: rgba(20, 49, 42, 0.94);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fab:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--deep-green);
}

.to-top {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--signal);
  background: var(--signal);
  color: #FFFFFF;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.24s ease-out, transform 0.24s ease-out,
    visibility 0.24s, background 0.2s ease;
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover { background: #B8401F; }

@media (max-width: 479px) {
  .fab { padding: 8px 10px; font-size: 0.64rem; }
  .to-top { width: 38px; height: 38px; }
  .footer-caveat { font-size: 0.76rem; }
}
