/* ==========================================================================
   抽屉 · Drawer
   纸白 + 苔绿的小工具集，视觉与一期一会试验场保持一致
   ========================================================================== */

:root {
  --bg: #f6f7f3;
  --bg-soft: #eef1ea;
  --surface: #ffffff;
  --surface-2: #fbfcf9;
  --surface-3: #f1f4ee;
  --fg: #28372e;
  --fg-soft: #55645a;
  --muted: #7b887e;
  --line: #e1e6dd;
  --line-strong: #cfd8cc;
  --primary: #426b55;
  --primary-dark: #2d503d;
  --primary-soft: #e8efe7;
  --on-primary: #ffffff;
  --accent: #b4553f;
  --accent-soft: #f7eae5;
  --gold: #b98a2f;
  --gold-soft: #f7efdc;
  --danger: #b4433a;
  --danger-soft: #f8e7e5;
  --ok: #3d7a58;
  --ok-soft: #e6f2e9;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 20px 50px rgba(32, 55, 44, 0.1);
  --shadow-sm: 0 8px 24px rgba(32, 55, 44, 0.06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #131915;
  --bg-soft: #18201b;
  --surface: #1c2620;
  --surface-2: #202b24;
  --surface-3: #253129;
  --fg: #e7ede5;
  --fg-soft: #b9c5ba;
  --muted: #8b9a8f;
  --line: #2c3931;
  --line-strong: #3a4a3f;
  --primary: #89c09d;
  --primary-dark: #aed8bb;
  --primary-soft: #24362b;
  --on-primary: #102016;
  --accent: #e0917c;
  --accent-soft: #3a2722;
  --gold: #d8b46a;
  --gold-soft: #382f1e;
  --danger: #e08b82;
  --danger-soft: #3a2523;
  --ok: #8cc9a2;
  --ok-soft: #203529;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 540px at 88% -12%, rgba(66, 107, 85, 0.09), transparent 62%),
    radial-gradient(820px 480px at -12% 24%, rgba(180, 85, 63, 0.045), transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}
::selection { background: rgba(66, 107, 85, 0.22); }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 34px 64px;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  width: 250px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 22px; }
.brand-mark {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 20px; letter-spacing: 0.12em; }
.brand-text small { margin-top: 5px; font-size: 9px; letter-spacing: 0.18em; color: var(--muted); font-weight: 600; }
.sidebar-label {
  padding: 12px 12px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.cat-nav { display: flex; flex-direction: column; gap: 3px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  color: var(--fg-soft);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.cat-item:hover { background: var(--surface-3); color: var(--fg); }
.cat-item.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 20px rgba(66, 107, 85, 0.2); }
.cat-ico {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-3);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-soft);
}
.cat-item.active .cat-ico { background: rgba(255, 255, 255, 0.16); color: var(--on-primary); }
[data-theme="dark"] .cat-item.active .cat-ico { background: rgba(0, 0, 0, 0.15); }
.cat-name { flex: 1; }
.cat-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-item.active .cat-count { color: currentColor; opacity: 0.72; }
.sidebar-foot { margin-top: auto; padding: 18px 10px 2px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.back-link { font-size: 12.5px; font-weight: 600; color: var(--primary-dark); }
.back-link:hover { text-decoration: underline; }
.text-btn { border: 0; background: none; padding: 0; text-align: left; font-size: 12px; color: var(--muted); }
.text-btn:hover { color: var(--accent); }
.sidebar-foot p { font-size: 11px; line-height: 1.7; color: var(--muted); }
.scrim { display: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 34px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg-soft);
  font-size: 16px;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-dark); transform: translateY(-1px); }
.topbar .menu-btn { display: none; }
.search-box {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66, 107, 85, 0.12); }
.search-ico { color: var(--muted); font-size: 17px; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
}
.search-box input::placeholder { color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ghost-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
  transition: background 0.16s ease, transform 0.16s ease;
}
.ghost-link:hover { background: var(--primary-soft); transform: translateY(-1px); }

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  padding: 44px 40px 38px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 245, 0.86)),
    var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgba(30, 41, 34, 0.96), rgba(25, 34, 28, 0.9));
}
.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -100px;
  bottom: -190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 107, 85, 0.16), transparent 68%);
  pointer-events: none;
}
.hero-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.24em; color: var(--muted); }
.hero h1 {
  margin: 14px 0 16px;
  font-size: clamp(34px, 4.8vw, 50px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--primary-dark); }
.hero-lead { max-width: 560px; color: var(--fg-soft); font-size: 14.5px; }
.hero-lead strong { color: var(--primary-dark); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; color: var(--muted); font-size: 12.5px; }
.hero-stats b { color: var(--fg); font-size: 18px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.quick-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.quick-chip span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 10px;
}
.quick-chip:hover { transform: translateY(-2px); border-color: var(--primary); background: var(--primary-soft); }

.recent-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 18px 4px 0; }
.recent-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.recent-chip {
  padding: 5px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--fg-soft);
}
.recent-chip:hover { border-style: solid; border-color: var(--primary); color: var(--primary-dark); }

.section { margin-top: 46px; }
.section.tight { margin-top: 38px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.section-head p { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.section-link { font-size: 12.5px; font-weight: 600; color: var(--primary-dark); white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

.page-head { padding: 12px 2px 26px; }
.page-head.compact { padding-bottom: 22px; }
.page-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.22em; color: var(--muted); }
.page-head h1 { margin: 8px 0 6px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; }
.page-head p { color: var(--muted); font-size: 13.5px; }

/* ---------- 工具卡片 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.tool-grid.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 186px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.tool-card::after {
  content: "";
  position: absolute;
  inset: auto -40% -70% auto;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 107, 85, 0.09), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.tool-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.tool-card:hover::after { opacity: 1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 13px; }
.tool-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--primary-soft), var(--surface-3));
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex: none;
}
.tool-icon.large { width: 58px; height: 58px; border-radius: 17px; font-size: 22px; }
.card-fav {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.card-fav:hover { background: var(--gold-soft); color: var(--gold); transform: scale(1.08); }
.card-fav.on { color: var(--gold); }
.tool-cat { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.card-name { margin-top: 3px; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-desc { margin-top: 6px; flex: 1; color: var(--fg-soft); font-size: 12.5px; line-height: 1.72; }
.card-open { margin-top: 14px; font-size: 12px; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.card-open i { font-style: normal; transition: transform 0.18s ease; }
.tool-card:hover .card-open i { transform: translateX(4px); }

/* ---------- 空状态 ---------- */
.empty {
  padding: 60px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--surface-2);
}
.empty-mark { font-size: 38px; color: var(--line-strong); line-height: 1; }
.empty h3 { margin: 14px 0 6px; font-size: 17px; }
.empty p { max-width: 420px; margin: 0 auto 18px; color: var(--muted); font-size: 13px; }

.note-band {
  display: flex;
  gap: 16px;
  margin-top: 46px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--primary-soft);
}
.note-mark { font-size: 24px; color: var(--primary); line-height: 1.2; }
.note-band h3 { font-size: 14px; margin-bottom: 3px; }
.note-band p { color: var(--fg-soft); font-size: 12.5px; max-width: 760px; }

/* ---------- 工具页 ---------- */
.tool-head { padding: 4px 2px 20px; }
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--primary-dark); text-decoration: underline; }
.crumb-current { color: var(--fg-soft); }
.tool-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.tool-title { display: flex; align-items: center; gap: 15px; min-width: 0; }
.tool-title h1 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.03em; line-height: 1.2; }
.tool-title p { margin-top: 4px; color: var(--muted); font-size: 13px; max-width: 660px; }
.tool-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.local-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(61, 122, 88, 0.16); }
.tool-workspace {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-height: 240px;
}
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 0; color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--primary); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 34px; text-align: center; }
.error-box h3 { margin-bottom: 6px; }
.error-box p { color: var(--muted); margin-bottom: 16px; }
.tool-about { margin-top: 26px; padding: 2px 4px; }
.tool-about h2 { font-size: 14px; margin-bottom: 6px; }
.tool-about p { color: var(--fg-soft); font-size: 12.5px; max-width: 760px; }
.tool-about .muted { margin-top: 6px; color: var(--muted); }

body.focus .sidebar,
body.focus .topbar,
body.focus .page-foot { display: none; }
body.focus .main { min-height: 100vh; }
body.focus .view { max-width: 1040px; padding-top: 18px; }
body.focus .tool-head { padding-top: 0; }

/* ---------- 通用组件 ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px;
}
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-title { font-size: 13.5px; font-weight: 700; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.split.wide-left { grid-template-columns: 1.25fr 0.75fr; }
.split.wide-right { grid-template-columns: 0.75fr 1.25fr; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--fg-soft); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.break-all { word-break: break-all; }
.center { text-align: center; }

.input,
textarea.input,
select.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  padding: 10px 12px;
  font-size: 13px;
  outline: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:hover, textarea.input:hover, select.input:hover { border-color: var(--muted); }
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(66, 107, 85, 0.12);
}
textarea.input { min-height: 170px; resize: vertical; line-height: 1.65; font-family: var(--mono); font-size: 12.5px; }
textarea.input.plain { font-family: var(--sans); font-size: 13.5px; }
select.input { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; cursor: pointer; }
input[type="number"].input { font-variant-numeric: tabular-nums; }
input[type="date"].input, input[type="datetime-local"].input, input[type="time"].input { font-family: var(--sans); }
input[type="color"].input { padding: 4px; height: 40px; cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, color 0.16s ease;
}
.btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 6px 11px; font-size: 11.5px; border-radius: 8px; }
.btn.tiny { padding: 3px 8px; font-size: 11px; border-radius: 7px; }
.btn.on { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }

.tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-3); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
.tab:hover { color: var(--fg); }
.tab.active { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--muted); padding: 7px 12px; font-size: 12px; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--primary); color: var(--on-primary); }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--fg-soft); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); cursor: pointer; }
.range-value { min-width: 56px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--fg-soft); }

.code-output,
.code-box {
  margin: 0;
  padding: 13px 14px;
  min-height: 170px;
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg-soft);
}
.code-box.scroll-x { white-space: pre; overflow-x: auto; }
.tok-key { color: var(--primary-dark); font-weight: 600; }
.tok-str { color: var(--accent); }
.tok-num { color: #8a5a1f; }
.tok-lit { color: #7a4ab0; }
[data-theme="dark"] .tok-num { color: #d9a966; }
[data-theme="dark"] .tok-lit { color: #c49ae8; }

.result-list { display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.result-key { width: 92px; flex: none; font-size: 11.5px; color: var(--muted); }
.result-val { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.result-row .btn.tiny { flex: none; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 10px; }
.stat-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.stat-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-label { margin-top: 2px; font-size: 11px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: var(--surface-3); font-size: 11px; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.mono { font-family: var(--mono); font-size: 12px; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--fg-soft); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--gold-soft); color: var(--gold); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 34px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.dropzone .dz-icon { font-size: 30px; line-height: 1; }
.dropzone strong { color: var(--fg-soft); font-size: 13px; }
.dropzone small { font-size: 11.5px; }
.dropzone input { display: none; }

.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-card { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.preview-card .pc-head { display: flex; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); background: var(--surface-3); }
.preview-card img, .preview-card canvas { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 50% / 16px 16px; }
.preview-card .pc-foot { padding: 8px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.file-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-3); font-size: 12px; color: var(--fg-soft); }
.file-meta b { font-weight: 600; }

.highlight-box {
  padding: 13px 14px;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}
.highlight-box mark { background: var(--gold-soft); color: var(--fg); border-radius: 3px; padding: 1px 2px; box-shadow: inset 0 -2px 0 var(--gold); }
[data-theme="dark"] .highlight-box mark { background: #4a3d1f; color: #f4e7c9; }

.gauge { padding: 6px 0; }
.gauge-track { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #8bb7c9, #7fbf8f 38%, #d8b46a 68%, #cf7a63); }
.gauge-marker { position: absolute; top: 50%; width: 20px; height: 20px; border: 3px solid var(--surface); border-radius: 50%; background: var(--fg); transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); transition: left 0.3s ease; }
.gauge-labels { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10.5px; color: var(--muted); }

.big-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 30%, var(--primary-soft), transparent 70%),
    var(--surface-2);
  text-align: center;
}
.big-result .br-value { font-size: clamp(28px, 5vw, 46px); font-weight: 700; letter-spacing: -0.03em; color: var(--primary-dark); line-height: 1.2; word-break: break-all; }
.big-result .br-label { margin-top: 7px; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }

/* ---------- 计算器 ---------- */
.calc-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: right;
}
.calc-expr { min-height: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
.calc-value { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; word-break: break-all; }
.calc-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.calc-pad button {
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s ease, transform 0.12s ease;
}
.calc-pad button:hover { background: var(--surface-3); transform: translateY(-1px); }
.calc-pad button.op { color: var(--primary-dark); background: var(--primary-soft); }
.calc-pad button.eq { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.calc-pad button.wide { grid-column: span 2; }
.calc-history { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.calc-history button { text-align: right; border: 0; background: none; padding: 5px 2px; border-bottom: 1px dashed var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.calc-history button:hover { color: var(--primary-dark); }

/* ---------- 轮盘 / 随机 ---------- */
.choice-list { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-pill { padding: 5px 11px; border-radius: 999px; background: var(--surface-3); font-size: 12px; color: var(--fg-soft); }
.choice-pill.win { background: var(--primary); color: var(--on-primary); font-weight: 700; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-host { position: fixed; inset: 0; z-index: 100; }
.modal-host[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18, 28, 22, 0.46); backdrop-filter: blur(4px); }
.modal {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 12vh auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.share-body { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 22px; align-items: center; }
.qr-frame { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr-canvas { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.share-info p { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.share-info .row { gap: 7px; }
.share-info .input { font-size: 11.5px; }
.share-info .hint { margin-top: 9px; }

.toast-host { position: fixed; left: 50%; bottom: 34px; z-index: 120; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.warn { background: var(--accent); color: #fff; }

.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 30px; background: var(--bg); text-align: center; }

/* ---------- 页脚 ---------- */
.page-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 34px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(18, 28, 22, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .topbar .menu-btn { display: grid; }
  .topbar { padding: 11px 18px; }
  .view { padding: 24px 18px 52px; }
  .page-foot { padding: 16px 18px 24px; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 720px) {
  .split, .split.wide-left, .split.wide-right { grid-template-columns: 1fr; }
  .hero { padding: 32px 22px 28px; border-radius: 22px; }
  .hero h1 { font-size: 34px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .tool-card { min-height: 174px; padding: 15px; }
  .tool-title-row { gap: 14px; }
  .tool-actions { width: 100%; }
  .tool-workspace { padding: 16px; border-radius: var(--radius); }
  .share-body { grid-template-columns: 1fr; justify-items: center; }
  .share-info { width: 100%; }
  .preview-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .ghost-link { display: none; }
  .calc-pad { gap: 5px; }
  .calc-pad button { padding: 10px 2px; font-size: 12px; }
}

@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 8px 16px; }
  .hero-stats b { font-size: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; padding: 7px 8px; }
  .result-key { width: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 工具补充样式 ---------- */
.status-line { margin-top: 2px; }
.ok-text { color: var(--ok); }
.bad-text { color: var(--danger); }
.calc-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.4;
  color: var(--fg-soft);
}
.calc-input::placeholder { color: var(--muted); }
.big-result .rolling { animation: rollpulse 0.11s linear infinite alternate; }
@keyframes rollpulse {
  from { opacity: 0.55; transform: translateY(-1px); }
  to { opacity: 1; transform: translateY(1px); }
}
.qr-preview { width: 100%; display: grid; place-items: center; }

/* ---------- Markdown ---------- */
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.md-toolbar button {
  min-width: 32px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg-soft);
  font-size: 12px; font-weight: 700; line-height: 1;
}
.md-toolbar button:hover { background: var(--surface-3); border-color: var(--line-strong); color: var(--primary-dark); }
.md-editor { min-height: 360px; }
.md-preview {
  min-height: 360px; max-height: 560px; overflow: auto;
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px; line-height: 1.85;
}
.md-preview > :first-child { margin-top: 0; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 { margin: 1.1em 0 0.45em; line-height: 1.35; letter-spacing: -0.01em; }
.md-preview h1 { font-size: 1.7em; border-bottom: 1px solid var(--line); padding-bottom: 0.3em; }
.md-preview h2 { font-size: 1.35em; }
.md-preview h3 { font-size: 1.15em; }
.md-preview p { margin: 0.7em 0; }
.md-preview ul, .md-preview ol { padding-left: 1.4em; margin: 0.6em 0; }
.md-preview li { margin: 0.2em 0; }
.md-preview blockquote { margin: 1em 0; padding: 0.2em 0 0.2em 1em; border-left: 3px solid var(--primary); color: var(--fg-soft); }
.md-preview code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-3); padding: 0.15em 0.35em; border-radius: 4px; }
.md-preview pre { background: var(--surface-3); padding: 12px 14px; border-radius: 10px; overflow: auto; }
.md-preview pre code { background: none; padding: 0; }
.md-preview table { border-collapse: collapse; margin: 1em 0; width: 100%; }
.md-preview th, .md-preview td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.md-preview th { background: var(--surface-3); }
.md-preview a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.md-preview hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md-preview img { max-width: 100%; border-radius: 8px; }

/* ---------- 文本对比 ---------- */
.diff-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.diff-head { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-3); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--muted); }
.diff-head span { padding: 8px 12px; }
.diff-head span + span { border-left: 1px solid var(--line); }
.diff-body { max-height: 520px; overflow: auto; }
.diff-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--mono); font-size: 12px; }
.diff-table td { padding: 2px 8px; vertical-align: top; border-bottom: 1px solid var(--line); }
.diff-table .ln { width: 44px; text-align: right; color: var(--muted); user-select: none; font-variant-numeric: tabular-nums; }
.diff-table .txt { white-space: pre-wrap; word-break: break-word; }
.diff-table td:nth-child(2) { border-right: 1px solid var(--line); }
.diff-table tr.del td { background: var(--danger-soft); }
.diff-table tr.del .txt { color: var(--danger); }
.diff-table tr.add td { background: var(--ok-soft); }
.diff-table tr.add .txt { color: var(--ok); }
.diff-table tr.same td { color: var(--fg-soft); }

/* ---------- 词频 ---------- */
.freq-list { display: flex; flex-direction: column; gap: 6px; max-height: 430px; overflow: auto; }
.freq-row { display: grid; grid-template-columns: 28px minmax(64px, 1fr) minmax(70px, 1.6fr) 40px 48px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.freq-rank { color: var(--muted); font-family: var(--mono); font-size: 11px; text-align: right; }
.freq-word { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.freq-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.freq-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.freq-count { font-family: var(--mono); text-align: right; }
.freq-pct { color: var(--muted); font-size: 11px; text-align: right; }

/* ---------- 水印位置 ---------- */
.pos-grid { display: grid; grid-template-columns: repeat(3, 46px); gap: 5px; }
.pos-grid button { height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; }
.pos-grid button:hover { border-color: var(--line-strong); }
.pos-grid button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }

/* ---------- 图片分割 ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 7px; }
.tile-item img { width: 100%; display: block; border-radius: 6px; background: var(--surface-3); }
.tile-meta { display: flex; justify-content: space-between; gap: 6px; margin: 6px 0; font-size: 10.5px; color: var(--muted); }
.tile-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 取色板 ---------- */
.palette-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.swatch {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.swatch:hover { border-color: var(--primary); transform: translateY(-2px); }
.swatch-color { height: 54px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.swatch-hex { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.swatch-meta { font-size: 10px; color: var(--muted); }

/* ---------- 图表 ---------- */
.chart-frame { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-height: 300px; display: grid; place-items: center; }
.chart-frame svg { width: 100%; height: auto; display: block; }

/* ---------- 2048 ---------- */
.g2048-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.g2048-scores { display: flex; gap: 8px; }
.g2048-score { min-width: 78px; padding: 6px 12px; border-radius: 10px; background: var(--surface-3); text-align: center; }
.g2048-score span { display: block; font-size: 10px; letter-spacing: 0.08em; color: var(--muted); }
.g2048-score b { font-family: var(--mono); font-size: 18px; }
.g2048-stage { position: relative; max-width: 520px; }
.g2048-board {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 8px; border-radius: var(--radius); background: var(--surface-3);
  aspect-ratio: 1; outline: none; touch-action: none;
}
.g2048-cell { position: relative; border-radius: 9px; background: var(--surface); }
.g2048-tile {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 9px; font-family: var(--mono); font-weight: 700;
  font-size: clamp(18px, 4vw, 32px); color: #fff; background: #8a9a8f;
}
.g2048-tile.new { animation: tile-pop 0.18s ease; }
@keyframes tile-pop { from { transform: scale(0.6); opacity: 0.4; } }
.g2048-tile.v2 { background: #d9e6d5; color: #2d503d; }
.g2048-tile.v4 { background: #c5dcc0; color: #2d503d; }
.g2048-tile.v8 { background: #7fae8f; color: #fff; }
.g2048-tile.v16 { background: #5b8c74; color: #fff; }
.g2048-tile.v32 { background: #426b55; color: #fff; }
.g2048-tile.v64 { background: #2d503d; color: #fff; }
.g2048-tile.v128 { background: #d8b46a; color: #33240a; }
.g2048-tile.v256 { background: #c99a42; color: #33240a; }
.g2048-tile.v512 { background: #b4553f; color: #fff; }
.g2048-tile.v1024 { background: #9a4433; color: #fff; }
.g2048-tile.v2048 { background: #6a3a8a; color: #fff; box-shadow: 0 0 24px rgba(106, 58, 138, 0.4); }
.g2048-tile.vhigh { background: #28372e; color: #fff; }
.g2048-overlay { position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--radius); background: rgba(20, 30, 24, 0.55); backdrop-filter: blur(3px); }
.g2048-overlay[hidden] { display: none; }
.g2048-overlay-card { width: min(320px, 86%); padding: 24px; border-radius: var(--radius); background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.g2048-overlay-card h3 { font-size: 20px; margin-bottom: 6px; }
.g2048-overlay-card p { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }

@media (max-width: 720px) {
  .md-preview { min-height: 240px; max-height: 420px; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .freq-row { grid-template-columns: 22px minmax(48px, 1fr) minmax(50px, 1.2fr) 34px 42px; gap: 5px; }
  .g2048-board { gap: 6px; padding: 6px; }
}

/* 防止手机端 grid 子项被内容撑破 */
.split > *,
.stat-grid > *,
.panel,
.field,
.table-wrap,
.chart-frame,
.tool-workspace { min-width: 0; }

/* ---------- HTTP 状态码 ---------- */
.status-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.status-code {
  min-width: 58px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.5;
}
.status-name { font-size: 13.5px; font-weight: 700; }
.status-name span { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted); }
.status-desc { margin-top: 3px; font-size: 12px; color: var(--fg-soft); line-height: 1.65; }
.status-item .btn { margin-left: auto; flex: none; }

/* ---------- CSS 渐变 ---------- */
.gradient-preview {
  height: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.gradient-stop {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 50px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.gradient-stop input[type="color"] { width: 46px; height: 34px; padding: 2px; }
.gradient-stop input[type="range"] { width: 100%; accent-color: var(--primary); }

@media (max-width: 720px) {
  .status-item { flex-wrap: wrap; }
  .status-item .btn { margin-left: 0; }
  .gradient-preview { height: 220px; }
}


/* ---------- 富文本 ---------- */
.rich-editor {
  min-height: 380px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.85;
  outline: none;
}
.rich-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66, 107, 85, 0.12); }
.rich-editor h2 { margin: 0.5em 0 0.4em; font-size: 1.5em; }
.rich-editor blockquote { margin: 0.8em 0; padding-left: 1em; border-left: 3px solid var(--primary); color: var(--fg-soft); }
.rich-editor ul, .rich-editor ol { padding-left: 1.5em; }
.rich-editor a { color: var(--primary-dark); text-decoration: underline; }

/* ---------- 公式速查 ---------- */
.formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.formula-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .16s ease, transform .16s ease; }
.formula-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.formula-head { display: flex; align-items: center; gap: 8px; }
.formula-head strong { flex: 1; font-size: 13.5px; }
.formula-text { margin: 10px 0 6px; font-family: var(--mono); font-size: 15px; color: var(--primary-dark); word-break: break-word; }

/* ---------- 随机人名 ---------- */
.name-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }

/* ---------- 转盘 ---------- */
.wheel-wrap { display: grid; place-items: center; padding: 10px; }
.wheel-canvas { width: min(460px, 100%); height: auto; display: block; }

/* ---------- 贪吃蛇 ---------- */
.snake-canvas { width: 100%; max-width: 520px; height: auto; display: block; border: 1px solid var(--line); border-radius: 14px; background: #f1f4ee; touch-action: none; }

/* ---------- 扫雷 ---------- */
.ms-board-wrap { overflow-x: auto; padding-bottom: 4px; }
.ms-board { display: grid; gap: 3px; background: var(--surface-3); padding: 6px; border-radius: 12px; width: max-content; }
.ms-cell {
  aspect-ratio: 1; min-width: 22px; padding: 0;
  border: 0; border-radius: 5px; background: var(--surface);
  color: var(--fg); font-family: var(--mono); font-size: 13px; font-weight: 700;
  display: grid; place-items: center; cursor: pointer; user-select: none;
}
.ms-cell:hover:not(:disabled) { background: var(--primary-soft); }
.ms-cell.revealed { background: var(--surface-3); cursor: default; opacity: 1; }
.ms-cell.flagged { color: var(--accent); }
.ms-cell.mine { background: var(--danger-soft); color: var(--danger); }
.ms-cell.exploded { background: var(--danger); color: #fff; }
.ms-cell.n1 { color: #2f6db0; }
.ms-cell.n2 { color: #3d7a58; }
.ms-cell.n3 { color: #b4433a; }
.ms-cell.n4 { color: #6a3a8a; }
.ms-cell.n5 { color: #8a4433; }
.ms-cell.n6 { color: #2d7a7a; }
.ms-cell.n7 { color: #28372e; }
.ms-cell.n8 { color: #7b887e; }

/* ---------- 涂鸦板 ---------- */
.doodle-toolbar { display: flex; flex-direction: column; gap: 10px; }
.swatch-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.color-dot { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.color-dot.active { border-color: var(--fg); }
.doodle-wrap { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 8px; }
.doodle-canvas { display: block; width: 100%; height: auto; border-radius: 10px; touch-action: none; cursor: crosshair; }

/* ---------- Favicon ---------- */
.favicon-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.favicon-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.favicon-item img { display: block; width: 64px; height: 64px; object-fit: contain; }
.favicon-item span { font-size: 10px; color: var(--muted); }

@media (max-width: 720px) {
  .rich-editor { min-height: 260px; padding: 14px; }
  .formula-grid { grid-template-columns: 1fr; }
  .doodle-toolbar .row { gap: 6px; }
  .favicon-item img { width: 52px; height: 52px; }
}


/* ---------- 本地记录 ---------- */
.record-layout { display: grid; grid-template-columns: minmax(280px, 0.85fr) 1.15fr; gap: 16px; align-items: start; }
.record-form-panel { position: sticky; top: 88px; }
.record-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.record-form .field { margin-bottom: 0; }
.record-form .field.wide { grid-column: 1 / -1; }
.record-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.record-item { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.record-item.done .record-title { text-decoration: line-through; color: var(--muted); }
.record-main { flex: 1; min-width: 0; }
.record-title { font-weight: 700; font-size: 14px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.record-chip { font-size: 10.5px; color: var(--muted); background: var(--surface-3); padding: 2px 8px; border-radius: 999px; }
.record-chip b { font-weight: 600; color: var(--fg-soft); }
.record-preview { margin-top: 6px; font-size: 12px; color: var(--fg-soft); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.record-link { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--primary-dark); }
.record-actions { display: flex; flex-direction: column; gap: 5px; flex: none; align-items: flex-end; }

/* ---------- 记忆力翻牌 ---------- */
.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; }
.memory-card {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-3); font-size: clamp(20px, 5vw, 34px);
  display: grid; place-items: center; cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.memory-card:hover:not(:disabled) { transform: translateY(-2px); }
.memory-card.flipped, .memory-card.matched { background: var(--surface); border-color: var(--line-strong); }
.memory-card.matched { opacity: 0.65; }

/* ---------- 井字棋 ---------- */
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 360px; }
.ttt-cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--fg);
  font-family: var(--mono); font-size: 42px; font-weight: 700;
  display: grid; place-items: center; cursor: pointer;
}
.ttt-cell.x { color: var(--primary-dark); }
.ttt-cell.o { color: var(--accent); }

/* ---------- 点灯 ---------- */
.lo-board { display: grid; gap: 6px; max-width: 460px; }
.lo-cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-3); cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.lo-cell.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 16px rgba(216, 180, 106, 0.5); }
.lo-cell:hover { border-color: var(--line-strong); }

/* ---------- 数字华容道 ---------- */
.p15-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 420px; }
.p15-cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--fg);
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  cursor: pointer; transition: transform 0.12s ease, background 0.12s ease;
}
.p15-cell:not(.blank):hover { background: var(--primary-soft); transform: scale(0.97); }
.p15-cell.blank { border: 0; background: var(--surface-3); cursor: default; }

/* ---------- 翻页时钟 ---------- */
.flipclock-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.flipclock { display: flex; align-items: center; gap: 8px; font-family: var(--mono); }
.flip-group { display: flex; gap: 4px; }
.flip-digit {
  min-width: clamp(46px, 10vw, 92px); padding: 10px 6px;
  border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line);
  text-align: center; font-size: clamp(38px, 9vw, 84px); font-weight: 700; line-height: 1.1;
  box-shadow: var(--shadow-sm); transform-origin: center; backface-visibility: hidden;
}
.flip-digit.flip { animation: flipDigit 0.32s ease; }
@keyframes flipDigit {
  0% { transform: rotateX(0); }
  45% { transform: rotateX(90deg); opacity: 0.55; }
  100% { transform: rotateX(0); }
}
.flip-colon { font-size: clamp(28px, 6vw, 60px); color: var(--muted); }
.flip-ampm { font-size: 14px; font-weight: 700; margin-left: 6px; color: var(--muted); }
.flip-date { margin-top: 16px; color: var(--muted); font-size: 13px; letter-spacing: 0.05em; text-align: center; }

/* ---------- LED ---------- */
.led-wrap { background: #070b08; border-radius: var(--radius); padding: 10px; overflow: hidden; border: 1px solid #1c2a20; }
.led-canvas { width: 100%; height: auto; display: block; border-radius: 8px; }

/* ---------- 手持弹幕 ---------- */
.barrage-stage { position: relative; height: 360px; border-radius: var(--radius); overflow: hidden; background: #101a14; border: 1px solid var(--line); }
.barrage-rows { position: absolute; inset: 0; }
.barrage-row { position: absolute; left: 0; right: 0; transform: translateY(-50%); white-space: nowrap; overflow: hidden; }
.barrage-text {
  display: inline-block; white-space: nowrap; font-weight: 700; letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); padding-left: 100%;
  animation: barrageMove linear infinite; animation-play-state: paused;
}
.barrage-stage.running .barrage-text { animation-play-state: running; }
@keyframes barrageMove { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- 色板 ---------- */
.palette-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.palette-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px; }
.palette-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.palette-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.palette-swatch {
  min-height: 64px; border: 0; border-radius: 8px; padding: 6px;
  display: flex; align-items: flex-end;
  font-family: var(--mono); font-size: 9px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.16s ease;
}
.palette-swatch:hover { transform: translateY(-2px); }

/* ---------- Color 选择器 ---------- */
.color-preview { height: 180px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin-bottom: 14px; }

@media (max-width: 820px) {
  .record-layout { grid-template-columns: 1fr; }
  .record-form-panel { position: static; }
  .record-form { grid-template-columns: 1fr; }
  .record-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .flipclock-wrap { padding: 26px 8px; }
  .flip-digit { min-width: 40px; padding: 8px 4px; }
  .barrage-stage { height: 260px; }
  .palette-groups { grid-template-columns: 1fr; }
}


/* ---------- 趋势记录 ---------- */
.tracker-chart { width: 100%; height: auto; display: block; }
.work-year-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.work-year { width: 16px; height: 16px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--line); }
.work-year.filled { background: var(--primary); border-color: var(--primary); }

/* ---------- 物品比价 ---------- */
.price-groups { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.price-group { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px; }
.price-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.price-group-head strong { font-size: 14px; }
.price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 12px; }
.price-row.lowest { background: var(--ok-soft); border-radius: 8px; padding: 8px 10px; border-top: 0; }
.price-platform { min-width: 90px; font-weight: 600; }
.price-number { font-family: var(--mono); }
.price-shipping { color: var(--muted); font-size: 11px; }
.price-total { font-family: var(--mono); font-weight: 700; color: var(--primary-dark); }

/* ---------- 在线写信 ---------- */
.letter-preview {
  min-height: 420px; padding: 34px 38px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  line-height: 1.95; font-family: "Songti SC", "SimSun", Georgia, serif;
}
.letter-preview.paper-plain { background: #ffffff; color: #2c2c2c; }
.letter-preview.paper-warm { background: #fbf7ee; color: #3a322a; }
.letter-preview.paper-lined {
  background:
    repeating-linear-gradient(#fbf7ee 0 31px, #e6ddcc 31px 32px);
  color: #3a322a;
}
.letter-to { font-weight: 700; margin-bottom: 10px; }
.letter-body { white-space: pre-wrap; word-break: break-word; min-height: 180px; }
.letter-sign { margin-top: 30px; text-align: right; }
.letter-sign span { color: var(--muted); font-size: 0.85em; }
.letter-preview h3 { margin: 0 0 12px; text-align: center; }

/* ---------- 号码一览 ---------- */
.phone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.phone-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); text-align: left; cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.phone-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.phone-cat { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.phone-card strong { font-size: 13px; }
.phone-card b { font-family: var(--mono); font-size: 22px; color: var(--primary-dark); }
.phone-card small { color: var(--muted); font-size: 11px; line-height: 1.5; }

/* ---------- 辐射参考 ---------- */
.radiation-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.radiation-row { display: grid; grid-template-columns: 190px minmax(80px, 1fr) 100px; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.radiation-name strong { display: block; font-size: 13px; }
.radiation-name span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.radiation-bar { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.radiation-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--gold)); }
.radiation-value { font-family: var(--mono); font-size: 12px; text-align: right; }

/* ---------- 世界之最 ---------- */
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.record-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.record-card h3 { margin: 8px 0 4px; font-size: 14px; }
.record-value { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--primary-dark); word-break: break-word; }

/* ---------- 打地鼠 ---------- */
.wam-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 460px; }
.wam-hole {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(circle at 50% 70%, var(--surface-3), var(--surface));
  font-size: 34px; display: grid; place-items: center;
  cursor: pointer; overflow: hidden;
}
.wam-hole span { transform: translateY(120%); transition: transform 0.12s ease; }
.wam-hole.active span { transform: translateY(0); }

/* ---------- 数字记忆 ---------- */
.nm-display {
  display: grid; place-items: center; min-height: 220px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-family: var(--mono);
  font-size: clamp(40px, 9vw, 76px); font-weight: 700; letter-spacing: 0.12em;
  color: var(--muted); text-align: center; word-break: break-all;
}
.nm-display.showing { color: var(--primary-dark); }

/* ---------- 拼图 ---------- */
.collage-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.collage-thumb { display: flex; flex-direction: column; gap: 5px; width: 86px; }
.collage-thumb img { width: 86px; height: 86px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- 正则可视化 ---------- */
.regex-tree {
  max-height: 420px; overflow: auto; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
}
.regex-node { padding-left: 12px; border-left: 1px solid var(--line); }
.regex-tree > .regex-node { padding-left: 0; border-left: 0; }
.regex-node-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.regex-type {
  flex: none; padding: 1px 6px; border-radius: 4px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 10px; font-weight: 700;
}

/* ---------- 拼音 ---------- */
.pinyin-table {
  max-height: 430px; overflow: auto; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.pinyin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pinyin-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
}
.pinyin-cell b { font-size: 17px; line-height: 1.2; }
.pinyin-main { font-family: var(--mono); font-size: 11.5px; color: var(--primary-dark); }
.pinyin-alt { font-family: var(--mono); font-size: 10px; color: var(--muted); text-align: center; line-height: 1.35; }

/* ---------- 简繁转换 ---------- */
.seg-wrap { flex-wrap: wrap; max-width: 100%; }
.seg-wrap button { flex: 1 1 auto; }
.chip-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-soft);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.cc-highlight {
  min-height: 200px; max-height: 460px; overflow: auto; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 14px; line-height: 2;
  white-space: pre-wrap; word-break: break-word;
}
.cc-text mark { background: var(--gold-soft); color: var(--fg); border-radius: 3px; padding: 0 1px; }

/* ---------- 代码转图片 ---------- */
.code-preview {
  padding: 10px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-3);
}
.code-preview canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; box-shadow: var(--shadow-sm); }

/* ---------- 表单小部件 ---------- */
.input-group { display: flex; gap: 8px; }
.input-group .input:first-child { flex: 1; min-width: 0; }
.input-group select.input { width: 92px; flex: none; }
.split.three { grid-template-columns: repeat(3, 1fr); }
.color-line { display: flex; align-items: center; gap: 8px; }
.color-line input[type="color"] {
  width: 48px; height: 40px; flex: none; padding: 3px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.color-line .input { flex: 1; min-width: 0; }

/* ---------- 对比度检查 ---------- */
.contrast-preview {
  min-height: 220px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.contrast-checks {
  display: flex; flex-direction: column; margin-top: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.contrast-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.contrast-row:last-child { border-bottom: 0; }
.contrast-row .muted { margin-left: auto; font-family: var(--mono); }

/* ---------- 时区 ---------- */
.tz-datetime { display: flex; gap: 8px; }
.tz-datetime .input { flex: 1; min-width: 0; }
.tz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.tz-card {
  position: relative; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.tz-card.is-source { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-soft); }
.tz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tz-head strong { font-size: 13px; }
.tz-remove {
  padding: 2px 4px; border: 0; background: transparent;
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.tz-remove:hover { color: var(--danger); }
.tz-time {
  margin-top: 8px; font-family: var(--mono); font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.tz-date { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.tz-meta {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 10px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}

/* ---------- 条形码 ---------- */
.barcode-preview {
  padding: 16px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #ffffff;
}
.barcode-preview canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; }

/* ---------- 图片滤镜 ---------- */
.filter-preview {
  padding: 10px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 50% / 16px 16px;
}
.filter-preview canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 6px; }
.filter-controls { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; align-items: center; gap: 10px; }
.filter-label { width: 42px; flex: none; font-size: 12px; color: var(--fg-soft); }
.filter-range { flex: 1; accent-color: var(--primary); cursor: pointer; }
.filter-row .range-value { min-width: 48px; }

/* ---------- 图片转字符画 ---------- */
.ascii-output {
  max-height: 600px; margin: 0; padding: 14px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--fg);
  font-family: var(--mono); font-size: 10px; line-height: 1.05; white-space: pre;
}
.ascii-output.ascii-colored { font-size: 9px; }

/* ---------- 生命游戏 ---------- */
.life-canvas {
  display: block; width: 100%; height: auto; cursor: crosshair;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); image-rendering: pixelated;
}

@media (max-width: 720px) {
  .letter-preview { padding: 24px 20px; min-height: 320px; }
  .radiation-row { grid-template-columns: 1fr; gap: 6px; }
  .radiation-value { text-align: left; }
  .record-grid { grid-template-columns: 1fr; }
  .pinyin-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
  .regex-tree { max-height: 300px; }
  .tz-grid { grid-template-columns: 1fr; }
  .tz-time { font-size: 24px; }
  .ascii-output { font-size: 8px; }
  .color-line input[type="color"] { width: 42px; }
}
