/* ==========================================================================
   星轨百科 · 样式表
   设计目标：移动优先、MediaWiki / 萌娘百科式阅读感、纯静态零依赖
   ========================================================================== */
:root {
  --bg: #f4f5f9;
  --bg-soft: #eceef5;
  --paper: #ffffff;
  --paper-2: #fafbfe;
  --paper-3: #f3f5fb;
  --ink: #202333;
  --ink-2: #34384c;
  --muted: #6d7287;
  --muted-2: #8b90a3;
  --line: #e2e5ef;
  --line-strong: #cbd0e0;
  --link: #2168b3;
  --link-hover: #0d4a86;
  --accent: #7468e8;
  --accent-2: #d96fa6;
  --accent-3: #3fb8b0;
  --good: #2f8f62;
  --warn: #b4761f;
  --danger: #c24d55;
  --shadow: 0 10px 30px rgba(28, 35, 66, .07);
  --shadow-sm: 0 3px 12px rgba(28, 35, 66, .06);
  --shadow-lg: 0 24px 70px rgba(24, 30, 58, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --header-h: 68px;
  --max: 1240px;
  --el: #9aa0b5;
  --el-2: #c9cede;
}

/* 属性色：由 data-el 驱动，卡片、信息框与搜索图标共用 */
[data-el="物理"] { --el: #a9adbd; --el-2: #d7dae5; }
[data-el="火"]   { --el: #ef6a5e; --el-2: #ffb27a; }
[data-el="冰"]   { --el: #59c1e6; --el-2: #a9e8f7; }
[data-el="雷"]   { --el: #a97bef; --el-2: #d7b7ff; }
[data-el="风"]   { --el: #52c99a; --el-2: #a6ecd0; }
[data-el="量子"] { --el: #7276ed; --el-2: #b6b8ff; }
[data-el="虚数"] { --el: #d9b34e; --el-2: #ffe09a; }

[data-theme="dark"] {
  --bg: #11131c;
  --bg-soft: #0c0e15;
  --paper: #191c28;
  --paper-2: #1c2030;
  --paper-3: #222739;
  --ink: #eceef8;
  --ink-2: #d8dbea;
  --muted: #a3a8bd;
  --muted-2: #83889e;
  --line: #2a3043;
  --line-strong: #3a4158;
  --link: #7db8ff;
  --link-hover: #a9d1ff;
  --accent: #a89bff;
  --accent-2: #f090c0;
  --accent-3: #65d8cf;
  --good: #63c894;
  --warn: #e0b266;
  --danger: #f08a90;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, .22);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(116, 104, 232, .10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(217, 111, 166, .08), transparent 55%),
    var(--bg);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
::selection { background: rgba(116, 104, 232, .24); }
a { color: var(--link); text-decoration: none; text-underline-offset: .18em; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  font-family: var(--font-mono);
  font-size: .74em;
  padding: .12em .42em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--paper-2);
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 12px; z-index: 300;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 10px; color: var(--paper); }

/* ---------------------------------- header --------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; height: var(--header-h);
  padding: 0 22px; display: flex; align-items: center; gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; font-size: 19px;
  background: linear-gradient(135deg, #6f7cff, #b48bff 55%, #ff9ac4);
  box-shadow: 0 5px 16px rgba(116, 104, 232, .35);
}
.brand-mark.small { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
.brand-text { display: grid; line-height: 1.12; }
.brand-text strong { font-size: 17px; letter-spacing: .06em; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: .08em; margin-top: 3px; }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.main-nav a {
  padding: 8px 11px; border-radius: 9px; color: var(--ink-2); font-size: 14.5px;
  font-weight: 500; white-space: nowrap;
}
.main-nav a:hover { background: var(--paper-3); text-decoration: none; color: var(--ink); }
.main-nav a.active { color: var(--link); background: color-mix(in srgb, var(--link) 9%, transparent); }
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.search-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2);
  color: var(--muted); font-size: 13px; min-width: 240px;
}
.search-pill:hover { border-color: var(--line-strong); background: var(--paper); color: var(--ink-2); }
.search-pill-icon { font-size: 17px; line-height: 1; transform: translateY(-1px); }
.search-pill-label { flex: 1; text-align: left; }
.icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-2); display: grid; place-items: center; font-size: 17px;
}
.icon-btn:hover { background: var(--paper); border-color: var(--line-strong); }
.menu-btn { display: none; }
.mobile-menu {
  border-top: 1px solid var(--line); background: var(--paper); padding: 10px 18px 16px;
}
.mobile-menu nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mobile-menu a {
  display: flex; justify-content: space-between; padding: 11px 12px; border-radius: 10px;
  background: var(--paper-2); color: var(--ink-2); font-size: 14px;
}
.mobile-menu a span { color: var(--muted-2); font-size: 12px; }
.mobile-menu a:hover, .mobile-menu a.active { color: var(--link); background: color-mix(in srgb, var(--link) 8%, transparent); text-decoration: none; }

/* ----------------------------------- app ---------------------------------- */
#app { flex: 1 0 auto; width: 100%; max-width: var(--max); margin: 0 auto; padding: 26px 22px 72px; min-height: 70vh; }
#app:focus { outline: none; }
.page { animation: page-in .38s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.loading { min-height: 45vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.loading-star { display: block; font-size: 34px; color: var(--accent); animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  margin: 0 0 8px; color: var(--accent); font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.page-head { margin-bottom: 22px; }
.page-title {
  margin: 0; font-family: var(--font-display); font-size: clamp(29px, 4.6vw, 44px);
  line-height: 1.22; letter-spacing: .02em; font-weight: 800;
}
.page-title .sub { display: block; font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: .04em; margin-top: 8px; }
.page-lead { margin: 10px 0 0; color: var(--muted); max-width: 76ch; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 34px 0 14px; }
.section-head h2 {
  margin: 0; font-family: var(--font-display); font-size: clamp(20px, 2.7vw, 26px);
  line-height: 1.3; letter-spacing: .02em;
}
.section-head h2::before {
  content: ""; display: inline-block; width: 4px; height: 1.05em; margin-right: 10px;
  border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  vertical-align: -.12em;
}
.section-head .more { font-size: 13px; color: var(--muted); white-space: nowrap; }
.section-head .more:hover { color: var(--link); }

/* ---------------------------------- hero ---------------------------------- */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .75fr);
  gap: 20px; padding: clamp(22px, 4vw, 40px); border: 1px solid var(--line);
  border-radius: var(--radius-lg); background:
    radial-gradient(700px 280px at 85% 0%, rgba(217, 111, 166, .18), transparent 60%),
    radial-gradient(600px 320px at 0% 100%, rgba(63, 184, 176, .14), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--paper) 92%, #eef0ff), var(--paper));
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before { width: 220px; height: 220px; right: 18%; top: -110px; border: 1px solid rgba(116, 104, 232, .22); }
.hero::after { width: 420px; height: 420px; right: -180px; bottom: -260px; border: 1px solid rgba(217, 111, 166, .18); }
.hero-copy { position: relative; z-index: 1; min-width: 0; }
.hero h1 {
  margin: 0; font-family: var(--font-display); font-size: clamp(38px, 7vw, 72px);
  line-height: 1.04; letter-spacing: .04em;
  background: linear-gradient(120deg, var(--ink) 0%, #5d55c9 52%, #c45895 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .hero h1 { background: linear-gradient(120deg, #fff, #b7a8ff 50%, #ff9ec8); -webkit-background-clip: text; background-clip: text; }
.hero .hero-kicker { margin: 0 0 10px; color: var(--muted); font-size: 13px; letter-spacing: .12em; }
.hero .lead { margin: 16px 0 0; max-width: 55ch; color: var(--ink-2); font-size: 15.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--ink); }
.btn.primary { background: linear-gradient(135deg, #6f7cff, #a77cf0 58%, #e482b5); border-color: transparent; color: #fff; }
.btn.primary:hover { color: #fff; box-shadow: 0 10px 24px rgba(116, 104, 232, .3); }
.btn.ghost { background: transparent; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 18px 26px; margin-top: 28px; }
.hero-stats div { display: grid; }
.hero-stats strong { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.hero-stats span { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; margin-top: 4px; }

.version-card {
  position: relative; z-index: 1; align-self: stretch; display: flex; flex-direction: column;
  padding: 20px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}
.version-card .vc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.version-card .badge-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--good); letter-spacing: .08em; }
.version-card .badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 15%, transparent); }
.version-card .ver { font-family: var(--font-display); font-size: 34px; line-height: 1; margin: 12px 0 4px; }
.version-card .ver-name { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.version-card .banner-name { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.version-card .banner-name strong { color: var(--ink); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 6px; }
.countdown div { text-align: center; padding: 7px 2px; border-radius: 8px; background: var(--paper-3); border: 1px solid var(--line); }
.countdown strong { display: block; font-family: var(--font-mono); font-size: 18px; line-height: 1.2; }
.countdown span { font-size: 9.5px; color: var(--muted); letter-spacing: .08em; }
.version-card .vc-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.version-card .vc-link { margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 600; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--line)); border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 7%, var(--paper)); color: var(--ink-2); font-size: 12.5px;
}
.notice strong { color: var(--warn); }
.notice.info { border-color: color-mix(in srgb, var(--link) 24%, var(--line)); background: color-mix(in srgb, var(--link) 5%, var(--paper)); }
.notice.info strong { color: var(--link); }

/* --------------------------------- portals -------------------------------- */
.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.portal {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 5px;
  min-height: 118px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow-sm); transition: transform .18s, border-color .18s;
}
.portal:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); text-decoration: none; }
.portal .p-icon { font-size: 20px; color: var(--accent); }
.portal strong { font-size: 16px; color: var(--ink); }
.portal span { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.portal .p-count { margin-top: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.portal::after {
  content: "→"; position: absolute; right: 16px; bottom: 14px; color: var(--muted-2);
  font-size: 14px; transition: transform .18s, color .18s;
}
.portal:hover::after { transform: translateX(3px); color: var(--accent); }

/* -------------------------------- char cards ------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 2px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2);
  color: var(--ink-2); font-size: 11.5px; line-height: 1.4; white-space: nowrap;
}
a.chip:hover { text-decoration: none; border-color: var(--line-strong); color: var(--link); background: var(--paper); }
.chip.solid { background: color-mix(in srgb, var(--accent) 9%, var(--paper)); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); color: var(--accent); }
.chip.el { color: var(--el); border-color: color-mix(in srgb, var(--el) 30%, var(--line)); background: color-mix(in srgb, var(--el) 8%, var(--paper)); }
.chip.path { color: var(--ink-2); }
.chip.rarity-5 { color: #b07816; border-color: #e8c37d; background: #fdf6e7; }
[data-theme="dark"] .chip.rarity-5 { color: #f0c36d; border-color: #5c4a28; background: #2a2418; }
.chip.rarity-4 { color: #6a58bf; border-color: #c8bdf2; background: #f5f1ff; }
[data-theme="dark"] .chip.rarity-4 { color: #b9aaff; border-color: #423a69; background: #201c33; }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; }
.char-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.char-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--el) 38%, var(--line)); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.char-card .card-portrait { position: relative; height: 116px; overflow: hidden; background:
  radial-gradient(120px 90px at 78% 20%, color-mix(in srgb, var(--el) 34%, transparent), transparent 70%),
  linear-gradient(135deg, color-mix(in srgb, var(--el) 18%, var(--paper)), color-mix(in srgb, var(--el-2) 13%, var(--paper)));
}
[data-theme="dark"] .char-card .card-portrait { background:
  radial-gradient(120px 90px at 78% 20%, color-mix(in srgb, var(--el) 38%, transparent), transparent 70%),
  linear-gradient(135deg, color-mix(in srgb, var(--el) 16%, #141722), color-mix(in srgb, var(--el-2) 9%, #141722));
}
.char-card .card-portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--paper) 92%, transparent));
}
.char-card .glyph {
  position: absolute; right: 12px; bottom: -10px; font-family: var(--font-display);
  font-size: 70px; line-height: 1; color: color-mix(in srgb, var(--el) 36%, transparent);
  font-weight: 900; letter-spacing: -.06em; user-select: none;
}
.char-card .el-orb {
  position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 12px;
  background: linear-gradient(135deg, var(--el), var(--el-2)); box-shadow: 0 3px 10px color-mix(in srgb, var(--el) 35%, transparent);
}
.char-card .rarity {
  position: absolute; right: 12px; top: 12px; z-index: 1; font-size: 10.5px; color: #fff;
  background: rgba(24, 27, 42, .55); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  padding: 2px 8px; backdrop-filter: blur(4px);
}
.char-card .card-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 5px; padding: 0 14px 14px; margin-top: -8px; }
.char-card h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: .02em; }
.char-card .en { font-size: 10.5px; color: var(--muted-2); letter-spacing: .03em; }
.char-card .role { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-card .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 3px; }
.char-card .ver { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); }
.stars { color: #d9a62e; font-size: 10px; letter-spacing: 1px; }
[data-theme="dark"] .stars { color: #f0c36d; }

/* --------------------------------- filters -------------------------------- */
.filter-panel {
  margin: 0 0 16px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow-sm);
}
.filter-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-top .field { flex: 1 1 240px; min-width: 0; }
.field { position: relative; display: flex; align-items: center; }
.field .f-icon { position: absolute; left: 11px; color: var(--muted-2); font-size: 15px; pointer-events: none; }
.field input, .field select {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--paper-2); color: var(--ink); font-size: 13px;
}
.field input { padding-left: 33px; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 9px; }
.filter-row .label { font-size: 11px; color: var(--muted-2); letter-spacing: .08em; min-width: 34px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button {
  min-height: 28px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-2); color: var(--muted); font-size: 11.5px;
}
.seg button:hover { color: var(--ink); border-color: var(--line-strong); }
.seg button.active { color: var(--link); border-color: color-mix(in srgb, var(--link) 35%, var(--line)); background: color-mix(in srgb, var(--link) 8%, var(--paper)); font-weight: 600; }
.result-count { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper-2); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* ------------------------------- article page ------------------------------ */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--link); }
.breadcrumbs .sep { color: var(--line-strong); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 24px; align-items: start; }
.article-main { min-width: 0; }
.article-main > .article-title-block { margin-bottom: 18px; }
.article-title-block h1 {
  margin: 0; font-family: var(--font-display); font-size: clamp(30px, 4.8vw, 46px);
  line-height: 1.2; letter-spacing: .02em;
}
.article-title-block .en-title { font-size: 12px; color: var(--muted-2); letter-spacing: .08em; margin-top: 3px; }
.article-title-block .subtitle { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.article-body {
  padding: clamp(18px, 3vw, 30px); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow-sm); min-width: 0; overflow-wrap: anywhere;
}
.article-body h2 {
  margin: 30px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-size: 23px; line-height: 1.35; letter-spacing: .02em;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.article-body h2:first-child { margin-top: 0; }
.article-body h2 .h2-num { color: var(--accent); font-family: var(--font-mono); font-size: 12px; margin-right: 8px; letter-spacing: .05em; }
.article-body h3 { margin: 22px 0 8px; font-size: 16.5px; color: var(--ink-2); }
.article-body p { margin: 9px 0; }
.article-body ul, .article-body ol { margin: 8px 0; padding-left: 1.4em; }
.article-body li { margin: 4px 0; }
.article-body strong { color: var(--ink); }
.article-body .lead { font-size: 16px; color: var(--ink-2); }
.article-body blockquote {
  margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--accent);
  background: var(--paper-2); color: var(--ink-2); border-radius: 0 8px 8px 0; font-size: 14px;
}
.article-body .hatnote {
  margin: 0 0 16px; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper-2); color: var(--muted); font-size: 12.5px;
}
.article-body .hatnote strong { color: var(--ink-2); }
.toc {
  margin: 0 0 20px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-2); font-size: 13px;
}
.toc-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.35em; columns: 2; column-gap: 24px; }
.toc li { margin: 2px 0; break-inside: avoid; }
.toc a { color: var(--muted); }
.toc a:hover, .toc a.active { color: var(--link); font-weight: 600; }
.toc .toc-close { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 2px 5px; }

.infobox {
  position: sticky; top: calc(var(--header-h) + 16px); overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow-sm); font-size: 12.5px; min-width: 0;
}
.infobox .info-portrait {
  position: relative; height: 150px; overflow: hidden;
  background:
    radial-gradient(180px 120px at 80% 10%, color-mix(in srgb, var(--el) 45%, transparent), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--el) 24%, var(--paper)), color-mix(in srgb, var(--el-2) 14%, var(--paper)));
}
.infobox .info-portrait .glyph { position: absolute; right: 12px; bottom: -28px; font-family: var(--font-display); font-size: 112px; font-weight: 900; line-height: 1; color: color-mix(in srgb, var(--el) 38%, transparent); }
.infobox .info-portrait .info-name { position: absolute; left: 16px; bottom: 12px; z-index: 1; }
.infobox .info-portrait .info-name strong { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.infobox .info-portrait .info-name span { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.info-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.info-table th, .info-table td { padding: 7px 12px; border-top: 1px solid var(--line); vertical-align: top; text-align: left; overflow-wrap: anywhere; word-break: break-word; }
.info-table th { width: 68px; color: var(--muted); font-weight: 500; white-space: normal; background: var(--paper-2); }
.info-table td { color: var(--ink-2); }
.info-table tr:first-child th, .info-table tr:first-child td { border-top: 0; }
.info-quote { margin: 0; padding: 11px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.65; background: var(--paper-2); }
.info-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 12px; border-top: 1px solid var(--line); }
.info-links .chip { font-size: 11px; }
.cat-links { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.cat-links a { margin-right: 8px; }

/* ---------------------------------- skills -------------------------------- */
.skill-list { display: grid; gap: 9px; margin-top: 12px; }
.skill {
  display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2);
}
.skill .sk-type { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .04em; padding-top: 2px; }
.skill .sk-name { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.skill .sk-desc { color: var(--muted); font-size: 12.5px; line-height: 1.65; margin-top: 2px; }
.skill:first-child { margin-top: 0; }

/* ---------------------------------- build --------------------------------- */
.build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.build-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.build-box h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.build-box p { margin: 0; font-size: 13px; color: var(--ink-2); }
.build-box ul { margin: 0; padding-left: 1.1em; font-size: 12.5px; color: var(--ink-2); }
.build-box li { margin: 2px 0; }
.build-note { margin-top: 10px; padding: 10px 13px; border-left: 3px solid var(--accent-3); background: var(--paper-2); border-radius: 0 8px 8px 0; font-size: 12.5px; color: var(--muted); }
.lc-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.lc-list .chip { font-size: 11px; }

/* ---------------------------------- teams --------------------------------- */
.team-list { display: grid; gap: 9px; margin-top: 12px; }
.team-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(135deg, var(--paper-2), color-mix(in srgb, var(--accent) 3%, var(--paper)));
}
.team-card .team-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.team-card strong { font-size: 13.5px; }
.team-card .members { font-size: 12px; color: var(--link); margin: 3px 0; }
.team-card p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* -------------------------------- relation -------------------------------- */
.rel-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.rel-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); font-size: 12px;
}
.rel-chip:hover { text-decoration: none; border-color: var(--line-strong); background: var(--paper); }
.rel-chip .mini-avatar {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--el), var(--el-2));
}
.rel-chip small { color: var(--muted); }
.relation-wrap { overflow-x: auto; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.relation-svg { display: block; min-width: 620px; width: 100%; height: auto; }
.rel-link { stroke: color-mix(in srgb, var(--accent) 35%, var(--line)); stroke-width: 1.4; }
.rel-node { cursor: pointer; }
.rel-node circle { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.4; }
.rel-node.center circle { fill: color-mix(in srgb, var(--accent) 12%, var(--paper)); stroke: var(--accent); stroke-width: 2.4; }
.rel-node text { fill: var(--ink); font-family: var(--font-sans); font-size: 12px; text-anchor: middle; }
.rel-node .rel-sub { fill: var(--muted); font-size: 9.5px; }
.rel-node:hover circle { stroke: var(--accent); }
.rel-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }

/* --------------------------------- stories -------------------------------- */
.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.story-card {
  position: relative; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .18s, border-color .18s;
}
.story-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); text-decoration: none; }
.story-card .era { font-size: 10.5px; color: var(--accent); letter-spacing: .12em; font-weight: 700; }
.story-card h3 { margin: 4px 0 3px; font-family: var(--font-display); font-size: 20px; }
.story-card .sub { font-size: 12px; color: var(--muted); }
.story-card p { margin: 9px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 10.5px; color: var(--muted-2); }
.spoiler-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 10%, var(--paper)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); font-size: 10px; }

.story-hero {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(217, 111, 166, .15), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--paper) 94%, #eef0ff), var(--paper));
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.story-hero .era { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.story-hero h1 { margin: 4px 0 4px; font-family: var(--font-display); font-size: clamp(30px, 4.8vw, 46px); line-height: 1.2; }
.story-hero .sub { color: var(--muted); font-size: 14px; }
.story-hero .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.acts { display: grid; gap: 10px; margin-top: 12px; counter-reset: act; }
.act {
  position: relative; padding: 13px 15px 13px 46px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--paper-2); counter-increment: act;
}
.act::before {
  content: counter(act, decimal-leading-zero); position: absolute; left: 12px; top: 13px;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 700;
}
.act strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.act p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* --------------------------------- timeline -------------------------------- */
.timeline { position: relative; display: grid; gap: 10px; margin-top: 14px; }
.timeline::before { content: ""; position: absolute; left: 47px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.version-item { position: relative; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; align-items: start; }
.version-item .v-label { position: relative; z-index: 1; padding-top: 6px; text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.version-item .v-dot { position: absolute; left: 43px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong); z-index: 2; }
.version-item.current .v-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.version-item.current .v-label { color: var(--accent); font-weight: 700; }
.version-box {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.version-box .v-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.version-box strong { font-size: 14.5px; }
.version-box .v-name { font-family: var(--font-display); font-size: 16px; }
.version-box .v-date { font-size: 10.5px; color: var(--muted-2); margin-left: auto; font-family: var(--font-mono); }
.version-box p { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
.version-box .chips { margin-top: 7px; }
.era-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }

/* --------------------------------- glossary ------------------------------- */
.glossary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.glossary-card {
  display: flex; flex-direction: column; gap: 4px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow-sm); color: var(--ink); transition: transform .18s, border-color .18s;
}
.glossary-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); text-decoration: none; }
.glossary-card .cat { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: .1em; }
.glossary-card h3 { margin: 0; font-size: 15.5px; }
.glossary-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.glossary-card .rel { margin-top: auto; padding-top: 6px; font-size: 10.5px; color: var(--muted-2); }

/* ---------------------------------- guides -------------------------------- */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-card {
  display: flex; flex-direction: column; gap: 5px; padding: 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .18s, border-color .18s;
}
.guide-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); text-decoration: none; }
.guide-card .g-cat { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: .1em; }
.guide-card h3 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.guide-card .g-sub { font-size: 11.5px; color: var(--muted-2); }
.guide-card p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.guide-card .g-foot { margin-top: auto; padding-top: 10px; font-size: 10.5px; color: var(--muted-2); display: flex; justify-content: space-between; }
.guide-sections { display: grid; gap: 10px; margin-top: 14px; }
.guide-section { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.guide-section h2 { margin: 0 0 5px; border: 0; padding: 0; font-family: var(--font-sans); font-size: 15px; color: var(--ink); }
.guide-section p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------- search -------------------------------- */
.search-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 20px; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 22, .55); backdrop-filter: blur(5px); }
.search-panel {
  position: relative; width: min(720px, 100%); max-height: 80vh; display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-radius: 16px; background: var(--paper);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: search-in .18s ease-out both;
}
@keyframes search-in { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }
.search-field { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-field span { color: var(--muted); font-size: 20px; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; height: 32px; }
.search-field input::placeholder { color: var(--muted-2); }
.search-results { overflow-y: auto; padding: 7px; min-height: 90px; }
.search-group-label { padding: 7px 10px 4px; font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--muted-2); text-transform: uppercase; }
.search-result {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink);
}
.search-result:hover, .search-result.active { background: var(--paper-3); text-decoration: none; color: var(--ink); }
.search-result .sr-icon {
  width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
  font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--el, #7468e8), var(--el-2, #d96fa6));
}
.search-result .sr-main { min-width: 0; display: grid; }
.search-result .sr-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result .sr-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result .sr-type { margin-left: auto; font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.search-result mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.search-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); background: var(--paper-2); }
.search-footer a { margin-left: auto; font-size: 11px; }
body.modal-open { overflow: hidden; }

/* -------------------------------- search page ------------------------------ */
.search-page-box { max-width: 760px; margin: 0 auto; }
.search-page-box .search-field { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-sm); }
.search-page-results { margin-top: 16px; }
.search-page-results .search-result { padding: 10px 12px; border-bottom: 1px solid var(--line); border-radius: 0; }
.search-page-results .search-result:last-child { border-bottom: 0; }

/* --------------------------------- versions -------------------------------- */
.banner-panel {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
  padding: 20px 22px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--radius); background:
    radial-gradient(400px 160px at 100% 0%, rgba(217, 111, 166, .16), transparent 65%),
    var(--paper); box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.banner-panel h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 24px; }
.banner-panel p { margin: 2px 0; font-size: 12.5px; color: var(--muted); }
.banner-panel .banner-date { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.banner-panel .countdown { min-width: 230px; margin: 0; }

/* ---------------------------------- about --------------------------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.about-box { padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.about-box h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 20px; }
.about-box p, .about-box li { font-size: 13px; color: var(--muted); }
.about-box ul { margin: 6px 0; padding-left: 1.2em; }
.about-box code { font-family: var(--font-mono); font-size: 11.5px; background: var(--paper-3); padding: 1px 5px; border-radius: 4px; color: var(--ink-2); }
.about-box a { word-break: break-all; }

/* --------------------------------- footer --------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 26px 22px 34px; display: grid; grid-template-columns: 1fr auto; gap: 14px 22px; align-items: start; }
.footer-brand { display: flex; gap: 10px; align-items: flex-start; }
.footer-brand strong { font-size: 14px; }
.footer-brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.footer-copy { grid-column: 1 / -1; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted-2); line-height: 1.7; }
.to-top { position: fixed; right: 18px; bottom: 22px; z-index: 70; }
.to-top button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--paper); box-shadow: var(--shadow); color: var(--ink); font-size: 17px;
}
.to-top button:hover { color: var(--accent); border-color: var(--accent); }
.noscript { position: fixed; inset: auto 10px 10px; z-index: 300; padding: 12px 16px; border-radius: 10px; background: #c24d55; color: #fff; font-size: 13px; }

/* -------------------------------- utilities ------------------------------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 16px !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: grid; gap: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-col > *, .build-grid > *, .story-grid > *, .guide-grid > *, .char-grid > * { min-width: 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }

/* --------------------------------- responsive ----------------------------- */
@media (max-width: 1120px) {
  .main-nav a { padding: 8px 8px; font-size: 13.5px; }
  .search-pill { min-width: 196px; }
  .portal-grid { grid-template-columns: repeat(3, 1fr); }
  .glossary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .main-nav { display: none; }
  .menu-btn { display: grid; }
  .header-inner { gap: 10px; padding: 0 14px; }
  .search-pill { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-pill-label, .search-pill kbd { display: none; }
  .hero { grid-template-columns: 1fr; }
  .version-card { max-width: none; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .infobox { position: static; }
  .infobox .info-portrait { height: 122px; }
  .story-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  #app { padding: 18px 13px 56px; }
  .header-inner { height: 58px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
  .brand-text strong { font-size: 15.5px; }
  .brand-text small { font-size: 9.5px; }
  .hero { padding: 20px 17px; border-radius: 18px; }
  .hero .lead { font-size: 14px; }
  .hero h1 { font-size: clamp(38px, 12vw, 52px); }
  .hero-stats { gap: 14px 20px; }
  .portal-grid { grid-template-columns: 1fr 1fr; }
  .portal { min-height: 104px; padding: 13px 14px; }
  .portal strong { font-size: 14.5px; }
  .portal span { font-size: 11.5px; }
  .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .char-card .card-portrait { height: 92px; }
  .char-card .glyph { font-size: 62px; bottom: -14px; }
  .char-card .card-body { padding: 0 10px 11px; }
  .char-card h3 { font-size: 15px; }
  .char-card .en { font-size: 9px; }
  .char-card .role { font-size: 10.5px; }
  .filter-panel { padding: 10px; }
  .filter-top .field { flex-basis: 100%; }
  .article-body { padding: 16px 14px; border-radius: 12px; }
  .article-body h2 { font-size: 20px; margin-top: 24px; }
  .article-title-block h1 { font-size: 29px; }
  .skill { grid-template-columns: 1fr; gap: 2px; }
  .skill .sk-type { padding-top: 0; }
  .build-grid { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .glossary-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .banner-panel { grid-template-columns: 1fr; }
  .banner-panel .countdown { min-width: 0; }
  .search-modal { padding: 6vh 9px 12px; }
  .search-panel { max-height: 86vh; }
  .search-result .sr-type { display: none; }
  .version-item { grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
  .timeline::before { left: 37px; }
  .version-item .v-dot { left: 33px; }
  .version-item .v-label { font-size: 10.5px; }
  .version-box { padding: 10px 11px; }
  .version-box .v-date { margin-left: 0; width: 100%; }
  .footer-inner { padding: 22px 14px 28px; }
}
@media (max-width: 400px) {
  .portal-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .search-modal, .to-top, .hero-actions, .toc-close, .filter-panel { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  #app { max-width: none; padding: 0; }
  .article-layout { display: block; }
  .infobox { position: static; margin-bottom: 16px; }
  .article-body, .story-hero, .version-box { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
}
