:root {
  --bg: #f6f7f9;
  --card: #fff;
  --line: #e3e6ea;
  --ink: #1c2024;
  --sub: #666e78;
  --acc: #1f6feb;
  --acc-soft: #eaf1fd;
  --ok: #0f7b4f;
  --warn: #b54708;
  --radius: 10px;
  --wrapw: 1080px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
body.wbpage { --wrapw: 1280px; }
body.gamepage { --wrapw: 1000px; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.hd {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  padding-top: env(safe-area-inset-top);
}
.hdin {
  max-width: var(--wrapw); margin: 0 auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px calc(20px + env(safe-area-inset-right)) 14px calc(20px + env(safe-area-inset-left));
}
.hd .logo { font-weight: 700; font-size: 17px; color: var(--ink); }
.hd nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.hd nav a { padding: 3px 1px; border-radius: 4px; }
.hd nav a.on { font-weight: 700; box-shadow: inset 0 -2px 0 var(--acc); }
.wrap { max-width: var(--wrapw); margin: 0 auto; padding: 20px; }
h1 { font-size: 25px; margin: 6px 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.lede { color: var(--sub); margin: 0 0 18px; }
.crumb { font-size: 13px; color: var(--sub); margin: 0 0 6px; }
.cols { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.15fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.cols > * { min-width: 0; }
.form, .result, .block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.field { margin-bottom: 14px; position: relative; }
.field > label, .rlabel { display: block; font-size: 13px; color: var(--sub); margin-bottom: 5px; }
.field input[type=text], .field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: #fbfcfd; font: inherit; color: var(--ink);
}
.field textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--acc); background: #fff; box-shadow: 0 0 0 3px var(--acc-soft);
}
.field .unit { display: inline-block; font-size: 12px; color: var(--sub); margin-top: 3px; }
.field.check { display: flex; align-items: center; }
.field.check label { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink); margin: 0; }
.field.radios .rrow { display: flex; gap: 16px; flex-wrap: wrap; }
.radio { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.hint { font-size: 12px; color: var(--sub); margin: 4px 0 0; }
.btns { display: flex; gap: 8px; margin-top: 4px; }
button {
  font: inherit; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
}
button.go { background: var(--acc); border-color: var(--acc); color: #fff; }
button:hover { filter: brightness(0.96); }
.rows { display: flex; flex-direction: column; gap: 0; }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.row:last-child { border-bottom: 0; }
.row .k { color: var(--sub); font-size: 14px; }
.row .v { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.row .v i { font-style: normal; font-weight: 400; font-size: 12px; color: var(--sub); margin-left: 3px; }
.row.total { background: var(--acc-soft); border-radius: 7px; padding: 12px 10px; margin-top: 8px; border: 0; }
.row.total .v { font-size: 20px; color: var(--acc); }
.row.sub .v { font-weight: 500; font-size: 15px; }
.row.ok .v { color: var(--ok); }
.row.bad .v { color: var(--warn); }
.tblwrap { margin-top: 16px; }
.tbname { font-size: 13px; color: var(--sub); margin: 0 0 6px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 9px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: #f2f4f7; color: var(--sub); font-weight: 600; position: sticky; top: 0; }
.rawout { background: #f8f9fb; border: 1px solid var(--line); border-radius: 7px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.rawout pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.note { font-size: 13px; color: var(--sub); background: #fbfbfc; border-left: 3px solid var(--line); padding: 9px 11px; border-radius: 0 6px 6px 0; margin: 14px 0 0; }
.tip { font-size: 12px; color: var(--sub); margin: 14px 0 0; }
.src { font-size: 12px; color: var(--sub); margin: 6px 0 0; }
.block { margin-top: 18px; }
.block ul { margin: 0; padding-left: 20px; color: var(--sub); font-size: 14px; }
.block p { color: var(--sub); font-size: 14px; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details p { margin: 8px 0 0; }
.rellist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rel { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.rel span { color: var(--ink); font-size: 14px; font-weight: 600; }
.rel em { color: var(--sub); font-size: 12px; font-style: normal; }
.rel:hover { text-decoration: none; border-color: var(--acc); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 8px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 15px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px; color: var(--ink); overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--h, var(--acc)); transform: scaleY(0); transform-origin: top; transition: transform .2s ease;
}
.card strong { font-size: 15px; }
.card span { font-size: 13px; color: var(--sub); line-height: 1.5; }
.card .tag { margin-top: auto; align-self: flex-end; font-size: 12px; font-weight: 600; color: var(--h, var(--acc)); opacity: .58; transition: opacity .18s ease; }
.card:hover { text-decoration: none; border-color: var(--h, var(--acc)); box-shadow: 0 8px 20px rgba(20, 40, 80, .1); transform: translateY(-3px); }
.card:hover::before { transform: scaleY(1); }
.card:hover .tag { opacity: 1; transform: none; }
.ft { max-width: var(--wrapw); margin: 30px auto 0; padding: 18px 20px 40px; border-top: 1px solid var(--line); color: var(--sub); font-size: 13px; }
.ft p { margin: 4px 0; }
main h1 + .lede { margin-bottom: 20px; }
.grid + h2 { margin-top: 26px; }
main > h2 { margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }

/* ===== 首页：主视觉、分类徽章、卡片动效 ===== */
.hero {
  position: relative; overflow: hidden; margin: 4px 0 22px; padding: 30px 30px 26px; border-radius: 22px; color: #fff;
  background: linear-gradient(128deg, #0d2c66 0%, #1f6feb 58%, #4f95ff 100%);
  box-shadow: 0 14px 34px rgba(13, 44, 102, .22);
}
.hero::before { content: ""; position: absolute; top: -96px; right: -70px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .26), transparent 64%); }
.hero::after { content: ""; position: absolute; bottom: -110px; right: 24%; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.herotag {
  position: relative; display: inline-flex; align-items: center; gap: 7px; margin: 0 0 14px;
  padding: 5px 13px; border-radius: 999px; background: rgba(255, 255, 255, .17); font-size: 12.5px; letter-spacing: .02em;
}
.herotag i { width: 6px; height: 6px; border-radius: 50%; background: #7ef0b6; }
.hero h1 { position: relative; margin: 0 0 12px; font-size: clamp(23px, 4.4vw, 37px); line-height: 1.28; }
.hero h1 em { font-style: normal; color: #ffe08a; }
.herolede { position: relative; max-width: 640px; margin: 0 0 20px; color: #dbe7fb; font-size: 14.5px; line-height: 1.75; }
.search {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 580px; margin: 0;
  padding: 4px 6px 4px 14px; background: #fff; border-radius: 13px; box-shadow: 0 8px 22px rgba(6, 20, 48, .24);
}
.nfgobtn { flex: 0 0 auto; padding: 8px 17px; border: 0; border-radius: 9px; background: var(--acc); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.nfgobtn:hover { background: #1f5fd0; }
.notfound .nfhero { margin-bottom: 26px; }
.notfound .pinned { margin-bottom: 4px; }
.backhome { margin: 24px 0 4px; font-size: 14.5px; }
.search svg { flex: 0 0 auto; color: var(--sub); }
.search input { flex: 1; min-width: 0; padding: 11px 2px; border: 0; background: transparent; font: inherit; color: var(--ink); }
.search input:focus { outline: none; }
.search kbd { flex: 0 0 auto; margin-right: 6px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; background: #f6f7f9; font-size: 11px; color: var(--sub); }
.hotwords { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 15px 0 0; font-size: 12.5px; color: #bcd3f6; }
.hotwords a { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .15); color: #fff; }
.hotwords a:hover { background: rgba(255, 255, 255, .3); text-decoration: none; }
.herostats { position: relative; display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .22); }
.herostats div { display: flex; flex-direction: column; }
.herostats b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.herostats span { margin-top: 5px; font-size: 12px; color: #bfd4f5; }
.catnav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 28px; }
.catnav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 13px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 15px; color: var(--ink); transition: .16s ease;
}
.catnav a:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--h); box-shadow: 0 8px 20px rgba(20, 40, 80, .11); }
.catnav .medal { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--hsoft); color: var(--h); }
.catnav .cbody { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.catnav .cname { font-size: 14.5px; font-weight: 600; }
.catnav .cblurb { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--sub); font-weight: 400; }
.catnav .ccount {
  position: absolute; top: 9px; right: 11px; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--hsoft); color: var(--h); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cat-sec { margin: 0 0 30px; scroll-margin-top: 74px; }
.sechead { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding-bottom: 11px; border-bottom: 2px solid var(--line); }
.sechead .medal { width: 34px; height: 34px; }
.sechead h2 { margin: 0; font-size: 19px; white-space: nowrap; }
.sechead p { margin: 0; color: var(--sub); font-size: 13px; }
.sechead .hits { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--hsoft); color: var(--h); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pinned { margin: 0 0 30px; }
#pinned .sechead { --h: #b45309; --hsoft: #fdf3e3; }
.pinned .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.pcard { background: linear-gradient(180deg, #fff, #fbfcff); }
.pcard .pinmark { position: absolute; top: 0; right: 0; padding: 3px 10px; border-radius: 0 12px 0 10px; background: var(--hsoft); color: var(--h); font-size: 11px; font-weight: 700; font-style: normal; }
.noresult { margin: 20px 0 4px; padding: 18px; text-align: center; color: var(--sub); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }
.rv { opacity: 0; transform: translateY(10px); }
.rv.in { opacity: 1; transform: none; transition: opacity .42s ease, transform .42s ease; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .card:hover, .catnav a:hover { transform: none; }
}
@media (max-width: 640px) {
  .hero { padding: 22px 18px 20px; border-radius: 18px; }
  .herostats { gap: 12px 20px; }
  .herostats b { font-size: 21px; }
  .search kbd { display: none; }
  .catnav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catnav .cblurb { display: none; }
  .rellist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nfgobtn { padding: 8px 12px; }
  .sechead p { display: none; }
  .hd nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 34px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
  .hd nav::-webkit-scrollbar { display: none; }
  .hd nav a { white-space: nowrap; }
}

input[type=color] { width: 56px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ===== 抠图工作台：仅 data-custom="matting" 的两个页面生效 ===== */
.wbtitle { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; }
.wbtitle h1 { font-size: 21px; margin: 0; }
.wbtitle .lede { margin: 0; font-size: 13.5px; flex: 1; min-width: 240px; }
.wb { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.wbleft { min-width: 0; align-self: stretch; }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; min-height: min(760px, calc(100vh - 96px)); min-width: 0; position: sticky; top: 72px; }
.drop { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 30px 16px; min-height: 460px; cursor: pointer; transition: border-color .15s, background .15s; border: 1.5px dashed #c3cede; border-radius: 12px; background: #fbfcfe; }
.drop:hover, .drop.over { border-color: var(--acc); background: #f1f6ff; }
.drop:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.dropicon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 8px; border-radius: 50%; color: var(--acc); background: var(--acc-soft); box-shadow: inset 0 0 0 1px #d4e2fb; }
.dropmain { margin: 0; font-size: 16px; font-weight: 600; }
.dropsub { margin: 2px 0 0; font-size: 13px; color: var(--sub); }
.board { display: flex; flex-direction: column; gap: 10px; }
.frame { position: relative; --ar: 0.75; width: min(100%, calc(var(--ar) * 62vh)); aspect-ratio: var(--ar); margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background:
  linear-gradient(45deg, #e9edf3 25%, transparent 25%) 0 0/16px 16px,
  linear-gradient(-45deg, #e9edf3 25%, transparent 25%) 0 8px/16px 16px,
  linear-gradient(45deg, transparent 75%, #e9edf3 75%) 8px -8px/16px 16px,
  linear-gradient(-45deg, transparent 75%, #e9edf3 75%) 8px 0/16px 16px, #fff; }
.frame img.orig, .frame canvas.cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.frame canvas.cv { z-index: 2; box-shadow: 0 0 0 1px rgba(20, 40, 80, .06); }
.splitline { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(20, 40, 80, .25); z-index: 3; }
.splitline span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(20, 40, 80, .3); }
.splitline span::before, .splitline span::after { content: ''; position: absolute; top: 50%; width: 0; height: 0; margin-top: -4px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.splitline span::before { left: 7px; border-right: 5px solid var(--sub); }
.splitline span::after { right: 7px; border-left: 5px solid var(--sub); }
.busy { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(255, 255, 255, .86); }
.busy p { margin: 0; font-size: 14px; color: var(--sub); }
.busy .bar { position: relative; width: 160px; height: 4px; border-radius: 4px; background: var(--acc-soft); overflow: hidden; }
.busy .bar::after { content: ''; position: absolute; inset: 0; width: 45%; border-radius: 4px; background: var(--acc); animation: wbSlide 1.1s infinite ease-in-out; }
@keyframes wbSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(230%); } }
.stagebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--sub); }
.matfile { font-weight: 600; color: var(--ink); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost { padding: 3px 10px; border-radius: 20px; background: #eef7f1; color: #14713d; font-size: 12.5px; }
.cost b { font-variant-numeric: tabular-nums; }
.split { width: 100%; margin: 2px 0 0; }
.matstatus { margin: 0; font-size: 13.5px; color: var(--sub); min-height: 22px; }
.matstatus.ok { color: #14713d; }
.matstatus.bad { color: #b3261e; }
.rail { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wbform, .wbcalc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.wbform .field { margin-bottom: 16px; position: relative; }
.chips { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 8px; }
.chip { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1px 6px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 13.5px; line-height: 1.3; cursor: pointer; transition: .12s; text-align: center; }
.chip:hover { border-color: #b9c6dd; background: #f7f9fc; }
.chip .sw { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%; background: var(--sw, transparent); box-shadow: inset 0 0 0 1px rgba(20, 40, 80, .18); }
.chip .csub { flex: 0 0 100%; font-size: 11px; color: var(--sub); }
.chip-clear .sw { background: repeating-conic-gradient(#dfe5ee 0 25%, #fff 0 50%) 50%/8px 8px; }
.sw-custom { background: conic-gradient(#f87171, #fbbf24, #34d399, #60a5fa, #c084fc, #f87171); }
.chip.on { border-color: var(--acc); background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); font-weight: 600; }
.chip.on .csub { color: var(--acc); }
.field .mirror, .field .mirror-c { position: absolute; top: 0; left: 0; width: 1px; height: 1px; min-width: 0; padding: 0; margin: 0; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; pointer-events: none; visibility: hidden; }
.srow { display: flex; gap: 10px; align-items: center; }
.srow input[type=range] { flex: 1; }
.srow input[type=number] { width: 76px; }
.sl-unit { float: right; font-weight: 400; font-size: 12px; color: var(--sub); }
.crow { display: flex; align-items: center; gap: 10px; }
.hexout { font: 13px ui-monospace, Consolas, monospace; color: var(--sub); }
.wbacts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.wbacts .dl { padding: 11px 20px; border: 1px solid #14713d; border-radius: 9px; background: #14713d; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.wbacts .dl:disabled { opacity: .45; cursor: not-allowed; }
.wbacts .clr { padding: 11px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.wbacts .rst { padding: 8px 10px; border: 0; background: none; color: var(--sub); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.wbhint { margin: 10px 0 0; font-size: 12.5px; color: var(--sub); }
.wbcalc summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 14px; }
.wbcalc summary::-webkit-details-marker { display: none; }
.wbcalc summary::before { content: '▸'; color: var(--acc); margin-right: 6px; }
.wbcalc[open] summary::before { content: '▾'; }
.wbcalc .result { padding: 12px 0 0; border: 0; background: none; }
.wbcalc .result table { font-size: 12.5px; }
.wbcalc .result th, .wbcalc .result td { padding: 5px 7px; white-space: normal; vertical-align: top; }
.wbcalc .result th:first-child, .wbcalc .result td:first-child { min-width: 5em; }
.wbcalc .row .v { font-size: 15px; }
@media (max-width: 940px) {
  .wb { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .stage { position: static; min-height: 420px; }
  .frame { width: min(100%, calc(var(--ar) * 52vh)); }
}

/* ===== 解压小游戏 ===== */
.game { margin: 14px 0 6px; }
.gamebox { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px; box-shadow: 0 2px 16px rgba(20, 40, 80, .06); }
.gamebox:fullscreen { border-radius: 0; padding: 18px; overflow: auto; background: #0e1522; }
.ghud { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.gstats { display: flex; gap: 18px; flex-wrap: wrap; }
.gstat { display: flex; flex-direction: column; gap: 2px; }
.gstat b { font-size: 27px; font-weight: 800; line-height: 1; color: var(--acc); font-variant-numeric: tabular-nums; }
.gstat span { font-size: 11.5px; color: var(--sub); letter-spacing: .04em; }
.gacts { display: flex; gap: 8px; flex-wrap: wrap; }
.gbtn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 13px; font-size: 13px; color: var(--ink); cursor: pointer; transition: .12s; }
.gbtn:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }
.gbtn.pri { border-color: var(--acc); background: var(--acc); color: #fff; font-weight: 600; }
.gamebox:fullscreen .gbtn { background: #1a2434; border-color: #2b3a52; color: #cdd9ea; }
.gstage { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 220px; }
.gbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.gbtn.on { border-color: var(--acc); background: var(--acc); color: #fff; font-weight: 600; }
.gcanvas { display: block; width: 100%; max-width: 660px; height: auto; border-radius: 12px; background: #101a2b; touch-action: none; }
.ggrid { display: grid; gap: 9px; width: 100%; max-width: 560px; }
.gmsg { margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--sub); min-height: 20px; }
.gmsg.ok { color: var(--ok); }
.gmsg.bad { color: #b3261e; }
.gamebox:fullscreen .gmsg { color: #9fb0c7; }
.gnav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.gnav a { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); transition: .14s; }
.gnav a:hover { border-color: var(--acc); box-shadow: 0 3px 12px rgba(31, 111, 235, .12); text-decoration: none; transform: translateY(-1px); }
.gnav a em { font-size: 11.5px; font-style: normal; color: var(--sub); }
.gnav a span { font-size: 15px; font-weight: 600; }
.gnav a.next { align-items: flex-end; text-align: right; background: var(--acc-soft); border-color: #cfe0fb; }
@media (max-width: 620px) {
  .gstat b { font-size: 22px; }
  .ghud { align-items: flex-start; }
}

/* ---- 滑块字段 ---- */
.rangewrap { display: flex; align-items: center; gap: 12px; }
.rangewrap input[type=range] { flex: 1 1 auto; min-width: 0; -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.rangewrap input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--line); }
.rangewrap input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--acc); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(16, 24, 40, .25); }
.rangewrap input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.rangewrap input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--acc); border: 2px solid #fff; }
.rangewrap input[type=range]:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 999px; }
.rangecur { flex: 0 0 auto; min-width: 46px; padding: 4px 8px; border-radius: 8px; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rangewrap .runit { flex: 0 0 auto; font-size: 12.5px; color: var(--sub); }

/* ---- 开关式按钮组（字符集、对比口径） ---- */
.field.checks .swrow { display: flex; flex-wrap: wrap; gap: 8px; }
.field.checks .sw { display: inline-block; margin: 0; position: relative; }
.field.checks .sw > input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.field.checks .sw > span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 13.5px; line-height: 1.3; cursor: pointer; transition: .12s; user-select: none; }
.field.checks .sw > span::before { content: ''; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #cfd6e0; transition: .12s; }
.field.checks .sw:hover > span { border-color: #b9c6dd; background: #f7f9fc; }
.field.checks .sw > input:checked + span { border-color: var(--acc); background: var(--acc-soft); font-weight: 600; box-shadow: inset 0 0 0 1px var(--acc); }
.field.checks .sw > input:checked + span::before { background: var(--acc); }
.field.checks .sw > input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---- 密码强度条 ---- */
.strength { margin-bottom: 14px; }
.meter { position: relative; height: 10px; border-radius: 999px; background: #e9edf3; overflow: hidden; }
.meter > i { position: absolute; top: 0; bottom: 0; left: 0; display: block; border-radius: 999px; background: linear-gradient(90deg, #d64545, #e0a13a 42%, #1f6feb 74%, #0f7b4f); transition: width .18s ease; }
.sline { display: flex; align-items: baseline; gap: 9px; margin: 7px 0 0; font-size: 13px; color: var(--sub); flex-wrap: wrap; }
.sline b { font-size: 15px; color: var(--ink); }
.strength.ok .sline b { color: var(--ok); }
.strength.sub .sline b { color: var(--warn); }
.strength.bad .sline b { color: #c63a3a; }
.pwlist { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.pwlist li { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f9; }
.pwlist code { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; word-break: break-all; }

/* ---- 二维码 ---- */
.qrbox { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.qrbox > svg { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qracts { display: flex; flex-direction: column; gap: 8px; }
.qrdl { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid var(--acc); border-radius: 9px; background: var(--acc); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.qrdl:hover { background: #1f5fd0; border-color: #1f5fd0; color: #fff; text-decoration: none; }
.qrdl.qrpng { background: #fff; color: var(--acc); }
.qrdl.qrpng:hover { background: var(--acc-soft); color: var(--acc); border-color: var(--acc); }

/* ---- 文本差异 ---- */
.diff { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.dline { display: flex; align-items: stretch; border-bottom: 1px solid #eef1f5; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.6; }
.dline:last-child { border-bottom: 0; }
.dline .dn { flex: 0 0 46px; padding: 2px 8px; text-align: right; background: #f2f5f8; color: #98a2b0; user-select: none; }
.dline .db { flex: 0 0 22px; text-align: center; font-weight: 700; color: #98a2b0; }
.dline code { flex: 1 1 auto; min-width: 0; padding: 2px 10px 2px 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dline.add { background: #eaf7ef; }
.dline.add .db { color: var(--ok); }
.dline.add .dn { background: #d8efe1; }
.dline.del { background: #fdecec; }
.dline.del .db { color: #c63a3a; }
.dline.del .dn { background: #f7dbdb; }
.dline.gap { background: #f4f6f9; font-family: inherit; color: var(--sub); }
.dline.gap code { padding: 2px 10px; }
@media (max-width: 640px) {
  .field.checks .sw > span { padding: 7px 10px; font-size: 13px; }
  .qracts { flex-direction: row; width: 100%; }
  .qrdl { flex: 1 1 auto; }
  .dline .dn { flex-basis: 34px; padding: 2px 5px; }
  .dline .db { flex-basis: 16px; }
}

/* ---- PWA 安全区：viewport-fit=cover 后 iOS 刘海/手势条才有 inset，普通浏览器为 0 ---- */
.wrap { padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
.ft { padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.stage, .rail { top: calc(72px + env(safe-area-inset-top)); }
