/* ============================================================
   乐投·CN 共享样式表  /assets/site.css
   结构：reset → 变量 → 中文排版 → 通用容器 → 组件 → 页头 → 页脚 → 响应式
   ============================================================ */

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

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

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

ul, ol { list-style: none; }

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

a { color: inherit; text-decoration: none; }

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

table { border-collapse: collapse; width: 100%; }

/* ---------- 变量 ---------- */
:root {
  --orange: #FF5A2B;
  --orange-mid: #FF8A3D;
  --coral: #E23E3E;
  --ink: #0E1B33;
  --ink-2: #1B2C4F;
  --mint: #6FE3C4;
  --gold: #F2B705;
  --paper: #F4F6FB;
  --line: #E3E8F2;
  --text: #46536B;
  --white: #FFFFFF;

  --grad-warm: linear-gradient(120deg, #FF8A3D 0%, #FF5A2B 48%, #E23E3E 100%);

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

  --topbar-h: 72px;
  --rail-w: 264px;
  --rail-w-collapsed: 88px;
  --radius: 14px;
  --shadow-hard: 6px 6px 0 var(--ink);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 中文排版基线 ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  color: var(--text);
  background: var(--paper);
  padding-top: var(--topbar-h);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.2;
}

h1 { font-size: clamp(3.2rem, 9vw, 7.5rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 3rem); }
h3 { font-size: 1.25rem; font-weight: 800; }
h4 { font-size: 1.05rem; font-weight: 800; }

p { max-width: 68ch; }

strong, b { font-weight: 800; color: var(--ink); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* 章节数字 / 版本号 / 数据带 */
.num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
}

/* 竖排小注释 */
.side-note {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ---------- 焦点与无障碍 ---------- */
:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  border: 2px solid var(--ink);
  transform: translateY(-200%);
  transition: transform 160ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }

#main-content { scroll-margin-top: calc(var(--topbar-h) + 16px); }

/* ---------- 通用容器 ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 44px);
}
.container--wide { max-width: 1360px; }
.container--narrow { max-width: 820px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease),
              background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

.btn--primary { background: var(--grad-warm); color: #fff; }
.btn--outline { background: #fff; color: var(--ink); }
.btn--mint { background: var(--mint); color: var(--ink); }
.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}
.btn--ghost:hover {
  color: var(--mint);
  border-color: var(--mint);
  background: rgba(111, 227, 196, 0.12);
  transform: none;
  box-shadow: none;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.breadcrumb__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb__item + .breadcrumb__item::before { content: "/"; color: #9AA6BD; }
.breadcrumb a { border-bottom: 2px solid transparent; }
.breadcrumb a:hover { color: var(--orange); border-bottom-color: var(--orange); }

/* ---------- 章节结构 ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section--tight { padding-block: clamp(36px, 5vw, 60px); }
.section--white { background: var(--white); }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink-2); color: rgba(255, 255, 255, 0.84); }
.section--ink h2,
.section--ink h3,
.section--ink h1 { color: #fff; }
.section--ink strong { color: var(--mint); }

.section__rule {
  display: block;
  height: 6px;
  width: 100%;
  border-radius: 3px;
  background: var(--grad-warm);
  transform-origin: left center;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.section__head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section__no {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #fff;
  background: var(--grad-warm);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 3px 11px;
  box-shadow: 2px 2px 0 var(--ink);
}
.section--ink .section__no { border-color: rgba(255, 255, 255, 0.5); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4); }

.section__title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--ink);
  max-width: 24ch;
}
.section--ink .section__title { color: #fff; }

.section__lede {
  font-size: 17px;
  line-height: 1.75;
  max-width: 60ch;
  color: var(--text);
}
.section--ink .section__lede { color: rgba(255, 255, 255, 0.78); }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: clamp(16px, 2.4vw, 26px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- 卡片 ---------- */
.card {
  display: block;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: clamp(20px, 2.4vw, 28px);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.card:hover {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--ink);
}
.card__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.card__text { font-size: 15.5px; line-height: 1.75; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 7px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}
.tag--gold { background: var(--gold); }
.tag--mint { background: var(--mint); }
.tag--coral { background: var(--coral); color: #fff; }

/* ---------- 图片容器（页面阶段放入占位） ---------- */
.media {
  display: block;
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-hard);
}
.media__frame {
  display: block;
  width: 100%;
  background:
    radial-gradient(circle at 22% 26%, rgba(255, 90, 43, 0.16), transparent 44%),
    radial-gradient(circle at 78% 74%, rgba(111, 227, 196, 0.20), transparent 48%),
    linear-gradient(150deg, #FFFFFF 0%, var(--paper) 100%);
}
.media__frame img { width: 100%; height: 100%; object-fit: cover; }
.media--16x9 .media__frame { aspect-ratio: 16 / 9; }
.media--4x3 .media__frame { aspect-ratio: 4 / 3; }
.media--1x1 .media__frame { aspect-ratio: 1 / 1; }
.media--wide .media__frame { aspect-ratio: 21 / 9; }
.media__caption {
  display: block;
  padding: 12px 18px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
  background: #fff;
  border-top: 2px solid var(--ink);
}

/* ---------- 显现动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 440ms var(--ease), transform 440ms var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.section__rule { transform: scaleX(0); transition: transform 320ms var(--ease); }
.section__rule.is-visible,
[data-reveal].is-visible .section__rule { transform: scaleX(1); }

/* ============================================================
   页头
   ============================================================ */
.site-header { position: relative; z-index: 70; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: var(--ink);
  color: #fff;
  border-bottom: 2px solid #06101F;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  min-width: 0;
}
.brand__mark {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--grad-warm);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 9px;
}
.brand__mark span { width: 4px; border-radius: 2px; background: #fff; }
.brand__mark span:nth-child(1) { height: 8px; }
.brand__mark span:nth-child(2) { height: 15px; }
.brand__mark span:nth-child(3) { height: 11px; }

.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
}
.brand__desc {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar .btn { padding: 9px 18px; font-size: 13px; }
.topbar .btn--primary { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }
.topbar .btn--primary:hover { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}
.nav-toggle:hover { border-color: var(--mint); color: var(--mint); }
.nav-toggle__bars { display: flex; flex-direction: column; gap: 3px; }
.nav-toggle__bars i {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 72;
  background: rgba(14, 27, 51, 0.10);
  pointer-events: none;
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad-warm);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------- 桌面端左侧轨道导航 ---------- */
.site-rail {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 20px 24px;
  background: var(--ink-2);
  color: #fff;
  border-right: 2px solid #0A1428;
  overflow-y: auto;
  transition: width 200ms var(--ease), padding 200ms var(--ease);
}
.site-rail__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  padding: 0 12px 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
  margin-bottom: 12px;
}

.rail-list { display: flex; flex-direction: column; gap: 4px; }
.rail-list__item { display: block; }

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 2px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  font-size: 15px;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.rail-link__no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}
.rail-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(111, 227, 196, 0.4);
}
.rail-link:hover .rail-link__no { color: var(--mint); }
.rail-link[aria-current="page"] {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--ink);
}
.rail-link[aria-current="page"] .rail-link__no { color: var(--ink); opacity: 0.65; }

.rail-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  display: grid;
  gap: 10px;
}
.rail-switch {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  transition: border-color 140ms ease, color 140ms ease;
}
.rail-switch:hover { border-color: var(--mint); color: var(--mint); }
.rail-note {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.42);
  max-width: none;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 120px);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
}
.site-footer::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--grad-warm);
}

.footer-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(26px, 4vw, 40px) clamp(20px, 4vw, 48px);
  background: var(--ink-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-band__lead { display: grid; gap: 10px; }
.footer-band__kicker {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint);
  border: 2px solid rgba(111, 227, 196, 0.42);
  border-radius: 999px;
  padding: 3px 11px;
}
.footer-band__line {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  line-height: 1.4;
  color: #fff;
  max-width: 34ch;
}
.footer-band__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.footer-main {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(0, 2fr);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(36px, 5vw, 56px) clamp(20px, 4vw, 48px) clamp(28px, 4vw, 44px);
}

.footer-brand__name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: #fff;
}
.footer-brand__desc {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}
.footer-contact {
  margin-top: 20px;
  display: grid;
  gap: 7px;
  font-size: 14.5px;
  line-height: 1.7;
}
.footer-contact__note {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.45);
  max-width: 34ch;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.footer-col__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(111, 227, 196, 0.35);
  max-width: none;
}
.footer-col__list { display: grid; gap: 2px; }
.footer-col__link {
  display: inline-block;
  padding: 5px 0;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.72);
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.footer-col__link:hover {
  color: var(--mint);
  border-bottom-color: var(--mint);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 20px clamp(20px, 4vw, 48px) 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.footer-legal__icp { font-family: var(--font-mono); letter-spacing: 0.06em; max-width: none; }
.footer-legal__signoff { max-width: 52ch; }

/* ============================================================
   响应式
   ============================================================ */
@media (min-width: 1080px) {
  body { padding-left: var(--rail-w); }
  body.rail-collapsed { padding-left: var(--rail-w-collapsed); }
  body.rail-collapsed .site-rail {
    width: var(--rail-w-collapsed);
    padding-inline: 14px;
  }
  body.rail-collapsed .site-rail__eyebrow,
  body.rail-collapsed .rail-link__label,
  body.rail-collapsed .rail-note { display: none; }
  body.rail-collapsed .rail-link { justify-content: center; padding-inline: 6px; }
  body.rail-collapsed .rail-foot { justify-items: center; }
  body.rail-collapsed .rail-switch { padding-inline: 6px; font-size: 11.5px; }
}

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

  .site-rail {
    position: fixed;
    top: auto;
    left: auto;
    right: 14px;
    bottom: 14px;
    width: min(320px, calc(100vw - 28px));
    max-height: min(74vh, 560px);
    border: 2px solid var(--ink);
    border-right: 2px solid var(--ink);
    border-radius: 18px;
    padding: 18px 14px 16px;
    box-shadow: 8px 8px 0 rgba(14, 27, 51, 0.35);
    z-index: 75;
    transform: translateY(calc(100% + 32px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 240ms var(--ease), opacity 200ms ease,
                visibility 0s linear 240ms;
  }
  .site-rail[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 240ms var(--ease), opacity 200ms ease,
                visibility 0s linear 0s;
  }
  .site-rail__eyebrow { padding-inline: 8px; }
  .rail-link { padding: 10px 10px; font-size: 15px; }
  .rail-switch { display: none; }
  .rail-note { padding-top: 4px; }
}

@media (max-width: 960px) {
  .topbar .btn--tool,
  .topbar .btn--reach { display: none; }
}

@media (max-width: 820px) {
  .footer-main { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
  .footer-band { align-items: flex-start; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 64px; }
  body { font-size: 16.5px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__name { font-size: 17px; }
  .brand__desc { display: none; }
  .topbar .btn--primary { padding: 8px 14px; font-size: 12.5px; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-band__cta .btn { width: 100%; }
  .footer-legal { font-size: 12.5px; }
}

@media (max-width: 400px) {
  .nav-toggle__label { display: none; }
}

/* ---------- 动效偏好 ---------- */
@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .section__rule { transform: scaleX(1); }
}
