/* ============================================================
   赢宝中心 · 共享样式 /assets/site.css
   负责：reset、变量、中文排版、页头、页脚、按钮、面包屑、
        正文容器、网格与基础组件
   ============================================================ */

/* ---------- 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, ol, ul {
  margin: 0;
  padding: 0;
}

ol, ul { list-style: none; }

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

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

a { color: inherit; }

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

/* ---------- 2. 变量 ---------- */
:root {
  /* 色板 */
  --ink-900: #0B1F33;
  --ink-700: #123A5C;
  --ink-500: #2A5E8A;
  --ink-100: #DDE7F0;
  --gold-500: #C9A227;
  --gold-200: #EBD9A0;
  --coral-500: #FF6B4A;
  --celadon-500: #2F9E82;
  --paper-50: #F8F4EC;
  --graphite-700: #3C4652;
  --white-0: #FFFFFF;

  /* 字体 */
  --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: "IBM Plex Mono", "JetBrains Mono", ui-monospace,
    SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  /* 尺寸 */
  --shell: 1280px;
  --gutter: 24px;
  --edge: 20px;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  /* 动效 */
  --dur: 180ms;
  --dur-slow: 220ms;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* 语义 */
  --surface: var(--paper-50);
  --surface-card: var(--white-0);
  --text-body: var(--graphite-700);
  --text-strong: var(--ink-900);
  --line: var(--ink-100);
}

@media (min-width: 720px) {
  :root { --edge: 24px; }
}

/* ---------- 3. 基础排版 ---------- */
body {
  background-color: var(--surface);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(201, 162, 39, .07), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(42, 94, 138, .08), transparent 46%);
  background-repeat: no-repeat;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 720px) {
  body { font-size: 17px; }
}

h1, h2, h3, h4 {
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
}

h3 {
  font-size: 18px;
  line-height: 1.5;
}

h4 {
  font-size: 16px;
  line-height: 1.5;
}

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

a {
  color: var(--ink-700);
  text-decoration-color: rgba(42, 94, 138, .4);
  text-underline-offset: 4px;
  transition: color var(--dur) var(--ease),
              text-decoration-color var(--dur) var(--ease);
}

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

strong { color: var(--text-strong); font-weight: 600; }

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

/* 等宽数字 */
.num {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.num--lg {
  font-size: 1.35em;
  color: var(--ink-700);
}

/* 纵向 / 旋转小注释 */
.side-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-500);
  letter-spacing: 0.08em;
}

@media (min-width: 900px) {
  .side-note--vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }
  .side-note--rotated {
    transform: rotate(90deg);
    transform-origin: left top;
    white-space: nowrap;
  }
}

/* ---------- 4. 焦点与可访问性 ---------- */
:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  display: inline-block;
  padding: 10px 18px;
  background: var(--gold-500);
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 0;
  color: var(--ink-900);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 5. 页头 ---------- */
.site-header {
  position: relative;
  z-index: 60;
}

/* 5.1 上层品牌条 */
.brandbar {
  background: var(--ink-900);
  background-image:
    repeating-linear-gradient(115deg,
      rgba(255, 255, 255, .035) 0 1px,
      transparent 1px 14px);
  color: var(--paper-50);
}

.brandbar__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 12px var(--edge);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

.brandbar__mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brandbar__brand {
  color: var(--paper-50);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.brandbar__brand:hover {
  color: var(--gold-500);
  text-decoration: none;
}

.brandbar__rule {
  width: 1px;
  height: 16px;
  background: linear-gradient(180deg, var(--gold-500), transparent);
  flex: none;
}

.brandbar__note {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(221, 231, 240, .78);
  white-space: nowrap;
}

.brandbar__quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.brandbar__quicklabel {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold-200);
  margin-right: 2px;
}

.quick-link {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(221, 231, 240, .28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--paper-50);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.quick-link:hover {
  border-color: var(--gold-500);
  color: var(--gold-200);
  background: rgba(201, 162, 39, .14);
  text-decoration: none;
}

/* 5.2 下层栏目条 */
.navband {
  position: sticky;
  top: 0;
  z-index: 55;
  background: var(--paper-50);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(11, 31, 51, .04);
}

.navband__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0 var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.nav { min-width: 0; }

.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__item { flex: none; }

.nav__link {
  position: relative;
  display: inline-block;
  padding: 16px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-700);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.nav__link:hover {
  color: var(--gold-500);
  border-bottom-color: var(--gold-500);
  text-decoration: none;
}

.nav__link[aria-current="page"] {
  color: var(--ink-900);
}

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-200));
}

/* 5.3 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--ink-500);
  border-radius: 999px;
  background: var(--white-0);
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: background-color var(--dur) var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-toggle__text { line-height: 1; }

.site-header[data-open] .nav-toggle__bars { background: transparent; }
.site-header[data-open] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* 5.4 阅读进度条 */
.navband__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold-500), var(--coral-500));
  pointer-events: none;
}

/* 5.5 断点：平板与手机 */
@media (max-width: 1023px) {
  .nav__link {
    padding: 16px 9px;
    font-size: 14px;
  }
}

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

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--paper-50);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 24px -18px rgba(11, 31, 51, .5);
  }

  .site-header[data-open] .nav { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: var(--shell);
    margin-inline: auto;
    padding: 8px var(--edge) 18px;
  }

  .nav__link {
    display: block;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
  }

  .nav__link[aria-current="page"] {
    background: var(--ink-100);
    box-shadow: inset 3px 0 0 var(--gold-500);
  }

  .nav__link[aria-current="page"]::after { display: none; }
}

@media (max-width: 599px) {
  .brandbar__inner {
    padding: 10px var(--edge);
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .brandbar__note { display: none; }

  .brandbar__quick { gap: 6px; }

  .brandbar__quicklabel { display: none; }

  .quick-link {
    padding: 4px 10px;
    font-size: 12px;
  }
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--ink-900);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .032) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .032) 0 1px, transparent 1px 52px);
  color: var(--ink-100);
  font-size: 14px;
  line-height: 1.7;
}

.footer__inner {
  padding-top: 56px;
  padding-bottom: 28px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.4fr;
  gap: 32px 28px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(221, 231, 240, .16);
}

.footer__col { min-width: 0; }

.footer__brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--paper-50);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.footer__lede {
  font-size: 14px;
  color: rgba(221, 231, 240, .74);
  max-width: 34em;
  margin-bottom: 14px;
}

.footer__region {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(201, 162, 39, .5);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold-200);
}

.footer__heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-200);
  margin-bottom: 14px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__link {
  display: inline-block;
  color: rgba(221, 231, 240, .84);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.footer__link:hover {
  color: var(--gold-500);
  border-bottom-color: var(--gold-500);
  text-decoration: none;
}

.footer__contactline {
  font-size: 13px;
  color: rgba(221, 231, 240, .72);
  margin-bottom: 6px;
  word-break: break-word;
}

.footer__contactline--note {
  margin-top: 10px;
  color: var(--celadon-500);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 22px;
}

.footer__copy {
  font-size: 13px;
  color: rgba(221, 231, 240, .7);
  margin: 0;
}

.footer__icp {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(221, 231, 240, .7);
  margin: 0;
}

@media (max-width: 1023px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 599px) {
  .site-footer { margin-top: 52px; }

  .footer__inner {
    padding-top: 40px;
    padding-bottom: 22px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

/* ---------- 7. 容器 / 面包屑 / 网格 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--edge);
}

.shell--narrow { max-width: 880px; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
  font-size: 13px;
  color: var(--ink-500);
}

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

.crumbs__item + .crumbs__item::before {
  content: "/";
  color: var(--ink-100);
}

.crumbs a {
  color: var(--ink-500);
  text-decoration: none;
}

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

.grid {
  display: grid;
  gap: var(--gutter);
}

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

.grid__col { min-width: 0; }

@media (max-width: 899px) {
  .grid--12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  .grid--12 {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.prose {
  max-width: 68ch;
  color: var(--text-body);
}

.prose > * + * { margin-top: 1em; }

.prose h2,
.prose h3 { margin-top: 1.6em; }

.prose ul,
.prose ol {
  padding-left: 1.2em;
  list-style: disc;
}

.prose li { margin-bottom: 0.5em; }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn:active { transform: translateY(0); }

.btn--gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-200));
  color: var(--ink-900);
}

.btn--gold:hover { color: var(--ink-900); }

.btn--ink {
  background: var(--ink-700);
  color: var(--paper-50);
}

.btn--ink:hover { color: var(--gold-200); }

.btn--coral {
  background: var(--coral-500);
  color: var(--white-0);
}

.btn--coral:hover { color: var(--white-0); }

.btn--ghost {
  background: transparent;
  border-color: var(--ink-500);
  color: var(--ink-700);
}

.btn--ghost:hover {
  border-color: var(--gold-500);
  color: var(--gold-500);
}

/* ---------- 9. 基础组件 ---------- */
/* 9.1 分类筛选标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white-0);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.tag:hover {
  border-color: var(--gold-500);
  color: var(--gold-500);
  text-decoration: none;
}

.tag[aria-pressed="true"],
.tag[data-active="true"] {
  background: var(--ink-700);
  border-color: var(--ink-700);
  color: var(--paper-50);
}

/* 9.2 折叠面板 */
.panel {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}

.panel[data-open] { border-color: var(--gold-500); }

.panel__trigger {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.panel__trigger:hover { color: var(--gold-500); }

.panel__body {
  padding: 0 20px 20px;
  font-size: 15px;
  color: var(--text-body);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* 9.3 横向对比条 */
.rail {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-500) var(--ink-100);
  background:
    linear-gradient(90deg, var(--paper-50) 0, rgba(248, 244, 236, 0) 24px) left / 24px 100% no-repeat,
    linear-gradient(270deg, var(--paper-50) 0, rgba(248, 244, 236, 0) 24px) right / 24px 100% no-repeat;
}

.rail__track {
  display: inline-flex;
  gap: 1px;
  min-width: 100%;
}

.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-track { background: var(--ink-100); }
.rail::-webkit-scrollbar-thumb {
  background: var(--ink-500);
  border-radius: 999px;
}

/* 9.4 图片容器基础规则 */
.figure {
  display: block;
  margin: 0;
}

.figure__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, var(--ink-100) 0%, var(--white-0) 62%, var(--gold-200) 100%);
  aspect-ratio: 16 / 10;
}

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

.figure__frame--wide { aspect-ratio: 21 / 9; }
.figure__frame--tall { aspect-ratio: 4 / 5; }
.figure__frame--square { aspect-ratio: 1 / 1; }
.figure__frame--rounded { border-radius: var(--radius-lg); }

.figure__caption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-500);
}

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

.js [data-reveal][data-reveal-state="in"] {
  opacity: 1;
  transform: none;
}

/* 锚点跳转后的标题提示（配合 :target） */
.section-title:target,
h2:target,
h3:target {
  box-shadow: inset 3px 0 0 var(--gold-500);
  padding-left: 12px;
}

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

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

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

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