:root {
  --bg: #f7f8fa; --card: #fff; --text: #111827; --muted: #4b5563; --line: #e5e7eb;
  --brand: #0f766e; --brand-2: #14b8a6; --ok: #047857; --err: #b91c1c;
  --add: #dcfce7; --del: #fee2e2; --mark: #fde68a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --card: #111a2b; --text: #e5e7eb; --muted: #9ca3af; --line: #243047;
    --brand: #2dd4bf; --brand-2: #5eead4; --ok: #34d399; --err: #f87171; --add: #064e3b; --del: #7f1d1d; --mark: #854d0e; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); background: var(--line); padding: 0 4px; border-radius: 4px; font-size: .9em; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 24px; height: 56px; overflow-x: auto; }
.logo { font-weight: 700; font-size: 18px; color: var(--text); white-space: nowrap; }
.top nav { display: flex; gap: 16px; white-space: nowrap; }
.top nav a { color: var(--muted); }
.top nav a[aria-current] { color: var(--brand); font-weight: 600; }
main { padding: 16px 16px 48px; }
h1 { font-size: 26px; line-height: 1.3; margin: 12px 0 8px; }
h2 { font-size: 20px; margin: 28px 0 8px; }
.h3 { font-size: 16px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.crumbs { font-size: 14px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 10px 0; }
.btn { display: inline-block; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1.5; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: 2px 10px; font-size: 13px; }
.btn.file { position: relative; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
textarea { width: 100%; min-height: 260px; font-family: var(--mono); font-size: 14px; resize: vertical; }
.mono { font-family: var(--mono); }
.big { width: 100%; font-size: 20px; padding: 10px 14px; }
.small { width: 70px; }
.io, .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .io, .grid2 { grid-template-columns: 1fr; } }
.out-wrap { position: relative; }
.out-wrap [data-copy] { position: absolute; top: 8px; right: 8px; background: var(--card); }
.out { margin: 0; min-height: 260px; max-height: 70vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 14px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.card .out { min-height: 120px; }
.msg { min-height: 1.5em; color: var(--muted); margin: 8px 0; font-size: 14px; }
.msg.ok { color: var(--ok); } .msg.err, .result.err { color: var(--err); }
.result { font-family: var(--mono); font-size: 18px; margin: 10px 0 0; word-break: break-all; }
.now { margin-bottom: 8px; } .now b { font-family: var(--mono); color: var(--brand); }
.card input { width: 100%; }
.kv { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.kv th, .kv td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; word-break: break-all; }
.kv th { background: var(--bg); white-space: nowrap; }
.regex-row { display: flex; align-items: center; gap: 6px; font: 20px var(--mono); }
.regex-row #pattern { flex: 1; font-family: var(--mono); }
.hl mark { background: var(--mark); color: inherit; border-radius: 3px; }
.diff .add { background: var(--add); display: block; } .diff .del { background: var(--del); display: block; }
.runs { font-family: var(--mono); }
.radix label { display: flex; flex-direction: column; gap: 4px; }
.radix label .small { display: inline-block; }
#preview { max-width: 200px; margin-top: 8px; border: 1px solid var(--line); }
.content { max-width: 800px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related a { border: 1px solid var(--line); background: var(--card); padding: 4px 12px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.grid a.card { color: var(--text); display: block; }
.grid a.card:hover { border-color: var(--brand); text-decoration: none; }
.grid a.card b { color: var(--brand); display: block; margin-bottom: 4px; }
.grid a.card span { color: var(--muted); font-size: 14px; }
.hero { padding: 28px 0 8px; } .hero h1 { font-size: 30px; }
.q { border: 1px solid var(--line); background: var(--card); border-radius: 10px; margin: 10px 0; padding: 10px 14px; }
.q legend { font-weight: 600; padding: 0 4px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.scale label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); cursor: pointer; text-align: center; }
.scale input { width: 22px; height: 22px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--brand-2); transition: width .2s; }
.result-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.kicker { color: var(--muted); margin: 0; }
.type-code { font-size: 44px; margin: 4px 0; color: var(--brand); } .type-code small { font-size: 22px; color: var(--text); }
.lead { font-size: 18px; }
.dim { display: grid; grid-template-columns: 80px 1fr 80px 110px; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.dim .bar { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; } .dim .bar div { height: 100%; background: var(--brand-2); }
.dim span:nth-of-type(2) { text-align: right; } .dim em { font-style: normal; color: var(--muted); }
@media (max-width: 560px) { .dim { grid-template-columns: 60px 1fr 60px; } .dim em { grid-column: 1 / -1; } }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.note { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 16px 0 32px; }
.foot a { color: var(--muted); margin-left: 6px; }

/* 解压小游戏 */
.game-canvas { display: block; width: 100%; border-radius: 10px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; background: #e5e7eb; }
.game progress { flex: 1; min-width: 160px; height: 12px; accent-color: var(--brand); }
.result { margin-top: 12px; padding: 16px; border: 2px solid var(--brand); border-radius: 12px; text-align: center; }
.result-stat { margin: 0; color: var(--muted); }
.result-title { margin: 4px 0; color: var(--brand); font-size: 28px; }
.result .toolbar { justify-content: center; }
.bubble-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.blob { width: 96px; height: 96px; transition: transform .15s; }
.blob[data-mood="happy"] { transform: scale(1.08) rotate(-4deg); }
.blob[data-mood="wild"] { transform: scale(1.18) rotate(6deg); }
.blob[data-mood="dizzy"] { transform: rotate(-14deg); }
.blob[data-mood="dizzy"] .eye { transform-box: fill-box; transform-origin: center; transform: scaleY(.3); }
.bubbles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; width: 100%; max-width: 520px; padding: 12px; background: #e0f2fe; border-radius: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.bubble { aspect-ratio: 1; border-radius: 50%; border: 2px solid #7dd3fc; padding: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #fff 0 18%, rgba(255,255,255,.75) 30%, rgba(186,230,253,.6) 70%); box-shadow: inset -3px -4px 6px rgba(14,116,144,.18), 0 2px 3px rgba(14,116,144,.15); transition: transform .08s; }
.bubble:active { transform: scale(.9); }
.bubble.popped { cursor: default; transform: scale(.88, .6) rotate(-12deg); background: rgba(148,163,184,.25); box-shadow: none; border-color: rgba(125,211,252,.5); }
@media (prefers-color-scheme: dark) { .bubbles { background: #0c2a3a; } }
