/* ============================================================
   road-dafa.com.cn — 共享样式 / assets/site.css
   深墨蓝轨道 + 暖纸正文 + 路标橙指示
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --ink: #0E1B2C;
  --ink-2: #16283F;
  --paper: #F3EBDD;
  --paper-lite: #FBF7EF;
  --orange: #FF6B35;
  --gold: #F5C518;
  --gold-deep: #7A5C00;
  --teal: #2EC4B6;
  --teal-deep: #17766C;
  --alert: #C9452B;
  --graphite: #4A5568;
  --mist: #E6E9EE;

  --line-light: rgba(14, 27, 44, 0.16);
  --line-soft: rgba(14, 27, 44, 0.08);
  --line-dark: rgba(230, 233, 238, 0.18);

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Roboto Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 3.4vw, 44px);
  --max-w: 1320px;
  --baseline: 48px;
  --bar-h: 44px;
  --nav-reserve: 0px;
  --radius: 2px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 240ms;
}

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, rgba(14, 27, 44, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(14, 27, 44, 0.045) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

ul[class], ol[class] { list-style: none; padding-left: 0; }

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

a { color: inherit; }

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

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

.site-header :focus-visible,
.pill-nav :focus-visible,
.site-footer :focus-visible { outline-color: var(--mist); }

/* ---------- 通用容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line-soft);
}

.section--flush { border-top: 0; padding-top: 0; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
  margin-bottom: clamp(20px, 3vw, 36px);
}

/* ---------- 排版 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.18em;
  color: var(--graphite);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--orange);
}

.display-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.headline {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-stretch: condensed;
}

.subhead {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.3;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- 正文 ---------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose p { font-size: 17px; line-height: 1.75; }
.prose h2 {
  font-size: clamp(24px, 2.6vw, 28px);
  font-weight: 800;
  line-height: 1.3;
  margin-top: 1.9em;
}
.prose h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.6em;
}
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--orange); }
.prose strong { font-weight: 700; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--paper-lite);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.btn--primary { background: var(--orange); color: var(--ink); }
.btn--primary:hover { background: var(--gold); }

.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--paper-lite); }

.btn--light { border-color: var(--line-dark); color: var(--paper-lite); background: transparent; }
.btn--light:hover { border-color: var(--orange); color: var(--orange); }

.btn--arrow::after {
  content: "→";
  font-family: var(--font-mono);
  font-weight: 400;
  transition: transform var(--dur) var(--ease);
}
.btn--arrow:hover::after { transform: translateX(4px); }

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--graphite);
}

.crumbs__link {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.crumbs__link:hover { color: var(--ink); border-bottom-color: var(--orange); }
.crumbs__sep { color: rgba(74, 85, 104, 0.55); }
.crumbs__current { color: var(--ink); }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: clamp(20px, 3vw, 36px); }
.grid--split { grid-template-columns: minmax(0, 1fr) minmax(0, 0.42fr); }
.grid--rail { grid-template-columns: 220px minmax(0, 1fr); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 图片容器基础 ---------- */
.figure {
  margin: 0;
  border: 1px solid var(--line-light);
  background: var(--paper-lite);
  border-radius: var(--radius);
  overflow: hidden;
}

.figure__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(14, 27, 44, 0.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(14, 27, 44, 0.06) 0 1px, transparent 1px 24px),
    var(--paper-lite);
}

.figure__frame > img,
.figure__frame > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure__caption {
  padding: 9px 14px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--graphite);
}

.figure--wide .figure__frame { aspect-ratio: 21 / 9; }
.figure--tall .figure__frame { aspect-ratio: 4 / 5; }

/* ---------- 表格基础 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-lite);
  border: 1px solid var(--line-light);
  font-size: 14px;
}

.data-table caption {
  caption-side: top;
  text-align: start;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--graphite);
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: start;
  vertical-align: top;
}

.data-table thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--graphite);
  background: rgba(14, 27, 44, 0.04);
}

.data-table tbody tr { transition: box-shadow var(--dur) var(--ease); }
.data-table tbody tr:hover { box-shadow: inset -4px 0 0 var(--orange); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- 分段切换 ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: var(--paper-lite);
}

.seg__tab {
  min-height: 34px;
  padding: 5px 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--graphite);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.seg__tab:hover { color: var(--ink); }
.seg__tab[aria-selected="true"] { background: var(--ink); color: var(--paper-lite); }
.seg__tab[aria-selected="true"]:hover { color: var(--paper-lite); }

.seg__panel[hidden] { display: none; }

/* ---------- 阅读进度 ---------- */
.scroll-meter {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 200;
  width: 0;
  height: 2px;
  background: var(--orange);
  pointer-events: none;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  inset-block-start: -80px;
  inset-inline-start: 12px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--orange);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-radius: var(--radius);
  transition: inset-block-start 160ms var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible { inset-block-start: 12px; }

/* ============================================================
   头部
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  font-size: 14px;
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--bar-h);
  padding-inline: var(--gutter);
  padding-inline-end: calc(var(--gutter) + var(--nav-reserve));
  background: var(--ink);
  border-bottom: 1px solid var(--line-dark);
  overflow: hidden;
  transition: height var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header[data-scrolled] .site-header__bar {
  height: 3px;
  border-bottom-color: var(--orange);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper-lite);
  white-space: nowrap;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: 1px;
}

.brand__name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand__tagline {
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--line-dark);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(230, 233, 238, 0.62);
}

.route-path {
  min-width: 0;
  padding-inline-start: 14px;
  border-inline-start: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(230, 233, 238, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-cta {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 13px;
  background: var(--orange);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: background var(--dur) var(--ease);
}

.quick-cta::after {
  content: "→";
  font-family: var(--font-mono);
  font-weight: 400;
  transition: transform var(--dur) var(--ease);
}

.quick-cta:hover { background: var(--gold); }
.quick-cta:hover::after { transform: translateX(4px); }

/* 胶囊导航 */
.pill-nav {
  position: absolute;
  top: 3px;
  right: 0;
  z-index: 2;
  padding-inline-end: var(--gutter);
}

.pill-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.site-header[data-scrolled] .pill-nav__list {
  background: rgba(14, 27, 44, 0.92);
  box-shadow: 0 8px 26px rgba(14, 27, 44, 0.32);
}

.pill-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid rgba(230, 233, 238, 0.3);
  border-radius: 999px;
  color: rgba(230, 233, 238, 0.86);
  font-size: 12.5px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.pill-nav__link:hover {
  border-color: var(--orange);
  color: var(--paper-lite);
  background: rgba(255, 107, 53, 0.14);
}

.pill-nav__link[aria-current="page"] {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  font-weight: 800;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  position: absolute;
  top: 5px;
  right: var(--gutter);
  z-index: 130;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 14px;
  background: var(--orange);
  color: var(--ink);
  border: 1px solid var(--orange);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 14px;
  height: 9px;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease), top var(--dur) var(--ease);
}

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 7px; }

.site-header[data-open] .nav-toggle {
  background: var(--paper-lite);
  border-color: var(--paper-lite);
}

.site-header[data-open] .nav-toggle__bars::before { top: 3.5px; transform: rotate(45deg); }
.site-header[data-open] .nav-toggle__bars::after { top: 3.5px; transform: rotate(-45deg); }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(230, 233, 238, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(230, 233, 238, 0.05) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  color: var(--mist);
  padding-block-start: clamp(40px, 6vw, 64px);
  font-size: 14px;
  line-height: 1.7;
}

.footer__grid {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 32px 40px;
}

.footer__col { min-width: 0; }

.footer__col + .footer__col {
  border-inline-start: 1px solid var(--line-dark);
  padding-inline-start: 28px;
}

.brand--footer {
  color: var(--paper-lite);
  margin-bottom: 14px;
}

.brand--footer .brand__name { font-size: 15px; }

.footer__claim {
  max-width: 26ch;
  color: rgba(230, 233, 238, 0.78);
  font-size: 13.5px;
  line-height: 1.8;
}

.footer__meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(230, 233, 238, 0.5);
}

.footer__heading {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.footer__list { display: grid; gap: 7px; }

.footer__link {
  color: rgba(230, 233, 238, 0.82);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer__link:hover {
  color: var(--paper-lite);
  border-bottom-color: var(--orange);
}

.footer__contact {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(230, 233, 238, 0.82);
  word-break: break-word;
}

.footer__contact--note {
  margin-top: 10px;
  color: rgba(230, 233, 238, 0.56);
  font-size: 11.5px;
}

.footer__legal {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  margin-top: clamp(32px, 5vw, 52px);
  padding: 18px var(--gutter) 22px;
  border-top: 1px solid var(--line-dark);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(230, 233, 238, 0.6);
}

.footer__legal-links { display: inline-flex; flex-wrap: wrap; gap: 8px; }

.footer__legal-link {
  color: rgba(230, 233, 238, 0.72);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer__legal-link:hover {
  color: var(--paper-lite);
  border-bottom-color: var(--orange);
}

/* ============================================================
   响应式
   ============================================================ */
@media (min-width: 1181px) {
  :root { --nav-reserve: 566px; }
}

@media (max-width: 1180px) {
  :root { --nav-reserve: 0px; }

  .site-header__bar {
    height: var(--bar-h);
    padding-inline: var(--gutter) calc(var(--gutter) + 100px);
  }

  .brand__tagline,
  .route-path { display: none; }

  .nav-toggle { display: inline-flex; }

  .site-header[data-scrolled] .site-header__bar {
    height: var(--bar-h);
    border-bottom-color: var(--line-dark);
  }

  .pill-nav {
    position: fixed;
    inset-inline: 10px;
    inset-block-end: calc(10px + env(safe-area-inset-bottom, 0px));
    top: auto;
    right: auto;
    z-index: 130;
    padding-inline-end: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(140%);
    transition: transform 280ms var(--ease), opacity 200ms var(--ease), visibility 280ms linear;
  }

  .site-header[data-open] .pill-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .pill-nav__list {
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    background: var(--ink);
    border: 1px solid var(--line-dark);
    box-shadow: 0 14px 34px rgba(14, 27, 44, 0.42);
    scrollbar-width: none;
  }

  .pill-nav__list::-webkit-scrollbar { display: none; }

  .pill-nav__link {
    min-height: 34px;
    padding: 6px 13px;
    font-size: 13px;
  }

  .site-header[data-scrolled] .pill-nav__list {
    background: var(--ink);
    box-shadow: 0 14px 34px rgba(14, 27, 44, 0.42);
  }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__col + .footer__col { border-inline-start: 0; padding-inline-start: 0; }
  .footer__col:nth-child(even) {
    border-inline-start: 1px solid var(--line-dark);
    padding-inline-start: 24px;
  }
}

@media (max-width: 900px) {
  body { font-size: 16px; }

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

@media (max-width: 640px) {
  .site-header__bar { gap: 10px; }
  .brand__name { font-size: 13px; letter-spacing: 0.03em; }
  .quick-cta { padding: 3px 10px; font-size: 11.5px; }

  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer__col:nth-child(even) { border-inline-start: 0; padding-inline-start: 0; }
  .footer__col + .footer__col {
    border-top: 1px solid var(--line-dark);
    padding-top: 22px;
  }

  .footer__legal { justify-content: flex-start; }

  .display-title { font-size: clamp(34px, 9vw, 52px); }
}

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