/* =========================================================================
 * styles.css — JSON Box
 * ========================================================================= */
:root {
  --bg: #f6f7fa;
  --panel: #ffffff;
  --line: #e4e7ee;
  --line-2: #eef0f5;
  --text: #1b2333;
  --muted: #667085;
  --faint: #98a1b0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eef3ff;
  --ok: #15803d;
  --err: #b91c1c;
  --warn: #b45309;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 12px 28px -18px rgba(16, 24, 40, .28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[v-cloak] { display: none !important; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--brand); }

/* ---------------------------------- 顶栏 ---------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  color: #fff;
  font: 700 14px/1 var(--mono);
  display: grid;
  place-items: center;
  letter-spacing: -1px;
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 15px; letter-spacing: -.2px; }
.brand-text small { font-size: 11px; color: var(--faint); }

.search { position: relative; flex: 1; max-width: 440px; display: flex; align-items: center; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 62px 0 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.search input:focus {
  background: #fff;
  border-color: #b9cdfb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.search-icon { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search kbd {
  position: absolute;
  right: 8px;
  font: 11px var(--mono);
  color: var(--faint);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  padding: 1px 5px;
}
.clear-q {
  position: absolute;
  right: 8px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #e7eaf1;
  color: #5b6472;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pill-safe { color: #0f766e; border-color: #ccece7; background: #f0fbf9; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #4b5563;
  cursor: pointer;
}
.burger { display: none; }

/* ---------------------------------- 布局 ---------------------------------- */
.shell { display: flex; align-items: flex-start; }
.sidebar {
  width: 238px;
  flex: 0 0 238px;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.side-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 18px; }
.side-scroll::-webkit-scrollbar { width: 8px; }
.side-scroll::-webkit-scrollbar-thumb { background: #dfe3ea; border-radius: 4px; }
.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  color: var(--faint);
  text-transform: uppercase;
}
.group-title i { font-style: normal; font-size: 10.5px; color: #b6bdc9; font-weight: 500; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13.2px;
  color: #3d4657;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: #f5f7fb; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-bar { width: 3px; height: 13px; border-radius: 2px; background: transparent; flex: none; }
.nav-item.active .nav-bar { background: var(--brand); }
.nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { padding: 24px 10px; text-align: center; color: var(--faint); font-size: 12.5px; }
.side-empty p { margin: 0 0 10px; }
.side-foot {
  border-top: 1px solid var(--line-2);
  padding: 9px 14px;
  font-size: 11px;
  color: var(--faint);
}
.overlay { display: none; }

.main { flex: 1; min-width: 0; padding: 22px 26px 44px; max-width: calc(100vw - 240px); }
.tool-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tool-head h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.3px; }
.tool-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 780px; }
.tool-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.page-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--faint);
}
.foot-kbd kbd {
  font: 10.5px var(--mono);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  background: #fff;
}

/* ---------------------------------- 工作区 ---------------------------------- */
.work {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.work.pad { padding: 16px; display: flex; flex-direction: column; gap: 14px; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
.grow { flex: 1 1 auto; }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; flex: none; }
.meta { font-size: 11.5px; color: var(--faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12.8px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s, border-color .13s, color .13s, box-shadow .13s;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .35); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: #3c4557; }
.btn-ghost:hover { border-color: #c7cfdd; background: #f9fafc; }
.btn-soft { background: #f4f6fa; color: #5b6472; }
.btn-soft:hover { background: #eceff6; color: #333; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.spin {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mini {
  height: 24px;
  padding: 0 8px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  color: #5b6472;
  cursor: pointer;
  transition: all .12s;
}
.mini:hover { background: #f5f7fb; color: var(--brand-dark); border-color: #cfd9ea; }

.seg { display: inline-flex; background: #f4f6fa; border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: 0;
  background: transparent;
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  color: #5b6472;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button.on {
  background: #fff;
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .09);
}

.chip {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 6px;
  border: 1px dashed var(--line);
  background: #fff;
  color: #5b6472;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover, .chip.on { border-style: solid; border-color: #b9cdfb; color: var(--brand-dark); background: var(--brand-soft); }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--brand); }
.chk.right { margin-left: auto; }
.opt { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.opt > span { white-space: nowrap; }
.opt input, .opt select, .row select, .row input[type="text"], .row input[type="datetime-local"], .row input[type="number"] {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
  outline: none;
  min-width: 0;
}
.opt input:focus, .opt select:focus, .row input:focus, .row select:focus {
  border-color: #b9cdfb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.opt.big { flex: 1; }
.opt.big input { flex: 1; height: 34px; }
input.num { width: 68px; }

/* 身份证生成器 */
input.num-s { width: 58px; }
.id-table td, .id-table th { white-space: nowrap; }
.id-table td.dim { color: var(--faint); font: 11px var(--mono); }
.id-table td.strong { font-weight: 600; color: #1e293b; }
.id-table code { color: #0f766e; }
.id-table td.mono { font: 14px var(--mono); color: #475569; }

.opts {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line-2);
}

.split { display: grid; grid-template-columns: 1fr 1fr; }
.pane { min-width: 0; display: flex; flex-direction: column; }
.pane + .pane { border-left: 1px solid var(--line); }
.pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-2);
  background: #fcfcfd;
}
.pane-title { font-size: 12.5px; font-weight: 600; color: #39414f; }
.pane-sub { font-size: 11.5px; color: var(--faint); margin-left: auto; }
.pane-actions { margin-left: auto; display: flex; gap: 6px; }
.pane textarea, .card-mini textarea {
  border: 0;
  outline: none;
  resize: vertical;
  width: 100%;
  min-height: 372px;
  padding: 12px 14px;
  font: 13px/1.7 var(--mono);
  color: #1f2937;
  background: #fff;
  tab-size: 2;
}
.pane textarea::placeholder, .card-mini textarea::placeholder { color: #b8c0cc; }
.card-mini textarea { min-height: 140px; border: 1px solid var(--line); border-radius: 8px; }
.card-mini textarea.tall { min-height: 200px; }
.card-mini textarea.tall-xl { min-height: 320px; }
.card-mini textarea.mono, textarea.mono { font-family: var(--mono); }

.out {
  margin: 0;
  padding: 12px 14px;
  font: 13px/1.7 var(--mono);
  white-space: pre;
  overflow: auto;
  min-height: 372px;
  max-height: 62vh;
  color: #1f2937;
  tab-size: 2;
}
.out.small { min-height: 0; max-height: 320px; font-size: 12.5px; }
.out-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.placeholder {
  display: grid;
  place-items: center;
  min-height: 372px;
  padding: 20px;
  color: #b0b8c6;
  font-size: 12.5px;
  background: repeating-linear-gradient(45deg, #fcfcfd, #fcfcfd 10px, #fafbfd 10px, #fafbfd 20px);
}
.placeholder.small { min-height: 200px; }

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--muted);
  background: #fcfcfd;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd3df; flex: none; }
.status.is-ok { color: var(--ok); background: #f8fdf9; }
.status.is-ok .dot { background: #22c55e; }
.status.is-error { color: var(--err); background: #fff8f8; }
.status.is-error .dot { background: #ef4444; }
.status-size { margin-left: auto; color: var(--faint); }
.hidden-file { display: none; }

/* 错误框 */
.errbox {
  margin: 12px;
  padding: 12px 14px;
  border: 1px solid #fbd5d5;
  background: #fff8f8;
  border-radius: 9px;
  font-size: 12.5px;
  color: #7f1d1d;
}
.err-title { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #b91c1c; margin-bottom: 6px; }
.err-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.errbox p { margin: 0 0 4px; }
.err-hint { color: #991b1b; }
.err-pos { color: #b45309; font-family: var(--mono); font-size: 11.5px; }
.err-code {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #f3d6d6;
  border-radius: 6px;
  font: 11.5px/1.5 var(--mono);
  color: #7f1d1d;
  white-space: pre;
  overflow: auto;
}
.err-detail { margin-top: 8px; font-size: 11.5px; color: #9a6b6b; }
.err-detail summary { cursor: pointer; }
.err-detail code { font-family: var(--mono); word-break: break-all; }
.errline { color: var(--err); font-size: 12px; margin: 6px 0 0; }
.hint { color: var(--faint); font-size: 11.5px; margin: 6px 0 0; }
.muted { color: var(--faint); }
.badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
}
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row + .row { margin-top: 8px; }
.row > input[type="text"], .row > input[type="datetime-local"] { flex: 1; height: 32px; }
code.block {
  display: block;
  padding: 9px 11px;
  background: #f8fafc;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font: 12.5px/1.6 var(--mono);
  color: #334155;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
code.block.break { word-break: break-all; }

/* JSON 高亮 */
.tk-key { color: #1d4ed8; }
.tk-str { color: #0f766e; }
.tk-num { color: #b45309; }
.tk-bool { color: #7c3aed; }
.tk-null { color: #94a3b8; }

/* 树形 */
.tree {
  padding: 10px 12px;
  overflow: auto;
  max-height: 62vh;
  min-height: 372px;
  font: 12.8px/1.75 var(--mono);
  background: #fff;
}
.jn-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  cursor: default;
  white-space: pre;
}
.jn-row.branch { cursor: pointer; }
.jn-row:hover { background: #f5f8ff; }
.jn-toggle { width: 12px; color: #94a3b8; font-size: 10px; flex: none; display: inline-block; }
.jn-toggle.ghost { color: #cbd5e1; }
.jn-key { color: #1d4ed8; }
.jn-key.index { color: #94a3b8; }
.jn-colon { color: #94a3b8; margin-right: 3px; }
.jn-val.t-string { color: #0f766e; }
.jn-val.t-number { color: #b45309; }
.jn-val.t-boolean { color: #7c3aed; }
.jn-val.t-null { color: #94a3b8; }
.jn-sum.t-object { color: #64748b; background: #f1f5f9; border-radius: 4px; padding: 0 5px; font-size: 11.5px; }
.jn-sum.t-array { color: #0369a1; background: #eff6ff; border-radius: 4px; padding: 0 5px; font-size: 11.5px; }
.jn-comma { color: #94a3b8; }
.jn-children { padding-left: 14px; border-left: 1px dashed #e8edf5; margin-left: 5px; }
.jn-more { color: var(--faint); font-size: 11.5px; padding: 2px 0 2px 16px; }

/* Diff */
.diff-stat { display: flex; gap: 8px; font-size: 11.5px; font-family: var(--mono); }
.diff-stat i { font-style: normal; padding: 1px 6px; border-radius: 4px; }
.lg-add { color: #15803d; background: #ecfdf3; }
.lg-del { color: #b91c1c; background: #fef2f2; }
.lg-same { color: var(--faint); background: #f4f6fa; }
.diff-result { border-top: 1px solid var(--line); }
.diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: #fcfcfd;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  font-weight: 600;
  color: #39414f;
}
.diff-head .legend { display: flex; gap: 8px; font-weight: 400; }
.legend i { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 4px; }
.diff-same-tip { color: var(--ok); }
.diff-body { max-height: 48vh; overflow: auto; font: 12.5px/1.65 var(--mono); background: #fff; }
.diff-row { display: flex; align-items: flex-start; gap: 0; border-bottom: 1px solid #f7f8fb; }
.diff-row .ln {
  width: 44px;
  flex: none;
  padding: 0 8px;
  text-align: right;
  color: #b6bdc9;
  user-select: none;
  background: #fcfcfd;
  border-right: 1px solid #f1f4f9;
}
.diff-row .sign { width: 18px; flex: none; text-align: center; color: #9aa3b2; user-select: none; }
.diff-row .txt { flex: 1; padding: 0 8px 0 2px; white-space: pre-wrap; word-break: break-word; color: #3d4657; }
.diff-row.r-add { background: #f2fbf5; }
.diff-row.r-add .txt { color: #14532d; }
.diff-row.r-add .sign { color: #16a34a; font-weight: 700; }
.diff-row.r-del { background: #fef5f5; }
.diff-row.r-del .txt { color: #7f1d1d; }
.diff-row.r-del .sign { color: #dc2626; font-weight: 700; }

/* ---------------------------------- 卡片类工具 ---------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.card-mini {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-mini h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #2b3444;
}
.card-mini h3.mt { margin-top: 16px; }

/* 时间戳 */
.now-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid #dbe6ff;
  background: linear-gradient(120deg, #f5f9ff, #eef4ff 60%, #f7fbff);
}
.now-label { font-size: 11.5px; color: #64748b; letter-spacing: .06em; }
.now-time { font: 600 26px/1.3 var(--mono); color: #1e3a8a; letter-spacing: -.5px; margin: 2px 0; }
.now-tz { font-size: 11.5px; color: #64748b; }
.now-right { display: flex; flex-direction: column; gap: 8px; }
.now-kv { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #475569; }
.now-kv span { min-width: 80px; }
.now-kv code { font: 12.5px var(--mono); color: #1e3a8a; background: #fff; border: 1px solid #dbe6ff; border-radius: 6px; padding: 2px 8px; }

.kv-list { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.kv-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line-2); }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { width: 92px; flex: none; font-size: 12px; color: var(--faint); }
.kv-row .v { flex: 1; font: 12.5px var(--mono); color: #334155; word-break: break-all; }
.custom-out {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.custom-out code { flex: 1; font: 14px var(--mono); color: #1e3a8a; }
.row input.pat { flex: 0 1 220px; }

/* 颜色 */
.color-top { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; }
.swatch {
  width: 120px;
  min-height: 92px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  display: grid;
  place-items: end center;
  padding-bottom: 8px;
}
.swatch span {
  font: 11.5px var(--mono);
  color: #fff;
  background: rgba(0, 0, 0, .38);
  padding: 1px 7px;
  border-radius: 5px;
  mix-blend-mode: normal;
}
.color-input { flex: 1; min-width: 240px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.color-row .k { width: 116px; flex: none; font-size: 11.5px; color: var(--faint); }
.color-row .v { flex: 1; font: 12.5px var(--mono); color: #1f2937; word-break: break-all; }
.slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.slider-row .ch { width: 16px; font: 600 11.5px var(--mono); color: var(--faint); }
.slider-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.slider-row code { width: 44px; text-align: right; font: 12px var(--mono); color: #475569; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; }
.palette .sw {
  flex: 1 1 70px;
  height: 62px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .06);
  cursor: pointer;
  display: grid;
  place-items: end center;
  padding-bottom: 5px;
  transition: transform .12s;
}
.palette .sw:hover { transform: translateY(-2px); }
.palette .sw span {
  font: 10px var(--mono);
  color: #fff;
  background: rgba(0, 0, 0, .35);
  padding: 0 4px;
  border-radius: 3px;
}

/* 正则 */
.regex-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
}
.regex-bar:focus-within { border-color: #b9cdfb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); background: #fff; }
.regex-bar .slash { color: #94a3b8; font: 15px var(--mono); }
.regex-bar input { border: 0; outline: none; background: transparent; font: 13px var(--mono); color: #1f2937; height: 30px; }
.regex-bar input.pat { flex: 1; }
.regex-bar input.flags { width: 62px; border-left: 1px solid var(--line-2); padding-left: 8px; color: var(--brand-dark); }
.hl {
  padding: 12px;
  background: #fcfcfd;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font: 12.8px/1.9 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow: auto;
  color: #3d4657;
  min-height: 120px;
}
.hl mark {
  background: #fff3bf;
  color: #92400e;
  border-radius: 3px;
  box-shadow: 0 0 0 1px #f7d97b inset;
}
.table-wrap { overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; max-height: 480px; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; background-color:#fff;}
.grid-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 8px 11px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  z-index: 1;
}
.grid-table td { padding: 7px 11px; border-bottom: 1px solid #f3f5f9; vertical-align: top; color: #475569; }
.grid-table tr:last-child td { border-bottom: 0; }
.grid-table code { font: 14px var(--mono); color: #0f766e; word-break: break-all; }
.grid-table code.wrap { white-space: pre-wrap; word-break: break-all; color: #334155; }

/* 二维码 */
.qr-box { display: flex; align-items: center; justify-content: center; min-height: 340px; background: #fcfcfd; }
.qr-canvas { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: var(--shadow); }
.qr-canvas svg { display: block; }

/* 图片 */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 14px;
  border: 1.5px dashed #cfd8e6;
  border-radius: 10px;
  background: #fbfcfe;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: all .14s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone p { margin: 4px 0 0; font-size: 12.8px; }
.dropzone small { color: var(--faint); font-size: 11px; }
.img-preview {
  display: grid;
  place-items: center;
  padding: 10px;
  background: repeating-conic-gradient(#f1f4f9 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  min-height: 160px;
}
.img-preview img { max-width: 100%; max-height: 280px; border-radius: 6px; }

/* 生成器 */
.gen-list { display: flex; flex-direction: column; gap: 6px; }
.gen-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.gen-item .idx { width: 22px; flex: none; font: 11px var(--mono); color: var(--faint); }
.gen-item code { flex: 1; font: 13px var(--mono); color: #1e3a8a; word-break: break-all; }
.strength { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.st-bars { display: flex; gap: 4px; }
.st-bars i { width: 26px; height: 6px; border-radius: 3px; background: #e6eaf2; }
.st-bars i.on { background: linear-gradient(90deg, #34d399, #2563eb); }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-cell { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fbfcfe; }
.stat-v { font: 600 20px/1.2 var(--mono); color: #1e3a8a; }
.stat-k { font-size: 12px; color: #475569; margin-top: 2px; }
.stat-h { font-size: 10.5px; color: var(--faint); }
.freq-list { display: flex; flex-direction: column; gap: 6px; }
.freq-row { display: flex; align-items: center; gap: 10px; }
.freq-ch { width: 28px; text-align: center; font: 13px var(--mono); color: #334155; flex: none; }
.freq-bar { flex: 1; height: 8px; background: #f1f4f9; border-radius: 4px; overflow: hidden; }
.freq-bar i { display: block; height: 100%; background: linear-gradient(90deg, #93c5fd, #2563eb); border-radius: 4px; }
.freq-n { width: 40px; text-align: right; font: 11.5px var(--mono); color: var(--faint); flex: none; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: #101828;
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .5);
  z-index: 100;
  max-width: 80vw;
}
.toast-enter-active, .toast-leave-active { transition: opacity .18s ease, transform .18s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translate(-50%, 10px); }

/* ---------------------------------- 响应式 ---------------------------------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .pane textarea, .out, .placeholder, .tree { min-height: 240px; }
}
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 58px;
    z-index: 40;
    height: calc(100vh - 58px);
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 24px 48px rgba(16, 24, 40, .16);
  }
  #app.nav-open .sidebar { transform: none; }
  .burger { display: inline-flex; }
  .overlay {
    display: block;
    position: fixed;
    inset: 58px 0 0;
    background: rgba(16, 24, 40, .32);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 35;
  }
  #app.nav-open .overlay { opacity: 1; pointer-events: auto; }
}
@media (max-width: 720px) {
  .main { padding: 16px 12px 32px; }
  .brand-text small { display: none; }
  .pill-count { display: none; }
  .search { max-width: none; }
  .search kbd { display: none; }
  .search input { padding-right: 30px; }
  .tool-head h1 { font-size: 19px; }
  .tool-tags { display: none; }
  .color-grid { grid-template-columns: 1fr; }
  .now-time { font-size: 22px; }
  .pad { padding: 10px; }
  .toolbar { gap: 6px; }
  .btn { height: 30px; padding: 0 10px; font-size: 12.2px; }
}
