/* =========================================================
   BET9主页 — /assets/site.css
   共享外壳样式：reset / 变量 / 排版 / 头部 / 页脚 / 基础组件
   ========================================================= */

/* ---------- 1. RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { padding: 0; }

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

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

button { background: none; border: 0; }

a { color: inherit; }

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

/* ---------- 2. 变量 ---------- */
:root {
  /* 品牌色板 */
  --c-void: #060B18;
  --c-deep: #0D1730;
  --c-cyan: #2FE0E0;
  --c-violet: #8B5CF6;
  --c-orange: #FF7A2F;
  --c-paper: #F2F5FF;
  --c-mist: #9AA8C7;
  --c-steel: #22314F;
  --c-mint: #4ADE80;
  --c-ink: #101014;

  /* 渐变 */
  --grad-brand: linear-gradient(100deg, var(--c-cyan) 0%, var(--c-violet) 100%);
  --grad-band: linear-gradient(90deg, rgba(47, 224, 224, 0.14) 0%, rgba(139, 92, 246, 0.14) 100%);

  /* 尺寸与节奏 */
  --shell: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;
  --header-h-compact: 58px;

  /* 字体 */
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system,
               "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono",
               Consolas, "Liberation Mono", Menlo, monospace;

  /* 阴影 */
  --shadow-cyan: 4px 4px 0 0 var(--c-cyan);
  --shadow-violet: 4px 4px 0 0 var(--c-violet);
  --shadow-steel: 4px 4px 0 0 var(--c-steel);
  --shadow-block: 8px 8px 0 0 rgba(139, 92, 246, 0.22);
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--c-paper);
  background-color: var(--c-void);
  background-image:
    radial-gradient(920px 540px at 90% -10%, rgba(47, 224, 224, 0.13), transparent 62%),
    radial-gradient(760px 480px at 4% 2%, rgba(139, 92, 246, 0.16), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--c-paper);
}

h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: clamp(22px, 3.4vw, 28px); }
h3 { font-size: clamp(18px, 2.6vw, 22px); }

p { max-width: 76ch; }

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

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

/* 焦点可见性 */
:focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- 4. 工具类 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-cyan);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background: var(--c-orange);
  flex: none;
}

.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.85;
  color: var(--c-mist);
}

.prose p { margin-bottom: 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--c-cyan); text-underline-offset: 4px; }
.prose a:hover { color: var(--c-orange); }

.band {
  background: var(--grad-band);
  border-top: 2px solid var(--c-steel);
  border-bottom: 2px solid var(--c-steel);
  padding-block: 18px;
}

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

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -120px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--c-orange);
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--c-ink);
  box-shadow: var(--shadow-violet);
  transition: top 0.22s ease;
}

.skip-link:focus {
  top: 10px;
  outline: 3px solid var(--c-cyan);
  outline-offset: 2px;
}

/* ---------- 6. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--c-void);
  border-bottom: 2px solid var(--c-steel);
  transition: border-color 0.25s ease;
}

.site-header.is-compact {
  border-bottom-color: var(--c-cyan);
}

.header-shell {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  transition: min-height 0.25s ease;
}

.site-header.is-compact .header-shell {
  min-height: var(--header-h-compact);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 7px 9px;
  color: var(--c-ink);
  background: var(--grad-brand);
  border: 2px solid var(--c-ink);
  box-shadow: 3px 3px 0 0 var(--c-ink);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-cn {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--c-paper);
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-mist);
  transition: opacity 0.2s ease;
}

.site-header.is-compact .brand-en { opacity: 0; }

/* 主导航 */
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-mist);
  text-decoration: none;
  border: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
              padding 0.25s ease;
}

.site-header.is-compact .nav-link {
  padding: 7px 10px;
  font-size: 14px;
}

.nav-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--c-steel);
  transition: color 0.2s ease;
}

.nav-label-en { display: none; }

.nav-link:hover {
  color: var(--c-paper);
  border-color: var(--c-cyan);
}

.nav-link:hover .nav-idx { color: var(--c-cyan); }

.nav-link[aria-current="page"] {
  color: var(--c-paper);
  background: var(--c-deep);
  border-color: var(--c-orange);
}

.nav-link[aria-current="page"] .nav-idx { color: var(--c-orange); }

html[data-lang-mode="en"] .nav-label-cn { display: none; }
html[data-lang-mode="en"] .nav-label-en { display: inline; }

.nav-note { display: none; }

/* 头部工具栏 */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.lang-switch {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-paper);
  background: transparent;
  border: 2px solid var(--c-steel);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.lang-switch:hover {
  border-color: var(--c-cyan);
  box-shadow: 3px 3px 0 0 rgba(47, 224, 224, 0.35);
}

.lang-code { color: var(--c-cyan); }
.lang-hint { color: var(--c-steel); font-size: 10px; }

.lang-switch[aria-pressed="true"] .lang-code { color: var(--c-orange); }
.lang-switch[aria-pressed="true"] .lang-hint { color: var(--c-mist); }

/* 移动端按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  color: var(--c-paper);
  border: 2px solid var(--c-steel);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

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

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
  flex: none;
}

.nav-toggle-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle-icon span:nth-child(1) { top: 0; }
.nav-toggle-icon span:nth-child(2) { top: 5px; }
.nav-toggle-icon span:nth-child(3) { top: 10px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* 进度轨 */
.header-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.header-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left center;
}

/* 抽屉遮罩 */
.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 24, 0.76);
  z-index: 70;
}

.nav-scrim[hidden] { display: none; }

body.nav-open { overflow: hidden; }

/* ---------- 7. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--c-void);
  background: var(--c-paper);
  border: 2px solid var(--c-ink);
  box-shadow: var(--shadow-cyan);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
              background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--c-cyan);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 0 var(--c-cyan);
}

.btn-hot {
  background: var(--c-orange);
  color: var(--c-ink);
  box-shadow: var(--shadow-violet);
}

.btn-hot:hover { box-shadow: 6px 6px 0 0 var(--c-violet); }
.btn-hot:active { box-shadow: 2px 2px 0 0 var(--c-violet); }

.btn-cyan {
  background: var(--c-cyan);
  color: var(--c-ink);
  box-shadow: var(--shadow-violet);
}

.btn-cyan:hover { box-shadow: 6px 6px 0 0 var(--c-violet); }
.btn-cyan:active { box-shadow: 2px 2px 0 0 var(--c-violet); }

.btn-ghost {
  background: transparent;
  color: var(--c-paper);
  border-color: var(--c-steel);
  box-shadow: var(--shadow-steel);
}

.btn-ghost:hover {
  color: var(--c-cyan);
  border-color: var(--c-cyan);
  box-shadow: 6px 6px 0 0 var(--c-cyan);
}

.btn-ghost:active { box-shadow: 2px 2px 0 0 var(--c-cyan); }

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

.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }

.breadcrumb li + li::before {
  content: "/";
  color: var(--c-steel);
}

.breadcrumb a {
  color: var(--c-mist);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover { color: var(--c-cyan); }

.breadcrumb [aria-current="page"] { color: var(--c-paper); }

/* ---------- 9. 基础组件 ---------- */
.card {
  position: relative;
  display: block;
  background: var(--c-deep);
  border: 2px solid var(--c-steel);
  padding: clamp(20px, 3vw, 28px);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--c-cyan);
  box-shadow: var(--shadow-block);
  transform: translate(-2px, -2px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c-mist);
  background: rgba(34, 49, 79, 0.35);
  border: 1px solid var(--c-steel);
}

.tag--hot { color: var(--c-orange); border-color: rgba(255, 122, 47, 0.45); }
.tag--cyan { color: var(--c-cyan); border-color: rgba(47, 224, 224, 0.45); }
.tag--mint { color: var(--c-mint); border-color: rgba(74, 222, 128, 0.45); }

/* 图片容器基础规则（页面阶段放入 img 或占位） */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--c-deep) 0%, var(--c-void) 70%);
  border: 2px solid var(--c-steel);
  box-shadow: var(--shadow-block);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(47, 224, 224, 0.07) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(139, 92, 246, 0.07) 0 1px, transparent 1px 40px);
}

.media-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--square { aspect-ratio: 1 / 1; }

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

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

/* ---------- 11. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 9vw, 130px);
  background: var(--c-deep);
  border-top: 2px solid var(--c-steel);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--grad-brand);
}

.footer-shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(32px, 4vw, 52px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 40px);
}

.footer-brand {
  grid-column: span 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--c-steel);
}

.footer-motto {
  max-width: 46ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--c-mist);
}

.footer-index { grid-column: span 6; }
.footer-contact { grid-column: span 3; }
.footer-legal { grid-column: span 3; }

.footer-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--c-paper);
  border-bottom: 2px solid var(--c-steel);
}

.footer-heading-en {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-violet);
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
  list-style: none;
}

.code-link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 5px 0;
  font-size: 13.5px;
  color: var(--c-mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.code-link:hover {
  color: var(--c-cyan);
  border-bottom-color: rgba(47, 224, 224, 0.5);
}

.code-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--c-violet);
}

.code-link:hover .code-num { color: var(--c-orange); }

.contact-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 14px;
  font-size: 13.5px;
  line-height: 1.6;
}

.contact-list dt {
  color: rgba(154, 168, 199, 0.62);
  white-space: nowrap;
}

.contact-list dd {
  color: var(--c-paper);
  word-break: break-word;
}

.legal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin-bottom: 20px;
}

.legal-list a {
  font-size: 14px;
  color: var(--c-mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-list a:hover {
  color: var(--c-orange);
  border-bottom-color: var(--c-orange);
}

.footer-icp {
  font-size: 12px;
  color: rgba(154, 168, 199, 0.7);
}

.footer-base {
  background: var(--c-void);
  border-top: 1px solid var(--c-steel);
}

.footer-base-inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 20px var(--gutter) 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--c-mist);
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1023px) {

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    width: min(86vw, 340px);
    margin: 0;
    padding: clamp(88px, 20vw, 116px) 22px 36px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--c-deep);
    border-left: 2px solid var(--c-steel);
    box-shadow: -14px 0 0 0 rgba(139, 92, 246, 0.2);
    overflow-y: auto;
    transform: translateX(105%);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .site-nav[data-open] { transform: translateX(0); }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .nav-item { border-bottom: 1px solid var(--c-steel); }

  .nav-item:first-child { border-top: 1px solid var(--c-steel); }

  .nav-link {
    padding: 15px 4px 15px 14px;
    font-size: 17px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
  }

  .nav-link:hover {
    border-color: transparent;
    border-left-color: var(--c-cyan);
    color: var(--c-paper);
  }

  .nav-link[aria-current="page"] {
    background: transparent;
    border-color: transparent;
    border-left-color: var(--c-orange);
    color: var(--c-orange);
  }

  .nav-link[aria-current="page"] .nav-idx { color: var(--c-orange); }

  .nav-note {
    display: block;
    margin-top: 26px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    line-height: 1.9;
    color: var(--c-steel);
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-tools { margin-left: auto; }

  .lang-switch { display: none; }

  .footer-index { grid-column: span 12; }
  .footer-contact { grid-column: span 6; }
  .footer-legal { grid-column: span 6; }
}

@media (max-width: 640px) {

  :root { --header-h: 66px; }

  .brand-text { display: none; }
  .site-header.is-compact .brand-text { display: none; }

  .header-shell { gap: 10px; }

  .btn { padding: 9px 13px; font-size: 13px; }

  .nav-toggle-text { display: none; }

  .footer-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-contact,
  .footer-legal { grid-column: span 12; }

  .code-grid { grid-template-columns: minmax(0, 1fr); }

  .contact-list { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .contact-list dt { margin-top: 10px; }

  .footer-base-inner { flex-direction: column; gap: 10px; }
}

/* ---------- 13. 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {

  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

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