/* 灵契百科 2.4 — an encyclopedia site's look (2026-10-27): grey page, white sheet, a blue top bar, a side menu,
   type-coloured infoboxes and table heads. The section builders' classes from style.css are kept, recoloured. */
:root {
  --bg: #e9edf2; --sheet: #ffffff; --card: #ffffff; --card2: #f3f5f8; --ink: #202122; --muted: #5f6670;
  --line: #c8ccd1; --line2: #e3e6ea; --link: #2f5ca8; --accent: #3b66b0; --accent-ink: #fff; --accent-soft: #e6eefb;
  --warn: #b5432f; --warn-soft: #fbe7e1; --mark: #fff3b0; --top: #2c4a7c; --top2: #1f375f; --side: #f6f7f9;
  --shadow: 0 1px 2px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121519; --sheet: #1b1f24; --card: #1f242a; --card2: #262c33; --ink: #e6e8ea; --muted: #a2a9b1;
  --line: #3a414a; --line2: #2c333b; --link: #8fb4ff; --accent: #6f9be8; --accent-ink: #0c1424; --accent-soft: #23314a;
  --warn: #f08f78; --warn-soft: #3b241f; --mark: #5c4c14; --top: #18263d; --top2: #101a2b; --side: #171b20; } }
:root[data-theme="dark"] {
  --bg: #121519; --sheet: #1b1f24; --card: #1f242a; --card2: #262c33; --ink: #e6e8ea; --muted: #a2a9b1;
  --line: #3a414a; --line2: #2c333b; --link: #8fb4ff; --accent: #6f9be8; --accent-ink: #0c1424; --accent-soft: #23314a;
  --warn: #f08f78; --warn-soft: #3b241f; --mark: #5c4c14; --top: #18263d; --top2: #101a2b; --side: #171b20; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; overflow-wrap: anywhere;
  font: 15px/1.7 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
p { margin: .5em 0; }
ul, ol { padding-left: 1.4em; margin: .4em 0; }
small, .muted, .hint { color: var(--muted); }
small { font-size: .85em; }
.hint { font-size: .9em; }
button { font: inherit; color: inherit; }

/* top bar */
.top { position: sticky; top: 0; z-index: 40; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: linear-gradient(var(--top), var(--top2)); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none !important; flex: none; }
.lg1 { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: radial-gradient(circle at 35% 30%, #ff8a73, #d9382a 70%); border: 2px solid #fff; box-shadow: 0 0 0 2px #1a2a44; }
.lg2 { font-weight: 800; font-size: 1.15rem; letter-spacing: .06em; }
.mbtn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px;
  width: 36px; height: 34px; cursor: pointer; flex: none; }
#menubtn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input { width: 100%; border: 0; border-radius: 18px; padding: 7px 14px; font: inherit; background: #fff; color: #202122; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.3); max-height: 70vh; overflow-y: auto; display: none; }
.results.show { display: block; }
.results a { display: flex; gap: 8px; padding: 8px 12px; color: var(--ink); border-bottom: 1px solid var(--line2); align-items: baseline; }
.results a:hover, .results a.cur { background: var(--accent-soft); text-decoration: none; }
.results .k { font-size: .72em; color: #fff; background: var(--accent); border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.results .n { font-weight: 600; }
.results .x { color: var(--muted); font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.results .none { padding: 12px; color: var(--muted); }

/* frame */
.layout { display: flex; align-items: flex-start; max-width: 1280px; margin: 0 auto; }
.side { position: sticky; top: 52px; width: 190px; flex: none; height: calc(100vh - 52px); overflow-y: auto; padding: 12px 8px 30px; }
.portlet { margin-bottom: 14px; }
.portlet .pt { font-size: .78em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 0 6px 3px; margin-bottom: 4px; letter-spacing: .1em; }
.portlet a { display: block; padding: 3px 8px; border-radius: 6px; font-size: .92em; }
.portlet a.cur { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.portlet .small { font-size: .78em; color: var(--muted); padding: 0 6px; }
.content { flex: 1; min-width: 0; margin: 12px 12px 40px 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px;
  padding: 18px 26px 30px; box-shadow: var(--shadow); min-height: 80vh; }
.page { display: none; }
.page.on { display: block; }
.page::after { content: ""; display: block; clear: both; }
h1.ttl { font-size: 1.75rem; font-weight: 500; font-family: "Songti SC", "SimSun", serif; border-bottom: 1px solid var(--line);
  padding-bottom: 4px; margin: 4px 0 12px; }
.page h2 { font-size: 1.3rem; font-weight: 500; font-family: "Songti SC", "SimSun", serif; border-bottom: 1px solid var(--line);
  margin: 22px 0 8px; padding-bottom: 2px; }
.page h3 { font-size: 1.1rem; margin: 18px 0 6px; }
.page h4 { font-size: 1rem; margin: 12px 0 4px; color: var(--accent); }
.lead { color: var(--muted); }

/* main page */
.welcome { text-align: center; padding: 18px 10px 8px; border-radius: 10px; margin-bottom: 14px;
  background: linear-gradient(135deg, #e8f0ff, #fdeee9); border: 1px solid var(--line); }
:root[data-theme="dark"] .welcome { background: linear-gradient(135deg, #1e2a40, #3a2622); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .welcome { background: linear-gradient(135deg, #1e2a40, #3a2622); } }
.welcome .wl { font-size: 2rem; font-weight: 800; letter-spacing: .1em; }
.welcome .wt2 { color: var(--accent); font-weight: 600; }
.stamp { font-size: .8em; color: var(--muted); }
.portals { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 12px 0; }
.portal, .box, .tipbox, .dexbox { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.portal .ph, .box .bh, .tipbox .th, .dexbox .dh { background: var(--pc, var(--accent)); color: #fff; font-weight: 700; padding: 5px 12px; }
.portal .pb { padding: 8px 12px 10px; }
.portal .pb p { margin: 0 0 6px; font-size: .92em; }
.pl2 a { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 10px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line2); font-size: .88em; }
.tipbox { margin: 10px 0; --pc: #3e9a6a; }
.tipbox ul, .tipbox p { margin: 6px 12px 8px; }
.box { margin: 12px 0; }
.featrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.feat { display: none; flex-direction: column; align-items: center; width: 92px; padding: 6px; border-radius: 8px; background: var(--card2); color: var(--ink); font-size: .85em; }
.feat.on { display: flex; }

/* the 契灵 page */
.pnav { display: flex; justify-content: space-between; gap: 8px; font-size: .88em; background: var(--card2); border: 1px solid var(--line2);
  border-radius: 6px; padding: 4px 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ibox { float: right; width: 290px; margin: 0 0 14px 18px; border: 2px solid var(--tc, var(--accent)); border-radius: 10px; overflow: hidden; background: var(--card); }
.ih { color: #fff; padding: 8px 12px; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.ino { font-size: .85em; opacity: .9; }
.inm { font-size: 1.35rem; font-weight: 800; }
.ileg { display: inline-block; font-size: .75em; background: rgba(0,0,0,.25); border-radius: 4px; padding: 0 6px; }
.ipic { display: grid; place-items: center; padding: 10px; background: var(--tint, var(--card2)); }
.ipic small { font-size: .78em; color: var(--muted); }
.spr.s160 { width: 160px; height: 160px; }
.itab { width: 100%; border-collapse: collapse; font-size: .9em; }
.itab th { width: 6.5em; text-align: left; background: var(--tint, var(--card2)); padding: 5px 10px; border-top: 1px solid var(--line2); font-weight: 600; white-space: nowrap; }
.itab td { padding: 5px 10px; border-top: 1px solid var(--line2); }
.dexbox { margin: 0 0 8px; --pc: var(--tc, var(--accent)); }
.dexbox p { margin: 8px 12px; }
.body { overflow: hidden; }
.page.sp .body, #event .body { overflow: visible; }
table.wt { border-collapse: collapse; margin: 6px 0; font-size: .92em; }
table.wt th, table.wt td { border: 1px solid var(--line); padding: 4px 9px; }
table.wt th { background: var(--hc, var(--card2)); }
table.mv { width: 100%; }
table.mv tr:first-child th { background: var(--tc, var(--accent)); color: #fff; }
table.stats { width: 100%; max-width: 520px; }
table.stats th { color: #fff; width: 5em; text-align: left; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
table.stats td.n { width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
table.stats td.barc { width: auto; }
table.stats .bar { display: block; height: 10px; border-radius: 5px; }
table.stats tr.tot th { background: var(--muted); }
table.match th { width: 3.4em; text-align: center; }
table.match tr.hi th { background: #f3c6bb; color: #6b1d10; }
table.match tr.lo th { background: #c9e7c6; color: #1c4a17; }
:root[data-theme="dark"] table.match tr.hi th { background: #5a2a22; color: #ffd8cd; }
:root[data-theme="dark"] table.match tr.lo th { background: #22452a; color: #cdf3c8; }
td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.l { text-align: left; }
td.b { font-weight: 700; }

/* lists */
.tw { overflow-x: auto; max-width: 100%; }
table.list { width: 100%; }
table.list tr:first-child th { background: var(--top); color: #fff; cursor: pointer; white-space: nowrap; position: sticky; top: 0; }
table.list tr:nth-child(even) td { background: var(--card2); }
table.list td { text-align: center; }
.chips { margin: 6px 0; }
.chip { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .85em; border: 2px solid var(--cc, var(--line));
  background: var(--card); margin: 2px 4px 2px 0; cursor: pointer; }
.chip.on { background: var(--cc, var(--accent)); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.filters input, input[type="search"] { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 6px; padding: 5px 10px; font: inherit; min-width: 0; }
.filters input { flex: 1 1 160px; }
.count { color: var(--muted); font-size: .85em; }
ul.news li { margin: .3em 0; }

/* maps */
.mapfig { margin: 8px 0; }
.mapimg { width: 100%; max-width: 640px; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated;
  border: 1px solid var(--line); border-radius: 6px; background-color: #1c2a1c; }
.mapimg.sm { max-width: 460px; }
.mapfig figcaption { font-size: .82em; color: var(--muted); margin-top: 2px; }
.lg .d { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 8px; vertical-align: middle; }
.d.ex { background: #f2d05a; border-radius: 2px; } .d.tr { background: #e04a3a; } .d.np { background: #2f6fd6; } .d.it { background: #e8b52c; border-radius: 2px; transform: rotate(45deg); } .d.an { background: #35c7de; }
details.stepmap { margin: 4px 0 6px; }
details.stepmap > summary { cursor: pointer; color: var(--link); font-size: .9em; }
.plmap { padding: 6px 14px 0; }

/* the old sections' pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.note { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 4px; padding: 8px 12px; margin: 10px 0; }
.warnbox { background: var(--warn-soft); border-left: 4px solid var(--warn); border-radius: 4px; padding: 8px 12px; margin: 10px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .93em; }
th, td { padding: 5px 9px; text-align: left; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--card2); white-space: nowrap; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nw, th.nw { white-space: nowrap; }
table.chart { width: auto; font-size: .85em; }
table.chart th, table.chart td { text-align: center; padding: 4px 6px; }
table.chart td.x2 { background: #cdeacc; color: #12400f; font-weight: 700; }
table.chart td.x05 { background: #f4d4cf; color: #5a1b10; }
table.chart td.x1 { color: var(--muted); }
:root[data-theme="dark"] table.chart td.x2 { background: #1f4a22; color: #c9f1c6; }
:root[data-theme="dark"] table.chart td.x05 { background: #4d2620; color: #f5cfc7; }
.tag { display: inline-block; padding: 0 9px; border-radius: 4px; font-size: .8em; line-height: 1.7; color: #fff; white-space: nowrap;
  margin: 1px 3px 1px 0; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,.25); border: 1px solid rgba(0,0,0,.15); }
.pill { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: .8em; background: var(--card2); color: var(--muted); margin-right: 3px; white-space: nowrap; border: 1px solid var(--line2); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.good { background: var(--accent-soft); color: var(--accent); }
.spr { display: inline-block; background-repeat: no-repeat; background-position: center; background-size: contain; image-rendering: pixelated; width: 40px; height: 40px; flex: none; vertical-align: middle; }
.spr.s24 { width: 24px; height: 24px; } .spr.s32 { width: 32px; height: 32px; } .spr.s56 { width: 56px; height: 56px; } .spr.s96 { width: 96px; height: 96px; }
.bars { display: grid; grid-template-columns: 4.5em 2.6em 1fr; gap: 3px 8px; align-items: center; max-width: 420px; }
.bars .bg { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.bars .fg { height: 100%; border-radius: 4px; }
.evo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--card2); }
.evo .arrow { color: var(--muted); font-size: .85em; text-align: center; }
.evo a.node { display: inline-flex; flex-direction: column; align-items: center; padding: 2px 8px; border-radius: 8px; color: var(--ink); font-size: .85em; }
.evo a.node.me { background: var(--tint, var(--accent-soft)); font-weight: 700; outline: 2px solid var(--tc, var(--accent)); }
.kv { display: grid; grid-template-columns: 5.2em 1fr; gap: 4px 10px; margin: 6px 0; }
.kv > b { color: var(--muted); font-weight: 600; }
.mini { display: inline-flex; align-items: center; gap: 2px; margin: 2px 8px 2px 0; white-space: nowrap; font-size: .9em; }
.mini .spr { margin-right: 2px; }
details.fold, details.pl, details.sp { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
details.fold > summary, details.pl > summary { cursor: pointer; padding: 7px 12px; }
details.fold > .inner { padding: 4px 14px 12px; }
details.pl .body { padding: 2px 14px 12px; border-top: 1px dashed var(--line); }
details.spoil { border: 1px dashed var(--warn); border-radius: 8px; margin: 8px 0; background: var(--card); }
details.spoil > summary { cursor: pointer; padding: 6px 12px; color: var(--warn); font-weight: 600; }
details.spoil > .inner { padding: 4px 14px 12px; }
details.in { margin: 3px 0; }
details.in > summary { cursor: pointer; color: var(--link); font-size: .9em; }
.talk p { margin: .25em 0; }
.talk .who { color: var(--accent); font-weight: 600; margin-right: .4em; }
.talk .nar { color: var(--muted); font-style: italic; }
.talk .sys { color: var(--warn); }
.step { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 6px 12px; margin: 12px 0; background: var(--card); }
.step h4 { margin: 0 0 2px; color: var(--ink); }
.goal { background: var(--accent-soft); border-radius: 4px; padding: 2px 10px; display: inline-block; margin: 2px 0; }
.battle { background: var(--card2); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.battle .bn { font-weight: 700; }
.reward { color: #2e7d4f; }
p.pl { margin: 6px 0; }
.hid, [hidden] { display: none !important; }
.hl { animation: flash 1.8s ease-out; }
@keyframes flash { 0% { background: var(--mark); } 100% { background: transparent; } }

/* phones */
@media (max-width: 900px) {
  #menubtn { display: block; }
  .lg2 { display: none; }
  .side { position: fixed; z-index: 45; left: 0; top: 52px; height: calc(100vh - 52px); background: var(--side); width: min(80vw, 260px);
    transform: translateX(-102%); transition: transform .18s; box-shadow: 6px 0 22px rgba(0,0,0,.3); }
  .side.open { transform: none; }
  .content { margin: 0; border-radius: 0; border-left: 0; border-right: 0; padding: 14px 14px 30px; }
  .ibox { float: none; width: 100%; margin: 0 0 12px; }
}
@media print { .top, .side { display: none !important; } .page { display: block !important; } .content { margin: 0; border: 0; } }








































































































































































































































































































img.spr, img.mapimg { object-fit: contain; }
