/* =========================================================
   博万游艺 · 共享样式表 /assets/site.css
   草原电子手册：沙金规则带 + 青绿命令栏 + 切角面板
   ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { padding: 0; list-style: none; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

:root {
  /* --- 色板 --- */
  --bw-green: #0F6E5C;
  --bw-green-dark: #0A4E42;
  --bw-mist: #E4F1EC;
  --bw-lift: #63C2A6;
  --bw-sand: #E8B75A;
  --bw-sand-deep: #8A5F16;
  --bw-violet: #6B4BC9;
  --bw-coral: #E2552F;
  --bw-coral-dark: #C4431F;
  --bw-paper: #FBFAF6;
  --bw-ink: #10221E;
  --bw-stone: #CFC9B8;
  --bw-moss: #5C736C;

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

  /* --- 形状 --- */
  --bw-cut: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  --bw-cut-sm: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  --bw-cut-xs: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));

  /* --- 尺度 --- */
  --bw-shell: 1240px;
  --bw-gap: clamp(14px, 2vw, 24px);
  --bw-header-h: 66px;
}

body {
  font-family: var(--bw-font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--bw-ink);
  background: var(--bw-paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--bw-font-display);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--bw-sand);
  outline-offset: 2px;
}

/* ============ 跳过链接 ============ */
.bw-skip {
  position: absolute;
  left: 16px;
  top: -72px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--bw-ink);
  color: var(--bw-paper);
  font-size: 14px;
  font-weight: 600;
  clip-path: var(--bw-cut-sm);
  transition: top 0.18s ease;
}
.bw-skip:focus { top: 10px; }

/* ============ 容器 ============ */
.bw-shell {
  width: 100%;
  max-width: var(--bw-shell);
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 32px);
}

/* =========================================================
   页头
   ========================================================= */
.bw-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bw-green);
  color: var(--bw-paper);
  border-bottom: 1px solid rgba(16, 34, 30, 0.18);
}

/* 沙金规则窄带 */
.bw-ruler {
  background: var(--bw-sand);
  color: var(--bw-sand-deep);
  font-family: var(--bw-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}
.bw-ruler__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 30px;
}
.bw-ruler__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.bw-ruler__dot {
  width: 6px;
  height: 6px;
  background: var(--bw-coral);
  border-radius: 50%;
  flex: 0 0 auto;
}
.bw-ruler__label { font-weight: 500; }
.bw-ruler__link {
  margin-left: auto;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(138, 95, 22, 0.5);
  font-weight: 600;
  white-space: nowrap;
}
.bw-ruler__link:hover { border-bottom-color: var(--bw-sand-deep); }

/* 命令栏主行 */
.bw-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 24px);
  min-height: var(--bw-header-h);
}

/* 品牌 */
.bw-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.bw-brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--bw-sand);
  color: var(--bw-sand-deep);
  font-family: var(--bw-font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  clip-path: var(--bw-cut-sm);
}
.bw-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.bw-brand__name {
  font-family: var(--bw-font-display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--bw-paper);
}
.bw-brand__line {
  font-family: var(--bw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(251, 250, 246, 0.62);
}

/* 主导航 */
.bw-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.bw-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}
.bw-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  font-size: 14.5px;
  line-height: 1.3;
  color: rgba(251, 250, 246, 0.82);
  box-shadow: inset 0 -2px 0 transparent;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.bw-nav__link:hover {
  background: rgba(251, 250, 246, 0.1);
  color: var(--bw-paper);
}
.bw-nav__link[aria-current="page"] {
  color: var(--bw-paper);
  box-shadow: inset 0 -2px 0 var(--bw-sand);
}
.bw-nav__index {
  font-family: var(--bw-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(232, 183, 90, 0.7);
}
.bw-nav__link[aria-current="page"] .bw-nav__index { color: var(--bw-sand); }
.bw-nav__label { white-space: nowrap; }
.bw-nav__actions { display: none; }

.bw-header__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  flex: 0 0 auto;
}

/* 进度线 */
.bw-progress {
  position: relative;
  height: 2px;
  background: rgba(16, 34, 30, 0.2);
  overflow: hidden;
}
.bw-progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--bw-sand), var(--bw-coral));
  transition: transform 0.08s linear;
}

/* 移动菜单按钮 */
.bw-nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 9px 13px;
  color: var(--bw-paper);
  box-shadow: inset 0 0 0 1px rgba(251, 250, 246, 0.38);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.bw-nav-toggle:hover { background: rgba(251, 250, 246, 0.12); }
.bw-nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
}
.bw-nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.bw-header[data-open="true"] .bw-nav-toggle__bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.bw-header[data-open="true"] .bw-nav-toggle__bars span:nth-child(2) { opacity: 0; }
.bw-header[data-open="true"] .bw-nav-toggle__bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.bw-nav-toggle__text {
  font-family: var(--bw-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* =========================================================
   页脚
   ========================================================= */
.bw-footer {
  background: var(--bw-green-dark);
  color: rgba(251, 250, 246, 0.86);
}
.bw-footer__stripe {
  height: 10px;
  background: repeating-linear-gradient(
    135deg,
    var(--bw-sand) 0 10px,
    transparent 10px 20px
  );
}
.bw-footer__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1.05fr) 2fr;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(32px, 5vw, 56px);
}
.bw-footer__brand { max-width: 34ch; }
.bw-brand--footer .bw-brand__name { font-size: 19px; }
.bw-footer__pitch {
  margin: 16px 0 18px;
  font-family: var(--bw-font-body);
  font-size: 15px;
  line-height: 1.75;
  color: rgba(251, 250, 246, 0.76);
}
.bw-footer__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bw-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
}
.bw-footer__title {
  margin-bottom: 12px;
  font-family: var(--bw-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--bw-sand);
}
.bw-footer__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.bw-footer__link {
  font-size: 14.5px;
  color: rgba(251, 250, 246, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.bw-footer__link:hover {
  color: var(--bw-paper);
  border-bottom-color: var(--bw-sand);
}
.bw-footer__lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(251, 250, 246, 0.72);
  overflow-wrap: anywhere;
}
.bw-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-block: 18px 26px;
  border-top: 1px solid rgba(251, 250, 246, 0.16);
  font-size: 12.5px;
  color: rgba(251, 250, 246, 0.62);
}
.bw-footer__metanav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-right: auto;
}
.bw-footer__legal,
.bw-footer__version,
.bw-footer__copy { line-height: 1.6; }

/* =========================================================
   通用按钮
   ========================================================= */
.bw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--bw-font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  border-bottom: 2px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, box-shadow 0.18s ease;
}
.bw-btn--accent {
  background: var(--bw-coral);
  color: #FFFFFF;
}
.bw-btn--accent:hover {
  background: var(--bw-coral-dark);
  border-bottom-color: var(--bw-sand);
}
.bw-btn--outline {
  color: var(--bw-paper);
  box-shadow: inset 0 0 0 1px rgba(251, 250, 246, 0.45);
}
.bw-btn--outline:hover {
  background: rgba(251, 250, 246, 0.14);
  box-shadow: inset 0 0 0 1px var(--bw-paper);
}
.bw-btn--sand {
  background: var(--bw-sand);
  color: var(--bw-sand-deep);
}
.bw-btn--sand:hover { background: #F0C577; }
.bw-btn--ghost {
  color: var(--bw-paper);
  box-shadow: inset 0 0 0 1px rgba(251, 250, 246, 0.28);
}
.bw-btn--ghost:hover {
  background: rgba(251, 250, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(251, 250, 246, 0.6);
}

/* =========================================================
   排版与区块组件
   ========================================================= */
.bw-section { padding-block: clamp(36px, 6vw, 72px); }
.bw-section__head {
  max-width: 62ch;
  margin-bottom: clamp(18px, 3vw, 28px);
}
.bw-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--bw-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--bw-green);
}
.bw-kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--bw-coral);
}
.bw-title {
  font-size: clamp(26px, 3.4vw, 38px);
  color: var(--bw-ink);
}
.bw-title--xl {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
}
.bw-lede {
  margin-top: 12px;
  font-family: var(--bw-font-body);
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 500;
  line-height: 1.9;
  color: var(--bw-moss);
}
.bw-mono {
  font-family: var(--bw-font-mono);
  font-size: 0.92em;
  letter-spacing: 0.04em;
}
.bw-note {
  padding-left: 14px;
  border-left: 3px solid var(--bw-lift);
  font-family: var(--bw-font-body);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--bw-moss);
}

/* 切角面板 */
.bw-panel {
  --bw-panel-line: var(--bw-stone);
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--bw-paper);
  color: var(--bw-ink);
  clip-path: var(--bw-cut);
}
.bw-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--bw-panel-line), var(--bw-panel-line)),
    linear-gradient(var(--bw-panel-line), var(--bw-panel-line)),
    linear-gradient(var(--bw-panel-line), var(--bw-panel-line)),
    linear-gradient(var(--bw-panel-line), var(--bw-panel-line));
  background-repeat: no-repeat;
  background-size: 34px 1px, 1px 34px, 34px 1px, 1px 34px;
  background-position: left top, left top, right bottom, right bottom;
}
.bw-panel--mist { background: var(--bw-mist); }
.bw-panel--gold {
  background: var(--bw-sand);
  color: var(--bw-sand-deep);
  --bw-panel-line: rgba(138, 95, 22, 0.45);
}
.bw-panel--violet {
  background: var(--bw-violet);
  color: #FFFFFF;
  --bw-panel-line: rgba(255, 255, 255, 0.38);
}
.bw-panel--coral {
  background: var(--bw-coral);
  color: #FFFFFF;
  --bw-panel-line: rgba(255, 255, 255, 0.38);
}

/* 标签与胶囊 */
.bw-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--bw-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--bw-mist);
  color: var(--bw-green);
  clip-path: var(--bw-cut-xs);
}
.bw-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--bw-stone);
  font-family: var(--bw-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--bw-moss);
}
.bw-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bw-lift);
}

/* 面包屑 */
.bw-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-block: 16px;
  font-family: var(--bw-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--bw-moss);
}
.bw-breadcrumb__item { display: inline-flex; align-items: center; gap: 6px; }
.bw-breadcrumb__item + .bw-breadcrumb__item::before {
  content: "/";
  color: var(--bw-stone);
}
.bw-breadcrumb__item a:hover { color: var(--bw-green); }
.bw-breadcrumb__item[aria-current="page"] { color: var(--bw-ink); }

/* 网格 */
.bw-grid {
  display: grid;
  gap: var(--bw-gap);
}
.bw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bw-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bw-grid--split {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
}

/* 图片容器基础规则（页面阶段放占位图） */
.bw-media {
  position: relative;
  overflow: hidden;
  background: var(--bw-mist);
  clip-path: var(--bw-cut);
  isolation: isolate;
}
.bw-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bw-media--wide { aspect-ratio: 16 / 9; }
.bw-media--square { aspect-ratio: 1 / 1; }
.bw-media--portrait { aspect-ratio: 4 / 5; }
.bw-media__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, transparent, rgba(16, 34, 30, 0.74));
  color: var(--bw-paper);
  font-family: var(--bw-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* 章节斜线分隔带 */
.bw-rule {
  height: 14px;
  background: repeating-linear-gradient(
    135deg,
    var(--bw-stone) 0 2px,
    transparent 2px 12px
  );
}

/* 标签页 */
.bw-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.bw-tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bw-moss);
  background: var(--bw-mist);
  clip-path: var(--bw-cut-xs);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.bw-tab:hover { color: var(--bw-green); }
.bw-tab[aria-selected="true"] {
  background: var(--bw-green);
  color: var(--bw-paper);
}
.bw-tabpanel { padding-top: 18px; }
.bw-tabpanel[hidden] { display: none; }

/* 入场显现（仅 JS 可用时隐藏初始态） */
.bw-js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.bw-js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1080px) {
  .bw-header__tools { display: none; }
  .bw-nav-toggle { display: inline-flex; }

  .bw-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    margin-left: 0;
    padding: 12px clamp(16px, 3vw, 32px) 22px;
    background: var(--bw-green);
    border-top: 1px solid rgba(251, 250, 246, 0.18);
    box-shadow: 0 20px 34px rgba(16, 34, 30, 0.32);
    max-height: calc(100vh - var(--bw-header-h) - 30px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  .bw-header[data-open="true"] .bw-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
  .bw-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .bw-nav__item + .bw-nav__item { border-top: 1px solid rgba(251, 250, 246, 0.12); }
  .bw-nav__link {
    justify-content: flex-start;
    padding: 14px 4px;
    font-size: 16px;
    box-shadow: none;
  }
  .bw-nav__link[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--bw-sand);
    padding-left: 12px;
  }
  .bw-nav__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
  }
  .bw-nav__actions .bw-btn { flex: 1 1 auto; }
}

@media (max-width: 900px) {
  .bw-footer__inner { grid-template-columns: 1fr; }
  .bw-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bw-grid--2,
  .bw-grid--3,
  .bw-grid--split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --bw-header-h: 60px; }
  .bw-ruler__item--time { display: none; }
  .bw-ruler__inner { gap: 10px; font-size: 11px; }
  .bw-brand__mark { width: 34px; height: 34px; font-size: 12px; }
  .bw-brand__name { font-size: 15.5px; }
  .bw-brand__line { font-size: 9.5px; }
  .bw-media--wide { aspect-ratio: 4 / 3; }
  .bw-footer__cols { grid-template-columns: 1fr; }
  .bw-footer__metanav { width: 100%; margin-right: 0; }
}

@media (max-width: 420px) {
  .bw-nav-toggle__text { display: none; }
  .bw-ruler__link { font-size: 10.5px; }
}

/* =========================================================
   可访问性降级
   ========================================================= */
@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;
  }
  .bw-js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
