/* ============================================================
   彩宝网指南 · 共享样式 /assets/site.css
   深水蓝锚点 + 米白阅读区 + 暖金水下光源
   ============================================================ */

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

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

body { margin: 0; }

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

ul, ol { list-style: none; }

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

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] { display: none !important; }

/* ---------- 2. 设计令牌 ---------- */
:root {
  /* 色彩 */
  --deep: #0E2337;
  --ink: #0A0C0E;
  --night: #13293D;
  --gold: #C8A15A;
  --gold-glow: #E8CE95;
  --celadon: #6E8F82;
  --clay: #9C5B44;
  --mist: #D9DEE3;
  --cream: #F4F1EA;
  --stone: #6B7076;

  --line-gold: rgba(200, 161, 90, 0.4);
  --line-soft: rgba(217, 222, 227, 0.14);
  --panel-dark: rgba(19, 41, 61, 0.72);
  --panel-light: rgba(255, 255, 255, 0.6);
  --body-ink: #1B2733;

  /* 尺度 */
  --shell: 1240px;
  --gap: 24px;
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 40px;
  --sp-5: 64px;

  /* 字体 */
  --font-display: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;

  /* 运动 */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 320ms;
}

/* ---------- 3. 中文排版基线 ---------- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--body-ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--deep);
}

h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

p { line-height: 1.85; }

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

.text-gold { color: var(--gold); }
.text-mist { color: var(--mist); }
.text-stone { color: var(--stone); }

:focus-visible {
  outline: 2px solid var(--gold-glow);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 4. 布局工具 ---------- */
.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

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

.section--dark {
  background: linear-gradient(180deg, var(--deep) 0%, #0B1B2B 100%);
  color: var(--mist);
}

.section--ink {
  background: linear-gradient(180deg, #0C1620 0%, var(--ink) 100%);
  color: var(--mist);
}

.section--cream { background: var(--cream); }

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

.layout-note {
  display: grid;
  gap: var(--sp-4);
}

@media (min-width: 1024px) {
  .layout-note {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--sp-5);
  }
}

.rule-slant {
  height: 2px;
  border: 0;
  background: linear-gradient(
    90deg,
    rgba(200, 161, 90, 0) 0%,
    rgba(200, 161, 90, 0.55) 22%,
    rgba(200, 161, 90, 0.55) 78%,
    rgba(200, 161, 90, 0) 100%
  );
  transform: skewY(-12deg);
  transform-origin: 0 50%;
}

.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- 5. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(180deg, #0E2337 0%, #0C1E2F 100%);
  color: var(--cream);
  border-bottom: 1px solid rgba(200, 161, 90, 0.26);
  box-shadow: 0 1px 0 rgba(10, 12, 14, 0.4);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--gold-glow);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  border-radius: 2px;
  transition: top 200ms var(--ease);
}

.skip-link:focus { top: 10px; }

.header-progress {
  display: block;
  height: 2px;
  background: rgba(200, 161, 90, 0.12);
  overflow: hidden;
}

.header-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-glow) 100%);
}

.header-upper__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(16px, 2.4vw, 36px);
  padding-block: 14px;
  transition: padding var(--dur) var(--ease);
}

.site-header[data-scrolled] .header-upper__inner { padding-block: 5px; }

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--gold-glow) 0%, var(--gold) 46%, #8E6C33 100%);
  clip-path: polygon(50% 0, 100% 32%, 100% 68%, 50% 100%, 0 68%, 0 32%);
  box-shadow: 0 0 16px rgba(200, 161, 90, 0.4);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: var(--cream);
  white-space: nowrap;
}

.brand__line {
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.2em;
  color: var(--gold);
  white-space: nowrap;
  opacity: 1;
  transition: opacity 240ms var(--ease);
}

.site-header[data-scrolled] .brand__line { opacity: 0; }

/* 检索 */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  padding-inline: 14px;
  background: rgba(244, 241, 234, 0.06);
  border: 1px solid rgba(217, 222, 227, 0.18);
  border-radius: 2px;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.search:focus-within {
  border-color: var(--line-gold);
  background: rgba(244, 241, 234, 0.1);
}

.search__label {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--celadon);
  white-space: nowrap;
}

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 0;
  font-size: 14px;
  background: none;
  border: 0;
  outline: none;
  color: var(--cream);
}

.search__input::placeholder { color: rgba(217, 222, 227, 0.42); }

.search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search__count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--gold-glow);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.search__count[data-active] { opacity: 1; }

/* 工具区 */
.header-utility {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-utility__link {
  padding: 8px 14px;
  font-size: 14px;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--gold-glow);
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  white-space: nowrap;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}

.header-utility__link:hover { background: rgba(200, 161, 90, 0.14); }

.header-utility__meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(217, 222, 227, 0.5);
  white-space: nowrap;
}

/* 移动目录按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--gold-glow);
  border: 1px solid var(--line-gold);
  border-radius: 2px;
}

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 16px;
}

.nav-toggle__bar {
  display: block;
  height: 1px;
  background: currentColor;
  transform-origin: 50% 50%;
  transition: transform 240ms var(--ease);
}

.nav-toggle__bar:last-child {
  width: 66%;
  justify-self: end;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child {
  transform: translateY(2.5px) rotate(12deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-child {
  width: 100%;
  transform: translateY(-2.5px) rotate(-12deg);
}

/* 目录轴 */
.site-nav {
  border-top: 1px solid var(--line-soft);
  background: rgba(10, 12, 14, 0.3);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.site-nav__item {
  flex: 1 1 auto;
  min-width: 0;
}

.site-nav__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 15px 18px 15px 20px;
  font-size: 15px;
  letter-spacing: 0.05em;
  line-height: 1.4;
  color: rgba(244, 241, 234, 0.72);
  white-space: nowrap;
  transition: color 200ms var(--ease), background 200ms var(--ease);
}

.site-nav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 260ms var(--ease);
}

.site-nav__link:hover {
  color: var(--cream);
  background: rgba(244, 241, 234, 0.05);
}

.site-nav__link:hover::before { height: 40%; }

.site-nav__link[aria-current="page"] {
  color: var(--gold-glow);
  background: rgba(200, 161, 90, 0.09);
}

.site-nav__link[aria-current="page"]::before { height: 64%; }

.site-nav__index {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--celadon);
  transition: color 200ms var(--ease);
}

.site-nav__link[aria-current="page"] .site-nav__index { color: var(--gold); }

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  padding-bottom: 36px;
  background: linear-gradient(180deg, #0E2337 0%, #0A0C0E 80%);
  color: var(--mist);
}

.footer-slant {
  height: 56px;
  border-top: 1px solid rgba(200, 161, 90, 0.3);
  background:
    repeating-linear-gradient(
      78deg,
      transparent 0 26px,
      rgba(200, 161, 90, 0.14) 26px 27px
    ),
    linear-gradient(180deg, rgba(200, 161, 90, 0.06), rgba(200, 161, 90, 0));
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent);
}

.footer__inner {
  display: grid;
  gap: 44px;
  padding-block: 52px 40px;
}

@media (min-width: 900px) {
  .footer__inner {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 56px;
  }
}

.footer__brand { min-width: 0; }

.footer__name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.footer__tagline {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.footer__note {
  margin-top: 18px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(217, 222, 227, 0.66);
}

.footer__cta { margin-top: 26px; }

.footer__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
}

@media (min-width: 640px) {
  .footer__columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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

.footer-col__title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.6;
  color: var(--celadon);
}

.footer-col__list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.7;
}

.footer-col__list a {
  color: rgba(217, 222, 227, 0.8);
  border-bottom: 1px solid transparent;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}

.footer-col__list a:hover {
  color: var(--gold-glow);
  border-bottom-color: var(--line-gold);
}

.footer-col__list--plain { color: rgba(217, 222, 227, 0.6); }

.footer-col__list--plain li {
  word-break: break-word;
  font-size: 13px;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(217, 222, 227, 0.12);
  font-size: 12px;
  color: rgba(217, 222, 227, 0.5);
}

.footer__legal-line { letter-spacing: 0.04em; }
.footer__copy { letter-spacing: 0.02em; }

/* ---------- 7. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  letter-spacing: 0.06em;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background 200ms var(--ease), color 200ms var(--ease),
              border-color 200ms var(--ease), transform 200ms var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn--gold {
  background: var(--gold);
  color: #101418;
}

.btn--gold:hover { background: var(--gold-glow); }

.btn--ghost {
  border-color: rgba(200, 161, 90, 0.45);
  color: var(--gold-glow);
}

.btn--ghost:hover {
  background: rgba(200, 161, 90, 0.12);
  border-color: var(--gold);
}

.btn--deep {
  background: var(--deep);
  color: var(--cream);
}

.btn--deep:hover { background: #17324B; }

/* 面包屑 */
.crumb {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--stone);
}

.crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.crumb li + li::before {
  content: "／";
  color: rgba(107, 112, 118, 0.5);
}

.crumb a {
  color: var(--stone);
  border-bottom: 1px solid rgba(107, 112, 118, 0.3);
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}

.crumb a:hover {
  color: var(--deep);
  border-bottom-color: var(--gold);
}

.crumb [aria-current="page"] { color: var(--deep); }

/* 正文 */
.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.85;
  color: var(--body-ink);
}

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

.prose h2 { font-size: 26px; }
.prose h3 { font-size: 20px; }

.prose ul li {
  position: relative;
  padding-left: 18px;
}

.prose ul li + li { margin-top: 0.5em; }

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 6px;
  height: 1px;
  background: var(--gold);
}

.prose a {
  color: var(--deep);
  border-bottom: 1px solid var(--line-gold);
}

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

.prose strong { color: var(--deep); }

/* 切角面板 */
.panel {
  position: relative;
  padding: 26px 28px;
  background: var(--panel-light);
  border: 1px solid rgba(14, 35, 55, 0.1);
  clip-path: polygon(
    16px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 16px
  );
}

.panel--dark {
  background: linear-gradient(160deg, rgba(19, 41, 61, 0.96) 0%, rgba(10, 12, 14, 0.94) 100%);
  border-color: rgba(200, 161, 90, 0.24);
  color: var(--mist);
}

.panel--dark h2,
.panel--dark h3 { color: var(--cream); }

.panel--light {
  background: var(--cream);
  border-color: rgba(14, 35, 55, 0.12);
}

.notch {
  clip-path: polygon(
    16px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 16px
  );
}

/* 图片容器 */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(200, 161, 90, 0.22), transparent 58%),
    radial-gradient(90% 80% at 82% 88%, rgba(110, 143, 130, 0.22), transparent 62%),
    linear-gradient(150deg, #16304A 0%, #0E2337 46%, #0A0C0E 100%);
  clip-path: polygon(
    16px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 16px
  );
}

.media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(200, 161, 90, 0.24);
  clip-path: inherit;
  pointer-events: none;
}

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

.media--wide { aspect-ratio: 16 / 9; }
.media--soft { aspect-ratio: 4 / 3; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 3 / 4; }

.media__caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  padding: 22px 20px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(244, 241, 234, 0.84);
  background: linear-gradient(180deg, rgba(10, 12, 14, 0) 0%, rgba(10, 12, 14, 0.84) 100%);
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  color: var(--celadon);
  border: 1px solid currentColor;
  border-radius: 999px;
}

.tag--gold { color: var(--gold); }
.tag--clay { color: var(--clay); }

/* ---------- 8. 索引与显现 ---------- */
[data-index-item] {
  transition: opacity 240ms var(--ease), border-color 240ms var(--ease);
}

[data-index-item][data-filtered="miss"] { opacity: 0.26; }

[data-index-item][data-filtered="hit"] {
  border-color: var(--gold);
}

[data-nav] a[data-filtered="miss"] { opacity: 0.34; }
[data-nav] a[data-filtered="hit"] { color: var(--gold-glow); }

[data-reveal] { transition: opacity 480ms var(--ease), transform 480ms var(--ease); }

html[data-js] [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}

html[data-js] [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 980px) {
  .header-upper__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "search search";
    gap: 12px;
    padding-block: 12px;
  }

  .brand { grid-area: brand; }

  .nav-toggle {
    grid-area: toggle;
    display: inline-flex;
    justify-self: end;
  }

  .search {
    grid-area: search;
    max-width: none;
    margin-inline: 0;
  }

  .header-utility { display: none; }

  .site-nav {
    display: grid;
    grid-template-rows: 0fr;
    border-top-color: transparent;
    transition: grid-template-rows var(--dur) var(--ease);
  }

  .site-nav[data-open] {
    grid-template-rows: 1fr;
    border-top-color: var(--line-soft);
  }

  .site-nav__list {
    display: block;
    width: 100%;
    min-height: 0;
    padding-inline: 20px;
    overflow: hidden;
  }

  .site-nav__item { width: 100%; }

  .site-nav__link {
    display: flex;
    padding: 14px 6px 14px 16px;
    border-top: 1px solid var(--line-soft);
  }

  .site-nav__item:first-child .site-nav__link { border-top: 0; }

  .site-nav__link::before { left: 0; }

  .grid-12 { gap: 16px; }

  .panel { padding: 22px 20px; }
}

@media (max-width: 640px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }

  h1 { font-size: 28px; }
  h2 { font-size: 22px; }

  .brand__name { font-size: 17px; }
  .brand__line { letter-spacing: 0.14em; }

  .search__label { display: none; }

  .footer__legal { flex-direction: column; }
}

/* ---------- 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;
  }

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

  .site-nav { transition: none; }
  .header-progress__bar { transition: none; }
}
