/* ==========================================================================
   28杠主页 共享样式 /assets/site.css
   结构：变量 → 重置 → 排版 → 头部 → 页脚 → 基础组件 → 动效与无障碍
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  --ink-900: #0B211B;
  --ink-800: #102C24;
  --ink-700: #173B30;
  --grid-line: #2A4C40;
  --gold-500: #C9A227;
  --gold-300: #E8CE7E;
  --flame-500: #E4572E;
  --cream-100: #F3EDDF;
  --moss-400: #7E9C8C;
  --paper-200: #D9D3C4;

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

  --rail-w: 112px;
  --topline-h: 46px;
  --wrap: 1180px;
  --edge: clamp(18px, 3.2vw, 48px);
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

@media (max-width: 899px) {
  :root { --topline-h: 54px; }
}

/* ---------- 2. 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border-radius: 0; }
table { border-collapse: collapse; }

/* ---------- 3. 基础与中文排版 ---------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--ink-900);
  background-image:
    linear-gradient(to right, rgba(42, 76, 64, .30) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 76, 64, .30) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  padding-top: var(--topline-h);
  background: transparent;
  color: var(--paper-200);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  color: var(--cream-100);
  letter-spacing: 0;
}

h1 { font-size: clamp(34px, 5.6vw, 76px); }
h2 { font-size: clamp(24px, 3.2vw, 40px); }
h3 { font-size: clamp(19px, 2vw, 24px); }
h4 { font-size: 17px; }

p { max-width: 64ch; }
a { color: var(--gold-300); }
strong { color: var(--cream-100); font-weight: 700; }

small, .text-sm { font-size: 13px; line-height: 1.5; }
.mono { font-family: var(--font-mono); letter-spacing: .08em; }
.mark { color: var(--gold-500); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .18em;
  color: var(--gold-500);
  text-transform: uppercase;
}

::selection { background: var(--gold-500); color: var(--ink-900); }

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

#main-content {
  display: block;
  outline: none;
  scroll-margin-top: calc(var(--topline-h) + 14px);
}

/* ---------- 4. 头部 ---------- */
.site-header {
  display: block;
  color: var(--paper-200);
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -90px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--gold-500);
  color: var(--ink-900);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 10px; }

/* 顶部细条 */
.topline {
  position: fixed;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  height: var(--topline-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--edge);
  background: var(--ink-800);
  border-bottom: 1px solid var(--grid-line);
  z-index: 74;
}

@media (min-width: 900px) {
  .topline { left: var(--rail-w); }
}

.topline__brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--cream-100);
  white-space: nowrap;
}

.topline__province {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--moss-400);
  padding-left: 14px;
  border-left: 1px solid var(--grid-line);
  white-space: nowrap;
}

.topline__quick {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.topline__quick a {
  display: inline-block;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--gold-300);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: border-color .16s, background-color .16s;
}
.topline__quick a:hover {
  border-color: var(--gold-500);
  background: rgba(201, 162, 39, .08);
}

/* 抽屉按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  color: var(--gold-300);
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .16s, background-color .16s;
}
.nav-toggle:hover { border-color: var(--gold-500); background: rgba(201, 162, 39, .08); }

@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }
}

.nav-toggle__bars {
  display: block;
  position: relative;
  width: 14px;
  height: 2px;
  background: currentColor;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 2px;
  background: currentColor;
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* 侧边品牌轨道 */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 12px 0 18px;
  background: var(--ink-800);
  border-right: 1px solid var(--grid-line);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 76;
}

.rail__brand {
  display: block;
  padding: 6px 8px 14px;
  text-align: center;
  text-decoration: none;
  border-bottom: 1px solid var(--grid-line);
}

.rail__mark {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--gold-500);
}

.rail__word {
  display: block;
  margin-top: 4px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--cream-100);
}

.rail__sub {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--moss-400);
}

.rail__list { flex: 1 1 auto; padding: 10px 0 0; }

.rail__list a {
  display: block;
  padding: 11px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--paper-200);
  border-left: 2px solid transparent;
  border-bottom: 1px solid rgba(42, 76, 64, .55);
  transition: background-color .16s, color .16s, border-color .16s;
}
.rail__list a:hover { background: rgba(201, 162, 39, .09); color: var(--gold-300); }

.rail__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--moss-400);
}

.rail__label { display: block; margin-top: 2px; font-size: 12.5px; }

.rail__list a[aria-current="page"] {
  color: var(--gold-300);
  background: rgba(201, 162, 39, .13);
  border-left-color: var(--gold-500);
}
.rail__list a[aria-current="page"] .rail__num { color: var(--gold-500); }

.rail__cta {
  display: block;
  margin: 12px 10px 0;
  padding: 10px 6px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.35;
  letter-spacing: .04em;
  color: #FFF6EE;
  background: var(--flame-500);
  border: 1px solid var(--flame-500);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color .16s, border-color .16s;
}
.rail__cta:hover { background: #C94A25; border-color: #C94A25; }

/* 移动端抽屉态 */
@media (max-width: 899px) {
  .rail {
    width: min(86vw, 320px);
    padding: 16px 0 22px;
    transform: translateX(-102%);
    transition: transform .3s var(--ease);
    box-shadow: 0 0 0 1px var(--grid-line), 12px 0 40px rgba(0, 0, 0, .35);
  }
  .rail[data-open] { transform: translateX(0); }

  .rail__brand { text-align: left; padding: 0 20px 16px; }
  .rail__mark { font-size: 30px; }
  .rail__word { font-size: 15px; }
  .rail__sub { font-size: 12px; }

  .rail__list a {
    text-align: left;
    padding: 14px 20px;
    border-left-width: 3px;
  }
  .rail__num { display: inline-block; margin: 0 12px 0 0; font-size: 11px; vertical-align: 2px; }
  .rail__label { display: inline-block; margin-top: 0; font-size: 15px; }

  .rail__cta { margin: 16px 20px 0; padding: 13px 10px; font-size: 13.5px; }
}

/* 遮罩 */
.scrim {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(11, 33, 27, .72);
  border: 0;
  z-index: 75;
}
.scrim[hidden] { display: none; }

@media (min-width: 900px) {
  .scrim { display: none !important; }
}

/* ---------- 5. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 120px);
  padding: clamp(40px, 5vw, 72px) var(--edge) 28px;
  background: var(--ink-800);
  border-top: 1px solid var(--grid-line);
  color: var(--paper-200);
  z-index: 1;
}

.footer__grid {
  max-width: var(--wrap);
  margin-inline: auto;
  display: grid;
  gap: clamp(26px, 3vw, 40px);
  grid-template-columns: 1fr;
}

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

@media (min-width: 1080px) {
  .footer__grid { grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); }
}

.footer__col { min-width: 0; }
.footer__col--brand { max-width: 36ch; }

.footer__brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--cream-100);
}

.footer__tag {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--moss-400);
}

.footer__shortcut {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.footer__top {
  display: inline-block;
  margin-top: 16px;
  padding-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--gold-300);
  text-decoration: none;
  border-bottom: 1px solid var(--grid-line);
  transition: border-color .16s, color .16s;
}
.footer__top:hover { border-bottom-color: var(--gold-500); color: var(--gold-500); }

.footer__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--gold-500);
  text-transform: uppercase;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer__list a {
  font-size: 13.5px;
  color: var(--paper-200);
  text-decoration: none;
  transition: color .16s;
}
.footer__list a:hover { color: var(--gold-300); }

.footer__list--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
}

.footer__contact { display: grid; gap: 10px; }

.footer__contact dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--moss-400);
}

.footer__contact dd {
  margin-top: 2px;
  font-size: 13px;
  color: var(--paper-200);
  overflow-wrap: anywhere;
}

.footer__note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--moss-400);
}

.footer__legal {
  max-width: var(--wrap);
  margin: clamp(32px, 4vw, 52px) auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--grid-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 12px;
  color: var(--moss-400);
}

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

.footer__copy { font-size: 12px; }

/* ---------- 6. 基础组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--cream-100);
  background: transparent;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s;
}

.btn--ghost { color: var(--gold-300); }
.btn--ghost:hover { border-color: var(--gold-500); background: rgba(201, 162, 39, .08); }

.btn--accent {
  background: var(--flame-500);
  border-color: var(--flame-500);
  color: #FFF6EE;
}
.btn--accent:hover { background: #C94A25; border-color: #C94A25; }

.btn--gold {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--ink-900);
}
.btn--gold:hover { background: var(--gold-300); border-color: var(--gold-300); }

.btn--sm { padding: 8px 14px; font-size: 12.5px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--moss-400);
}
.breadcrumb a { color: var(--moss-400); text-decoration: none; transition: color .16s; }
.breadcrumb a:hover { color: var(--gold-300); }
.breadcrumb__sep { color: var(--grid-line); }
.breadcrumb [aria-current="page"] { color: var(--gold-300); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--edge);
}

.section { padding-block: clamp(48px, 7vw, 104px); }
.section--tight { padding-block: clamp(28px, 4vw, 56px); }
.section--deep { background: var(--ink-800); }

.section--light {
  background: var(--cream-100);
  color: var(--ink-700);
}
.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4 { color: var(--ink-900); }
.section--light a { color: var(--ink-800); }
.section--light .eyebrow { color: var(--ink-700); }

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.card {
  position: relative;
  padding: clamp(18px, 2.2vw, 28px);
  background: var(--ink-700);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
}

.card__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--gold-500);
}

.card__title {
  margin-top: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  color: var(--cream-100);
}

.card__text {
  margin-top: 8px;
  font-size: 14px;
  color: var(--moss-400);
}

/* 响应式图片容器基础规则 */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--ink-700);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
}

.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media--wide { aspect-ratio: 16 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }
.media--panel { aspect-ratio: 3 / 2; }

.media--placeholder {
  background-color: var(--ink-700);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(201, 162, 39, .10) 0 1px,
    transparent 1px 14px
  );
}
.media--placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201, 162, 39, .20);
  pointer-events: none;
}

.media__cap {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--moss-400);
}

/* ---------- 7. 脚本注入组件 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--flame-500));
  z-index: 95;
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  color: var(--gold-300);
  background: var(--ink-800);
  border: 1px solid var(--gold-500);
  border-radius: var(--radius);
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover { background: var(--ink-700); color: var(--gold-500); }

/* ---------- 8. 动效与无障碍 ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

html.js [data-reveal][data-shown] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  html.js [data-reveal] { transform: none; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 479px) {
  .topline { gap: 10px; }
  .topline__brand { font-size: 13px; }
  .topline__province { display: none; }
  .topline__quick a { padding: 6px 7px; font-size: 12px; }
  .to-top { right: 12px; bottom: 12px; }
}
