/* ============================================================
   /assets/site.css — 赢宝CN 共享外壳样式
   1 reset · 2 tokens · 3 排版 · 4 布局 · 5 组件 · 6 页头 · 7 页脚 · 8 响应式
   ============================================================ */

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

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

body, h1, h2, h3, h4, p, ul, ol, li, figure, figcaption, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
img, svg, picture, video { display: block; max-width: 100%; }

::selection { background: var(--c-heat); color: var(--c-deep); }

:focus-visible {
  outline: 3px solid var(--c-cyan);
  outline-offset: 3px;
}

/* ---------- 2. TOKENS ---------- */
:root {
  --c-deep: #0B1F3A;
  --c-midnight: #071426;
  --c-navy: #12335C;
  --c-navy-raise: #17406F;
  --c-mist: #F4F7FA;
  --c-graphite: #1B2A3A;
  --c-heat: #FF6A2A;
  --c-amber: #FFB27A;
  --c-celadon: #3FBFA0;
  --c-cyan: #2ED3E0;
  --c-violet: #6C5CE7;
  --c-line: #C9D3DF;
  --c-line-soft: rgba(201, 211, 223, 0.16);
  --c-line-strong: rgba(201, 211, 223, 0.32);

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

  --shell: 1280px;
  --gutter: clamp(18px, 4vw, 40px);
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --dur: 200ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 78px;
}

/* ---------- 3. 排版 ---------- */
body {
  background: var(--c-deep);
  color: var(--c-mist);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--c-mist);
}

h1 { font-size: clamp(2.4rem, 5vw, 5.8rem); line-height: 1.04; }
h2 { font-size: clamp(1.7rem, 3vw, 3rem); }
h3 { font-size: clamp(1.12rem, 1.4vw, 1.5rem); font-weight: 800; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { max-width: 74ch; }

[data-mono] {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

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

/* ---------- 4. 布局 ---------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}
.container--narrow { --shell: 880px; }
.container--wide { --shell: 1440px; }

.section { padding-block: clamp(56px, 8vw, 112px); }
.section--tight { padding-block: clamp(36px, 4.5vw, 64px); }
.section--deep { background: var(--c-deep); }
.section--midnight { background: var(--c-midnight); }
.section--navy { background: var(--c-navy); }
.section--mist { background: var(--c-mist); color: var(--c-graphite); }
.section--mist h2,
.section--mist h3,
.section--mist h4 { color: var(--c-graphite); }

.grid { display: grid; gap: clamp(16px, 2.2vw, 30px); }
.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)); }

.stack > * + * { margin-top: var(--stack-gap, 18px); }

/* ---------- 5. 组件 ---------- */
/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn--primary {
  background: var(--c-heat);
  color: var(--c-deep);
  box-shadow: 0 10px 24px -14px rgba(255, 106, 42, 0.9);
}
.btn--primary:hover {
  background: var(--c-amber);
  transform: translateY(-1px);
}
.btn--ghost {
  border-color: var(--c-line-strong);
  background: rgba(18, 51, 92, 0.4);
  color: var(--c-mist);
}
.btn--ghost:hover {
  border-color: var(--c-cyan);
  color: var(--c-mist);
}
.btn--quiet {
  padding-inline: 4px;
  color: var(--c-cyan);
  font-weight: 600;
}
.btn--quiet:hover { color: var(--c-amber); }
.btn--block { width: 100%; }

/* 面板与卡片 */
.panel {
  position: relative;
  background: var(--c-navy);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 40px);
}
.panel--cut { border-radius: var(--radius-lg) var(--radius-sm) var(--radius-lg) var(--radius-sm); }
.panel--light {
  background: var(--c-mist);
  color: var(--c-graphite);
  border-color: rgba(27, 42, 58, 0.12);
}
.panel--light h2,
.panel--light h3,
.panel--light h4 { color: var(--c-graphite); }

.card {
  background: rgba(18, 51, 92, 0.55);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius-md);
  padding: clamp(18px, 2.2vw, 28px);
  transition: border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.card:hover {
  border-color: rgba(46, 211, 224, 0.5);
  transform: translateY(-2px);
}

/* 章节编号 */
.section-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-heat);
}
.section-index::after {
  content: "";
  width: clamp(28px, 6vw, 72px);
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c-cyan);
}
.tag--version {
  color: var(--c-violet);
  border-color: rgba(108, 92, 231, 0.55);
  background: rgba(108, 92, 231, 0.12);
}
.tag--success {
  color: var(--c-celadon);
  border-color: rgba(63, 191, 160, 0.5);
  background: rgba(63, 191, 160, 0.1);
}
.tag--action {
  color: var(--c-heat);
  border-color: rgba(255, 106, 42, 0.45);
  background: rgba(255, 106, 42, 0.1);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(244, 247, 250, 0.6);
}
.breadcrumb a { color: inherit; transition: color var(--dur) var(--ease); }
.breadcrumb a:hover { color: var(--c-cyan); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before {
  content: "/";
  color: rgba(201, 211, 223, 0.42);
}
.breadcrumb--on-light { color: rgba(27, 42, 58, 0.7); }
.breadcrumb--on-light a:hover { color: var(--c-navy); }

/* 图片容器 */
.media-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-sm) var(--radius-lg) var(--radius-sm);
  border: 1px solid var(--c-line-soft);
  background: linear-gradient(160deg, var(--c-navy-raise) 0%, var(--c-deep) 62%, var(--c-midnight) 100%);
}
.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(46, 211, 224, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 211, 224, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
}
.media-frame img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(244, 247, 250, 0.78);
  background: linear-gradient(transparent, rgba(7, 20, 38, 0.88));
}
.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--16x10 { aspect-ratio: 16 / 10; }
.media-frame--4x3 { aspect-ratio: 4 / 3; }
.media-frame--1x1 { aspect-ratio: 1 / 1; }
.media-frame--4x5 { aspect-ratio: 4 / 5; }

/* 显现（JS 开启后才有初始隐藏态） */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 6. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(7, 20, 38, 0.92);
  border-bottom: 1px solid rgba(46, 211, 224, 0.18);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 120;
  padding: 12px 22px;
  border-radius: 0 0 14px 14px;
  background: var(--c-heat);
  color: var(--c-deep);
  font-size: 14px;
  font-weight: 700;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0; }

.header-inner {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 32px);
  padding-block: 10px;
}

.header-lead {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.brand-mark {
  display: grid;
  gap: 4px;
  width: 30px;
  flex: none;
}
.brand-mark i {
  display: block;
  height: 5px;
  border-radius: 3px;
  transition: width var(--dur) var(--ease);
}
.brand-mark i:nth-child(1) { width: 100%; background: var(--c-heat); }
.brand-mark i:nth-child(2) { width: 74%; margin-left: auto; background: var(--c-celadon); }
.brand-mark i:nth-child(3) { width: 46%; margin-left: auto; background: var(--c-cyan); }

.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--c-mist);
}
.brand-suffix {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(244, 247, 250, 0.5);
}

.search-launch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: min(38vw, 300px);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(201, 211, 223, 0.22);
  background: rgba(18, 51, 92, 0.5);
  color: rgba(244, 247, 250, 0.62);
  font-size: 13.5px;
  transition: border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}
.search-launch:hover,
.search-launch:focus-visible {
  border-color: var(--c-cyan);
  background: rgba(18, 51, 92, 0.8);
  color: var(--c-mist);
}
.search-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-icon {
  position: relative;
  flex: none;
  width: 15px;
  height: 15px;
}
.search-icon::before {
  content: "";
  position: absolute;
  inset: 0 3px 3px 0;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: right center;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  border: 1px solid rgba(201, 211, 223, 0.24);
  background: rgba(18, 51, 92, 0.6);
  transition: border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}
.nav-toggle:hover { border-color: var(--c-cyan); }

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-mist);
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.site-header[data-open="true"] .nav-toggle-bars { background: transparent; }
.site-header[data-open="true"] .nav-toggle-bars::before {
  transform: translateY(7px) rotate(45deg);
  background: var(--c-heat);
}
.site-header[data-open="true"] .nav-toggle-bars::after {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--c-heat);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 24px);
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.1vw, 16px);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 9px 6px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  color: rgba(244, 247, 250, 0.7);
  transition: color var(--dur) var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-heat), var(--c-amber));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease);
}
.nav-link:hover { color: var(--c-mist); }
.nav-link:hover::after { transform: scaleX(0.55); }
.nav-link[aria-current="page"] { color: var(--c-mist); font-weight: 700; }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-cta {
  flex: none;
  padding: 10px 18px;
  font-size: 14px;
}

.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(46, 211, 224, 0.12);
  overflow: hidden;
}
.scroll-meter-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-celadon) 55%, var(--c-heat));
  transition: width 0.1s linear;
}

/* ---------- 7. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--c-midnight);
  color: rgba(244, 247, 250, 0.68);
  border-top: 1px solid rgba(46, 211, 224, 0.2);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -140px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 211, 224, 0.16), transparent 68%);
  pointer-events: none;
}
.site-footer::after {
  content: "";
  position: absolute;
  bottom: -200px;
  left: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 106, 42, 0.12), transparent 70%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
  padding-block: clamp(48px, 7vw, 92px) clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(210px, 1fr);
  gap: clamp(26px, 3.4vw, 56px);
}

.footer-brand .brand { margin-bottom: 16px; }
.footer-brand .brand-suffix { color: rgba(244, 247, 250, 0.42); }

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--c-cyan);
  margin-bottom: 14px;
}
.footer-note {
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(244, 247, 250, 0.5);
}

.footer-col-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.4;
  color: rgba(244, 247, 250, 0.52);
}

.footer-links { display: grid; gap: 10px; }
.footer-link {
  display: inline-block;
  font-size: 14.5px;
  color: rgba(244, 247, 250, 0.76);
  transition: color var(--dur) var(--ease);
}
.footer-link::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 0;
  height: 1px;
  margin-right: 0;
  background: var(--c-heat);
  transition: width var(--dur) var(--ease), margin-right var(--dur) var(--ease);
}
.footer-link:hover { color: var(--c-mist); }
.footer-link:hover::before { width: 14px; margin-right: 8px; }

.footer-contact-list { display: grid; gap: 14px; }
.footer-contact-item { display: grid; gap: 2px; }
.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(244, 247, 250, 0.42);
}
.footer-contact-value {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--c-mist);
  word-break: break-word;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
  padding-block: 20px 28px;
  border-top: 1px solid rgba(201, 211, 223, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  font-size: 12.5px;
  color: rgba(244, 247, 250, 0.48);
}
.footer-legal,
.footer-copy {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ---------- 8. 响应式 ---------- */
@media (max-width: 1200px) {
  .search-launch { max-width: 220px; }
}

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

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: block;
    margin-left: 0;
    padding-inline: var(--gutter);
    background: var(--c-midnight);
    border-bottom: 1px solid rgba(46, 211, 224, 0.2);
    box-shadow: 0 26px 40px -30px rgba(0, 0, 0, 0.9);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.28s var(--ease),
                opacity 0.22s var(--ease),
                visibility 0.28s,
                padding 0.28s var(--ease);
  }
  .site-header[data-open="true"] .site-nav {
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
    padding-block: 14px 30px;
  }

  .nav-list { display: block; }
  .nav-link {
    display: block;
    padding: 15px 6px;
    font-size: 17px;
    font-weight: 600;
    border-bottom: 1px solid rgba(201, 211, 223, 0.1);
  }
  .nav-link::after { display: none; }
  .nav-link:hover::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--c-heat); }
  .nav-link[aria-current="page"]::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 10px;
    border-radius: 2px;
    background: var(--c-heat);
    vertical-align: middle;
  }
  .nav-cta { margin-top: 18px; width: 100%; padding-block: 14px; }

  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-note { max-width: 46ch; }
}

@media (max-width: 960px) {
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-launch { max-width: 180px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  :root { --header-h: 66px; }
  .header-inner { gap: 10px; }
  .brand-suffix { display: none; }
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .search-launch { padding: 10px; border-radius: 12px; }
  .search-label { display: none; }
  .brand-name { font-size: 1.06rem; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .media-frame figcaption { font-size: 12.5px; padding: 14px 16px; }
}

/* ---------- 9. 动效降级 ---------- */
@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;
    scroll-behavior: auto !important;
  }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
  .nav-link:hover::after { transform: scaleX(0); }
  .card:hover { transform: none; }
}
