/* ==========================================================================
   crown-route.com.cn — shared site kit
   /assets/site.css : reset, tokens, typography, header, footer, base components
   ========================================================================== */

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

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

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. tokens ---------- */
:root {
  /* palette */
  --ink: #0E2A24;
  --ink-2: #123A31;
  --ink-3: #1C4A3F;
  --gold: #C9A227;
  --gold-soft: #E3C766;
  --cream: #F3EBDD;
  --cream-2: #E5D9C3;
  --paper: #F7F4EC;
  --amber: #B4531A;
  --deep-red: #8C1D18;
  --sage: #6F7F79;
  --white: #FFFFFF;

  /* lines & veils */
  --line: rgba(201, 162, 39, 0.42);
  --line-strong: rgba(201, 162, 39, 0.72);
  --line-soft: rgba(201, 162, 39, 0.20);
  --grid-veil: rgba(243, 235, 221, 0.06);
  --on-ink: rgba(255, 255, 255, 0.84);
  --on-ink-dim: rgba(255, 255, 255, 0.58);

  /* type */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  /* metrics */
  --header-h: 78px;
  --rail-w: 244px;
  --shell: 1400px;
  --gap: 24px;
  --pad: 20px;
}

/* ---------- 3. base typography ---------- */
body {
  background-color: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
}

h1 { font-size: clamp(30px, 4.4vw, 54px); line-height: 1.18; }
h2 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.26; }
h3 { font-size: 20px; line-height: 1.45; }

p { max-width: 68ch; }
strong { color: var(--white); font-weight: 700; }

a:hover { color: var(--gold-soft); }

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

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

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

/* ---------- 4. skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--ink);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); color: var(--ink); }

/* ---------- 5. main / shell ---------- */
#main-content,
.site-main { padding-top: var(--header-h); }

.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

.shell--split {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* ---------- 6. header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  isolation: isolate;
  background-color: transparent;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-veil) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-veil) 1px, transparent 1px);
  background-size: 24px 24px;
}

.site-header.is-scrolled {
  background-color: var(--ink);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.header-inner {
  position: relative;
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  transition: min-height 0.25s ease;
}
.site-header.is-scrolled .header-inner { min-height: 66px; }

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand__seal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  background: rgba(201, 162, 39, 0.06);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--white);
}
.brand__sub {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--sage);
}

/* navigation */
.site-nav { justify-self: center; min-width: 0; }
.site-nav__list { display: flex; align-items: center; gap: 2px; }
.site-nav__item { min-width: 0; }
.site-nav__link {
  position: relative;
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--on-ink);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}
.site-nav__link:hover { color: var(--gold-soft); }
.site-nav__link:hover::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--gold-soft); }
.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--gold-soft);
}

/* header tools */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.index-badge {
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--sage);
  white-space: nowrap;
}
.issue-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.issue-chip:hover { border-color: var(--gold); background: rgba(201, 162, 39, 0.1); }
.issue-chip__label { font-size: 10px; letter-spacing: 0.14em; color: var(--sage); }
.issue-chip__num { font-size: 13px; font-weight: 700; color: var(--gold-soft); }

.header-cta { white-space: nowrap; }

/* nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.nav-toggle:hover { border-color: var(--gold); }
.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--gold-soft);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 7. buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.btn--gold:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: var(--ink);
}
.btn--ghost {
  background: transparent;
  color: var(--gold-soft);
}
.btn--ghost:hover {
  background: rgba(201, 162, 39, 0.12);
  box-shadow: inset 0 0 0 1px var(--gold);
  color: var(--gold-soft);
}

/* ---------- 8. footer ---------- */
.site-footer {
  position: relative;
  isolation: isolate;
  margin-top: 96px;
  padding: 56px 0 28px;
  background-color: var(--ink);
  border-top: 1px solid var(--line);
  color: var(--on-ink);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--grid-veil) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-veil) 1px, transparent 1px);
  background-size: 24px 24px;
}

.footer-inner {
  position: relative;
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

.footer-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}
.footer-lead__text { min-width: 0; }
.footer-lead__brand {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
}
.footer-lead__update {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sage);
}
.footer-cta { flex: 0 0 auto; }

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.3fr 0.8fr;
  gap: 32px 28px;
  padding: 32px 0 8px;
}
.footer-col { min-width: 0; }
.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.footer-list { display: flex; flex-direction: column; gap: 9px; }
.footer-list__link {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  font-size: 14px;
  color: var(--on-ink);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer-list__link:hover {
  color: var(--gold-soft);
  border-bottom-color: var(--line);
}
.footer-list__item {
  font-size: 13px;
  line-height: 1.6;
  color: var(--on-ink-dim);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.footer-base__contact {
  font-size: 12px;
  line-height: 1.7;
  color: var(--sage);
  max-width: 64ch;
}
.footer-base__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--on-ink-dim);
}
.footer-base__icp { color: var(--sage); }

/* ---------- 9. layout & content primitives ---------- */
.grid-veil { position: relative; isolation: isolate; }
.grid-veil::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-veil) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-veil) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}
.bento > * { min-width: 0; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.section-bar {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.section-bar__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.section-bar__title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
}
.section-bar__note {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sage);
}

.eyebrow {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--sage);
}

.panel {
  padding: 24px;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
}
.panel--gold { border-color: var(--line); }
.panel--paper {
  background: var(--cream);
  border-color: rgba(14, 42, 36, 0.16);
  color: var(--ink);
}
.panel--paper h2,
.panel--paper h3 { color: var(--ink); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold-soft);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--sage);
}
.breadcrumbs__sep { color: rgba(111, 127, 121, 0.6); }
.breadcrumbs [aria-current="page"] { color: var(--on-ink); }

/* image container base — 页面阶段在此放置占位图 */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  background: var(--ink-2);
}
.media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
}
.media__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: linear-gradient(transparent, rgba(14, 42, 36, 0.88));
}
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }

/* ---------- 10. data table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  background: var(--cream);
  color: var(--ink);
}
.data-table {
  width: 100%;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(14, 42, 36, 0.14);
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--cream-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.data-table tbody tr:nth-child(even) { background: rgba(229, 217, 195, 0.5); }
.data-table tbody tr:hover { background: rgba(201, 162, 39, 0.2); }
.data-table td.num,
.data-table th.num { font-family: var(--font-mono); letter-spacing: 0.08em; }

/* ---------- 11. tabs ---------- */
.tabs { width: 100%; }
.tablist {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: thin;
}
.tab {
  position: relative;
  padding: 12px 20px;
  font-size: 15px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--on-ink-dim);
  transition: color 0.2s ease;
}
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s ease;
}
.tab:hover { color: var(--gold-soft); }
.tab[aria-selected="true"] { color: var(--gold-soft); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }

.tab-panel { padding-top: 20px; }
.tab-panel[hidden] { display: none; }

.tabs--paper .tablist { border-bottom-color: rgba(14, 42, 36, 0.18); }
.tabs--paper .tab { color: rgba(14, 42, 36, 0.58); }
.tabs--paper .tab:hover,
.tabs--paper .tab[aria-selected="true"] { color: var(--ink); }
.tabs--paper .tab[aria-selected="true"]::after { background: var(--deep-red); }

/* ---------- 12. heat grid ---------- */
.heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 3px;
}
.heat-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-soft);
  background: var(--ink-2);
  transition: opacity 0.35s ease;
}
.heat-cell[data-level="1"] { background: rgba(180, 83, 26, 0.28); }
.heat-cell[data-level="2"] { background: rgba(180, 83, 26, 0.55); }
.heat-cell[data-level="3"] { background: rgba(160, 62, 24, 0.78); }
.heat-cell[data-level="4"] { background: rgba(140, 45, 24, 0.92); }
.heat-cell[data-level="5"] { background: rgba(140, 29, 24, 0.96); }
.heat-cell[data-level="6"] { background: var(--deep-red); }

/* ---------- 13. reveal ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 14. responsive ---------- */
@media (max-width: 1240px) {
  .index-badge { display: none; }
}

@media (max-width: 1080px) {
  .nav-toggle { display: flex; }
  .header-cta { display: none; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 99;
    justify-self: stretch;
    padding: 8px 20px 24px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: var(--ink-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s linear;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    counter-reset: navidx;
  }
  .site-nav__item {
    counter-increment: navidx;
    border-bottom: 1px solid rgba(201, 162, 39, 0.16);
  }
  .site-nav__item:last-child { border-bottom: 0; }
  .site-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    font-size: 16px;
  }
  .site-nav__link::before {
    content: counter(navidx, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--sage);
  }
  .site-nav__link::after {
    left: 0;
    right: auto;
    width: 26px;
    bottom: 8px;
  }

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

  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-col--wide,
  .footer-col--narrow { grid-column: span 1; }
}

@media (max-width: 980px) {
  .span-3,
  .span-4 { grid-column: span 6; }
  .footer-cols { gap: 28px 24px; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }

  .header-inner { width: calc(100% - 24px); gap: 12px; }
  .shell,
  .footer-inner { width: calc(100% - 24px); }

  .brand__sub { display: none; }
  .brand__name { font-size: 15px; }
  .brand__seal { width: 32px; height: 32px; font-size: 15px; }
  .issue-chip__label { display: none; }

  .site-footer { margin-top: 64px; padding-top: 40px; }
  .footer-lead__brand { font-size: 19px; }
  .footer-lead__update { font-size: 11px; }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .span-3,
  .span-4,
  .span-6,
  .span-8 { grid-column: span 12; }

  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .panel { padding: 18px; }
  .tab { padding: 11px 14px; font-size: 14px; }
  .section-bar { flex-wrap: wrap; }
  .section-bar__note { margin-left: 0; width: 100%; }
}

/* ---------- 15. reduced motion ---------- */
@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.js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .site-nav[data-open="true"] { transform: none; }
}
