/* ============================================================
 * gallery.css — 设计风格图鉴自身样式
 * 设计系统基准：Dark Mode (OLED) + JetBrains Mono / IBM Plex Sans
 * （由 ui-ux-pro-max --design-system 生成）
 * ============================================================ */
:root {
  --g-bg: #0b1120;
  --g-bg2: #0f172a;
  --g-card: #131c30;
  --g-card2: #182339;
  --g-fg: #f8fafc;
  --g-muted: #94a3b8;
  --g-border: rgba(148, 163, 184, 0.16);
  --g-border-strong: rgba(148, 163, 184, 0.32);
  --g-accent: #22c55e;
  --g-accent2: #38bdf8;
  --g-warn: #fbbf24;
  --g-dep: #64748b;
  --g-radius: 14px;
  --g-mono: "JetBrains Mono", Consolas, monospace;
  --g-sans: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --g-display: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--g-bg);
  color: var(--g-fg);
  font-family: var(--g-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--g-mono); }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(34, 197, 94, 0.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3a52; border-radius: 6px; border: 2px solid var(--g-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ======= 顶栏 ======= */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--g-border);
}
.site-head-inner {
  max-width: 1440px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--g-accent); flex: none; }
.brand-name {
  font-family: var(--g-display); font-weight: 800; font-size: 17px;
  letter-spacing: -0.01em; white-space: nowrap;
}
.brand-sub {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--g-muted); border: 1px solid var(--g-border);
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.search {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  background: var(--g-card); border: 1px solid var(--g-border);
  border-radius: 12px; padding: 9px 14px; width: min(420px, 42vw);
  color: var(--g-muted); transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}
.search svg { width: 16px; height: 16px; flex: none; }
.search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  color: var(--g-fg); font: 500 13.5px var(--g-sans);
}
.search input::placeholder { color: #5d6b82; }
.search input:focus { outline: none; }
.search kbd {
  font-size: 10px; color: var(--g-muted);
  border: 1px solid var(--g-border); border-radius: 5px; padding: 1px 6px;
}

/* ======= 站点板块导航 ======= */
.site-nav { display: flex; gap: 4px; flex: none; }
.site-nav a {
  font: 600 13px/1 var(--g-sans); color: var(--g-muted); text-decoration: none;
  padding: 9px 14px; border-radius: 9px; white-space: nowrap;
  transition: all 0.18s ease;
}
.site-nav a:hover { color: var(--g-fg); background: rgba(148, 163, 184, 0.1); }
.site-nav a.on {
  color: #86efac; background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.35); padding: 8px 13px;
}

/* 紧凑 hero（配色/字体/图表页） */
.hero-compact { padding: 48px 28px 28px; }
.hero-compact h1 { font-size: clamp(28px, 4vw, 46px); }
.hero-compact .hero-lead { margin-top: 14px; }
.hero-compact .hero-meta { margin-top: 18px; }

/* ======= Hero ======= */
.hero { position: relative; max-width: 1440px; margin: 0 auto; padding: 72px 28px 40px; text-align: center; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% -20% auto; height: 130%; pointer-events: none;
  background:
    radial-gradient(480px 300px at 22% 30%, rgba(34, 197, 94, 0.14), transparent 65%),
    radial-gradient(520px 320px at 78% 26%, rgba(56, 189, 248, 0.13), transparent 65%),
    radial-gradient(360px 260px at 50% 10%, rgba(139, 92, 246, 0.10), transparent 70%);
}
.hero-kicker {
  position: relative; display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em; color: var(--g-accent);
  border: 1px solid rgba(34, 197, 94, 0.35); border-radius: 999px; padding: 6px 16px;
  background: rgba(34, 197, 94, 0.08);
}
.hero h1 {
  position: relative;
  font-family: var(--g-display); font-size: clamp(34px, 5.4vw, 62px);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.12;
  margin: 22px 0 0;
  background: linear-gradient(115deg, #f8fafc 30%, #86efac 60%, #7dd3fc 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-meta {
  position: relative; margin-top: 26px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  font-size: 11.5px; color: var(--g-muted);
}
.hero-meta span {
  border: 1px solid var(--g-border); border-radius: 999px;
  padding: 5px 14px; background: rgba(19, 28, 48, 0.6);
}
.hero-meta b { color: var(--g-fg); font-weight: 700; }

/* ======= 工具栏 ======= */
.toolbar {
  position: sticky; top: 59px; z-index: 30;
  max-width: 1440px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: rgba(11, 17, 32, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--g-border);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid var(--g-border);
  background: var(--g-card); color: var(--g-muted);
  font: 600 12.5px/1 var(--g-sans);
  padding: 9px 15px; border-radius: 999px;
  transition: all 0.18s ease; white-space: nowrap;
}
.chip:hover { color: var(--g-fg); border-color: var(--g-border-strong); }
.chip.on {
  background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
}
.chip .n { font-family: var(--g-mono); font-size: 10px; opacity: 0.75; margin-left: 5px; }
.chips-sm .chip { padding: 7px 12px; font-size: 11.5px; }
.hue-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 7px; vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.count { font-size: 11px; color: var(--g-muted); letter-spacing: 0.06em; white-space: nowrap; }

/* ======= 卡片网格 ======= */
.grid {
  max-width: 1440px; margin: 0 auto; padding: 30px 28px 60px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px;
}
.style-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--g-card); border: 1px solid var(--g-border);
  border-radius: var(--g-radius); overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  color: inherit; text-decoration: none; cursor: pointer; outline: none;
}
.style-card:hover {
  transform: translateY(-4px);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(34, 197, 94, 0.18);
}
.style-card:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }

.shot {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--g-card2); cursor: pointer;
}
.shot-bg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.45s ease 0.1s;
}
.shot-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 14px 14px; opacity: 0.35;
}
.shot-bg .ph-name {
  position: relative; font-family: var(--g-display);
  font-size: clamp(18px, 2vw, 24px); font-weight: 800; letter-spacing: -0.02em;
  padding: 0 24px; text-align: center; line-height: 1.25;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35); color: #fff;
}
.shot iframe {
  position: absolute; top: 0; left: 0; border: 0; background: #fff;
  width: 1280px; height: 800px; transform-origin: 0 0;
  pointer-events: none; opacity: 0; transition: opacity 0.45s ease;
}
.shot iframe.ready { opacity: 1; }
.shot::after { /* 底部渐隐提示可点击 */
  content: "点击进入全屏演示";
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 26px 14px 10px; text-align: center;
  font: 600 11px/1 var(--g-sans); letter-spacing: 0.06em; color: #fff;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.72));
  opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.style-card:hover .shot::after { opacity: 1; }

.status-badge {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  font: 700 10px/1 var(--g-mono); letter-spacing: 0.08em;
  padding: 5px 9px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.status-badge.ok { background: rgba(34, 197, 94, 0.85); color: #052e12; }
.status-badge.sup { background: rgba(251, 191, 36, 0.88); color: #3c2a02; }
.status-badge.dep { background: rgba(100, 116, 139, 0.85); color: #0b1120; }

.card-meta { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-titles { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.card-titles h3 {
  margin: 0; font-family: var(--g-display);
  font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em;
}
.card-titles .card-zh {
  font-size: 12px; color: var(--g-accent2); font-weight: 600;
}
.card-desc {
  margin: 0; color: var(--g-muted); font-size: 12.8px; line-height: 1.62;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-chips { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.mini-chip {
  font: 600 10.5px/1 var(--g-sans); color: var(--g-muted);
  border: 1px solid var(--g-border); border-radius: 999px; padding: 4px 9px;
}
.mini-chip.cat { color: #a5b4fc; border-color: rgba(129, 140, 248, 0.35); }

.empty { text-align: center; color: var(--g-muted); padding: 60px 20px; font-size: 14px; }

/* ======= 页脚 ======= */
.site-foot {
  border-top: 1px solid var(--g-border); margin-top: 20px;
  padding: 30px 28px 40px; text-align: center;
  color: var(--g-muted); font-size: 12px; display: grid; gap: 6px;
}
.site-foot .mono { font-size: 11px; opacity: 0.8; }

/* ======= 详情页（style.html） ======= */
.detail-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.detail-head {
  flex: none; display: flex; align-items: center; gap: 18px;
  padding: 12px 20px; border-bottom: 1px solid var(--g-border);
  background: rgba(11, 17, 32, 0.6);
}
.back-link {
  flex: none; display: flex; align-items: center; gap: 7px;
  color: var(--g-muted); text-decoration: none;
  font: 600 12.5px var(--g-sans);
  border: 1px solid var(--g-border); border-radius: 10px;
  padding: 8px 14px; background: var(--g-card);
  transition: all 0.18s ease;
}
.back-link svg { width: 14px; height: 14px; }
.back-link:hover { color: var(--g-fg); border-color: rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.1); }

.d-title { min-width: 0; }
.d-title-row { display: flex; align-items: center; gap: 12px; }
.d-no { font-size: 11px; font-weight: 700; color: var(--g-accent); letter-spacing: 0.08em; }
.d-title h1 {
  margin: 0; font-family: var(--g-display); font-size: 19px;
  font-weight: 800; letter-spacing: -0.015em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.d-zh { margin: 1px 0 0; font-size: 12px; color: var(--g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.d-pos { font-size: 11px; color: var(--g-muted); min-width: 64px; text-align: center; }
.badge {
  flex: none; font: 700 10px/1 var(--g-mono); letter-spacing: 0.08em;
  padding: 5px 10px; border-radius: 999px;
}
.badge.ok { background: rgba(34, 197, 94, 0.16); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.badge.sup { background: rgba(251, 191, 36, 0.14); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.4); }
.badge.dep { background: rgba(100, 116, 139, 0.18); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.45); }
.nav-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--g-card); color: var(--g-fg);
  border: 1px solid var(--g-border); border-radius: 10px;
  transition: all 0.18s ease;
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover { border-color: rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.12); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.detail-main { flex: 1; min-height: 0; display: flex; }
.demo-stage {
  flex: 1; min-width: 0; position: relative;
  background:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow: auto;
}
.demo-frame {
  width: 100%; height: 100%;
  border-radius: 12px; overflow: hidden; position: relative;
  box-shadow: 0 22px 55px rgba(2, 6, 23, 0.6);
  background: #fff; transition: width 0.3s ease;
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.demo-frame.w-phone { width: 392px; max-width: 100%; }
.demo-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.demo-loading {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  color: var(--g-muted); font: 600 12px var(--g-mono); letter-spacing: 0.12em;
  background: #f8fafc;
}
.demo-loading i {
  width: 26px; height: 26px; margin-bottom: 12px; border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.25); border-top-color: var(--g-accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.detail-side {
  width: 316px; flex: none; border-left: 1px solid var(--g-border);
  padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
  background: rgba(11, 17, 32, 0.45);
}
.m-desc { margin: 0; font-size: 13.5px; line-height: 1.75; color: #d7e0ec; }
.side-sec h3 {
  margin: 0 0 10px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; color: var(--g-muted);
}
.side-sec h3::before { content: "· "; color: var(--g-accent); }

.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swatch {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--g-card); border: 1px solid var(--g-border);
  border-radius: 9px; padding: 6px 10px 6px 7px; cursor: pointer;
  transition: border-color 0.18s;
}
.swatch i {
  display: block; width: 18px; height: 18px; flex: none; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.swatch code {
  font: 500 10.5px var(--g-mono); color: var(--g-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swatch:hover { border-color: var(--g-border-strong); }

.meta-list { margin: 0; display: grid; gap: 9px; }
.meta-list > div { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: baseline; }
.meta-list dt { font: 600 10.5px/1.5 var(--g-mono); color: var(--g-muted); letter-spacing: 0.04em; }
.meta-list dd { margin: 0; font-size: 12.5px; line-height: 1.6; color: #d7e0ec; }
.meta-list .warn-text { color: #fca5a5; }
.meta-list .best-text { color: #86efac; }

.tagrow { display: flex; flex-wrap: wrap; gap: 7px; }
.tagrow span {
  font-size: 11.5px; color: #c7d2e4;
  background: var(--g-card); border: 1px solid var(--g-border);
  border-radius: 999px; padding: 5px 11px;
}

.font-list { display: grid; gap: 8px; }
.font-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: var(--g-card); border: 1px solid var(--g-border);
  border-radius: 9px; padding: 8px 12px;
}
.font-row code { font: 600 11.5px var(--g-mono); color: var(--g-fg); }
.font-row span { font-size: 10.5px; color: var(--g-muted); flex: none; }

.detail-missing { padding: 80px 20px; text-align: center; color: var(--g-muted); }
.detail-missing a { color: var(--g-accent); }

.seg { display: inline-flex; background: var(--g-card); border: 1px solid var(--g-border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn {
  appearance: none; border: 0; background: transparent; color: var(--g-muted);
  font: 600 12px var(--g-sans); padding: 7px 16px; border-radius: 8px;
  transition: all 0.18s ease;
}
.seg-btn.on { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.seg-btn:not(.on):hover { color: var(--g-fg); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #052e12; color: #86efac; border: 1px solid rgba(34, 197, 94, 0.5);
  font: 600 12.5px var(--g-sans); padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ======= 配色方案卡 ======= */
.palette-card .pal-strip {
  display: flex; height: 14px;
}
.palette-card .pal-strip i { flex: 1; }
.pal-preview {
  padding: 14px 16px 16px; border-bottom: 1px solid var(--g-border);
  display: flex; flex-direction: column; gap: 10px; min-height: 148px;
}
.pv-nav { display: flex; align-items: center; gap: 8px; }
.pv-logo { width: 16px; height: 16px; border-radius: 5px; background: currentColor; opacity: 0.25; }
.pv-link { width: 34px; height: 6px; border-radius: 3px; background: currentColor; opacity: 0.18; }
.pv-btn {
  margin-left: auto; font: 700 10.5px/1 var(--g-sans);
  padding: 6px 11px; border-radius: 7px; white-space: nowrap;
}
.pv-card {
  position: relative; border: 1px solid; border-radius: 11px;
  padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 7px;
}
.pv-badge {
  position: absolute; top: -9px; right: 10px;
  font: 700 8.5px/1 var(--g-mono); letter-spacing: 0.1em;
  padding: 4px 8px; border-radius: 999px;
}
.pv-title { font: 700 12.5px var(--g-sans); }
.pv-line { height: 6px; border-radius: 3px; background: currentColor; opacity: 0.3; }
.pv-line { display: block; width: 88%; }
.pv-line.short { width: 56%; }
.pv-row { display: flex; gap: 7px; margin-top: 3px; }
.pv-chip { width: 44px; height: 16px; border-radius: 6px; }
.pv-chip.ghost { border: 1px dashed; opacity: 0.7; }
.pal-swatches { margin-top: 2px; }
.pal-swatches .swatch code { font-size: 9.5px; }
.palette-card .card-desc { -webkit-line-clamp: 3; font-size: 12.2px; }

/* ======= 字体搭配卡 ======= */
.font-card .font-sample {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: #fbfbf9; border-bottom: 1px solid var(--g-border);
  display: flex; flex-direction: column; justify-content: center;
  gap: 8px; padding: 18px 22px;
}
.font-sample .fp-h {
  font-size: 26px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15;
  color: #17151f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.font-sample .fp-b { font-size: 12.5px; color: #33313c; line-height: 1.45; }
.font-sample .fp-cn {
  font-size: 15px; color: #17151f; line-height: 1.4; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.font-sample .fp-zh {
  font-size: 11px; color: #8a8794; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-cjk-note { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--g-muted); }
.card-cjk-note b { font-weight: 600; color: #9fb6d9; }
.font-sample::after {
  content: "加载字体…"; position: absolute; inset: 0; display: grid; place-items: center;
  background: #fbfbf9; color: #9a97a4; font: 600 11px var(--g-mono); letter-spacing: 0.1em;
  opacity: 1; transition: opacity 0.5s ease 0.15s;
}
.font-sample.font-loaded::after { opacity: 0; pointer-events: none; }
.font-pair-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fp-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 12px var(--g-mono); color: #e8eef7;
  background: var(--g-card2); border: 1px solid var(--g-border);
  border-radius: 999px; padding: 6px 12px;
}
.fp-pill .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--g-accent); }
.fp-pill .dot.body { background: var(--g-accent2); }
.fp-x { color: var(--g-muted); font-size: 12px; }
.fp-best { color: var(--g-accent2); font-weight: 600; }

/* ======= 图表选型卡 ======= */
.chart-card .chart-visual {
  position: relative; aspect-ratio: 16 / 8; overflow: hidden;
  background:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--g-border);
  display: grid; place-items: center; padding: 14px 20px;
}
.chart-svg { width: min(240px, 88%); height: auto; display: block; }
.risk-badge {
  position: absolute; top: 10px; right: 10px;
  font: 700 10px/1 var(--g-mono); letter-spacing: 0.06em;
  padding: 5px 10px; border-radius: 999px;
}
.risk-badge.risk-low { background: rgba(34, 197, 94, 0.16); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.risk-badge.risk-medium { background: rgba(251, 191, 36, 0.14); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.4); }
.risk-badge.risk-high { background: rgba(248, 113, 113, 0.14); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.4); }
.risk-badge.risk-conditional,
.risk-badge.risk-unknown { background: rgba(100, 116, 139, 0.18); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.45); }
.chart-best {
  margin: 0; font-family: var(--g-display); font-size: 15px;
  font-weight: 800; letter-spacing: -0.01em; color: #86efac;
}
.chart-alt { margin: 0; font-size: 12px; color: var(--g-muted); }
.chart-line {
  margin: 0; font-size: 12px; line-height: 1.6; color: #c3cddf;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chart-line b { font-weight: 600; margin-right: 5px; }
.chart-line b.ok-text { color: #86efac; }
.chart-line b.warn-text { color: #fca5a5; }
.chart-line b.mono-lb {
  font: 600 10.5px var(--g-mono); color: var(--g-muted);
  letter-spacing: 0.04em;
}

/* ======= 响应式 ======= */
@media (max-width: 1100px) {
  .site-head-inner { flex-wrap: wrap; row-gap: 8px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; }
  .site-nav a { padding: 8px 12px; }
}

@media (max-width: 900px) {
  .site-head-inner { padding: 12px 16px; gap: 12px; }
  .brand-sub { display: none; }
  .search { width: min(300px, 50vw); }
  .search kbd { display: none; }
  .hero { padding: 46px 18px 28px; }
  .hero-compact { padding: 36px 18px 24px; }
  .toolbar { top: 53px; padding: 12px 16px; gap: 10px; }
  .toolbar-right { margin-left: 0; }
  .grid { padding: 20px 16px 44px; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

  /* 详情页：上下堆叠 */
  .detail-body { height: auto; min-height: 100vh; overflow: auto; }
  .detail-head { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .d-title { flex: 1; min-width: 0; }
  .d-title h1 { font-size: 16px; white-space: normal; }
  .d-zh { white-space: normal; }
  .detail-nav { margin-left: 0; width: 100%; justify-content: flex-end; }
  .d-pos { display: none; }
  .detail-main { flex-direction: column; overflow-y: auto; }
  .demo-stage { min-height: 58vh; flex: none; padding: 12px; }
  .demo-frame { height: 56vh; }
  .detail-side { width: 100%; border-left: 0; border-top: 1px solid var(--g-border); }
}

/* 无动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
