/* ============================================================
   168彩票讯 · 共享样式 /assets/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, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ---------- 2. 设计令牌 ---------- */
:root {
  /* 色彩 */
  --night: #0A1024;
  --ink: #121B36;
  --red: #E23B3B;
  --red-soft: rgba(226, 59, 59, 0.20);
  --cyan: #3DF0D0;
  --gold: #F2C14E;
  --paper: #F3E9D2;
  --paper-deep: #D8C7A4;
  --graphite: #2A3040;
  --mist: #E8ECF4;
  --alert: #FF7A45;

  --mist-90: rgba(232, 236, 244, 0.90);
  --mist-72: rgba(232, 236, 244, 0.72);
  --mist-52: rgba(232, 236, 244, 0.52);
  --mist-34: rgba(232, 236, 244, 0.34);
  --mist-14: rgba(232, 236, 244, 0.14);
  --mist-08: rgba(232, 236, 244, 0.08);
  --ink-16: rgba(18, 27, 54, 0.16);

  /* 字体 */
  --font-display: 'Noto Sans SC', 'Source Han Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-serif: 'Noto Serif SC', 'Songti SC', Georgia, serif;

  /* 尺度 */
  --rail-w: 124px;
  --bar-h: 58px;
  --shell-max: 1180px;

  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow-card: 0 26px 48px -30px rgba(0, 0, 0, 0.86);
  --shadow-float: 0 22px 44px -24px rgba(0, 0, 0, 0.78);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-top: var(--bar-h);
  padding-left: 0;
  color: var(--mist);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(61, 240, 208, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 240, 208, 0.045) 1px, transparent 1px),
    radial-gradient(780px 540px at 10% -12%, rgba(226, 59, 59, 0.20), transparent 64%),
    radial-gradient(860px 660px at 98% 4%, rgba(61, 240, 208, 0.10), transparent 62%);
  background-size: 72px 72px, 72px 72px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed, fixed;
}

h1, h2, h3, h4 {
  font-weight: 300;
  line-height: 1.24;
  letter-spacing: 0.005em;
}

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

main { display: block; }

a { color: var(--cyan); text-decoration: none; }

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

strong, b { font-weight: 700; color: var(--mist); }

::selection {
  background: var(--cyan);
  color: var(--night);
}

/* 焦点 */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 4. 工具类 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.22s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--ink);
}

/* 容器 */
.container {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.container--narrow { max-width: 820px; }
.container--wide { max-width: 1400px; }

/* 网格 */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn--solid { background: var(--red); color: #FFFFFF; }
.btn--solid:hover { background: #F04A4A; color: #FFFFFF; transform: translateY(-2px); }

.btn--line {
  background: transparent;
  color: var(--mist);
  border-color: var(--mist-34);
}
.btn--line:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.btn--paper { background: var(--paper); color: var(--ink); }
.btn--paper:hover { background: #FFFFFF; color: var(--ink); transform: translateY(-2px); }

.btn--ghost {
  background: rgba(61, 240, 208, 0.10);
  color: var(--cyan);
  border-color: rgba(61, 240, 208, 0.36);
}
.btn--ghost:hover { background: rgba(61, 240, 208, 0.18); color: var(--cyan); transform: translateY(-2px); }

/* 面包屑 */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  letter-spacing: 0.09em;
  color: var(--mist-52);
}

.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: '/'; color: var(--mist-34); }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--cyan); }
.breadcrumbs [aria-current="page"] { color: var(--mist-90); }

/* 编号章节标题 */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--mist-14);
}

.section-no {
  flex: none;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.20em;
  color: var(--cyan);
}

.section-title {
  font-size: clamp(23px, 3.2vw, 36px);
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--mist);
}

/* 说明牌卡片 */
.placard {
  position: relative;
  padding: 24px 26px;
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.placard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--red), var(--gold));
  opacity: 0.92;
}

.placard h3,
.placard h4 { color: var(--ink); }
.placard p { color: rgba(18, 27, 54, 0.80); }

/* 图片容器（页面阶段放置占位或 <img>） */
.media {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--mist-08);
  background-image:
    linear-gradient(150deg, rgba(61, 240, 208, 0.14), rgba(10, 16, 36, 0) 58%),
    linear-gradient(330deg, rgba(242, 193, 78, 0.12), rgba(10, 16, 36, 0) 62%),
    linear-gradient(rgba(61, 240, 208, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 240, 208, 0.05) 1px, transparent 1px);
  background-color: var(--ink);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--square { aspect-ratio: 1 / 1; }
.media--wide { aspect-ratio: 21 / 9; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--chart { aspect-ratio: 16 / 10; }

.media figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 18px;
  color: var(--mist);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, rgba(10, 16, 36, 0), rgba(10, 16, 36, 0.90));
}

/* 滚动显现 */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.68s var(--ease), transform 0.68s var(--ease);
}

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

/* ---------- 5. 头部：侧边轨道导航 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: var(--bar-h);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(180deg, #121B36, #0C142B);
  border-bottom: 1px solid var(--mist-14);
}

.rail-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.rail-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 38px;
  border-radius: 11px;
  background: var(--red);
  color: #FFFFFF;
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.05em;
  animation: railPulse 2.8s var(--ease) infinite;
}

.rail-brand__name {
  color: var(--mist);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.10em;
  white-space: nowrap;
}

@keyframes railPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 59, 59, 0.55); }
  55% { box-shadow: 0 0 0 10px rgba(226, 59, 59, 0); }
}

/* 移动导航按钮 */
.rail-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--mist-34);
  border-radius: 12px;
  background: rgba(232, 236, 244, 0.06);
  color: var(--mist);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.rail-toggle:hover { border-color: var(--cyan); background: rgba(61, 240, 208, 0.10); }

.rail-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
}

.site-header[data-open] .rail-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header[data-open] .rail-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open] .rail-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 抽屉 / 导航容器 —— 移动端 */
.rail-drawer {
  position: fixed;
  top: var(--bar-h);
  left: 0;
  right: 0;
  z-index: 79;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--bar-h));
  padding: 14px 16px 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, #121B36, #0B1226);
  border-bottom: 1px solid var(--mist-14);
  box-shadow: var(--shadow-float);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease), visibility 0.26s linear;
}

.site-header[data-open] .rail-drawer {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-nav__link {
  display: block;
  padding: 12px 14px;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--mist-72);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.rail-nav__link:hover {
  color: var(--mist);
  background: rgba(61, 240, 208, 0.08);
}

.rail-nav__link[aria-current="page"] {
  color: var(--night);
  background: var(--cyan);
  font-weight: 700;
  box-shadow: 0 10px 22px -14px rgba(61, 240, 208, 0.95);
}

/* 轨道工具组 */
.rail-tools {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--mist-14);
}

.rail-tools__label {
  margin: 0 0 4px;
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--mist-34);
  text-align: left;
}

.rail-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mist-14);
  border-radius: var(--radius-sm);
  background: rgba(232, 236, 244, 0.04);
  color: var(--mist-72);
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.rail-tool:hover {
  color: var(--mist);
  background: rgba(61, 240, 208, 0.09);
  border-color: rgba(61, 240, 208, 0.32);
}

.rail-tool[aria-expanded="true"] {
  color: var(--night);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}

.rail-tool__label { white-space: nowrap; }

.rail-tool__sign {
  flex: none;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* 工具面板 */
.rail-panel {
  display: none;
  margin-top: 2px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}

.rail-panel[data-open] { display: block; }

.rail-panel__title {
  margin: 0 0 10px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--red);
}

.rail-panel__list { display: grid; gap: 2px; }

.rail-panel__list a {
  display: block;
  padding: 9px 0;
  border-bottom: 1px dashed var(--ink-16);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}

.rail-panel__list li:last-child a { border-bottom: 0; }

.rail-panel__list a:hover {
  color: var(--red);
  padding-left: 4px;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: 80px;
  padding: 58px 0 26px;
  color: var(--mist);
  border-top: 1px solid var(--mist-14);
  background-image:
    radial-gradient(680px 440px at 4% 0%, rgba(226, 59, 59, 0.20), transparent 64%),
    radial-gradient(720px 480px at 96% 16%, rgba(242, 193, 78, 0.10), transparent 62%),
    linear-gradient(180deg, #0D1430, #070B18);
}

.footer-watermark {
  position: absolute;
  right: -14px;
  bottom: -48px;
  font-family: var(--font-num);
  font-size: clamp(120px, 21vw, 240px);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.06em;
  color: rgba(232, 236, 244, 0.045);
  pointer-events: none;
  user-select: none;
}

.footer-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.footer-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.footer-brand {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--mist);
}

.footer-kicker {
  margin: 0;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.footer-statement {
  margin: 0;
  max-width: 320px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--mist-72);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 24px;
}

.footer-col__title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mist-14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.20em;
  color: var(--mist-52);
}

.footer-col__list { display: grid; gap: 9px; }

.footer-col__list a {
  color: var(--mist-72);
  font-size: 14px;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}

.footer-col__list a:hover { color: var(--cyan); padding-left: 4px; }

.footer-contact {
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.footer-contact__title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink-16);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--red);
}

.footer-contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(18, 27, 54, 0.86);
}

.footer-contact__key {
  flex: none;
  min-width: 34px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding-top: 3px;
}

.footer-contact__row .num { font-size: 12.5px; color: var(--ink); }

.footer-contact__note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--ink-16);
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(18, 27, 54, 0.66);
}

.footer-base {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--shell-max);
  margin: 42px auto 0;
  padding: 18px 24px 0;
  border-top: 1px solid var(--mist-08);
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--mist-52);
}

.footer-base p { margin: 0; }

/* ---------- 7. 平板 ---------- */
@media (min-width: 641px) and (max-width: 900px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 8. 桌面：侧边轨道 ---------- */
@media (min-width: 901px) {
  body {
    padding-top: 0;
    padding-left: var(--rail-w);
  }

  .skip-link { left: calc(var(--rail-w) + 14px); top: 14px; }

  .site-header {
    right: auto;
    bottom: 0;
    width: var(--rail-w);
    height: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 18px;
    padding: 20px 12px 18px;
    background-image:
      linear-gradient(180deg, rgba(226, 59, 59, 0.18) 0%, rgba(226, 59, 59, 0) 36%),
      linear-gradient(180deg, #121B36, #0A1024);
    border-bottom: 0;
    border-right: 1px solid var(--mist-14);
  }

  .rail-brand {
    flex-direction: column;
    gap: 9px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--mist-14);
  }

  .rail-brand__mark {
    width: 56px;
    height: 46px;
    border-radius: 13px;
    font-size: 24px;
  }

  .rail-brand__name {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-align: center;
    white-space: normal;
    line-height: 1.4;
  }

  .rail-toggle { display: none; }

  .rail-drawer {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    transition: none;
  }

  .rail-nav { gap: 3px; }

  .rail-nav__link {
    padding: 10px 6px;
    border-left: 3px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-align: center;
    line-height: 1.35;
  }

  .rail-nav__link[aria-current="page"] {
    border-left-color: var(--gold);
    border-radius: 8px;
  }

  .rail-tools { margin-top: auto; }

  .rail-tools__label { text-align: center; }

  .rail-tool {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 9px 4px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .rail-tool__label { font-size: 11px; }

  .rail-tool__sign { font-size: 12px; }

  /* 桌面端面板向轨道右侧浮出 */
  .rail-panel {
    position: absolute;
    left: calc(100% + 16px);
    bottom: 0;
    width: 252px;
    margin: 0;
    z-index: 6;
  }

  .footer-shell {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.44fr) minmax(0, 0.98fr);
    gap: 40px 44px;
  }
}

/* ---------- 9. 大屏 ---------- */
@media (min-width: 1400px) {
  :root { --rail-w: 138px; }
  .rail-nav__link { font-size: 12.5px; }
}

/* ---------- 10. 减少动效 ---------- */
@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;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

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

  .rail-brand__mark { animation: none; }
}
