:root {
  --bg: #f7f8fc;
  --bg-elev: #ffffff;
  --bg-soft: #eef1f8;
  --border: #e2e6f0;
  --border-strong: #cdd4e4;
  --text: #171a23;
  --text-dim: #5b6478;
  --text-faint: #8a93a8;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --brand-border: #c7d2fe;
  --accent: #0ea5a4;
  --accent-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 25, 40, .06);
  --shadow: 0 2px 8px rgba(20, 25, 40, .07);
  --shadow-lg: 0 12px 32px rgba(20, 25, 40, .12);
  --maxw: 1200px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── Header ───────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--brand); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800;
}
.main-nav { display: flex; align-items: center; gap: 10px; margin-left: 6px; }
.main-nav > a {
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  white-space: nowrap;
}
.main-nav > a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.main-nav > a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* ── 下拉菜单 ─────────────────────────────────────── */
.nav-dd { position: relative; }

.nav-dd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 0; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  font-family: inherit; line-height: inherit;
  white-space: nowrap;
}
.nav-dd-btn:hover { background: var(--bg-soft); color: var(--text); }
.nav-dd-btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-dd-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 箭头用 CSS 三角形画，不依赖字体里的 ▾（那个字符在小字号下几乎看不见） */
.dd-caret {
  width: 0; height: 0; font-size: 0; line-height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .5;
  transition: transform .16s, opacity .16s;
}
.nav-dd-btn:hover .dd-caret,
.nav-dd.open .dd-caret { opacity: .8; }
.nav-dd.open .dd-caret { transform: rotate(180deg); }

/* 面板：外层透明、留 8px 空隙作为「桥」，中间才是白卡片，
   这样鼠标从按钮移到面板不会因为穿过空隙而收起 */
.nav-dd-panel {
  position: absolute; top: 100%; left: 0;
  padding-top: 8px; z-index: 120;
  display: none;
}
.nav-dd-inner {
  min-width: 460px; max-width: min(86vw, 620px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(16, 24, 40, .14), 0 3px 10px rgba(16, 24, 40, .06);
  padding: 10px;
}
.dd-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text); font-size: 13.5px;
}
.dd-item:hover { background: var(--bg-soft); text-decoration: none; color: var(--brand-dark); }
.dd-ic { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.dd-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-n {
  font-size: 11.5px; color: var(--text-faint);
  background: var(--bg-soft); border-radius: 99px;
  padding: 1px 7px; flex-shrink: 0;
}
.dd-all {
  display: block; margin-top: 8px; padding: 9px 10px;
  border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--brand);
  border-radius: 0 0 8px 8px;
}
.dd-all:hover { background: var(--bg-soft); text-decoration: none; }

/* 只有真鼠标才用 hover 展开，触摸屏靠点击（避免点一下只触发 hover） */
@media (hover: hover) and (pointer: fine) {
  .nav-dd:hover .nav-dd-panel { display: block; }
}
.nav-dd.open .nav-dd-panel,
.nav-dd:focus-within .nav-dd-panel { display: block; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 100px;
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  font-size: 13.5px; font-weight: 600; color: var(--text-dim);
}
.lang-switch:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  cursor: pointer; color: var(--text); align-items: center; justify-content: center;
  flex-direction: column; gap: 3px; padding: 0;
}
.nav-toggle span {
  display: block; width: 16px; height: 2px; border-radius: 1px;
  background: currentColor; transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ── Search ──────────────────────────────────────── */
.search-box { position: relative; flex: 1; max-width: 340px; }
.search-box input {
  width: 100%; height: 38px; padding: 0 14px 0 36px;
  border: 1px solid var(--border-strong); border-radius: 100px;
  background: var(--bg-elev); font-family: inherit; font-size: 14.5px; color: var(--text);
}
.search-box input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none; font-size: 15px;
}
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 120;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto; display: none; padding: 6px;
}
.search-results.open { display: block; }
.search-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-sm); color: var(--text); font-size: 14.5px;
}
.search-item:hover, .search-item.sel { background: var(--brand-soft); text-decoration: none; }
.search-item .si-icon {
  width: 26px; height: 26px; border-radius: 6px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 14px; flex-shrink: 0;
}
.search-item .si-name { font-weight: 600; }
.search-item .si-cat { margin-left: auto; font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.search-empty { padding: 22px 14px; text-align: center; color: var(--text-faint); font-size: 14px; }
mark { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ── Hero ────────────────────────────────────────── */
.hero { padding: 52px 0 34px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: 14px; letter-spacing: -.025em; }
.hero .sub { font-size: 17px; color: var(--text-dim); max-width: 640px; margin: 0 auto 22px; }
.hero-stats {
  display: flex; justify-content: center; gap: 10px 34px; flex-wrap: wrap;
  margin-top: 26px;
}
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 25px; color: var(--brand); font-weight: 800; line-height: 1.2; }
.hero-stat span { font-size: 13px; color: var(--text-faint); }

.search-hero { max-width: 560px; margin: 0 auto; }
.search-hero input {
  width: 100%; height: 50px; padding: 0 18px 0 46px; font-size: 15.5px;
  border: 1px solid var(--border-strong); border-radius: 100px;
  background: var(--bg-elev); font-family: inherit; color: var(--text);
  box-shadow: var(--shadow);
}
.search-hero input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-hero .search-box { max-width: none; }

/* ── Section ─────────────────────────────────────── */
.section { padding: 38px 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-head h2 { font-size: 23px; margin: 0; }
.section-head .count { font-size: 13.5px; color: var(--text-faint); }
.section-head .more { margin-left: auto; font-size: 14px; font-weight: 600; }

/* ── Category grid ───────────────────────────────── */
.cat-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
}
.cat-card {
  display: block; padding: 16px 18px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); transition: .16s;
}
.cat-card:hover {
  text-decoration: none; border-color: var(--brand);
  box-shadow: var(--shadow); transform: translateY(-2px);
}
.cat-card .cc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cat-card .cc-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 17px;
  background: var(--brand-soft);
}
.cat-card .cc-name { font-weight: 700; color: var(--text); font-size: 15.5px; }
.cat-card .cc-num { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.cat-card .cc-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }

/* ── Tool grid ───────────────────────────────────── */
.tool-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.tool-card {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); transition: .16s; color: var(--text);
}
.tool-card:hover {
  text-decoration: none; border-color: var(--brand);
  box-shadow: var(--shadow); transform: translateY(-1px);
}
.tool-card .tc-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px;
  background: var(--bg-soft);
}
.tool-card .tc-body { min-width: 0; }
.tool-card .tc-name { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.tool-card .tc-desc {
  font-size: 12.8px; color: var(--text-faint); line-height: 1.45; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Page layout (tool/game detail) ──────────────── */
.page-grid {
  display: grid; gap: 28px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 300px;
}
.page-main { min-width: 0; }
.breadcrumb { font-size: 13.5px; color: var(--text-faint); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb .sep { margin: 0 7px; opacity: .5; }

.page-title { font-size: clamp(24px, 4vw, 31px); margin-bottom: 8px; }
.page-desc { color: var(--text-dim); font-size: 16px; margin-bottom: 6px; }
.page-meta { font-size: 13px; color: var(--text-faint); margin-bottom: 20px; }

.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-title { font-size: 16.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* ── Tool widget ─────────────────────────────────── */
.tool-io { display: grid; gap: 14px; }
@media (min-width: 860px) {
  .tool-io.two-col { grid-template-columns: 1fr 1fr; }
}
.field { display: block; }
.field-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.field-label .grow { margin-left: auto; display: flex; gap: 6px; }

textarea, input[type="text"], input[type="number"], select {
  width: 100%; padding: 10px 12px; font-family: var(--mono); font-size: 13.5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); line-height: 1.6;
}
textarea { resize: vertical; min-height: 148px; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
input[type="text"].sans, .sans { font-family: var(--font); }
input[type="range"] { width: 100%; accent-color: var(--brand); }
input[type="color"] {
  width: 46px; height: 34px; padding: 2px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--bg); cursor: pointer;
}
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  color: var(--text-dim); font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .14s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px;
  margin: 12px 0; display: none;
}
.alert.show { display: block; }
.alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-info { background: var(--brand-soft); border: 1px solid var(--brand-border); color: var(--brand-dark); }

.result-line {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--border); font-size: 14px;
}
.result-line:last-child { border-bottom: 0; }
.result-line .rl-k { color: var(--text-dim); flex-shrink: 0; min-width: 96px; font-size: 13.5px; }
.result-line .rl-v { font-family: var(--mono); font-size: 13.5px; word-break: break-all; flex: 1; }

.stat-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.stat-tile {
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--bg-soft); text-align: center;
}
.stat-tile b { display: block; font-size: 21px; font-weight: 800; color: var(--text); line-height: 1.3; }
.stat-tile span { font-size: 12.5px; color: var(--text-faint); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 78px; height: 62px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); cursor: pointer; position: relative;
  display: grid; place-items: end center; padding-bottom: 4px;
  font-size: 10.5px; font-family: var(--mono);
}
.swatch:hover { transform: scale(1.05); z-index: 2; }

.copy-out {
  display: flex; gap: 8px; align-items: flex-start;
}
.copy-out textarea, .copy-out > div:first-child { flex: 1; min-width: 0; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar { position: sticky; top: 82px; }
.side-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px; margin-bottom: 16px;
}
.side-title {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); margin-bottom: 11px;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { margin-bottom: 3px; }
.side-list a {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: 14px;
}
.side-list a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.side-list a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side-list .sl-icon { flex-shrink: 0; opacity: .8; }

/* ── Ads ─────────────────────────────────────────── */
.ad-slot {
  margin: 20px 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  background: repeating-linear-gradient(45deg, #fafbfe, #fafbfe 10px, #f4f6fc 10px, #f4f6fc 20px);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-faint); overflow: hidden; min-height: 60px;
}
.ad-slot.filled { background: none; border: 0; min-height: 0; }
.ad-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.ad-dim { font-size: 11px; opacity: .6; }
.ad-slot.is-empty { display: none; }
@media (max-width: 860px) {
  .ad-slot[data-slot="header"], .ad-slot[data-slot="footer"] { max-width: 100%; }
}

/* ── Prose (about / privacy / guides) ─────────────── */
.prose { max-width: 760px; }
.prose h2 { font-size: 21px; margin: 34px 0 12px; padding-top: 6px; }
.prose h3 { font-size: 17px; margin: 24px 0 9px; }
.prose p { margin: 0 0 14px; color: var(--text-dim); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 24px; color: var(--text-dim); }
.prose li { margin-bottom: 7px; }
.prose code {
  background: var(--bg-soft); padding: 2px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 13px; color: var(--brand-dark);
}
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 600; }
.prose blockquote {
  margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--brand);
  background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--brand-dark);
}
.toc {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 26px;
}
.toc-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 26px; font-size: 14px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  margin-top: 60px; padding: 42px 0 26px;
  background: var(--bg-elev); border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid; gap: 30px;
  grid-template-columns: 1.6fr repeat(3, 1fr);
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h4 {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin-bottom: 12px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-dim); font-size: 14px; }
.footer-col a:hover { color: var(--brand); }
.footer-about p { color: var(--text-dim); font-size: 14px; margin: 10px 0 0; max-width: 300px; }
.footer-bottom {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint);
}

/* ── Game ────────────────────────────────────────── */
.game-stage {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; min-height: 340px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.game-hud {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 16px; width: 100%;
}
.hud-pill {
  padding: 5px 13px; border-radius: 100px; background: var(--bg-soft);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
}
.hud-pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.hud-pill.hi { background: var(--brand-soft); color: var(--brand-dark); }
.hud-pill.ok { background: #d1fae5; color: #065f46; }
.hud-pill.bad { background: #fee2e2; color: #991b1b; }

.game-arena {
  position: relative; width: 100%; max-width: 560px; height: 340px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  display: grid; place-items: center; user-select: none; touch-action: manipulation;
}
.game-arena.pad { display: block; }
.game-msg {
  text-align: center; color: var(--text-dim); font-size: 15.5px; padding: 20px;
  max-width: 400px;
}
.game-msg .big { font-size: 27px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.game-msg .hint { font-size: 13.5px; color: var(--text-faint); margin-top: 10px; }

.pad-grid { display: grid; width: 100%; height: 100%; }
.pad-cell {
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
  color: #fff; cursor: pointer; user-select: none; transition: background .08s;
  border: 2px solid var(--bg-elev);
}
.pad-cell:active { filter: brightness(.82); }
.pad-cell.flash { background: var(--brand) !important; }
.seq-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.seq-key {
  width: 62px; height: 62px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 25px; font-weight: 800;
  color: #fff; cursor: pointer; user-select: none; transition: transform .08s, filter .08s;
}
.seq-key:active { transform: scale(.9); filter: brightness(1.25); }
.seq-key.lit { filter: brightness(1.4); transform: scale(1.07); box-shadow: 0 0 0 3px var(--brand); }

.grip-area { position: relative; width: 100%; height: 100%; cursor: crosshair; }
.grip-target {
  position: absolute; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 20px; transform: translate(-50%, -50%);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .2);
}
.grip-cursor {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--brand); transform: translate(-50%, -50%); pointer-events: none;
}

/* ── 数字华容道 ── */
.sl-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  width: min(100%, 360px); margin: 4px auto 0; padding: 10px;
  background: var(--bg-soft); border-radius: 12px;
}
.sl-tile {
  aspect-ratio: 1; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  font-size: clamp(20px, 6vw, 30px); font-weight: 800; color: var(--text);
  cursor: pointer; user-select: none; box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transition: background .12s, transform .08s;
}
.sl-tile:active { transform: scale(.94); }
.sl-tile.correct { background: var(--brand-soft); color: var(--brand-dark); }
.sl-tile.empty { background: transparent; border-color: dashed var(--border); box-shadow: none; cursor: default; }

/* ── 24 点心算 ── */
.m24-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 6px 0 22px; }
.m24-card {
  width: 66px; height: 92px; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; color: #b91c1c;
  background: #fff; border: 2px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.m24-input {
  display: block; width: min(100%, 340px); margin: 0 auto; padding: 12px 14px;
  font-family: var(--mono); font-size: 18px; text-align: center;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft); color: var(--text);
}
.m24-msg { text-align: center; min-height: 24px; margin-top: 16px; font-size: 14px; color: var(--text-dim); }
.m24-msg.good { color: var(--ok); font-weight: 700; }
.m24-msg.bad { color: var(--danger); }
.m24-msg.hint { color: var(--brand-dark); }

/* ── 电子木鱼 ── */
.wf-fish {
  display: inline-block; line-height: 0; border: 0; background: none; cursor: pointer;
  padding: 8px 12px; user-select: none; transition: transform .08s;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.15));
}
.wf-fish svg { width: 180px; height: 135px; max-width: 60vw; }
.wf-fish.hit { animation: wf-hit .18s ease-out; }
@keyframes wf-hit { 0% { transform: scale(1) rotate(0) } 50% { transform: scale(.94) rotate(-3deg) } 100% { transform: scale(1) rotate(0) } }
.wf-mallet { transform-box: fill-box; transform-origin: 20% 80%; }
.wf-mallet.hit { animation: wf-mallet-hit .18s ease-out; }
@keyframes wf-mallet-hit { 0% { transform: rotate(0) } 50% { transform: rotate(-22deg) } 100% { transform: rotate(0) } }
.wf-count { font-size: 44px; font-weight: 800; color: var(--brand); line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 10px; }

/* ── 答案之书 ── */
.ab-book { font-size: 84px; text-align: center; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0,0,0,.15)); }
.ab-answer {
  max-width: 460px; margin: 0 auto; min-height: 78px; padding: 18px 22px;
  font-size: 19px; line-height: 1.7; text-align: center; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s;
}
.ab-answer.show { opacity: 1; transform: none; }

/* ── 捏泡泡 ── */
.bp-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; max-width: 560px; margin: 0 auto; }
.bp-bubble {
  aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--brand-border); cursor: pointer;
  background: radial-gradient(circle at 32% 28%, #fff 0%, var(--brand-soft) 55%, var(--brand-border) 100%);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.08), 0 2px 5px rgba(0,0,0,.08); transition: transform .1s, opacity .15s;
}
.bp-bubble:hover { transform: scale(1.08); }
.bp-bubble.popped { background: var(--bg-soft); border-style: dashed; box-shadow: none; transform: scale(.8); opacity: .5; }
@media (max-width: 560px) { .bp-grid { grid-template-columns: repeat(8, 1fr); } }

/* ── 烟花模拟器 ── */
.fw-canvas { display: block; width: 100%; height: min(60vh, 420px); min-height: 320px; border-radius: 12px; cursor: crosshair; background: #0a0c18; }

/* ── 空当接龙 ── */
.fc-board { max-width: 620px; margin: 0 auto; }
.fc-top { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.fc-gap { width: 20px; }
.fc-cell, .fc-slot {
  width: 58px; height: 82px; border-radius: 7px; border: 1.5px dashed var(--border);
  display: grid; place-items: center; background: var(--bg-soft); flex-shrink: 0;
}
.fc-found { color: var(--text-faint); font-size: 26px; }
.fc-cols { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.fc-col { min-height: 120px; display: flex; flex-direction: column; align-items: center; }
.fc-stack { margin-top: -52px; }
.fc-stack:first-child { margin-top: 0; }
.fc-card {
  width: 58px; height: 82px; border-radius: 7px; background: #fff; border: 1px solid #cbd0dc;
  box-shadow: 0 2px 5px rgba(0,0,0,.14); cursor: pointer; user-select: none;
  display: flex; flex-direction: column; align-items: flex-start; padding: 5px 6px; box-sizing: border-box;
  transition: transform .08s;
}
.fc-card:hover { transform: translateY(-2px); }
.fc-card.selected { outline: 3px solid var(--brand); outline-offset: 1px; }
.fc-card.fc-red { color: #d12f3e; }
.fc-card.fc-black { color: #1b2430; }
.fc-rank { font-size: 17px; font-weight: 800; line-height: 1; }
.fc-suit { font-size: 20px; line-height: 1.1; }
.fc-card.fc-down { background: repeating-linear-gradient(45deg, #4a5a86, #4a5a86 6px, #3a4a72 6px, #3a4a72 12px); color: #fff; font-size: 30px; align-items: center; justify-content: center; cursor: default; }
@media (max-width: 620px) {
  .fc-card, .fc-cell, .fc-slot { width: 38px; height: 54px; }
  .fc-rank { font-size: 13px; } .fc-suit { font-size: 15px; }
  .fc-stack { margin-top: -34px; }
  .fc-gap { width: 8px; }
}

/* ── 飞机大战 ── */
.ps-canvas { display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 12px; touch-action: none; cursor: crosshair; }

.catch-item {
  position: absolute; width: 42px; height: 42px; border-radius: 9px;
  display: grid; place-items: center; font-size: 21px; color: #fff;
  transform: translate(-50%, -50%); box-shadow: var(--shadow);
}
.catch-tray {
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: var(--brand-soft); border-top: 2px dashed var(--brand-border);
  display: grid; place-items: center; font-size: 12.5px; color: var(--brand-dark); font-weight: 600;
}

.bar-track { width: 100%; height: 12px; background: var(--bg-soft); border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 100px; transition: width .12s linear; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.bad { background: var(--danger); }
.bar-fill.warn { background: var(--warn); }

.record-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.record-table th, .record-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.record-table th { font-size: 12.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.record-table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.record-table tr:last-child td { border-bottom: 0; }

.guide-list { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 14.5px; }
.guide-list li { margin-bottom: 8px; }
kbd {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--text);
}

/* ── Misc ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12px; font-weight: 600;
}
.pill-game { background: var(--accent-soft); color: #0f766e; }
/* 窄屏：标签统一独占一行。
   否则「名字长的挤到下一行、名字短的跟标签同行」，同一行卡片高度不齐、看着乱。 */
@media (max-width: 720px) {
  .tool-card .pill {
    display: block; width: fit-content; margin-top: 4px;
    padding: 2px 7px; font-size: 10.5px; font-weight: 600;
  }
}
/* 窄屏：标签统一独占一行。
   否则「名字长的挤到下一行、名字短的跟标签同行」，同一行卡片高度不齐、看着乱。 */
@media (max-width: 720px) {
  .tool-card .pill {
    display: block; width: fit-content; margin-top: 4px;
    padding: 2px 7px; font-size: 10.5px; font-weight: 600;
  }
}

.breadcrumb-bar { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.breadcrumb-bar .wrap { padding-top: 9px; padding-bottom: 9px; }

.mobile-only { display: none; }
@media (max-width: 940px) {
  .page-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  /* 移动端：导航变成抽屉，由汉堡按钮切换 */
  /* ⚠️ 这里必须用 absolute 而不是 fixed：
     .site-header 上的 backdrop-filter 会创建新的包含块，
     内部 position:fixed 会相对 header 定位（高度 62px），抽屉直接变成 0 高。
     absolute + top:100% 相对 sticky 的 header 定位，行为稳定。 */
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - 62px);
    height: calc(100dvh - 62px);   /* iOS 地址栏收起/展开时更准，不支持的浏览器忽略此行 */
    display: none; flex-direction: column; align-items: stretch;
    gap: 4px; padding: 10px 12px 24px; margin: 0;
    background: var(--bg); border-top: 1px solid var(--border);
    overflow-y: auto; z-index: 110;
  }
  .main-nav.open { display: flex; }
  body.nav-open { overflow: hidden; }
  .main-nav > a { padding: 11px 12px; font-size: 15px; }
  .nav-toggle { display: flex; }

  /* 抽屉里的下拉改为就地展开，不做浮层 */
  .nav-dd { position: static; }
  .nav-dd-btn { width: 100%; justify-content: space-between; padding: 11px 12px; font-size: 15px; }
  .nav-dd-panel {
    position: static; padding-top: 0; display: none;
  }
  .nav-dd.open .nav-dd-panel { display: block; }
  .nav-dd-inner {
    min-width: 0; max-width: none; padding: 0 0 6px 4px;
    border: 0; box-shadow: none; background: transparent;
  }
  .dd-item { padding: 9px 10px; font-size: 14px; }
  .dd-all { border-top: 0; padding: 9px 10px; }

  .search-box { display: none; }
  .header-inner { gap: 12px; }
  .mobile-only { display: block; }
  .cat-grid, .tool-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .toc ol { columns: 1; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── 移植游戏（iframe）──────────────────────────────
   这些游戏来自 flea-game（MIT），页面独立放在 /assets/games/<id>/，
   用 iframe 隔离样式与脚本，避免与原站 CSS 互相污染。 */
.game-frame {
  display: block;
  width: 100%;
  height: min(78vh, 760px);
  min-height: 520px;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
  overscroll-behavior: contain;
}
@media (max-width: 720px) {
  .game-frame { height: 74vh; min-height: 460px; }
}

/* ── 第三方游戏版权署名 ──────────────────────────────
   MIT 许可证要求保留版权声明，必须显示，但不必抢戏：
   小一号、颜色更淡、上方一条细分隔线，视觉上退到说明区末尾。 */
/* 选择器必须带 .prose —— 否则被 `.prose p { color: var(--text-dim) }` 压掉，
   字号和颜色都不生效（优先级：.prose p = 0,0,1,1 > .game-credit = 0,0,1,0）。 */
.prose .game-credit {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  line-height: 1.75;
  color: #aab1c2;
}
.prose .game-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.prose .game-credit a:hover { color: var(--text-dim); }

/* ═══ 2026-11 第三批娱乐工具样式 ═══ */
/* 架子鼓 */
.drum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.drum-pad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; border: 2px solid var(--border); border-radius: 12px; background: var(--card);
  color: var(--text); cursor: pointer; transition: transform .08s, box-shadow .12s, border-color .12s; user-select: none; }
.drum-pad b { font-size: 20px; color: var(--pad); }
.drum-pad span { font-size: 12px; color: var(--text-dim); }
.drum-pad:hover { border-color: var(--pad); }
.drum-pad.hit { transform: scale(.93); border-color: var(--pad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pad) 28%, transparent); }
.drum-status { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 14px; min-height: 20px; }
@media (max-width: 520px) { .drum-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } .drum-pad { min-height: 66px; } .drum-pad b { font-size: 16px; } .drum-pad span { font-size: 10px; } }

/* 魔法键盘 */
.mk-stage { position: relative; overflow: hidden; border-radius: 14px; padding: 26px 12px 20px;
  background: radial-gradient(ellipse at 50% 60%, #101522, #070a12); min-height: 260px; }
.mk-glow { position: absolute; inset: 0; pointer-events: none; transition: background .25s; }
.mk-keys { position: relative; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.mk-row { display: flex; gap: 8px; justify-content: center; }
.mk-key { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 9px;
  background: #1b2233; color: #9aa6bd; font-weight: 700; font-size: 16px; position: relative; }
.mk-key.pop { animation: mk-pop .32s ease-out; }
@keyframes mk-pop { 0% { transform: scale(1.18) translateY(-4px); } 100% { transform: scale(1); } }
.mk-particle { position: absolute; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  animation: mk-fly .7s ease-out forwards; }
@keyframes mk-fly { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); } }
.mk-status { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 12px; }
@media (max-width: 520px) { .mk-key { width: 30px; height: 34px; font-size: 12px; } .mk-row, .mk-keys { gap: 5px; } }

/* 到账音效 */
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 12px; }

/* 在线空调 */
.ac-box { border-radius: 14px; background: linear-gradient(160deg, #eef6ff, #d9e9f7); padding: 22px 16px 18px;
  position: relative; overflow: hidden; min-height: 250px; }
.ac-unit { position: relative; height: 92px; background: linear-gradient(#fff, #eef2f6); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(40,80,130,.15); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.ac-vent { width: 55%; height: 12px; border-radius: 8px; background: repeating-linear-gradient(90deg, #b9c6d4 0 4px, #e8eef4 4px 9px); }
.ac-display { font-size: 14px; color: #3a6ea5; }
.ac-display b { font-size: 30px; }
.ac-snow { position: absolute; inset: 0; pointer-events: none; }
.ac-flake { position: absolute; top: -20px; font-size: 14px; animation: ac-fall linear infinite; }
@keyframes ac-fall { 0% { transform: translateY(-10px) rotate(0); } 100% { transform: translateY(280px) rotate(180deg); } }
.ac-msg { text-align: center; margin-top: 18px; font-size: 13.5px; color: #3a6ea5; font-weight: 600; min-height: 20px; }

/* 云壁炉 / 流体 */
.fp-canvas, .fluid-canvas { display: block; width: 100%; border-radius: 12px; touch-action: none; background: #0a0c16; }
.fluid-canvas { cursor: crosshair; height: auto; }

/* 摸头杀 / 云吸猫 */
.pet-stage, .purr-stage { position: relative; height: 240px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 70%, #fff4dc, #ffe0ea); display: grid; place-items: center; cursor: pointer; user-select: none; }
.pet-animal, .purr-cat { font-size: 108px; line-height: 1; transform-origin: 50% 90%; }
.pet-animal.patting { animation: pet-wiggle .5s ease-in-out; }
@keyframes pet-wiggle { 0%,100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-9deg) translateY(5px); } 75% { transform: rotate(9deg) translateY(5px); } }
.pet-hand { position: absolute; font-size: 52px; top: 6px; left: 50%; margin-left: -26px; transform: rotate(18deg); z-index: 2; }
.hand-pat .pet-hand { animation: hand-pat .5s ease-in-out; }
@keyframes hand-pat { 0%,100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(18deg) translateY(48px); } }
.pet-shadow { position: absolute; bottom: 34px; width: 140px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.08); }
.pet-name { text-align: center; font-weight: 700; font-size: 16px; margin-top: 12px; }
.purr-stage { background: radial-gradient(circle at 50% 70%, #eef6ff, #e8dcf7); }
.purr-cat.purring { animation: purr-shake .22s linear infinite; }
@keyframes purr-shake { 0%,100% { transform: translate(0,0); } 25% { transform: translate(1px,-1px); } 75% { transform: translate(-1px,1px); } }
.purr-zzz { position: absolute; top: 48px; right: 32%; font-size: 26px; opacity: .5; }

/* 程序员求签 */
.divine-box { text-align: center; padding: 10px 0 4px; }
.divine-cup { font-size: 56px; }
.divine-result { min-height: 96px; margin-top: 14px; opacity: 0; transform: translateY(8px); }
.divine-result.show { animation: divine-in .45s ease-out forwards; }
@keyframes divine-in { to { opacity: 1; transform: translateY(0); } }
.divine-tag { display: inline-block; font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: 2px; }
.divine-text { margin-top: 8px; font-size: 14.5px; color: var(--text-dim); line-height: 1.7; max-width: 460px; margin-inline: auto; }

/* 60 秒冥想 */
.med-box { display: grid; place-items: center; min-height: 300px; }
.med-ring { width: 230px; height: 230px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from 0deg, #8fd3c7, #6fa8dc, #b39ddb, #8fd3c7);
  transition: transform .25s linear; box-shadow: 0 0 50px rgba(111,168,220,.25); }
.med-core { width: 200px; height: 200px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.med-phase { font-size: 20px; color: var(--brand-dark); }
.med-time { font-size: 46px; font-weight: 800; line-height: 1.1; }
.med-core small { font-size: 12px; color: var(--text-faint); }

/* 故障风图片 */
.gi-wrap { width: 100%; }
.dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 44px 20px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--bg-soft, rgba(0,0,0,.02)); }
.dropzone > div { font-size: 16px; font-weight: 600; }
.dropzone small { display: block; margin-top: 8px; font-size: 12.5px; color: var(--text-faint); }
.gi-canvas { display: block; max-width: 100%; border-radius: 10px; margin-bottom: 16px; background: #111; height: auto; }
.gi-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
.gi-ctrl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.gi-ctrl span b { color: var(--brand); }
.gi-ctrl input[type=range] { width: 100%; }
@media (max-width: 520px) { .gi-controls { grid-template-columns: 1fr; } }

/* 通用按钮行 */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }


/* ===== 2026-11 第四批：toolwa 娱乐+便民图片类 ===== */
/* 几枝诗词波浪 */
.jp-canvas { display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.1); }
/* 声音倒放 */
.ar-status { margin-top: 14px; padding: 12px 14px; background: var(--bg-soft, rgba(0,0,0,.03)); border-radius: 8px; font-size: 14px; color: var(--text-dim); }
/* 锅碗瓢盆 */
.bd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.bd-pad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  aspect-ratio: 1; border: none; border-radius: 16px; cursor: pointer; color: #fff;
  background: var(--pad, #5a9bd4); box-shadow: 0 5px 0 rgba(0,0,0,.22), 0 8px 18px rgba(0,0,0,.12);
  transition: transform .06s, box-shadow .06s; user-select: none; touch-action: manipulation; }
.bd-pad b { font-size: 22px; opacity: .7; }
.bd-pad span { font-size: 15px; font-weight: 700; }
.bd-pad.hit { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.22), 0 3px 8px rgba(0,0,0,.12); }
@media (max-width: 520px) { .bd-grid { gap: 8px; } .bd-pad span { font-size: 13px; } }
/* 兽音译者 */
.bs-out { margin-top: 16px; min-height: 60px; padding: 14px; border-radius: 8px; background: var(--bg-soft, rgba(0,0,0,.03));
  font-size: 14px; color: var(--text); word-break: break-all; user-select: all; }
/* 舔狗日记 / 营销号 纸张感 */
.dd-paper, .cb-article { margin-top: 16px; padding: 24px 28px; border-radius: 6px;
  background: #fffdf7; color: #3a3630; box-shadow: 0 4px 18px rgba(0,0,0,.08);
  border: 1px solid #efe9d8; line-height: 1.9; font-size: 15px; }
.dd-title { font-size: 18px; font-weight: 700; border-bottom: 2px solid #e8dfc8; padding-bottom: 8px; margin-bottom: 8px; }
.dd-date { font-size: 13px; color: #9a8f77; margin-bottom: 16px; }
.dd-paper p, .cb-article p { margin: 10px 0; }
.dd-end { text-align: right; font-style: italic; color: #8a7f6a; margin-top: 18px !important; }
.cb-title { font-size: 21px; line-height: 1.5; color: #c0392b; margin: 0 0 14px; }
.cb-hook { color: #6a5acd; }
.cb-cta { text-align: center; font-weight: 700; color: #c0392b; margin-top: 18px !important; }
/* 菊花文 */
.ft-out { margin-top: 14px; min-height: 80px; padding: 16px; border-radius: 8px;
  background: var(--bg-soft, rgba(0,0,0,.03)); font-size: 18px; line-height: 2; word-break: break-all; }
/* 摸鱼日历 */
.fc-box { max-width: 520px; margin: 0 auto; padding: 24px; border-radius: 16px;
  background: linear-gradient(135deg, #f0fdf4, #e0f2fe); border: 1px solid var(--border); }
.fc-date { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 18px; }
.fc-index { text-align: center; margin-bottom: 10px; }
.fc-index span { display: block; font-size: 13px; color: var(--text-dim); }
.fc-index b { font-size: 52px; color: var(--brand); line-height: 1.2; }
.fc-index small { font-size: 14px; color: var(--text-faint); }
.fc-verdict { text-align: center; font-size: 15px; font-weight: 600; color: #15803d; margin-bottom: 20px; }
.fc-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fc-tile { background: #fff; border-radius: 10px; padding: 12px 6px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.fc-tile span { display: block; font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.fc-tile b { font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .fc-tiles { grid-template-columns: 1fr; } }
/* 提词器 */
.tp-view { margin-top: 16px; height: 320px; overflow: hidden; border-radius: 12px; background: #111;
  color: #fff; position: relative; display: flex; justify-content: center; padding: 20px; box-sizing: border-box; }
.tp-view.mirror .tp-inner { transform: scaleX(-1); }
.tp-inner { width: 100%; line-height: 1.6; text-align: center; will-change: transform; }
.tp-cfg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) { .tp-cfg { grid-template-columns: 1fr; } }
/* 图片类通用画布/控件 */
.op-canvas, .ri-canvas, .tw-canvas, .se-canvas, .bc-canvas { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 8px; }
.op-cfg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin: 14px 0; }
@media (max-width: 520px) { .op-cfg { grid-template-columns: 1fr; } }
.tw-info { font-size: 13px; color: var(--text-dim); margin: 8px 0; }
/* 头像 */
.ag-canvas { display: block; margin: 16px auto; max-width: 100%; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
/* 特殊符号 */
.sp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.sp-tab { padding: 6px 14px; border: 1px solid var(--border); border-radius: 18px; background: transparent;
  color: var(--text-dim); cursor: pointer; font-size: 13px; }
.sp-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.sp-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 22px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft, rgba(0,0,0,.02)); cursor: pointer; }
.sp-cell:hover { border-color: var(--brand); background: rgba(91,91,214,.08); }
.sp-cell.copied { background: var(--ok, #10a37f); color: #fff; }
/* 游戏：积木切切乐 / 小鸟 / 魔方 / 小黑屋 */
.bs-canvas, .sb-canvas { cursor: crosshair; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.dr-story { min-height: 140px; padding: 20px; border-radius: 12px; background: #1e1e26; color: #e8e6df;
  font-size: 16px; line-height: 1.9; box-shadow: inset 0 0 40px rgba(0,0,0,.5); }
.dr-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.dr-opt { text-align: left; }
.dr-win { margin-top: 16px; font-size: 20px; font-weight: 700; color: #ffd92f; }
.rc-ctrl { margin-top: 16px; }

/* ── 大画面游戏：开始占位 + 全高专注页 ───────────────
   详情页固定 740px iframe 会裁掉自带标题栏/关卡条的游戏，
   这些游戏改为「开始游戏」占位，点进去 /play/<slug>/ 全高展示。 */
.play-launch {
  min-height: 420px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 40px 20px; text-align: center;
  background: radial-gradient(circle at 50% 30%, var(--brand-soft, rgba(91,91,214,.08)), transparent 70%);
}
.play-launch-art {
  font-size: 76px; line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.15));
}
.play-launch-hint {
  margin: 0; max-width: 460px; font-size: 15px; line-height: 1.7; color: var(--text-dim);
}
.play-launch-btn { font-size: 16px; padding: 12px 30px; text-decoration: none; }

/* 专注页：顶栏 + 全宽 iframe + 下方说明与广告 */
.play-section { padding-bottom: 10px; }
.play-bar { background: var(--card); border-bottom: 1px solid var(--border); }
.play-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.play-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.play-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.play-stage-wrap { padding: 16px 20px 0; }
.play-frame {
  display: block; width: 100%; min-height: calc(100vh - 230px);
  border: 0; border-radius: 12px; background: var(--bg);
  box-shadow: 0 4px 24px rgba(0,0,0,.08); overscroll-behavior: contain;
}
.play-frame:fullscreen { min-height: 0; height: 100vh; border-radius: 0; background: #000; }
.play-howto { margin-top: 18px; }
.play-bottom-ad { margin: 18px 0 4px; }
@media (max-width: 720px) {
  .play-frame { min-height: calc(100vh - 250px); }
  .play-bar-inner { padding: 10px 14px; }
  .play-stage-wrap { padding: 10px 12px 0; }
}
