/* ============================================================
   site.css — 皇冠体彩彩讯 / 共享外壳与基础组件
   ============================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- 2. 变量 ---------- */
:root {
  --base-900: #111214;
  --base-800: #1C1E22;
  --line-600: #2A2D33;
  --brand-500: #C9A227;
  --brand-300: #E8CE7A;
  --accent-600: #8B1E2D;
  --surface-100: #F2ECE0;
  --text-100: #EDE7DA;
  --text-400: #8B8F97;
  --chart-teal: #2FBFA8;
  --chart-amber: #F0A63C;

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

  --rail-w: 220px;
  --topbar-h: 56px;

  --gap-xs: 8px;
  --gap-sm: 14px;
  --gap-md: 24px;
  --gap-lg: 48px;
  --gap-xl: 96px;

  --ease-cut: cubic-bezier(.2, .7, .2, 1);
  --dur-cut: 220ms;
}

/* ---------- 3. 基础排版 ---------- */
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text-100);
  background-color: var(--base-900);
  background-image:
    linear-gradient(to right, rgba(42, 45, 51, .55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 45, 51, .55) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; letter-spacing: .02em; }
a { color: var(--text-100); text-decoration: none; transition: color 160ms var(--ease-cut); }
a:hover { color: var(--brand-300); }
:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 3px; }
::selection { background: var(--brand-500); color: #151006; }
main { display: block; min-height: 60vh; padding-top: var(--topbar-h); transition: padding-top var(--dur-cut) var(--ease-cut); }

/* ---------- 4. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  transform: translateY(-220%);
  padding: 10px 18px;
  background: var(--brand-500);
  color: #151006;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  transition: transform 180ms var(--ease-cut);
}
.skip-link:focus { transform: translateY(0); color: #151006; }

/* ---------- 5. 头部：品牌轨道 ---------- */
.site-header { position: relative; z-index: 60; }

.brand-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  background: var(--base-900);
  border-right: 1px solid var(--line-600);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--dur-cut) var(--ease-cut);
}
.brand-rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom,
    var(--brand-500) 0,
    rgba(201, 162, 39, .28) 30%,
    rgba(201, 162, 39, 0) 66%,
    rgba(201, 162, 39, .42) 100%);
}

.rail-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px 0 20px;
}

.rail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--line-600);
  color: var(--text-100);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.rail-close:hover { border-color: var(--brand-500); color: var(--brand-300); }

.rail-top { padding: 0 18px 20px; }
.rail-brand { display: flex; align-items: center; gap: 10px; color: var(--text-100); }
.rail-brand:hover { color: var(--text-100); }
.rail-mark {
  flex: none;
  width: 22px;
  height: 20px;
  background: var(--brand-500);
  clip-path: polygon(0 28%, 25% 56%, 50% 4%, 75% 56%, 100% 28%, 100% 100%, 0 100%);
}
.rail-title { font-size: 17px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; }
.rail-sub {
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-400);
}
.rail-version {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 8px;
  border: 1px solid rgba(201, 162, 39, .42);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--brand-500);
}

.rail-nav { flex: 1 1 auto; padding-top: 16px; border-top: 1px solid var(--line-600); }
.rail-nav-label {
  margin: 0 0 10px;
  padding: 0 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-400);
}
.rail-list { display: grid; gap: 1px; }
.rail-link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 18px;
  border-left: 2px solid transparent;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--text-100);
  transition: color 160ms var(--ease-cut), background-color 160ms var(--ease-cut), border-color 160ms var(--ease-cut);
}
.rail-link:hover { background: rgba(201, 162, 39, .07); color: var(--brand-300); }
.rail-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rail-idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--text-400);
  opacity: .45;
  transform: translateX(-5px);
  transition: opacity 180ms var(--ease-cut), transform 180ms var(--ease-cut), color 180ms var(--ease-cut);
}
.rail-link:hover .rail-idx { opacity: 1; transform: translateX(0); color: var(--brand-300); }
.rail-link[aria-current="page"] {
  border-left-color: var(--brand-500);
  background: rgba(201, 162, 39, .1);
  color: var(--brand-300);
  font-weight: 600;
}
.rail-link[aria-current="page"] .rail-idx { opacity: 1; transform: translateX(0); color: var(--brand-500); }

.rail-foot {
  margin-top: auto;
  padding: 16px 18px 0;
  border-top: 1px solid var(--line-600);
}
.rail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: .06em;
  line-height: 1.5;
  color: var(--text-400);
}
.rail-status-lamp {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chart-teal);
  box-shadow: 0 0 0 3px rgba(47, 191, 168, .14);
}
.rail-status[data-live="true"] .rail-status-lamp { animation: lamp-breathe 2.4s ease-in-out infinite; }
@keyframes lamp-breathe {
  0%, 100% { box-shadow: 0 0 0 2px rgba(47, 191, 168, .12); opacity: .68; }
  50%      { box-shadow: 0 0 0 5px rgba(47, 191, 168, .05); opacity: 1; }
}
.rail-icp {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-400);
  opacity: .68;
}

/* ---------- 6. 头部：顶部命令栏 ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 16px;
  background: rgba(17, 18, 20, .94);
  border-bottom: 1px solid var(--line-600);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: height var(--dur-cut) var(--ease-cut), padding var(--dur-cut) var(--ease-cut);
}
.top-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(to right,
    var(--brand-500) 0,
    rgba(201, 162, 39, .35) 26%,
    rgba(201, 162, 39, 0) 68%);
  pointer-events: none;
}
.top-bar.is-condensed .bar-chip { padding: 1px 7px; font-size: 10.5px; }

.bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--line-600);
  color: var(--text-100);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 160ms var(--ease-cut), color 160ms var(--ease-cut);
}
.nav-toggle:hover { border-color: var(--brand-500); color: var(--brand-300); }
.nav-toggle-bars { display: grid; gap: 3px; width: 13px; }
.nav-toggle-bars i { display: block; height: 1px; width: 100%; background: currentColor; transition: transform 180ms var(--ease-cut); }
.nav-toggle-text { line-height: 1; }
.nav-toggle[aria-expanded="true"] { border-color: var(--brand-500); color: var(--brand-300); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:first-child { transform: translateY(2px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:last-child { transform: translateY(-2px) rotate(-45deg); }

.crumb { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 12px; letter-spacing: .08em; }
.crumb-root { color: var(--text-400); white-space: nowrap; }
.crumb-root:hover { color: var(--brand-300); }
.crumb-sep { font-family: var(--font-mono); color: var(--line-600); }
.crumb-current { color: var(--text-100); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar-right { display: flex; align-items: center; gap: 8px; flex: none; }
.bar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-600);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-100);
  transition: padding 160ms var(--ease-cut), font-size 160ms var(--ease-cut);
}
.bar-chip-key { font-size: 9px; letter-spacing: .2em; color: var(--text-400); }
.bar-chip--ver { color: var(--text-400); }
.bar-chip--period { border-color: rgba(201, 162, 39, .45); color: var(--brand-300); }
.bar-chip--period .bar-chip-key { color: rgba(201, 162, 39, .78); }

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, var(--brand-500), var(--brand-300));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  will-change: transform;
}

.rail-scrim { display: none; }

/* ---------- 7. 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--base-900);
  border-top: 1px solid var(--brand-500);
}
.footer-grid { display: grid; grid-template-columns: 1fr; }
.footer-cell { padding: 30px 22px; border-bottom: 1px solid var(--line-600); }
.footer-cell--brand { background: var(--base-800); }
.footer-cell--legal { display: grid; align-content: start; }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text-100);
}
.footer-crown {
  flex: none;
  width: 20px;
  height: 18px;
  background: var(--brand-500);
  clip-path: polygon(0 28%, 25% 56%, 50% 4%, 75% 56%, 100% 28%, 100% 100%, 0 100%);
}
.footer-tagline { margin: 0; max-width: 20em; font-size: 13px; line-height: 1.8; letter-spacing: .04em; color: var(--text-400); }
.footer-version { margin-top: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--brand-500); }

.footer-heading {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--brand-500);
}
.footer-heading--sub { margin-top: 24px; }

.footer-links { display: grid; gap: 9px; }
.footer-links--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; }
.footer-links a {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--text-100);
  transition: color 160ms var(--ease-cut), border-color 160ms var(--ease-cut);
}
.footer-links a:hover { color: var(--brand-300); border-bottom-color: rgba(201, 162, 39, .55); }

.footer-contact { display: grid; gap: 11px; }
.footer-contact li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.footer-contact-key {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-400);
}
.footer-contact-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--text-100);
  overflow-wrap: anywhere;
}
.footer-note { margin-top: 14px; font-size: 11.5px; letter-spacing: .04em; color: var(--text-400); }

.footer-icp {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--text-100);
}
.footer-copy { max-width: 26em; font-size: 12px; line-height: 1.8; color: var(--text-400); }
.footer-copy [data-year] { font-family: var(--font-mono); color: var(--brand-300); }

/* ---------- 8. 通用组件 ---------- */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms var(--ease-cut), border-color 180ms var(--ease-cut), color 180ms var(--ease-cut);
}
.btn--primary { background: var(--brand-500); border-color: var(--brand-500); color: #151006; }
.btn--primary:hover { background: var(--brand-300); border-color: var(--brand-300); color: #151006; }
.btn--ghost { background: transparent; border-color: var(--line-600); color: var(--text-100); }
.btn--ghost:hover { border-color: var(--brand-500); color: var(--brand-300); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-500);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--brand-500); }

.section-index {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 162, 39, .55);
}

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

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

.grid-2 { display: grid; gap: 28px; }
.grid-3 { display: grid; gap: 28px; }
.stack { display: grid; gap: var(--stack-gap, 20px); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-400);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { flex: none; width: 10px; height: 10px; background: var(--chart-teal); }
.legend-swatch--amber { background: var(--chart-amber); }
.legend-swatch--brand { background: var(--brand-500); }
.legend-swatch--accent { background: var(--accent-600); }

.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--base-800);
  border: 1px solid var(--line-600);
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, .12),
    inset 0 -70px 90px -50px rgba(0, 0, 0, .65);
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ---------- 9. 响应式 ---------- */
@media (min-width: 768px) {
  .container { padding-inline: 32px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

@media (max-width: 1023px) {
  .brand-rail {
    width: min(86vw, 330px);
    z-index: 80;
    transform: translateX(-102%);
  }
  .brand-rail[data-open="true"] {
    transform: translateX(0);
    box-shadow: 26px 0 70px rgba(0, 0, 0, .66);
  }
  .rail-close { display: flex; }
  body.nav-open { overflow: hidden; }
  body.nav-open .rail-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(9, 10, 11, .72);
  }
}

@media (max-width: 720px) {
  .bar-chip--ver { display: none; }
}

@media (max-width: 520px) {
  .crumb-root { display: none; }
  .crumb-sep { display: none; }
  .footer-links--cols { grid-template-columns: 1fr; }
}

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

@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }
  .top-bar { left: var(--rail-w); padding: 0 30px; background: rgba(17, 18, 20, .88); }
  .top-bar.is-condensed { padding: 0 30px; }
  .nav-toggle { display: none; }
  .rail-scrim { display: none !important; }
  .container { padding-inline: 44px; }
}

@media (min-width: 1100px) {
  .footer-grid { grid-template-columns: 1.15fr .95fr 1.35fr 1fr; }
  .footer-cell { padding: 40px 30px; border-bottom: 0; border-right: 1px solid var(--line-600); }
  .footer-cell:last-child { border-right: 0; }
}

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