/* ============================================================
   大发彩票站 · 共享样式表 /assets/site.css
   纸张叠层 + 冷光数据屏：reset / 变量 / 中文排版 / 头部 / 页脚 /
   通用组件 / 图片容器 / 响应式 / 动效降级
   ============================================================ */

/* ---------- 0. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { padding: 0; }

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

button { font: inherit; color: inherit; }

main { display: block; }

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--red); }

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

/* ---------- 1. 变量 ---------- */
:root {
  --ink-900: #14161A;
  --ink-800: #1C2027;
  --paper: #F6F1E7;
  --card: #FDFBF6;
  --red: #C8102E;
  --red-deep: #8E0B20;
  --blue: #1E5AA8;
  --blue-light: #4A82C9;
  --gold: #F2B705;
  --silver: #C9CFD6;
  --rule: #E2D9C8;
  --text: #2B2F36;
  --muted: #6F7681;

  --rail-w: 260px;
  --bar-h: 64px;

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

  --radius: 3px;
  --shadow-paper: 6px 6px 0 rgba(43, 47, 54, .07);
  --hairline: 1px solid rgba(201, 207, 214, .22);
}

/* ---------- 2. 基础排版（中文优先） ---------- */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(43, 47, 54, .075) 1px, transparent 1px);
  background-size: 22px 22px;
  padding-left: var(--rail-w);
  overflow-wrap: break-word;
  text-wrap: pretty;
}

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

h1 { font-size: clamp(34px, 5.2vw, 64px); }
h2 { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: clamp(20px, 2.2vw, 28px); }
h4 { font-size: 20px; }

p { max-width: 72ch; }

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.8;
  color: #3C424B;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stack > * + * { margin-top: 16px; }

/* ---------- 3. 工具类 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  background: var(--gold);
  color: var(--ink-900);
  font-weight: 800;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  outline: 3px solid var(--ink-900);
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 40px);
}

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease,
    background-color .16s ease, color .16s ease, border-color .16s ease;
}

.btn--gold {
  background: var(--gold);
  color: var(--ink-900);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
}

.btn--gold:hover {
  background: #FFC827;
  color: var(--ink-900);
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 rgba(0, 0, 0, .35);
}

.btn--outline {
  background: transparent;
  border-color: var(--rule);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--red);
  color: var(--red-deep);
  transform: translateY(-2px);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* ---------- 5. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.tag--red { color: var(--red-deep); border-color: var(--red); background: rgba(200, 16, 46, .07); }
.tag--blue { color: var(--blue); border-color: var(--blue); background: rgba(30, 90, 168, .07); }
.tag--gold { color: #7A5C00; border-color: var(--gold); background: rgba(242, 183, 5, .16); }

/* ---------- 6. 头部：侧边轨道 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 24px;
  overflow-y: auto;
  color: var(--paper);
  background-color: var(--ink-900);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, .028) 0 1px,
    transparent 1px 9px
  );
  border-right: var(--hairline);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}

.brand:hover { color: var(--paper); }

.brand__mark {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  background: radial-gradient(circle at 32% 26%, #E8324C, var(--red) 54%, var(--red-deep));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28), 0 6px 16px rgba(0, 0, 0, .5);
}

.brand__text { display: block; min-width: 0; }

.brand__name {
  display: block;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #fff;
}

.brand__tagline {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.5;
  color: var(--silver);
}

/* 移动端按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--paper);
  background: var(--ink-800);
  border: 1px solid rgba(201, 207, 214, .35);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--gold); color: var(--gold); }

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform .18s ease, opacity .18s ease;
}

/* 导航 */
.site-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  margin-top: 28px;
}

.site-nav__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--gold);
}

.site-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--silver);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 2px;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

.site-nav__num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(201, 207, 214, .55);
}

.site-nav__text { min-width: 0; }

.site-nav__link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

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

.site-nav__link[aria-current="page"] {
  color: #fff;
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(242, 183, 5, .18), rgba(242, 183, 5, 0));
}

.site-nav__link[aria-current="page"] .site-nav__num { color: var(--gold); }

/* 轨道卡片 */
.rail-card {
  margin-top: auto;
  padding: 16px;
  background: var(--ink-800);
  border: 1px solid rgba(201, 207, 214, .24);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.rail-card__label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--gold);
}

.rail-card__note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--silver);
  max-width: none;
}

.site-nav__meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: rgba(201, 207, 214, .65);
}

/* ---------- 7. 页脚 ---------- */
.site-footer {
  margin-top: clamp(56px, 8vw, 96px);
  padding: clamp(40px, 5vw, 64px) 0 26px;
  color: var(--silver);
  background-color: var(--ink-900);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, .025) 0 1px,
    transparent 1px 10px
  );
  border-top: 3px solid var(--gold);
}

.site-footer__grid {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
}

.site-footer__brand { max-width: 320px; }

.brand--footer { color: var(--paper); }

.brand--footer .brand__mark { width: 38px; height: 38px; font-size: 17px; }

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

.site-footer__closing {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.8;
  color: #E8E2D6;
  max-width: 26ch;
}

.site-footer__title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gold);
}

.site-footer__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__link {
  font-size: 14px;
  color: var(--silver);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}

.site-footer__link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-style: normal;
}

.site-footer__line {
  font-size: 14px;
  line-height: 1.7;
  color: var(--silver);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: 18px;
  border-top: 1px solid rgba(201, 207, 214, .2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
}

.site-footer__base p { max-width: none; }

.site-footer__note {
  color: rgba(201, 207, 214, .75);
  text-align: right;
}

/* ---------- 8. 面包屑 ---------- */
.breadcrumb { padding-top: clamp(24px, 4vw, 40px); }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
}

.breadcrumb__link { color: var(--muted); text-decoration: none; }

.breadcrumb__link:hover { color: var(--red); }

.breadcrumb__sep { color: var(--rule); }

.breadcrumb__current { color: var(--ink-900); font-weight: 700; }

/* ---------- 9. 章节 ---------- */
.section { padding: clamp(48px, 7vw, 96px) 0; }

.section--divider { border-top: 1px solid var(--rule); }

.section__head {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 24px);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.section__num {
  flex: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 64px);
  line-height: .92;
  letter-spacing: -0.04em;
  color: var(--gold);
  text-shadow: 2px 2px 0 rgba(43, 47, 54, .12);
}

.section__title { margin-bottom: 6px; }

.section__desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 62ch;
}

/* ---------- 10. 面板 ---------- */
.panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-paper);
}

.panel--stack::before {
  content: "";
  position: absolute;
  inset: 8px -8px -8px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: -1;
}

.panel--dark {
  background: var(--ink-800);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, .03) 0 1px,
    transparent 1px 9px
  );
  border-color: rgba(201, 207, 214, .22);
  color: var(--paper);
  box-shadow: 6px 6px 0 rgba(20, 22, 26, .25);
}

.panel--dark h2,
.panel--dark h3,
.panel--dark h4 { color: #fff; }

.panel__label {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--red-deep);
}

.panel--dark .panel__label { color: var(--gold); }

/* ---------- 11. 栅格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }

/* ---------- 12. 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-paper);
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table caption {
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--paper);
  background: var(--ink-800);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:nth-child(even) { background: rgba(226, 217, 200, .34); }

.data-table tbody tr:hover { background: rgba(242, 183, 5, .16); }

/* ---------- 13. 奖号球 ---------- */
.ball {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: 0 4px 10px rgba(20, 22, 26, .28);
  transition: transform .16s ease, box-shadow .16s ease;
}

.ball:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(20, 22, 26, .34);
}

.ball--red { background: radial-gradient(circle at 32% 26%, #E8324C, var(--red) 55%, var(--red-deep)); }
.ball--blue { background: radial-gradient(circle at 32% 26%, #4A8AD8, var(--blue) 55%, #123C74); }
.ball--gold { background: radial-gradient(circle at 32% 26%, #FFD75E, var(--gold) 55%, #B98A00); color: var(--ink-900); }

/* ---------- 14. 图片容器 ---------- */
.figure {
  margin: 0;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.figure__frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--ink-800);
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 10px),
    radial-gradient(circle at 70% 20%, rgba(242, 183, 5, .18), transparent 60%);
  border: 1px solid rgba(201, 207, 214, .24);
  border-radius: 2px;
}

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

.figure__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
}

/* ---------- 15. 章节目录 ---------- */
.toc { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; }

.toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid var(--rule);
}

.toc__link {
  display: block;
  margin-left: -2px;
  padding: 5px 10px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.toc__link:hover { color: var(--red); }

.toc__link[aria-current="true"] {
  color: var(--ink-900);
  font-weight: 700;
  border-left-color: var(--gold);
}

/* ---------- 16. 滚动进度与返回顶部 ---------- */
.scroll-meter {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  width: var(--scroll-progress, 0%);
  height: 3px;
  z-index: 80;
  pointer-events: none;
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--paper);
  background: var(--ink-800);
  border: 1px solid rgba(201, 207, 214, .3);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s, border-color .16s ease;
}

.back-to-top:hover { border-color: var(--gold); color: var(--gold); }

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- 17. 显现动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s ease, transform .32s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 18. 平板：轨道收为数字条 ---------- */
@media (min-width: 700px) and (max-width: 1023px) {
  :root { --rail-w: 76px; }

  .site-header { padding: 22px 12px; }

  .brand { justify-content: center; }
  .brand__text { display: none; }

  .site-nav__label,
  .site-nav__text,
  .rail-card,
  .site-nav__meta { display: none; }

  .site-nav { margin-top: 22px; gap: 10px; }

  .site-nav__link {
    justify-content: center;
    padding: 10px 0;
    border-left: 0;
    border-top: 2px solid transparent;
  }

  .site-nav__link[aria-current="page"] {
    background: linear-gradient(180deg, rgba(242, 183, 5, .18), rgba(242, 183, 5, 0));
    border-top-color: var(--gold);
    border-left-color: transparent;
  }

  .site-nav__num { font-size: 13px; }
}

/* ---------- 19. 手机：顶部条 + 抽屉 ---------- */
@media (max-width: 699px) {
  :root { --rail-w: 0px; }

  body { padding-left: 0; padding-top: var(--bar-h); }

  .site-header {
    top: 0; left: 0; right: 0; bottom: auto;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: var(--hairline);
  }

  .site-header__bar {
    width: 100%;
    height: var(--bar-h);
    padding: 0 16px;
  }

  .brand__tagline { display: none; }
  .brand__name { font-size: 17px; }

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

  .site-nav {
    position: fixed;
    top: var(--bar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    margin: 0;
    padding: 22px 20px 32px;
    gap: 16px;
    overflow-y: auto;
    background-color: var(--ink-900);
    background-image: repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, .028) 0 1px,
      transparent 1px 9px
    );
    border-top: var(--hairline);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }

  .site-header[data-open] .site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .site-nav__link { padding: 12px; font-size: 16px; }

  .rail-card { margin-top: 8px; }

  .site-nav__meta { padding-top: 4px; }

  .site-header[data-open] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .site-header[data-open] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
  .site-header[data-open] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .scroll-meter { left: 0; top: calc(var(--bar-h) - 3px); }

  .site-footer__note { text-align: left; }
}

/* ---------- 20. 栅格断点 ---------- */
@media (max-width: 960px) {
  .grid--2,
  .grid--3,
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 21. 动效与降级 ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .ball:hover,
  .btn:hover { transform: none; }
}
