/* 研图 · Figure Atlas */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e9ecf1;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --line: #e4e7ec;
  --line-strong: #cfd5de;
  --accent: #3b5bdb;
  --accent-strong: #2f4ac0;
  --accent-soft: #eef2ff;
  --accent-ink: #ffffff;
  --gold: #b7791f;
  --green: #0f8a5f;
  --artboard: #ffffff;
  --checker-a: #ffffff;
  --checker-b: #eceff3;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow: 0 10px 30px -12px rgba(17, 24, 39, .18);
  --shadow-lg: 0 24px 60px -20px rgba(17, 24, 39, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #161a21; --surface-2: #1c212a; --surface-3: #252b36; --ink: #e8eaed;
    --ink-2: #c7ccd4; --muted: #949cab; --faint: #6d7584; --line: #262c36; --line-strong: #353d4a;
    --accent: #7d93ff; --accent-strong: #9aabff; --accent-soft: #1d2340; --accent-ink: #0e1116;
    --gold: #e2b25c; --green: #43c595; --artboard: #f7f8fa; --checker-a: #2a303b; --checker-b: #222731;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161a21; --surface-2: #1c212a; --surface-3: #252b36; --ink: #e8eaed;
  --ink-2: #c7ccd4; --muted: #949cab; --faint: #6d7584; --line: #262c36; --line-strong: #353d4a;
  --accent: #7d93ff; --accent-strong: #9aabff; --accent-soft: #1d2340; --accent-ink: #0e1116;
  --gold: #e2b25c; --green: #43c595; --artboard: #f7f8fa; --checker-a: #2a303b; --checker-b: #222731;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-synthesis: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
img { display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.skip-link:focus { top: 12px; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-icon] svg, svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1480px; margin: 0 auto; height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { display: block; width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(66, 99, 235, .7); transition: transform .2s ease; }
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 19px; letter-spacing: 1.5px; }
.brand-text small { font-size: 10px; color: var(--muted); letter-spacing: 1.6px; text-transform: uppercase; margin-top: 3px; }
.topnav { display: flex; gap: 4px; }
.topnav button { padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 550; }
.topnav button:hover, .topnav button.active { background: var(--surface-2); color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--ink-2); }
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.pill-button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 550; box-shadow: var(--shadow-sm); }
.pill-button:hover { border-color: var(--line-strong); color: var(--ink); }
.pill-button b { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: 12px; text-align: center; }

/* ---------------------------------------------------------------- hero */
main { max-width: 1480px; margin: 0 auto; padding: 0 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; padding: 56px 0 36px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-weight: 650; font-size: 12.5px; letter-spacing: 1.2px; }
.hero h1 { margin: 0; font-size: clamp(34px, 4.2vw, 54px); line-height: 1.12; letter-spacing: -1.2px; font-weight: 720; }
.hero h1 span { background: linear-gradient(100deg, var(--accent) 10%, #8b5cf6 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin: 18px 0 26px; max-width: 600px; color: var(--muted); font-size: 15.5px; line-height: 1.8; }
.hero-lead b { color: var(--ink); font-variant-numeric: tabular-nums; }
.search { position: relative; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 16px 0 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 640px; transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow); }
.search > [data-icon] { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 15.5px; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 12px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; background: var(--surface-2); }
.search-clear { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.search-clear:hover { background: var(--surface-2); color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; max-width: 640px; }
.quick button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; }
.quick button:hover { border-color: var(--accent); color: var(--accent); }

.hero-art { position: relative; height: 380px; }
.hero-art .tile { position: absolute; border-radius: 16px; background: var(--artboard); border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 12px 12px 30px; overflow: hidden; transition: transform .4s ease; }
.hero-art .tile img { width: 100%; height: 100%; object-fit: contain; }
.hero-art .tile span { position: absolute; left: 12px; right: 12px; bottom: 8px; font-size: 11px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-art .tile:hover { transform: translateY(-4px) rotate(0deg) !important; z-index: 5; }
.hero-art .t1 { left: 0; top: 30px; width: 46%; height: 62%; transform: rotate(-3deg); }
.hero-art .t2 { left: 40%; top: 0; width: 38%; height: 50%; transform: rotate(2.5deg); z-index: 2; }
.hero-art .t3 { right: 0; top: 70px; width: 30%; height: 44%; transform: rotate(4deg); }
.hero-art .t4 { left: 30%; bottom: 0; width: 44%; height: 42%; transform: rotate(-1.5deg); z-index: 3; }
.hero-art .t5 { right: 2%; bottom: 10px; width: 26%; height: 34%; transform: rotate(-4deg); z-index: 1; }
.hero-art .chip { position: absolute; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; color: var(--ink-2); z-index: 6; }
.hero-art .chip img { width: 26px; height: 26px; }
.hero-art .c1 { left: -14px; bottom: 26px; }
.hero-art .c2 { right: 18px; top: 8px; }

/* ---------------------------------------------------------------- stats & tabs */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 8px 0 30px; }
.stat { text-align: left; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; }
button.stat:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }
.tabs { position: sticky; top: 64px; z-index: 20; display: flex; gap: 6px; padding: 10px 0; margin-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.tabs button > span:not([data-icon]) { font-size: 12px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tabs button[aria-selected="true"] > span:not([data-icon]) { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* ---------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 32px; padding: 18px 0 60px; }
.sidebar { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 146px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sidebar-head h2 { margin: 0; font-size: 15px; }
.sidebar-close { display: none; }
.link-button { color: var(--muted); font-size: 12.5px; }
.link-button:hover { color: var(--accent); }
.filter-block { padding: 14px 0; border-top: 1px solid var(--line); }
.filter-block h3 { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .6px; }
.facet { display: flex; flex-direction: column; gap: 2px; }
.facet button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 9px; border-radius: 8px; text-align: left; color: var(--ink-2); font-size: 13px; }
.facet button:hover { background: var(--surface-2); color: var(--ink); }
.facet button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.facet button .count { margin-left: auto; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.facet button.active .count { color: var(--accent); }
.facet button .sub { color: var(--faint); font-size: 11.5px; }
.facet .group-label { margin: 10px 9px 4px; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.facet .more-toggle { color: var(--accent); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 9px; padding: 6px 2px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.filter-note { display: flex; gap: 10px; margin-top: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.7; }
.filter-note p { margin: 0; }

/* ---------------------------------------------------------------- toolbar */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.toolbar h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar-controls { display: flex; align-items: center; gap: 8px; }
.toolbar select { height: 36px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; -webkit-appearance: none; color: var(--ink-2); }
.filters-toggle { display: none !important; }
.color-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 13px; }
.color-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.color-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--icon-color, #1f2937); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 14px; }
.active-filters button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 550; }
.active-filters button svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- grid */
.grid { --cols: 4; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.grid.icons { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .16s ease, box-shadow .16s ease, border-color .16s; content-visibility: auto; contain-intrinsic-size: 260px; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-open { display: flex; flex-direction: column; text-align: left; width: 100%; height: 100%; }
.card-art { position: relative; aspect-ratio: 4 / 3; background: var(--artboard); border-bottom: 1px solid var(--line); overflow: hidden; }
.card-art img, .card-art .glyph { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; }
.card-art .kind { position: absolute; z-index: 1; left: 10px; top: 10px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: rgba(17, 24, 39, .72); color: #fff; letter-spacing: .3px; }
.card-art .kind.atomic { background: rgba(183, 121, 31, .88); }
.card-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; min-height: 74px; }
.card-title { margin: 0; font-size: 13.5px; font-weight: 620; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.card-meta .model { color: var(--ink-2); font-weight: 600; flex-shrink: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; }
.card-meta .venue { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.save { position: absolute; right: 9px; top: 9px; z-index: 2; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .92); color: #4b5563; box-shadow: 0 2px 8px rgba(17, 24, 39, .14); opacity: 0; transition: opacity .15s; }
.card:hover .save, .card:focus-within .save, .save.on { opacity: 1; }
.save.on { color: #d97706; }
.save.on svg { fill: currentColor; }

.icon-card { contain-intrinsic-size: 150px; }
.icon-card .card-art { aspect-ratio: 1; }
.icon-card .card-art img, .icon-card .card-art .glyph { inset: 22%; width: 56%; height: 56%; }
.icon-card .glyph { display: block; background: var(--icon-color, #1f2937); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.icon-card .card-body { padding: 8px 10px 10px; min-height: 52px; gap: 1px; }
.icon-card .card-title { font-size: 12.5px; font-weight: 560; -webkit-line-clamp: 1; text-align: center; }
.icon-card .card-meta { justify-content: center; font-size: 11px; }
.icon-card .save { width: 28px; height: 28px; right: 6px; top: 6px; }
.icon-card .save svg { width: 15px; height: 15px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; border: 1px solid var(--line); height: 270px; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 26px; color: var(--muted); font-size: 12.5px; }
.ghost-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; }
.ghost-button:hover { border-color: var(--line-strong); color: var(--ink); }
.ghost-button.small { height: 32px; padding: 0 11px; font-size: 12.5px; }
.ghost-button svg { width: 15px; height: 15px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 650; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.primary-button:hover { background: var(--accent-strong); }
.empty, .error { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty > [data-icon] svg { width: 34px; height: 34px; color: var(--faint); }
.empty h3, .error h3 { color: var(--ink); margin: 12px 0 6px; }
.empty p, .error p { margin: 0 auto 18px; max-width: 420px; }

/* ---------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 12, 16, .42); backdrop-filter: blur(2px); animation: fade .18s ease; }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; padding: 0 14px 0 22px; border-bottom: 1px solid var(--line); }
.drawer-crumb { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-nav { display: flex; gap: 2px; }
.drawer-body { flex: 1; overflow-y: auto; }
.stage { position: relative; height: min(46vh, 430px); border-bottom: 1px solid var(--line); background: var(--artboard); }
.stage[data-bg="checker"] { background: conic-gradient(var(--checker-a) 25%, var(--checker-b) 0 50%, var(--checker-a) 0 75%, var(--checker-b) 0) 0 0 / 18px 18px; }
.stage[data-bg="dark"] { background: #111827; }
.stage img { position: absolute; left: 26px; right: 26px; top: 24px; bottom: 54px; width: calc(100% - 52px); height: calc(100% - 78px); object-fit: contain; }
.stage.icon img { left: 50%; top: calc(50% - 15px); width: min(240px, 60%); height: min(240px, 60%); transform: translate(-50%, -50%); }
.stage-tools { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #6b7280; }
.stage[data-bg="dark"] .stage-tools { color: #9ca3af; }
.stage-open { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: #4b5563; font-weight: 550; }
.stage[data-bg="dark"] .stage-open { color: #d1d5db; }
.stage-open svg { width: 14px; height: 14px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: rgba(17, 24, 39, .07); gap: 2px; }
.stage[data-bg="dark"] .segmented { background: rgba(255, 255, 255, .12); }
.segmented button { padding: 3px 9px; border-radius: 7px; font-size: 12px; color: inherit; }
.segmented button[aria-pressed="true"] { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.detail { padding: 22px 26px 34px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badges span { padding: 2px 9px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 550; }
.badges .accent { background: var(--accent-soft); color: var(--accent); }
.badges .warn { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.detail h2 { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -.3px; }
.detail-en { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.detail-desc { margin: 14px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.recolor { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.recolor label { font-size: 12.5px; color: var(--muted); }
.recolor input[type="color"] { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.actions .primary-button svg, .actions .ghost-button svg { width: 16px; height: 16px; }
.png-size { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.png-size .segmented { background: var(--surface-2); }
.png-size .segmented button { color: var(--ink-2); }
.png-size .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.caption { margin: 22px 0 0; }
.caption figcaption { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .5px; margin-bottom: 8px; }
.caption blockquote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.75; font-family: Georgia, "Times New Roman", var(--font); }
.source-card { margin-top: 20px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); }
.source-card h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.source-title { margin: 0; font-weight: 650; line-height: 1.5; }
.source-meta { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.source-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.source-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; font-size: 13px; }
.source-links a:hover { text-decoration: underline; }
.source-links svg { width: 14px; height: 14px; }
.cite { display: flex; gap: 8px; margin-top: 12px; }
.meta { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 9px 14px; margin: 20px 0 0; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.meta dd a { color: var(--accent); }
.meta dd a:hover { text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tags button { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.tags button:hover { border-color: var(--accent); color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13px; box-shadow: var(--shadow-lg); animation: fade .2s ease; }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 28px; display: flex; justify-content: space-between; gap: 30px; color: var(--muted); font-size: 12.5px; }
.footer strong { color: var(--ink); font-size: 13.5px; }
.footer p { margin: 6px 0 0; max-width: 640px; line-height: 1.7; }
.footer-links { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-art { height: 300px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats .static { display: none; }
}
@media (max-width: 900px) {
  .topnav { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 45; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); max-height: none; padding: 18px; background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(-104%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .sidebar-close { display: inline-flex; }
  .filters-toggle { display: inline-flex !important; }
  .color-label { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner, main, .footer-inner { padding-left: 16px; padding-right: 16px; }
  .topbar-actions .pill-button span:not([data-icon]) { display: none; }
  .hero { padding: 26px 0 18px; gap: 18px; }
  .hero-art { display: none; }
  .hero-lead { font-size: 14px; }
  .search { height: 52px; }
  .search kbd { display: none; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 19px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-controls { justify-content: space-between; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.icons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .card-body { padding: 9px 10px 11px; }
  .save { opacity: 1; }
  .drawer { width: 100vw; }
  .stage { height: 38vh; }
  .detail { padding: 18px 16px 28px; }
  .meta { grid-template-columns: 80px minmax(0, 1fr); }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 图元 is the lead collection */
.stat.lead { background: linear-gradient(135deg, #4263eb, #7048e8); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -12px rgba(66, 99, 235, .8); }
.stat.lead span { color: rgba(255, 255, 255, .82); }
button.stat.lead:hover { border-color: transparent; filter: brightness(1.06); }
.card-art .kind.atomic { background: rgba(59, 91, 219, .88); }
.empty-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -4px 0 16px; }
