/* ============================================================
   168彩票服 · 共享外壳样式
   路径：/assets/site.css
   ============================================================ */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg, video, picture { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; margin: 0; }

/* ---------- tokens ---------- */
:root {
  --ink: #0A1626;
  --ink-2: #0E1D31;
  --panel: #122943;
  --panel-2: #173252;
  --rule: #24456B;
  --gold: #C9A227;
  --gold-lite: #E7C85C;
  --cinnabar: #C0272D;
  --jade: #2E8B72;
  --paper: #EFE9DA;
  --muted: #93A5B8;
  --sand: #F4EFE3;

  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", "Courier New", monospace;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimHei, serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
  --cut: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-h: 64px;
}

/* ---------- base type ---------- */
body {
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(18, 41, 67, 0.55), transparent 420px),
    repeating-linear-gradient(90deg, rgba(36, 69, 107, 0.16) 0 1px, transparent 1px 96px);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#main-content { display: block; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.28;
}
h1 { font-size: clamp(30px, 4.6vw, 48px); }
h2 { font-size: clamp(24px, 3.2vw, 36px); }
h3 { font-size: clamp(19px, 2.1vw, 22px); font-family: var(--font-sans); }
p { max-width: 40em; }
strong { color: var(--gold-lite); font-weight: 600; }
em { font-style: normal; color: var(--gold-lite); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-lite);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 200;
  transform: translateY(-140%);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  transition: transform 0.18s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

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

.prose { max-width: 34em; }
.prose > * + * { margin-top: 0.9em; }
.lead {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.7;
  color: var(--paper);
  max-width: 36em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
  flex: 0 0 auto;
}

.section-title { margin-top: 10px; }

/* ---------- decorative ---------- */
.slash-rule {
  display: block;
  height: 3px;
  border: 0;
  background: repeating-linear-gradient(
    102deg,
    var(--rule) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.9;
}
.slash-rule--gold {
  background: repeating-linear-gradient(
    102deg,
    var(--gold) 0 10px,
    transparent 10px 18px
  );
}

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: clamp(16px, 2.4vw, 28px);
}
.panel-cut {
  position: relative;
  background: var(--panel);
  padding: clamp(16px, 2.4vw, 28px);
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
}
.panel-cut--sand {
  background: var(--sand);
  color: var(--ink);
}
.panel-cut--sand .eyebrow { color: #8a6d0d; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
              color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--gold {
  background: var(--gold);
  color: var(--ink);
}
.btn--gold:hover { background: var(--gold-lite); }
.btn--ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--rule);
}
.btn--ghost:hover {
  color: var(--gold-lite);
  border-color: var(--gold-lite);
}
.btn--sand {
  background: var(--sand);
  color: var(--ink);
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: clamp(18px, 3vw, 32px);
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before {
  content: "/";
  color: var(--rule);
  margin-right: 10px;
}
.breadcrumb a {
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.breadcrumb a:hover {
  color: var(--gold-lite);
  border-bottom-color: var(--gold);
}
.breadcrumb [aria-current="page"] { color: var(--gold); }

/* ---------- number balls ---------- */
.ball {
  --ball-size: 48px;
  width: var(--ball-size);
  height: var(--ball-size);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: calc(var(--ball-size) * 0.42);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: radial-gradient(circle at 32% 26%, #F2DC8E, var(--gold) 62%, #7C6314);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.ball:hover { transform: translateY(-2px); }
.ball--red {
  color: var(--paper);
  background: radial-gradient(circle at 32% 26%, #E26065, var(--cinnabar) 60%, #78141A);
}
.ball--jade {
  color: var(--paper);
  background: radial-gradient(circle at 32% 26%, #5CC2A3, var(--jade) 60%, #14503F);
}
.ball--ghost {
  color: var(--muted);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- media frames ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--rule);
  clip-path: polygon(
    12px 0,
    100% 0,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    0 100%,
    0 12px
  );
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.28), transparent 42%),
    repeating-linear-gradient(102deg, rgba(36, 69, 107, 0.5) 0 1px, transparent 1px 30px);
  opacity: 0.55;
  mix-blend-mode: screen;
}
.media-frame > img,
.media-frame > picture,
.media-frame > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-16x9 { aspect-ratio: 16 / 9; }
.media-4x3 { aspect-ratio: 4 / 3; }
.media-1x1 { aspect-ratio: 1 / 1; }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.24s var(--ease), border-color 0.24s var(--ease),
              backdrop-filter 0.24s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(10, 22, 38, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--gold);
}

.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.brand-mark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--paper);
  white-space: nowrap;
}
.brand-subline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}
.brand-link:hover .brand-mark { color: var(--gold-lite); }

.site-nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-list a {
  display: block;
  padding: 9px 13px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-list a:hover {
  color: var(--paper);
  border-bottom-color: var(--gold-lite);
}
.nav-list a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--cinnabar);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: clamp(10px, 2vw, 26px);
  flex: 0 0 auto;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid var(--gold);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
              transform 0.18s var(--ease);
}
.quick-link:hover {
  background: var(--gold);
  color: var(--ink);
  transform: translateY(-2px);
}

.nav-toggle {
  display: none;
  align-items: center;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--paper);
  border: 1px solid var(--rule);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  color: var(--gold-lite);
  border-color: var(--gold-lite);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold-lite));
  pointer-events: none;
}

/* header · mobile */
@media (max-width: 900px) {
  :root { --header-h: 58px; }
  .brand-subline { display: none; }
  .header-actions { margin-left: auto; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    margin-left: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 10px var(--gutter) 22px;
    background: var(--ink-2);
    border-bottom: 2px solid var(--gold);
    border-top: 1px solid var(--rule);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
                visibility 0.24s var(--ease);
  }
  .site-nav[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-list li + li { border-top: 1px solid var(--rule); }
  .nav-list a {
    padding: 15px 4px;
    font-size: 16px;
    border-bottom: 0;
    border-left: 2px solid transparent;
    padding-left: 12px;
  }
  .nav-list a:hover { border-left-color: var(--gold-lite); }
  .nav-list a[aria-current="page"] {
    border-left-color: var(--cinnabar);
    border-bottom-color: transparent;
    background: rgba(192, 39, 45, 0.08);
  }
}

@media (max-width: 420px) {
  .quick-link { padding: 7px 11px; letter-spacing: 0.08em; }
  .brand-mark { font-size: 18px; }
}

/* ============================================================
   footer
   ============================================================ */
.site-footer {
  margin-top: clamp(56px, 8vw, 96px);
  background: var(--ink-2);
  border-top: 2px solid var(--gold);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3.4vw, 44px);
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(28px, 4vw, 44px);
}

.footer-block { min-width: 0; }

.footer-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--paper);
  letter-spacing: 0.02em;
}
.footer-sub {
  margin-top: 12px;
  max-width: 32em;
  color: var(--muted);
}
.footer-stamp {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--rule);
  filter: brightness(1.5);
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 14px;
}
.footer-links li + li { margin-top: 8px; }
.footer-links a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-links a:hover {
  color: var(--gold-lite);
  border-bottom-color: var(--gold);
}

.footer-base {
  padding-top: 20px;
  padding-bottom: clamp(26px, 4vw, 42px);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: baseline;
  justify-content: space-between;
}
.footer-note { max-width: 44em; color: var(--muted); }
.footer-contact {
  max-width: 40em;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.footer-legal {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--rule);
  filter: brightness(1.6);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-block--brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

/* ---------- motion preferences ---------- */
@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;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover,
  .quick-link:hover,
  .ball:hover { transform: none; }
}
