/* ==========================================================================
   百家平台乐指南 — /assets/site.css
   共享外壳：重置 / 设计令牌 / 中文排版 / 框架页头 / 封底页脚 / 通用组件
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --paper: #F7F1E6;
  --paper-deep: #EFE6D6;
  --ink-blue: #123B4C;
  --lake: #2A6E86;
  --mist: #D8E5E8;
  --ochre: #A45B2A;
  --ink: #14262E;
  --flag-blue: #2C6FA6;
  --flag-red: #B4473D;
  --flag-green: #3E7659;
  --flag-yellow: #D3A23B;

  --lake-veil: rgba(42, 110, 134, 0.12);
  --ink-veil: rgba(18, 59, 76, 0.09);
  --paper-veil: rgba(247, 241, 230, 0.14);
  --paper-faint: rgba(247, 241, 230, 0.62);

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --shell: 1280px;
  --gutter: clamp(1.15rem, 4vw, 4.5rem);
  --measure: 34em;
  --rule: 1px solid rgba(18, 59, 76, 0.16);
  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --reveal-delay: 0ms;
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 520px at 82% -8%, rgba(216, 229, 232, 0.55), transparent 70%),
    radial-gradient(900px 420px at -6% 12%, rgba(164, 91, 42, 0.07), transparent 68%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

ul,
ol { margin: 0 0 1em; padding-left: 1.2em; }

::selection { background: var(--flag-yellow); color: var(--ink-blue); }

/* ---------- 3. 中文排版 ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.16;
  color: var(--ink-blue);
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.7rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 1.6vw, 1.5rem); letter-spacing: -0.02em; }
h4 { font-size: clamp(1.05rem, 1.2vw, 1.2rem); letter-spacing: -0.015em; }

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

a {
  color: var(--lake);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--ochre); }

strong, b { font-weight: 700; }
em { font-style: normal; color: var(--ochre); font-weight: 600; }

hr {
  height: 1px;
  border: 0;
  margin: clamp(1.6rem, 3vw, 2.6rem) 0;
  background: linear-gradient(90deg, var(--ochre) 0 48px, rgba(18, 59, 76, 0.16) 48px 100%);
}

/* ---------- 4. 焦点可见 ---------- */
:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline: 2px solid var(--flag-yellow);
  outline-offset: 3px;
}

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: -6rem;
  left: var(--gutter);
  z-index: 200;
  padding: 0.6rem 1.1rem;
  background: var(--flag-yellow);
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 12px 24px -18px rgba(18, 59, 76, 0.9);
  transition: top 0.18s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { top: 0; color: var(--ink-blue); }

/* ==========================================================================
   6. 页头 —— 深湖蓝框架横梁
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink-blue);
  background-image: linear-gradient(180deg, #0f3443 0%, #123B4C 62%, #14424f 100%);
  color: var(--paper);
  border-bottom: 1px solid rgba(247, 241, 230, 0.16);
  box-shadow: 0 20px 34px -34px rgba(18, 59, 76, 0.95);
}

/* 经幡五色窄带 */
.header-band {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 4px;
  width: 100%;
}
.band-seg { display: block; height: 100%; }
.band-seg--blue { background: var(--flag-blue); }
.band-seg--white { background: var(--paper); }
.band-seg--red { background: var(--flag-red); }
.band-seg--green { background: var(--flag-green); }
.band-seg--yellow { background: var(--flag-yellow); }

.header-frame {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(0.85rem, 2vw, 1.15rem) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.4rem;
}

/* 品牌 */
.header-brand { min-width: 0; }

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 0.22rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark:hover { color: inherit; }

.brand-mono {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.32rem, 1.1vw + 1rem, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.14;
  color: var(--paper);
}

.brand-tag {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--paper-faint);
}

/* 移动目录按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid rgba(247, 241, 230, 0.34);
  border-radius: var(--radius);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav-toggle:hover { background: rgba(247, 241, 230, 0.1); border-color: rgba(247, 241, 230, 0.6); }

.nav-toggle-glyph {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
}
.nav-toggle-glyph span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.site-header[data-open="true"] .nav-toggle-glyph span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle-glyph span:nth-child(2) { opacity: 0; }
.site-header[data-open="true"] .nav-toggle-glyph span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* 导航 */
.site-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.nav-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(247, 241, 230, 0.46);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.42rem;
  padding: 0.42rem 0.7rem;
  border-radius: var(--radius);
  color: rgba(247, 241, 230, 0.84);
  font-size: 0.9rem;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  background: rgba(247, 241, 230, 0.1);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--flag-yellow);
}
.nav-label { display: inline-block; }

.nav-link[aria-current="page"] {
  background: var(--flag-yellow);
  color: var(--ink-blue);
  font-weight: 700;
}
.nav-link[aria-current="page"]:hover,
.nav-link[aria-current="page"]:focus-visible {
  background: var(--flag-yellow);
  color: var(--ink-blue);
}
.nav-link[aria-current="page"] .nav-num { color: var(--ochre); }

/* ---------- 6.1 移动端折叠态 ---------- */
@media (max-width: 899.98px) {
  .site-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.2rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(247, 241, 230, 0.18);
    gap: 0.3rem;
  }
  .site-header[data-open="true"] .site-nav { display: flex; }

  .nav-kicker { display: block; margin-bottom: 0.35rem; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
  }
  .nav-item { width: 100%; }
  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.62rem 0.55rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(247, 241, 230, 0.1);
    border-radius: 0;
    white-space: normal;
  }
  .nav-num { min-width: 2.4ch; }
  .nav-link[aria-current="page"] { border-radius: var(--radius); }
}

/* ---------- 6.2 桌面端框架对齐 ---------- */
@media (min-width: 900px) {
  .nav-toggle { display: none; }

  .header-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
  }

  .site-nav {
    display: flex;
    align-items: flex-end;
    justify-self: end;
  }
  .nav-list { justify-content: flex-end; }
  .nav-kicker { align-self: flex-end; }
}

/* ==========================================================================
   7. 页脚 —— 归档封底
   ========================================================================== */
.site-footer {
  margin-top: clamp(3rem, 8vw, 6.5rem);
  background: var(--ink-blue);
  background-image:
    radial-gradient(760px 300px at 12% 0%, rgba(42, 110, 134, 0.42), transparent 72%),
    linear-gradient(180deg, #123B4C 0%, #0f2f3c 100%);
  color: rgba(247, 241, 230, 0.82);
  border-top: 4px solid var(--ochre);
}

.footer-frame {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(2.2rem, 5vw, 3.9rem) var(--gutter) clamp(1.6rem, 3vw, 2.4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.7rem, 3.5vw, 3rem);
}

.footer-mono {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(247, 241, 230, 0.48);
}

.footer-brand {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--paper);
}

.footer-line {
  margin: 0 0 0.4rem;
  max-width: 32em;
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(247, 241, 230, 0.78);
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}

.footer-link {
  display: inline-block;
  padding-bottom: 2px;
  color: rgba(247, 241, 230, 0.84);
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--flag-yellow);
  border-bottom-color: var(--flag-yellow);
}

.footer-base {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 1rem var(--gutter) 1.3rem;
  border-top: 1px solid rgba(247, 241, 230, 0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.6rem;
}

.footer-legal {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.7;
  color: rgba(247, 241, 230, 0.66);
}
.footer-legal--dim { color: rgba(247, 241, 230, 0.5); }

@media (min-width: 760px) {
  .footer-frame { grid-template-columns: 1.4fr 0.8fr 1fr; }
}

/* ==========================================================================
   8. 通用布局
   ========================================================================== */
.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--measure);
  line-height: 1.85;
}

.grid-2,
.grid-3,
.grid-auto {
  display: grid;
  gap: clamp(1.1rem, 3vw, 2.6rem);
}

.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }

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

/* ---------- 9. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--solid { background: var(--ochre); color: var(--paper); }
.btn--solid:hover,
.btn--solid:focus-visible { background: #8c4b20; color: var(--paper); }

.btn--lake { background: var(--lake); color: var(--paper); }
.btn--lake:hover,
.btn--lake:focus-visible { background: #22596d; color: var(--paper); }

.btn--ghost {
  background: transparent;
  color: var(--ink-blue);
  border-color: rgba(18, 59, 76, 0.32);
}
.btn--ghost:hover,
.btn--ghost:focus-visible { background: var(--ink-blue); color: var(--paper); border-color: var(--ink-blue); }

.btn--index {
  padding: 0.55rem 1rem;
  background: var(--mist);
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.btn--index:hover,
.btn--index:focus-visible { background: var(--lake); color: var(--paper); }

.btn__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* ---------- 10. 归档路径 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--lake);
}
.crumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(42, 110, 134, 0.35);
}
.crumbs a:hover,
.crumbs a:focus-visible { color: var(--ochre); border-bottom-color: var(--ochre); }
.crumbs__sep { color: rgba(20, 38, 46, 0.32); }
.crumbs [aria-current="page"] { color: var(--ink); }

/* ---------- 11. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.55rem;
  border-radius: 2px;
  background: var(--mist);
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1.7;
  text-decoration: none;
}
.tag--ochre { background: rgba(164, 91, 42, 0.14); color: #7a3f18; }
.tag--blue { background: rgba(44, 111, 166, 0.14); color: var(--flag-blue); }
.tag--green { background: rgba(62, 118, 89, 0.15); color: var(--flag-green); }
.tag--red { background: rgba(180, 71, 61, 0.14); color: var(--flag-red); }

/* ---------- 12. 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--mist);
  isolation: isolate;
}
.media img,
.media picture,
.media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 16 / 9; }
.media--band { aspect-ratio: 21 / 8; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }

.media--lake {
  background-image:
    radial-gradient(120% 90% at 22% 12%, rgba(247, 241, 230, 0.42), transparent 58%),
    linear-gradient(158deg, #3d8299 0%, #2A6E86 42%, #123B4C 100%);
}
.media--salt {
  background-color: #e7e0d2;
  background-image:
    repeating-linear-gradient(64deg, rgba(18, 59, 76, 0.16) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-58deg, rgba(18, 59, 76, 0.1) 0 1px, transparent 1px 31px),
    radial-gradient(90% 70% at 70% 30%, rgba(216, 229, 232, 0.9), transparent 70%);
}
.media--flag {
  background-image:
    linear-gradient(90deg, var(--flag-blue) 0 20%, var(--paper) 20% 40%, var(--flag-red) 40% 60%, var(--flag-green) 60% 80%, var(--flag-yellow) 80% 100%);
  opacity: 0.9;
}

/* ---------- 13. 滚动显现 ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease);
  transition-delay: var(--reveal-delay);
  will-change: opacity, transform;
}
.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 14. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .has-js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover { transform: none; }
}

/* ---------- 15. 打印 ---------- */
@media print {
  .site-header,
  .site-footer,
  .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
