/* ==========================================================================
   江南赛场 · 共享样式 /assets/site.css
   结构：变量 → 基础重置 → 中文排版 → 通用组件 → 头部 → 页脚 → 动效 → 响应式
   ========================================================================== */

:root {
  /* 色彩体系 */
  --paper: #F6F0E4;
  --paper-warm: #EBE0CC;
  --ink: #1B2429;
  --ink-blue: #2C4756;
  --lotus: #C7B2C0;
  --lotus-pale: #E4D8E0;
  --cinnabar: #B5382C;
  --cinnabar-dark: #8E2A21;
  --stone: #5C7E8C;
  --moss: #6E7F5C;
  --white: #FFFFFF;

  /* 线材 */
  --hair: 1px solid rgba(92, 126, 140, 0.34);
  --hair-strong: 1px solid rgba(92, 126, 140, 0.6);
  --hair-light: 1px solid rgba(246, 240, 228, 0.16);

  /* 尺寸 */
  --rail-w: 250px;
  --gutter: 20px;
  --container: 1140px;

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

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-blue);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button { font: inherit; }

::selection {
  background: var(--cinnabar);
  color: var(--white);
}

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

.site-header :focus-visible,
.site-footer :focus-visible {
  outline: 2px solid var(--lotus);
  outline-offset: 3px;
}

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.55em;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.28;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.14;
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.3;
}

h3 {
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.36;
}

p { margin: 0 0 1.2em; }

p:last-child { margin-bottom: 0; }

a {
  color: var(--cinnabar);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { color: var(--cinnabar-dark); }

ul, ol { margin: 0 0 1.2em; }

.num,
[data-num] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- 通用容器与网格 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 52px 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: var(--hair);
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

.grid-12 {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

.stack > * + * { margin-top: 20px; }

.rule {
  height: 0;
  margin: 34px 0;
  border: 0;
  border-top: var(--hair);
}

/* ---------- 印章式小标 ---------- */
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 3px 9px 3px 11px;
  border: 1px solid var(--cinnabar);
  color: var(--cinnabar);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.26em;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-blue);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--cinnabar-dark);
  border-color: var(--cinnabar-dark);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border-color: var(--stone);
  color: var(--ink-blue);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--ink-blue);
  background: rgba(92, 126, 140, 0.1);
  color: var(--ink);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  padding-top: 18px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--stone);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-list li + li::before {
  content: "─";
  margin-right: 8px;
  color: var(--lotus);
}

.breadcrumb-list a {
  color: var(--stone);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumb-list a:hover {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
}

/* ---------- 长文排版 ---------- */
.prose { max-width: 68ch; }

.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.6em; }

.prose ul,
.prose ol { padding-left: 1.4em; }

.prose li { margin-bottom: 0.5em; }

.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--cinnabar);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.7;
}

/* ---------- 竖排窄注释 ---------- */
.note-vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
  margin: 0;
  padding: 0;
  color: var(--stone);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.18em;
}

/* ---------- 图片容器基础 ---------- */
.photo {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--paper-warm);
}

.photo > img,
.photo > picture,
.photo > picture > img {
  display: block;
  width: 100%;
  height: 100%;
}

.photo > img,
.photo > picture > img {
  object-fit: cover;
  object-position: center;
}

.photo-wide { aspect-ratio: 16 / 9; }
.photo-portrait { aspect-ratio: 3 / 4; }
.photo-square { aspect-ratio: 1 / 1; }

.photo-caption {
  margin: 10px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--lotus);
  color: var(--stone);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

/* ---------- 跳过链接 ---------- */
.skip-link {
  position: absolute;
  top: -72px;
  left: 8px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--cinnabar);
  color: var(--white);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 8px;
  color: var(--white);
}

/* ---------- 头部：移动端顶部横框 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(246, 240, 228, 0.12);
}

.site-header.is-scrolled {
  box-shadow: 0 6px 18px rgba(27, 36, 41, 0.18);
}

.header-frame {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--paper);
  text-decoration: none;
}

.brand:hover { color: var(--paper); }

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  color: var(--paper);
}

.brand-line {
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: rgba(246, 240, 228, 0.56);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(246, 240, 228, 0.32);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.nav-toggle:hover {
  background: rgba(246, 240, 228, 0.1);
  border-color: rgba(246, 240, 228, 0.55);
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
}

.nav-toggle-bar {
  display: block;
  height: 1.5px;
  background: currentColor;
}

.nav-toggle-label {
  line-height: 1;
}

/* ---------- 导航本体（移动端下拉面板） ---------- */
.site-nav {
  flex: 1 1 100%;
  display: none;
  order: 3;
  padding: 14px 0 16px;
  border-top: var(--hair-light);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

.site-nav[data-open] { display: block; }

.nav-caption,
.rail-caption {
  display: none;
  margin: 0 0 10px;
  color: rgba(246, 240, 228, 0.46);
  font-size: 11px;
  letter-spacing: 0.32em;
}

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

.nav-list a {
  display: block;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  color: rgba(246, 240, 228, 0.78);
  font-size: 15px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.nav-list a:hover {
  color: var(--paper);
  border-left-color: var(--lotus);
  background: rgba(246, 240, 228, 0.06);
}

.nav-list a[aria-current="page"] {
  color: var(--white);
  border-left-color: var(--cinnabar);
  background: rgba(181, 56, 44, 0.2);
}

/* ---------- 四步刻度 ---------- */
.step-rail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: var(--hair-light);
}

.step-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(246, 240, 228, 0.72);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.18s ease;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  color: var(--lotus);
  transition: color 0.18s ease;
}

.step:hover,
.step:focus-visible { color: var(--white); }

.step:hover .step-num,
.step:focus-visible .step-num { color: var(--cinnabar); }

/* ---------- 头部工具区 ---------- */
.header-utility {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 14px;
}

.utility-btn {
  padding: 8px 12px;
  border: 1px solid rgba(246, 240, 228, 0.26);
  border-radius: 0;
  background: transparent;
  color: rgba(246, 240, 228, 0.82);
  font-size: 12.5px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.utility-btn:hover {
  background: rgba(246, 240, 228, 0.1);
  border-color: rgba(246, 240, 228, 0.5);
  color: var(--white);
}

.utility-btn[aria-pressed="true"] {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: var(--white);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 0;
  padding: 48px var(--gutter) 28px;
  background: var(--ink);
  color: rgba(246, 240, 228, 0.72);
  font-size: 15px;
  line-height: 1.8;
}

.site-footer a {
  color: rgba(246, 240, 228, 0.72);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.site-footer a:hover {
  color: var(--white);
  border-bottom-color: var(--cinnabar);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  max-width: var(--container);
  margin: 0 auto;
}

.footer-wordmark {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--paper);
}

.footer-tagline {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(246, 240, 228, 0.14);
  color: var(--cinnabar);
  font-size: 13px;
  letter-spacing: 0.2em;
}

.footer-intro {
  max-width: 34ch;
  margin: 0;
  color: rgba(246, 240, 228, 0.6);
  font-size: 14px;
  line-height: 1.85;
}

.footer-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

.footer-col-title {
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 2px solid var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.22em;
}

.footer-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-link-list li + li { margin-top: 8px; }

.footer-link-list a { font-size: 14.5px; }

.footer-meta {
  max-width: var(--container);
  margin: 34px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(246, 240, 228, 0.14);
}

.footer-contact {
  margin: 0 0 6px;
  color: rgba(246, 240, 228, 0.86);
  font-size: 14px;
  line-height: 1.8;
  word-break: break-word;
}

.footer-reply {
  margin: 0;
  color: rgba(246, 240, 228, 0.48);
  font-size: 13px;
  line-height: 1.75;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  max-width: var(--container);
  margin: 22px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(246, 240, 228, 0.1);
}

.footer-copy,
.footer-legal {
  margin: 0;
  color: rgba(246, 240, 228, 0.44);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.footer-legal { font-family: var(--font-mono); }

/* ---------- 滚动进度条与返回顶部 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  background: rgba(27, 36, 41, 0.1);
  pointer-events: none;
}

.scroll-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cinnabar);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.12s linear;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 190;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--stone);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease,
    background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: var(--white);
}

/* ---------- 显现动效基类 ---------- */
.reveal-ready {
  opacity: 0;
  transform: translateY(12px);
}

.reveal-ready.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s ease, transform 0.42s ease;
}

/* ---------- 平板 ---------- */
@media (min-width: 640px) {
  :root { --gutter: 28px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

@media (min-width: 768px) {
  .section { padding: 68px 0; }

  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* ---------- 桌面：左侧竖框导航 ---------- */
@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    height: 100vh;
    display: flex;
    overflow: hidden;
    border-bottom: 0;
    border-right: 1px solid rgba(181, 56, 44, 0.55);
  }

  .site-header.is-scrolled { box-shadow: none; }

  .skip-link {
    left: calc(var(--rail-w) + 8px);
    top: 8px;
    transform: translateY(-160%);
    transition: transform 0.18s ease;
  }

  .skip-link:focus { transform: none; }

  .header-frame {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 26px;
    width: 100%;
    height: 100%;
    padding: 30px 22px 26px;
    overflow-y: auto;
  }

  .brand { flex: 0 0 auto; }

  .nav-toggle { display: none; }

  .site-nav {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    order: 0;
    padding: 0;
    border-top: 0;
    max-height: none;
    overflow: visible;
  }

  .site-nav[data-open] { display: flex; }

  .nav-caption,
  .rail-caption { display: block; }

  .nav-list a {
    padding: 9px 10px 9px 12px;
    font-size: 14.5px;
  }

  .step-rail {
    margin-top: 22px;
    padding-top: 18px;
    border-top: var(--hair-light);
  }

  .step-list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    position: relative;
    padding-left: 4px;
  }

  .step-list::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 11px;
    width: 1px;
    background: rgba(199, 178, 192, 0.4);
  }

  .step {
    position: relative;
    padding-left: 0;
  }

  .step-num {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 500;
    min-width: 20px;
    padding: 2px 0;
    background: var(--ink);
  }

  .header-utility {
    flex-direction: column;
    margin-top: auto;
    gap: 8px;
  }

  .utility-btn { width: 100%; text-align: center; }

  .scroll-progress { left: var(--rail-w); }

  .site-footer {
    padding: 64px 40px 34px;
  }

  .footer-inner {
    grid-template-columns: 1.4fr 2.4fr;
    align-items: start;
    gap: 52px;
  }
}

@media (min-width: 1200px) {
  :root { --gutter: 40px; }
  .container { padding: 0 40px; }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

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

  .to-top {
    transform: none;
  }
}
