/* 曙光 · 离线版 */
@font-face { font-family: "Song"; src: url("fonts/song-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Song"; src: url("fonts/song-600.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Song"; src: url("fonts/song-900.woff2") format("woff2"); font-weight: 900; font-display: block; }
@font-face { font-family: "Kai"; src: url("fonts/kai-400.woff2") format("woff2"); font-weight: 400 600; font-display: block; }
@font-face { font-family: "Garamond"; src: url("fonts/garamond.woff2") format("woff2"); font-weight: 300 700; font-display: block; }
@font-face { font-family: "Garamond"; src: url("fonts/garamond-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: block; }

:root {
  --paper: #EFE2C8; --paper-2: #E7D7B9; --paper-3: #F5EBD7;
  --ink: #13305A; --ink-2: #4A5F7E; --ink-3: #78869A;
  --field: #0B2F57; --field-2: #123B68; --on-field: #EFE2C8; --on-field-2: rgba(239, 226, 200, .62);
  --gold: #A0711E; --gold-hi: #D6A548;
  --rule: rgba(19, 48, 90, .30); --hair: rgba(19, 48, 90, .15);
  --wash: rgba(11, 47, 87, .065); --wash-2: rgba(11, 47, 87, .11);
  --shadow: 0 1px 0 rgba(19, 48, 90, .08), 0 8px 24px -12px rgba(11, 47, 87, .35);
  --rail: 68px;
  --sel: #0B2F57;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C2342; --paper-2: #0A1D38; --paper-3: #10294B;
    --ink: #EBDDC2; --ink-2: #B4BFCD; --ink-3: #8794A8;
    --field: #071A31; --field-2: #0E2747; --on-field: #EFE2C8;
    --gold: #D6A548; --gold-hi: #E7BE69;
    --rule: rgba(235, 221, 194, .26); --hair: rgba(235, 221, 194, .12);
    --wash: rgba(235, 221, 194, .05); --wash-2: rgba(235, 221, 194, .09);
    --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
    --sel: #23497A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C2342; --paper-2: #0A1D38; --paper-3: #10294B;
  --ink: #EBDDC2; --ink-2: #B4BFCD; --ink-3: #8794A8;
  --field: #071A31; --field-2: #0E2747; --on-field: #EFE2C8;
  --gold: #D6A548; --gold-hi: #E7BE69;
  --rule: rgba(235, 221, 194, .26); --hair: rgba(235, 221, 194, .12);
  --wash: rgba(235, 221, 194, .05); --wash-2: rgba(235, 221, 194, .09);
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
  --sel: #23497A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { scrollbar-gutter: stable; background: var(--paper); }
body { text-autospace: normal; font-variant-numeric: lining-nums; background: var(--paper); color: var(--ink); font: 400 15px/1.7 "Song", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif; -webkit-font-smoothing: antialiased; }
::selection { background: #D6A548; color: #0B2F57; }
::-moz-selection { background: #D6A548; color: #0B2F57; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kai { font-family: "Kai", "KaiTi", serif; }
.gar { font-family: "Garamond", serif; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- 外壳：书脊式导航 */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; background: var(--field); color: var(--on-field); display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; z-index: 20; }
.rail .orb { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 40% 38%, #F6D88E, #D6A548 45%, #8F6219 100%); box-shadow: 0 0 18px rgba(214, 165, 72, .55); margin-bottom: 18px; display: block; }
.rail nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rail nav a { writing-mode: vertical-rl; text-decoration: none; font-size: 15px; letter-spacing: .32em; padding: 12px 0; width: 46px; display: flex; align-items: center; color: var(--on-field-2); border-radius: 3px; position: relative; transition: color .15s, background .15s; }
.rail nav a:hover { color: var(--on-field); background: rgba(255, 255, 255, .05); }
.rail nav a[aria-current="page"] { color: var(--on-field); }
.rail nav { position: relative; }
.rail nav .ind { position: absolute; left: 0; top: 0; width: 2px; height: calc(var(--h, 40px) - 20px); transform: translateY(calc(var(--y, 0px) + 10px)); background: var(--gold-hi); border-radius: 2px; box-shadow: 0 0 10px rgba(214, 165, 72, .6); transition: transform .38s cubic-bezier(.3, .8, .2, 1), height .38s, opacity .2s; pointer-events: none; }
.rail .tools { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(239, 226, 200, .22); background: none; color: var(--on-field-2); cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.icon-btn:hover { color: var(--on-field); border-color: rgba(239, 226, 200, .5); }
.main { min-width: 0; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; padding-bottom: 58px; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 56px; flex-direction: row; padding: 0 8px; }
  .rail .orb { width: 22px; height: 22px; margin: 0 8px 0 4px; }
  .rail nav { flex-direction: row; justify-content: space-around; gap: 0; }
  .rail nav a { writing-mode: horizontal-tb; letter-spacing: .08em; width: auto; padding: 6px 8px; font-size: 14px; }
  .rail nav .ind { top: auto; bottom: 4px; height: 2px; width: calc(var(--w, 40px) - 16px); transform: translateX(calc(var(--x, 0px) + 8px)); transition: transform .38s cubic-bezier(.3, .8, .2, 1), width .38s, opacity .2s; }
  .rail .tools { flex-direction: row; }
  .rail .tools .icon-btn { width: 30px; height: 30px; }
}

/* ---------------------------------------------------------------- 通用控件 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1px solid var(--rule); background: transparent; border-radius: 999px; cursor: pointer; text-decoration: none; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--sel); color: var(--on-field); border-color: var(--sel); }
.btn.primary:hover { background: var(--field-2); }
.btn.gold { border-color: var(--gold); color: var(--gold); }
.btn.small { padding: 4px 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: default; }
.input { width: 100%; padding: 9px 12px; border: 1px solid var(--rule); background: var(--paper-3); border-radius: 6px; outline: none; }
.input:focus { border-color: var(--gold); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border: 1px solid var(--rule); border-radius: 999px; background: none; cursor: pointer; font-size: 13px; line-height: 1.6; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--sel); color: var(--on-field); border-color: var(--sel); }
.chip .n { font-family: "Garamond"; font-size: 13px; color: var(--ink-3); }
.chip[aria-pressed="true"] .n { color: var(--on-field-2); }
.label { font-family: "Kai"; color: var(--ink-3); font-size: 13px; letter-spacing: .06em; }
.seal-s { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font: 600 15px/1 "Garamond"; letter-spacing: -.02em; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(160, 113, 30, .4); }
.seal-s.l2 { font-size: 13px; } .seal-s.l3 { font-size: 11px; }
.seal-s.none { border-style: dashed; border-color: var(--ink-3); color: var(--ink-3); font: 400 10px "Kai"; box-shadow: none; }
.seal-s.big { width: 52px; height: 52px; font-size: 22px; box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px rgba(160, 113, 30, .45); }
.seal-s.big.l2 { font-size: 19px; } .seal-s.big.l3 { font-size: 15px; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); font-family: "Kai"; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; background: var(--field); color: var(--on-field); padding: 9px 18px; border-radius: 999px; font-size: 14px; z-index: 100; box-shadow: var(--shadow); pointer-events: none; transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s; border: 1px solid rgba(214, 165, 72, .35); }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 760px) { .toast { bottom: 72px; } }
.page-head { padding: 34px 40px 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-weight: 900; font-size: 30px; letter-spacing: .12em; line-height: 1.2; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
@media (max-width: 760px) { .page-head { padding: 22px 18px 12px; } .page-head h1 { font-size: 24px; } }

/* ---------------------------------------------------------------- 首页 */
.hero { background: var(--field); color: var(--on-field); display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 56px; padding: 56px 64px 60px; align-items: center; min-height: min(100vh, 860px); position: relative; overflow: hidden; }
.hero .plate { position: relative; }
.hero .plate img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.hero h1 { margin: 0; font-weight: 900; font-size: clamp(64px, 9vw, 128px); letter-spacing: .38em; line-height: 1; margin-right: -.38em; }
.hero .sub { font-weight: 600; font-size: clamp(16px, 1.6vw, 21px); letter-spacing: .5em; margin: 22px 0 6px; color: rgba(239, 226, 200, .92); }
.hero .en { font: italic 400 17px "Garamond"; color: var(--gold-hi); letter-spacing: .08em; }
.hero .quote { font-family: "Kai"; color: var(--on-field-2); margin: 34px 0 30px; font-size: 16px; line-height: 1.9; border-left: 1px solid rgba(214, 165, 72, .6); padding-left: 16px; }
.hero-search { position: relative; max-width: 560px; }
.hero-search input { width: 100%; padding: 16px 20px 16px 22px; font-size: 17px; border-radius: 999px; border: 1px solid rgba(239, 226, 200, .3); background: rgba(239, 226, 200, .08); color: var(--on-field); outline: none; }
.hero-search input::placeholder { color: rgba(239, 226, 200, .55); }
.hero-search input:focus { border-color: var(--gold-hi); background: rgba(239, 226, 200, .12); }
.hero-search kbd { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font: 400 12px "Garamond"; color: var(--on-field-2); border: 1px solid rgba(239, 226, 200, .25); border-radius: 4px; padding: 1px 6px; }
.hero .cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero .cats a { text-decoration: none; color: var(--on-field-2); font-size: 14px; border: 1px solid rgba(239, 226, 200, .2); padding: 4px 12px; border-radius: 999px; }
.hero .cats a:hover { color: var(--on-field); border-color: rgba(239, 226, 200, .5); }
.hero .cats a b { font: 600 14px "Garamond"; color: var(--gold-hi); margin-left: 6px; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; padding: 32px 22px 40px; gap: 28px; } .hero .plate { max-width: 360px; } .hero h1 { margin-right: 0; } }

.home-sec { padding: 56px 64px 24px; }
.home-sec h2 { margin: 0 0 22px; font-weight: 900; font-size: 22px; letter-spacing: .14em; display: flex; align-items: baseline; gap: 14px; }
.home-sec h2 span { font: italic 400 16px "Garamond"; color: var(--gold); letter-spacing: .04em; }
@media (max-width: 760px) { .home-sec { padding: 36px 18px 12px; } }
.toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 36px; }
.toc-part { margin-bottom: 26px; break-inside: avoid; }
.toc-part > a { display: flex; align-items: baseline; gap: 10px; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin-bottom: 6px; }
.toc-part > a b { font-weight: 900; color: var(--gold); font-size: 17px; }
.toc-part > a span { font-weight: 900; font-size: 17px; letter-spacing: .14em; }
.toc-part ol { list-style: none; margin: 0; padding: 0; }
.toc-part li a { display: grid; grid-template-columns: 26px 1fr; text-decoration: none; padding: 4px 0; color: var(--ink-2); border-bottom: 1px dotted var(--hair); }
.toc-part li a:hover { color: var(--ink); }
.toc-part li a i { font: italic 500 15px "Garamond"; color: var(--gold); }
.cat-plates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 1100px) { .cat-plates { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cat-plates { grid-template-columns: 1fr; } }
.cat-plate { text-decoration: none; display: block; }
.cat-plate img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; transition: transform .25s; }
.cat-plate:hover img { transform: translateY(-3px); }
.cat-plate .t { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-weight: 900; font-size: 17px; }
.cat-plate .t b { font: 600 19px "Garamond"; color: var(--gold); }
.cat-plate p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.home-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.home-tools a { padding: 18px 22px 20px 0; text-decoration: none; border-bottom: 1px solid var(--hair); }
.home-tools a + a { padding-left: 22px; border-left: 1px solid var(--hair); }
.home-tools b { display: block; font-weight: 900; font-size: 18px; letter-spacing: .1em; margin-bottom: 4px; }
.home-tools span { color: var(--ink-2); font-size: 14px; }
@media (max-width: 760px) { .home-tools { grid-template-columns: 1fr; } .home-tools a + a { padding-left: 0; border-left: none; } }
.colophon { padding: 40px 64px 60px; color: var(--ink-3); font-family: "Kai"; font-size: 13px; }

/* ---------------------------------------------------------------- 规则阅读 */
.reader { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.reader aside { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--hair); padding: 26px 18px 40px 22px; background: var(--paper-2); }
.reader aside .label { display: block; margin-bottom: 10px; }
.reader aside .grp { margin: 14px 0 4px; font-weight: 900; font-size: 14px; letter-spacing: .12em; display: flex; gap: 8px; text-decoration: none; }
.reader aside .grp b { color: var(--gold); }
.reader aside a.ch { display: grid; grid-template-columns: 24px 1fr; text-decoration: none; font-size: 14px; padding: 4px 6px; border-radius: 4px; color: var(--ink-2); line-height: 1.5; }
.reader aside a.ch i { font: italic 500 14px "Garamond"; color: var(--gold); }
.reader aside a.ch:hover { color: var(--ink); background: var(--wash); }
.reader aside a.ch[aria-current="page"] { background: var(--sel); color: var(--on-field); }
.reader aside a.ch[aria-current="page"] i { color: var(--gold-hi); }
.reader > div { min-width: 0; }
.reader article { padding: 40px 48px 80px; min-width: 0; }
.reader .pager { display: flex; justify-content: space-between; gap: 12px; max-width: 980px; margin: 34px auto 0; border-top: 1px solid var(--ink); padding-top: 14px; }
.reader .pager a { text-decoration: none; max-width: 48%; }
.reader .pager a span { display: block; font-family: "Kai"; color: var(--ink-3); font-size: 13px; }
.reader .pager a b { font-weight: 900; font-size: 17px; }
.reader .pager a:last-child { text-align: right; margin-left: auto; }
.reader-mtoc { display: none; }
@media (max-width: 980px) {
  .reader { grid-template-columns: 1fr; }
  .reader aside { display: none; }
  .reader-mtoc { display: block; padding: 14px 18px 0; }
  .reader article { padding: 18px 16px 60px; }
}

/* 规则正文：复用印刷样式并放大 */
.rules { max-width: 980px; margin: 0 auto; zoom: 1.42; max-width: 690px; }
.rules .flow { columns: 1; }
.rules .chapter, .rules .part, .rules .front { break-before: auto; }
.rules .part { height: auto; padding: 28px 0 32px; border-radius: 3px; }
.rules .part .inner { position: static; }
.rules .part img { width: 62%; }
.rules h2 { scroll-margin-top: 20px; }
.rules .st, .rules .part { color: var(--on-field); }
.rules .st strong { color: var(--on-field); }
.rules svg text[fill="#13305A"], .rules svg text:not([fill]) { fill: var(--ink); }
.rules svg rect[fill="#13305A"] { fill: var(--ink); }
.rules svg [stroke^="rgba(19,48,90"] { stroke: var(--rule); }
.rules svg polygon[stroke="#13305A"] { stroke: var(--ink); }
.rules svg line[stroke="#13305A"] { stroke: var(--ink); }
.rules .chart text { fill: var(--ink); }
.rules .seal { box-shadow: inset 0 0 0 .9mm var(--paper), inset 0 0 0 1.15mm rgba(160, 113, 30, .45); }
.rules .ch-head .num { font-size: 52pt; }
.rules .web-cards { display: flex; flex-wrap: wrap; gap: 4mm; margin: 4mm 0; }
.rules .web-cards a { text-decoration: none; }
.rules .web-cards .card { transform-origin: top left; }
.rules .portrait img { background: var(--paper-3); }
.web-jump { display: block; text-decoration: none; border: .6pt solid var(--rule); border-left: 1.4pt solid var(--gold); padding: 3mm 4mm; margin: 3mm 0 4mm; break-inside: avoid; }
.web-jump b { display: block; font-weight: 900; font-size: 11pt; }
.web-jump span { font-size: 8.6pt; color: var(--ink-2); }
.web-jump:hover { background: var(--wash); }
.rules .realm-wrap { page: auto; }
.rules .sheet, .rules .cards-page { display: none; }
@media (max-width: 980px) {
  .rules { zoom: 1.15; width: calc((100vw - 32px) / 1.15); max-width: none; }
  .rules table { display: block; overflow-x: auto; }
  .rules .ch-head { grid-template-columns: 1fr; }
  .rules .ch-head .plate { order: -1; }
  .rules .cats, .rules .statgrid, .rules .tri, .rules .twocol, .rules .six-wide, .rules .qref-grid, .rules .sample-grid, .rules .anatomy { grid-template-columns: 1fr; }
  .rules .statnums { grid-template-columns: repeat(2, 1fr); }
  .rules .kv { grid-template-columns: repeat(2, 1fr); }
  .rules .six-wide dl { columns: 1; }
}

/* ---------------------------------------------------------------- 兑换图鉴 */
.catalog { display: grid; grid-template-columns: 272px minmax(0, 1fr) minmax(380px, 470px); height: 100vh; }
.filters { border-right: 1px solid var(--hair); overflow-y: auto; padding: 22px 18px 40px 22px; background: var(--paper-2); }
.filters h1 { margin: 0 0 14px; font-weight: 900; font-size: 22px; letter-spacing: .14em; }
.filters .grp { margin-top: 20px; }
.filters .grp > .label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.filters .grp > .label button { border: none; background: none; color: var(--gold); cursor: pointer; font-family: "Kai"; font-size: 13px; padding: 0; }
.tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tree li { margin: 0; }
.tree button { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; text-align: left; border: none; background: none; cursor: pointer; padding: 4px 8px; border-radius: 4px; line-height: 1.45; }
.tree button:hover { background: var(--wash); }
.tree button[aria-pressed="true"] { background: var(--sel); color: var(--on-field); }
.tree button .n { font: 500 13px "Garamond"; color: var(--ink-3); flex: none; }
.tree button[aria-pressed="true"] .n { color: var(--on-field-2); }
.tree .cat > button { font-weight: 900; letter-spacing: .06em; font-size: 15px; margin-top: 4px; }
.tree ul { list-style: none; margin: 0 0 4px 10px; padding: 0 0 0 8px; border-left: 1px solid var(--hair); }
.tree ul ul button { font-size: 13px; color: var(--ink-2); }
.grades { display: flex; flex-wrap: wrap; gap: 6px; }
.grades .chip { font-family: "Garamond"; font-weight: 600; font-size: 14px; padding: 1px 9px; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.range .input { padding: 6px 9px; font-family: "Garamond"; font-size: 15px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin-top: 6px; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }

.list-col { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.list-bar { padding: 18px 22px 12px; border-bottom: 1px solid var(--hair); display: grid; gap: 10px; }
.search { position: relative; }
.search input { padding-left: 38px; font-size: 16px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.list-meta b { font: 600 18px "Garamond"; color: var(--ink); }
.list-meta .sort { display: flex; align-items: center; gap: 8px; }
.list-meta select { width: auto; padding: 4px 28px 4px 10px; font-size: 13px; }
.vlist { flex: 1; overflow-y: auto; position: relative; contain: strict; }
.vrow { position: absolute; left: 0; right: 0; height: 72px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--hair); cursor: pointer; text-align: left; background: none; border-left: none; border-right: none; border-top: none; width: 100%; }
.vrow:hover { background: var(--wash); }
.vrow[aria-selected="true"] { background: var(--wash-2); box-shadow: inset 3px 0 0 var(--gold); }
.vrow .nm { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.45; }
.vrow .nm mark { background: rgba(214, 165, 72, .35); color: inherit; border-radius: 2px; }
.vrow .pth { font-family: "Kai"; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.vrow .pts { text-align: right; font: 600 17px/1.2 "Garamond"; white-space: nowrap; }
.vrow .pts small { display: block; font: 400 11px "Kai"; color: var(--ink-3); }
.vrow .hit { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.vrow .hit mark { background: rgba(214, 165, 72, .35); color: inherit; }

.detail { border-left: 1px solid var(--hair); overflow-y: auto; height: 100vh; background: var(--paper-3); }
.detail .close { display: none; }
.detail-in { padding: 26px 28px 60px; }
.d-path { font-family: "Kai"; color: var(--ink-3); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.d-path button { border: none; background: none; padding: 0; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.d-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; margin: 10px 0 14px; }
.d-head h2 { margin: 0; font-weight: 900; font-size: 25px; line-height: 1.3; letter-spacing: .02em; }
.d-head .src { font-family: "Kai"; color: var(--ink-2); margin-top: 6px; }
.d-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); margin-bottom: 18px; }
.d-facts > div { padding: 9px 0 10px; }
.d-facts > div + div { padding-left: 14px; border-left: 1px solid var(--hair); }
.d-facts b { display: block; font: 600 21px/1.25 "Garamond"; }
.d-facts b.t { font: 600 15px/1.5 "Song"; }
.d-body p { margin: 0 0 .7em; text-align: justify; line-height: 1.85; }
.d-body p.note { font-size: 14px; color: var(--ink-2); border-left: 2px solid var(--gold); padding-left: 10px; }
.d-body p.lab b { color: var(--ink); }
.d-body mark { background: rgba(214, 165, 72, .35); color: inherit; }
.d-attr { white-space: pre-line; font-size: 14px; background: var(--wash); padding: 10px 14px; border-radius: 6px; margin: 4px 0 16px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.d-card { display: flex; justify-content: center; padding: 18px 0 6px; border-top: 1px solid var(--hair); }
.d-loading { color: var(--ink-3); font-family: "Kai"; }
@media (max-width: 1280px) { .catalog { grid-template-columns: 250px minmax(0, 1fr) 400px; } }
@media (max-width: 1080px) {
  .catalog { grid-template-columns: 240px minmax(0, 1fr); }
  .detail { position: fixed; right: 0; top: 0; bottom: 0; width: min(520px, 100%); z-index: 30; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .22s; }
  .detail.open { transform: none; }
  .detail .close { display: block; position: sticky; top: 0; margin-left: auto; z-index: 2; }
}
@media (max-width: 760px) {
  .catalog { grid-template-columns: 1fr; height: calc(100dvh - 56px); }
  .filters { display: none; position: fixed; inset: 0 0 56px 0; z-index: 25; }
  .filters.open { display: block; }
  .list-col { height: calc(100dvh - 56px); }
  .vrow { padding: 0 14px; gap: 10px; grid-template-columns: 38px minmax(0, 1fr) auto; }
  .detail { bottom: 56px; }
}
.only-narrow { display: none; }
@media (max-width: 760px) { .only-narrow { display: inline-flex; } }

/* ---------------------------------------------------------------- 体系 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ink); padding: 0 40px; }
.tabs a { text-decoration: none; padding: 9px 16px 8px; font-size: 15px; color: var(--ink-2); border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; position: relative; top: 1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ink); background: var(--paper); font-weight: 600; }
@media (max-width: 760px) { .tabs { padding: 0 12px; overflow-x: auto; } }
.realm-scroll { overflow: auto; max-height: calc(100vh - 180px); margin: 18px 40px 40px; border: 1px solid var(--hair); background: var(--paper-3); }
@media (max-width: 760px) { .realm-scroll { margin: 12px 0 30px; max-height: calc(100vh - 220px); border-left: none; border-right: none; } }
.realm-t { border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.4; min-width: 1680px; }
.realm-t th, .realm-t td { padding: 7px 8px; border-bottom: 1px solid var(--hair); border-right: 1px solid var(--hair); text-align: center; vertical-align: middle; }
.realm-t thead th { position: sticky; top: 0; background: var(--field); color: var(--on-field); font-weight: 600; z-index: 2; white-space: nowrap; font-size: 13px; }
.realm-t th.sys, .realm-t td.sys { position: sticky; left: 0; background: var(--paper-2); text-align: left; font-weight: 600; z-index: 1; min-width: 168px; max-width: 168px; }
.realm-t thead th.sys { z-index: 3; background: var(--field); }
.realm-t td.f { background: var(--wash); }
.realm-t tr:hover td { background: var(--wash-2); }
.realm-t tr:hover td.sys { background: var(--paper-3); }
.realm-t td.hl, .realm-t th.hl { box-shadow: inset 0 0 0 999px rgba(214, 165, 72, .16); }
.realm-t td.sys.cont { color: var(--ink-3); font-weight: 400; }
.realm-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 40px 0; }
.realm-tools .input { max-width: 300px; }
@media (max-width: 760px) { .realm-tools { padding: 12px 14px 0; } }
.sys-layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 130px); }
.sys-list { border-right: 1px solid var(--hair); padding: 16px 16px 40px 40px; max-height: calc(100vh - 130px); overflow-y: auto; position: sticky; top: 0; }
.sys-list button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.sys-list button:hover { background: var(--wash); color: var(--ink); }
.sys-list button[aria-pressed="true"] { background: var(--sel); color: var(--on-field); }
.sys-body { padding: 24px 48px 80px; max-width: 900px; }
.sys-body h2 { margin: 0 0 18px; font-weight: 900; font-size: 26px; letter-spacing: .04em; }
.sys-body h3 { font-weight: 900; font-size: 18px; margin: 26px 0 8px; padding-top: 8px; border-top: 1px solid var(--ink); }
.sys-body p { margin: 0 0 .75em; line-height: 1.9; text-align: justify; }
.sys-body .ent { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.sys-body .ent > b { font-weight: 900; font-size: 16px; }
.sys-body .ent .c { font-family: "Kai"; color: var(--gold); font-size: 14px; margin-bottom: 4px; }
@media (max-width: 900px) { .sys-layout { grid-template-columns: 1fr; } .sys-list { position: static; max-height: none; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 4px; border-right: none; border-bottom: 1px solid var(--hair); } .sys-list button { width: auto; } .sys-body { padding: 18px 16px 60px; } .sys-body .ent { grid-template-columns: 1fr; gap: 4px; } }
.tiers { padding: 10px 40px 60px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0 40px; }
.tiers .tier-w { break-inside: avoid; padding: 14px 0 18px; border-top: 1px solid var(--ink); }
.tiers .tier-w h3 { margin: 0 0 6px; font-weight: 900; font-size: 20px; letter-spacing: .06em; }
.tiers dl { margin: 0; }
.tiers dt { font-family: "Kai"; color: var(--gold); font-size: 13.5px; margin-top: 8px; letter-spacing: .06em; }
.tiers dd { margin: 0; font-size: 14.5px; line-height: 1.8; text-align: justify; }
@media (max-width: 760px) { .tiers { padding: 6px 16px 40px; } }

/* ---------------------------------------------------------------- 人物卡 */
.sheet-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; min-height: 100vh; }
.sheet-form { padding: 28px 36px 80px; border-right: 1px solid var(--hair); }
.sheet-form h1 { margin: 0; font-weight: 900; font-size: 28px; letter-spacing: .14em; }
.sheet-form .bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; align-items: center; }
.sheet-form .bar select { width: auto; min-width: 160px; }
.fs { border: none; padding: 0; margin: 26px 0 0; }
.fs > legend { font-weight: 900; font-size: 17px; letter-spacing: .12em; padding: 0 0 6px; width: 100%; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; align-items: baseline; }
.fs > legend .btn { font-weight: 400; letter-spacing: 0; }
.fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; margin-top: 12px; }
.fgrid.c2 { grid-template-columns: repeat(2, 1fr); }
.fgrid.c3 { grid-template-columns: repeat(3, 1fr); }
.fgrid.c5 { grid-template-columns: repeat(5, 1fr); }
.fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fld > span { font-family: "Kai"; font-size: 13px; color: var(--ink-3); }
.fld .input { padding: 7px 10px; }
.fld.wide { grid-column: span 2; }
.fld.full { grid-column: 1 / -1; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.7; }
.attr-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.attr-table th { font-family: "Kai"; font-weight: 400; color: var(--ink-3); font-size: 13px; padding: 4px 4px; text-align: center; }
.attr-table th:first-child { text-align: left; }
.attr-table td { padding: 4px 4px; border-bottom: 1px solid var(--hair); }
.attr-table td:first-child { font-weight: 600; white-space: nowrap; }
.attr-table input { width: 100%; padding: 5px 6px; text-align: right; font-family: "Garamond"; font-size: 15px; border: 1px solid var(--hair); background: var(--paper-3); border-radius: 4px; }
.attr-table td.tot { text-align: right; font: 600 17px "Garamond"; padding-right: 8px; }
.attr-sum { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.attr-sum b { font-family: "Garamond"; font-size: 16px; color: var(--ink); }
.attr-sum .warn { color: #B4522A; }
.dyn { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13.5px; }
.dyn th { font-family: "Kai"; font-weight: 400; color: var(--ink-3); text-align: left; padding: 3px 4px; font-size: 12.5px; }
.dyn td { padding: 2px 3px; }
.dyn input { width: 100%; padding: 5px 7px; border: 1px solid var(--hair); background: var(--paper-3); border-radius: 4px; font-size: 13.5px; }
.dyn td.x { width: 28px; }
.dyn td.x button { border: none; background: none; cursor: pointer; color: var(--ink-3); font-size: 16px; }
.dyn td.x button:hover { color: #B4522A; }
.dyn-add { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.suggest { position: absolute; top: 100%; left: 0; z-index: 10; width: min(460px, 100%); background: var(--paper-3); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.suggest button { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left; border: none; background: none; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--hair); font-size: 13.5px; }
.suggest button:hover, .suggest button.on { background: var(--wash-2); }
.suggest button small { font-family: "Kai"; color: var(--ink-3); display: block; font-size: 12px; }
.dice-log { font-family: "Kai"; font-size: 13px; color: var(--ink-2); margin-top: 8px; min-height: 1.6em; }
.dice-log b { font-family: "Garamond"; color: var(--gold); font-size: 16px; }
.sheet-preview { background: var(--paper-2); padding: 28px 24px 60px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sheet-preview .label { display: block; text-align: center; margin-bottom: 12px; }
.sheet-scale { width: 210mm; transform-origin: top left; }
.sheet-scale .sheet { height: 279mm; background: #EFE2C8; padding: 9mm; box-shadow: var(--shadow); margin-bottom: 8mm; color: #13305A;
  --paper: #EFE2C8; --ink: #13305A; --ink-2: #4A5F7E; --ink-3: #7A8698; --field: #0B2F57; --rule: rgba(19,48,90,.30); --hair: rgba(19,48,90,.16); --wash: rgba(11,47,87,.065); --wash-2: rgba(11,47,87,.11); --gold: #A0711E; }
.sheet-scale .sheet .sec { color: #EFE2C8; }
@media (max-width: 1180px) { .sheet-page { grid-template-columns: 1fr; } .sheet-preview { position: static; height: auto; } .sheet-form { border-right: none; } }
@media (max-width: 760px) { .sheet-form { padding: 20px 14px 40px; } .fgrid { grid-template-columns: repeat(2, 1fr); } .fgrid.c5 { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------------------------- 卡牌工坊 */
.cards-ws { padding: 0 40px 80px; }
.ws-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 0 18px; border-bottom: 1px solid var(--hair); margin-bottom: 22px; }
.ws-bar .seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.ws-bar .seg button { border: none; background: none; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.ws-bar .seg button[aria-pressed="true"] { background: var(--sel); color: var(--on-field); }
.ws-grid { display: flex; flex-wrap: wrap; gap: 18px; }
.ws-item { position: relative; }
.ws-item .rm { position: absolute; right: -8px; top: -8px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper-3); cursor: pointer; z-index: 2; color: var(--ink-2); }
.ws-item .rm:hover { color: #B4522A; border-color: #B4522A; }
@media (max-width: 760px) { .cards-ws { padding: 0 14px 60px; } }


/* ---------------------------------------------------------------- 更新日志 */
.log-page { display: flex; flex-direction: column; height: 100vh; }
.log-tools { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 40px 14px; align-items: center; }
.log-tools .input { max-width: 320px; }
.log-tools select { width: auto; }
.log-head, .lrow { display: grid; grid-template-columns: 76px minmax(0, 1.6fr) 56px 96px 64px minmax(0, 1fr) 96px minmax(0, 1.2fr); gap: 12px; padding: 0 40px; align-items: center; }
.log-head { font-family: "Kai"; color: var(--ink-3); font-size: 13px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.lrow { position: absolute; left: 0; right: 0; height: 40px; border-bottom: 1px solid var(--hair); font-size: 14px; }
.lrow > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .no { font: 500 14px "Garamond"; color: var(--ink-3); }
.lrow .op { font-family: "Kai"; }
.lrow .op.add { color: #3F7A4E; } .lrow .op.del { color: #B4522A; } .lrow .op.adj { color: var(--gold); }
.lrow a { text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.lrow .dt { font: 500 14px "Garamond"; color: var(--ink-2); }
@media (max-width: 900px) {
  .log-head { display: none; }
  .log-head, .lrow { grid-template-columns: 64px minmax(0, 1fr) 48px 56px; padding: 0 14px; }
  .lrow > :nth-child(4), .lrow > :nth-child(6), .lrow > :nth-child(7), .lrow > :nth-child(8) { display: none; }
  .log-tools { padding: 0 14px 12px; }
}

/* ---------------------------------------------------------------- 打印 */
.print-root { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #EFE2C8 !important; }
  .app { display: none !important; }
  .print-root { display: block; color: #13305A;
    --paper: #EFE2C8; --ink: #13305A; --ink-2: #4A5F7E; --ink-3: #7A8698; --field: #0B2F57; --rule: rgba(19,48,90,.30); --hair: rgba(19,48,90,.16); --wash: rgba(11,47,87,.065); --wash-2: rgba(11,47,87,.11); --gold: #A0711E; --gold-hi: #D6A548; }
  .print-root .sheet { page: auto; break-before: auto; height: 296mm; padding: 9mm; break-after: page; background: #EFE2C8; overflow: hidden; }
  .print-root > :last-child { break-after: auto; }
  .print-root .sheet .sec { color: #EFE2C8; }
  .print-page { width: 210mm; height: 296mm; display: grid; place-content: center; break-after: page; background: #EFE2C8; overflow: hidden; }
  .print-page .grid9 { display: grid; grid-template-columns: repeat(3, 63mm); grid-auto-rows: 88mm; gap: 0; }
  .print-page .grid4 { display: grid; grid-template-columns: repeat(2, 88mm); grid-auto-rows: 126mm; gap: 0; }
  .print-page .card { border-radius: 0; box-shadow: inset 0 0 0 .1mm rgba(19, 48, 90, .4); }
  .print-page.mirror .grid9, .print-page.mirror .grid4 { direction: rtl; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.d-photo { margin: 0 0 16px; }
.d-photo img { width: 100%; display: block; border-radius: 4px; }
.d-photo figcaption { font-family: "Kai"; font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.colophon details { margin-top: 10px; }
.colophon summary { cursor: pointer; }
.colophon ul { margin: 8px 0 0; padding-left: 1.2em; line-height: 1.9; }
.seal-s.big.none { font-size: 13px; letter-spacing: 0; }

/* 图片预设宽高比，加载时不推挤正文 */
.rules .plate img, .rules .fig img { aspect-ratio: 3 / 2; object-fit: cover; }
.rules .part img { aspect-ratio: 2 / 3; object-fit: cover; }
.rules .portrait img { aspect-ratio: 2070 / 3804; object-fit: cover; }
.d-photo img { aspect-ratio: 16 / 9; object-fit: cover; background: #0B2A50; }
img { background-color: transparent; }

/* 页面切换：旧页淡出，新页淡入并上移 10px；导航栏不参与 */
.rail { view-transition-name: rail; }
::view-transition-group(rail), ::view-transition-old(rail), ::view-transition-new(rail) { animation: none; }
::view-transition-old(root) { animation: vt-out 140ms ease-in both; }
::view-transition-new(root) { animation: vt-in 300ms cubic-bezier(.2, .7, .2, 1) 40ms both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@supports not (view-transition-name: a) {
  .page { animation: vt-in 300ms cubic-bezier(.2, .7, .2, 1) both; }
}
.reader article .rules { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .page { animation: none !important; }
}
/* 详情栏换条目时轻微淡入 */
.detail-in { animation: d-in 220ms ease-out both; }
@keyframes d-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .detail-in { animation: none; } }

/* ================================================================ 统一组件 */
/* 滚动条 */
:root { --scroll: rgba(19, 48, 90, .26); --scroll-hi: rgba(19, 48, 90, .5); }
:root[data-theme="dark"] { --scroll: rgba(235, 221, 194, .2); --scroll-hi: rgba(235, 221, 194, .42); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --scroll: rgba(235, 221, 194, .2); --scroll-hi: rgba(235, 221, 194, .42); } }
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
*:hover { scrollbar-color: var(--scroll-hi) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hi); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
.realm-scroll { scrollbar-width: auto; }

/* 过渡 */
.btn, .chip, .tree button, .vrow, .sys-list button, .reader aside a.ch, .icon-btn, .rail nav a, .input, .sel-btn, .tabs a, .home-tools a, .toc-part li a, .hero .cats a { transition: background-color .16s, color .16s, border-color .16s, box-shadow .16s; }
.btn:active, .chip:active, .sel-btn:active { transform: translateY(1px); }

/* 下拉 */
.sel { position: relative; display: inline-block; min-width: 150px; }
.sel-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--rule); background: var(--paper-3); border-radius: 6px; cursor: pointer; text-align: left; font-size: 14px; line-height: 1.5; }
.sel-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-btn:hover { border-color: var(--ink-2); }
.sel.open .sel-btn { border-color: var(--gold); }
.sel .chev { width: 12px; height: 12px; flex: none; color: var(--ink-3); transition: transform .2s; }
.sel.open .chev { transform: rotate(180deg); color: var(--gold); }
.sel-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); min-width: 100%; width: max-content; max-width: min(420px, 90vw); z-index: 40; list-style: none; margin: 0; padding: 5px; background: var(--paper-3); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; transform-origin: top center; animation: pop-in .16s cubic-bezier(.2, .8, .2, 1) both; }
.sel.up .sel-pop { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.sel-opt { padding: 6px 10px; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 1.5; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.sel-opt.hi { background: var(--wash-2); }
.sel-opt[aria-selected="true"] { color: var(--gold); font-weight: 600; }
.sel-opt[aria-selected="true"]::after { content: ""; width: 5px; height: 9px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); margin-left: auto; margin-top: -3px; }
.sel-opt.grp { font-weight: 900; color: var(--gold); }
.sel-sm { min-width: 140px; }
.sel-sm .sel-btn { padding: 4px 10px; font-size: 13px; border-radius: 999px; }
.reader-mtoc .sel { display: block; }
.log-tools .sel { min-width: 140px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.sel.up .sel-pop { animation-name: pop-up; }
@keyframes pop-up { from { opacity: 0; transform: translateY(4px) scale(.98); } }

/* 复选框 */
.check input { appearance: none; -webkit-appearance: none; width: 17px; height: 17px; margin: 0; flex: none; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper-3); display: inline-grid; place-content: center; cursor: pointer; transition: background-color .16s, border-color .16s; }
.check input::after { content: ""; width: 9px; height: 5px; border: solid var(--on-field); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); }
.check input:checked { background: var(--sel); border-color: var(--sel); }
.check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check:hover input { border-color: var(--ink-2); }

/* 搜索框 */
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--wash-2); color: var(--ink-2); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; animation: pop-in .14s both; }
.search .clear:hover { background: var(--sel); color: var(--on-field); }
.input::placeholder { color: var(--ink-3); opacity: .8; }

/* 对话框 */
.sg-dialog { border: 1px solid var(--rule); border-radius: 12px; background: var(--paper-3); color: var(--ink); padding: 22px 24px 18px; min-width: min(360px, 90vw); box-shadow: var(--shadow); animation: dlg-in .2s cubic-bezier(.2, .8, .2, 1) both; }
.sg-dialog p { margin: 0 0 18px; font-size: 15px; line-height: 1.7; }
.sg-dialog .dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }
.sg-dialog::backdrop { background: rgba(7, 26, 49, .45); backdrop-filter: blur(2px); animation: fade-in .2s both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }

/* 首页进场：图版浮现，标题依次落位 */
.hero .plate { animation: hero-plate 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1, .hero .sub, .hero .en, .hero .quote, .hero-search, .hero .cats { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 { animation-delay: .15s; } .hero .sub { animation-delay: .27s; } .hero .en { animation-delay: .35s; }
.hero .quote { animation-delay: .45s; } .hero-search { animation-delay: .55s; } .hero .cats { animation-delay: .65s; }
@keyframes hero-plate { from { opacity: 0; transform: translateY(18px) scale(.985); filter: brightness(.6); } }
@keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } }
.rail .orb { transition: box-shadow .3s, transform .3s; }
.rail .orb:hover { box-shadow: 0 0 26px rgba(214, 165, 72, .9); transform: scale(1.06); }

/* 卡片与图版的悬停 */
.ws-item { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.ws-item:hover { transform: translateY(-3px); }
.rules .web-cards a { display: block; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.rules .web-cards a:hover { transform: translateY(-1mm); }
.tree ul { animation: fade-in .2s ease-out both; }
.detail.busy .detail-in { opacity: .55; transition: opacity .15s .08s; }
.detail-in { transition: opacity .15s; }
.vrow { transition: background-color .12s, box-shadow .12s; }

@media (prefers-reduced-motion: reduce) {
  .hero .plate, .hero h1, .hero .sub, .hero .en, .hero .quote, .hero-search, .hero .cats, .sel-pop, .sg-dialog, .tree ul, .search .clear { animation: none !important; }
  .rail nav .ind, .toast, .ws-item, .check input::after { transition: none !important; }
}
.attr-table th { white-space: nowrap; }

.d-card { padding: 24px 0 10px; }

/* 卡牌在网页里的呈现：固定配色（卡面自带），只加投影 */
.d-card .card { zoom: 1.15; box-shadow: inset 0 0 0 .2mm rgba(19, 48, 90, .28), 0 6mm 12mm -6mm rgba(0, 0, 0, .45); }
.ws-item .card { box-shadow: inset 0 0 0 .2mm rgba(19, 48, 90, .28), 0 5mm 10mm -6mm rgba(0, 0, 0, .4); }
.rules .web-cards .card { box-shadow: inset 0 0 0 .2mm rgba(19, 48, 90, .28), 0 3mm 6mm -4mm rgba(0, 0, 0, .35); }
/* 大卡 88×126mm：同一结构放大 */
.card.lg { width: 88mm; height: 126mm; border-radius: 3.4mm; }
.card.lg .cf { inset: 2.4mm; padding: 0 3mm; }
.card.lg .ch { height: 6.6mm; }
.card.lg .ct { font-size: 6.8pt; } .card.lg .ct svg { width: 3.1mm; height: 3.1mm; }
.card.lg .no { font-size: 7.8pt; height: 4.2mm; padding: 0 1.4mm; } .card.lg .no span { font-size: 6.2pt; }
.card.lg .art { height: 31mm; margin: 0 -3mm; }
.card.lg .seal { width: 12.6mm; height: 12.6mm; right: 3mm; top: 31mm; font-size: 15pt; }
.card.lg .seal.s2 { font-size: 12.8pt; } .card.lg .seal.s3 { font-size: 10.6pt; } .card.lg .seal.none { font-size: 10.4pt; }
.card.lg .nm { font-size: 12.6pt; margin: 2.8mm 14mm 0 0; } .card.lg .nm.long { font-size: 10.8pt; }
.card.lg .src { font-size: 6.9pt; margin-right: 14mm; }
.card.lg .rule { height: 3.2mm; }
.card.lg .tx p { margin: 0 0 .45em; text-indent: 0; }
.card.lg .req { font-size: 6.9pt; } .card.lg .req b { font-size: 6.2pt; }
.card.lg .ft { height: 8.6mm; margin: 1.6mm -3mm 0; padding: 0 3mm; }
.card.lg .pts { font-size: 13.5pt; } .card.lg .pts small, .card.lg .gr small { font-size: 6.6pt; } .card.lg .gr { font-size: 11pt; }
.card.lg.back, .card.back { background: #0B2F57; }
/* 详情里的编号牌 */
.no-big { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 5px; font: 600 18px/1 "Garamond"; letter-spacing: .03em; margin-top: 2px; }
.no-big span { font: 400 14px/1 "Song"; color: var(--ink-2); }
.card .gr.none { color: #7A8698; }

/* ================================================================ 控件尺寸与图标（统一档位：38 / 34 / 28 / 26px） */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.btn { height: 34px; padding: 0 15px; gap: 6px; font-size: 14px; line-height: 1; }
.btn .ic { width: 15px; height: 15px; margin-left: -3px; }
.btn.small { height: 28px; padding: 0 11px; gap: 5px; font-size: 13px; }
.btn.small .ic { width: 14px; height: 14px; margin-left: -2px; }
.btn.primary .ic { stroke: currentColor; }
.input { height: 38px; padding: 0 12px; line-height: 1.4; }
textarea.input { height: auto; padding: 9px 12px; }
.range .input { height: 34px; }
.fld .input { height: 36px; padding: 0 10px; }
.sel-btn { height: 38px; padding: 0 12px; }
.sel-sm .sel-btn { height: 28px; padding: 0 11px; }
.fld .sel-btn { height: 36px; }
.chip { height: 26px; padding: 0 10px; line-height: 1; }
.grades .chip { min-width: 38px; justify-content: center; padding: 0 8px; }
.attr-table input, .dyn input { height: 30px; padding: 0 8px; }
.icon-btn { width: 36px; height: 36px; padding: 0; }
.icon-btn .ic { width: 18px; height: 18px; stroke-width: 1.5; }
.search .ic.lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search .clear .ic { width: 13px; height: 13px; stroke-width: 2; }
.ws-item .rm { display: grid; place-items: center; padding: 0; }
.ws-item .rm .ic { width: 12px; height: 12px; stroke-width: 2; }
.dyn td.x button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; padding: 0; }
.dyn td.x button:hover { background: var(--wash-2); }
.dyn td.x .ic { width: 12px; height: 12px; stroke-width: 2; }
.d-actions { gap: 10px; }
.list-meta .sort { gap: 8px; }
.sheet-form .bar { gap: 8px; }
.label { line-height: 1.6; }
.d-facts .label { display: block; margin-bottom: 2px; }

/* 无支线／仅介绍：与卡面一致的淡色实线印章 */
.seal-s.none { border-style: solid; border-color: var(--rule); color: var(--ink-3); font: 400 14px/1 "Kai"; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--hair); }
.vrow[aria-selected="true"] .seal-s, .vrow:hover .seal-s { box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(160, 113, 30, .35); }
.vrow[aria-selected="true"] .seal-s.none, .vrow:hover .seal-s.none { box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px var(--hair); }
.seal-s.big.none { font-size: 20px; letter-spacing: 0; box-shadow: inset 0 0 0 4px var(--paper-3), inset 0 0 0 5.5px var(--hair); }
.seal-s.big { box-shadow: inset 0 0 0 4px var(--paper-3), inset 0 0 0 5.5px rgba(160, 113, 30, .45); }
.seal-s.intro { border-style: dashed; }
.d-facts b.no-big { display: inline-flex; }
