/* ============================================================
   工具箱设计系统
   - 单一强调色（teal），全局锁定
   - 统一圆角尺度
   - 明 / 暗双主题（CSS 变量）
   - 克制动效，支持 prefers-reduced-motion
   ============================================================ */

:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --surface-3: #e6eaef;
  --border: #e1e6ec;
  --border-strong: #d2d9e1;
  --text: #1b2230;
  --text-2: #4b5364;
  --text-muted: #8b94a4;
  --accent: #0f766e;
  --accent-strong: #0f766e;
  --accent-soft: #e4f6f3;
  --accent-text: #0b5d56;
  --on-accent: #ffffff;
  --danger: #d23b3b;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow: 0 6px 22px rgba(16,24,40,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --sidebar-w: 256px;
}

[data-theme="dark"] {
  --bg: #0e1217;
  --surface: #161c24;
  --surface-2: #1c242e;
  --surface-3: #232d39;
  --border: #28323e;
  --border-strong: #36424f;
  --text: #e7ecf2;
  --text-2: #b4bdcc;
  --text-muted: #7d8798;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: #0e2e2b;
  --accent-text: #5eead4;
  --on-accent: #04201d;
  --danger: #f06a6a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 8px 26px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

::selection { background: var(--accent-soft); color: var(--accent-text); }

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

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--on-accent);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.brand .logo svg { width: 20px; height: 20px; }
.brand .name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand .sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.nav { flex: 1; overflow-y: auto; padding: 12px 12px 8px; }
.nav-group { margin: 6px 0 2px; padding: 0 10px; }
.nav-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 11px;
  margin: 2px 0;
  border: none; background: transparent;
  color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 600;
  text-align: left; cursor: pointer;
  border-radius: var(--radius-sm);
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.nav-item .ic { width: 20px; height: 20px; flex: 0 0 auto; color: var(--text-muted); transition: color .15s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover .ic { color: var(--text-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item.active .ic { color: var(--accent-strong); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--accent-strong);
}

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s ease;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle .ic { width: 18px; height: 18px; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn {
  display: none; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); width: 38px; height: 38px; cursor: pointer;
  color: var(--text); align-items: center; justify-content: center;
}
.topbar .crumb { font-weight: 600; font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .hint { font-size: 12.5px; color: var(--text-muted); }

.content { padding: 28px 26px 64px; }
.wrap { max-width: 1120px; margin: 0 auto; }

.tool-header { margin-bottom: 20px; }
.tool-header h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; letter-spacing: .2px; }
.tool-header p { margin: 0; color: var(--text-muted); font-size: 14px; max-width: 70ch; }

/* ---------- 面板 / 卡片 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ---------- 按钮 ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, transform .08s ease, border-color .15s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- 表单 ---------- */
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; }
.input, .textarea, select.input {
  width: 100%; font: inherit; font-size: 14px;
  padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; line-height: 1.55; }
.textarea.mono { font-family: var(--mono); font-size: 13.5px; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.field { margin-bottom: 14px; }

/* ---------- 分段标签（tabs） ---------- */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tab {
  border: none; background: transparent; color: var(--text-2);
  font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 7px 14px; border-radius: 6px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-panel { display: none; margin-top: 18px; }
.tab-panel.active { display: block; animation: fade .25s ease; }

/* ---------- IO 三栏（输入 | 操作 | 输出） ---------- */
.io-grid {
  display: grid; grid-template-columns: 1fr 132px 1fr; gap: 16px; align-items: stretch;
}
.io-grid .ops {
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
}
.io-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.io-col .io-title { font-size: 13px; font-weight: 700; color: var(--text-2); }
.io-col .textarea { flex: 1; min-height: 230px; }

/* 特定工具文本框加高：仅作用于对应面板，不影响共享 ioGrid 的其他工具 */
#panel-encoding .io-col .textarea,
#panel-crypto .textarea,
#panel-urlparams .io-col .textarea,
#panel-uuid .textarea,
#panel-http #http_body { min-height: 340px; }
#panel-http #http_headers { min-height: 170px; }

/* ---------- 提示 / 状态 ---------- */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 13.5px; line-height: 1.55; border: 1px solid color-mix(in srgb, var(--accent-strong) 25%, transparent);
}
.note.warn { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.note .ic { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.msg-err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------- 杂项 ---------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }

/* cron 生成器专用 */
.cron-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.cron-tab {
  border: none; background: transparent; font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 14px; cursor: pointer; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease;
}
.cron-tab:hover { color: var(--text); }
.cron-tab.active { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }
.cron-pane { display: none; }
.cron-pane.active { display: block; animation: fade .2s ease; }
.opt { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 14px; }
.opt input[type="radio"], .opt input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-strong); }
.opt .nums { display: inline-flex; align-items: center; gap: 6px; }
.opt .nums input { width: 64px; }
.cron-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin-top: 6px; }
.cron-grid label { display: flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.cron-grid label:hover { background: var(--surface-2); }
.cron-result { margin-top: 18px; }
.cron-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cron-table th, .cron-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: center; }
.cron-table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.cron-table td .val { font-family: var(--mono); color: var(--accent-text); font-weight: 700; }
.cron-expr { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.cron-expr .input { font-family: var(--mono); flex: 1; }

/* 二维码 / 图片预览 */
.preview-box { display: flex; align-items: center; justify-content: center; min-height: 200px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; }
.preview-box img, .preview-box canvas { max-width: 100%; border-radius: 6px; background: #fff; }
.preview-box.qr img, .preview-box.qr canvas { background: #fff; padding: 8px; }
.img-prev-img { max-width: 100%; max-height: 320px; border-radius: 8px; box-shadow: var(--shadow-sm); background-color: #fff;
  background-image: linear-gradient(45deg, #e9ecf1 25%, transparent 25%), linear-gradient(-45deg, #e9ecf1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9ecf1 75%), linear-gradient(-45deg, transparent 75%, #e9ecf1 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }

/* 应用图标预览网格 */
.img-ico-grid { display: flex; flex-wrap: wrap; gap: 14px 18px; margin-top: 18px; }
.img-ico-cell { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.img-ico-cell canvas { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; box-shadow: var(--shadow-sm);
  background-color: #fff; border: 1px solid var(--border);
  background-image: linear-gradient(45deg, #e9ecf1 25%, transparent 25%), linear-gradient(-45deg, #e9ecf1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9ecf1 75%), linear-gradient(-45deg, transparent 75%, #e9ecf1 75%);
  background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; }
.img-ico-cell-name { font-size: 11px; line-height: 1.3; color: var(--text-2); word-break: break-all; max-height: 28px; overflow: hidden; }
.img-ico-cell-dim { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.img-ico-grid-empty { color: var(--text-muted); font-size: 14px; }

/* 二维码工具布局 */
.qr-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }
.qr-form .textarea { min-height: 120px; }
.qr-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; margin: 16px 0; }
.field-inline { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-inline .input { width: 100%; }
.input-color { padding: 4px; height: 40px; cursor: pointer; }
.qr-ph { color: var(--text-muted); font-size: 13.5px; }
.qr-preview { position: sticky; top: 80px; }
@media (max-width: 880px) {
  .qr-layout { grid-template-columns: 1fr; }
  .qr-preview { position: static; }
}

/* JSON 树 */
.jsonview { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.jsonview .null { color: var(--danger); }
.jsonview .bool { color: #d9a441; }
.jsonview .num { color: #b06fd6; }
.jsonview .string { color: #1f9d6b; word-break: break-word; }

.json-tree {
  min-height: 230px; max-height: 540px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface); color: var(--text);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
}
.json-tree .jsonview { font-size: 13.5px; }

/* JSON 工具：输入框与树视图尽量铺满窗口剩余可视区域 */
#panel-json .io-grid { min-height: calc(100dvh - 240px); }
#panel-json .io-col .textarea { flex: 1; min-height: calc(100dvh - 300px); }
#panel-json .json-tree { max-height: none; flex: 1; min-height: calc(100dvh - 300px); }

/* 诗词卡片 */
.poem-card { white-space: pre-wrap; font-size: 16px; line-height: 2; }
.poem-meta { color: var(--text-muted); font-size: 13px; margin-top: 10px; }

/* 遮罩（移动端抽屉） */
.scrim {
  display: none; position: fixed; inset: 0; background: rgba(8,12,18,.45); z-index: 40;
}

/* ---------- 密码生成 ---------- */
.pw-strength { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.pw-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .2s ease, background .2s ease; }
.pw-bar span.weak { background: #d23b3b; }
.pw-bar span.mid { background: #d9a441; }
.pw-bar span.strong { background: #1f9d6b; }
.pw-bar span.vstrong { background: var(--accent-strong); }
.pw-label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }

/* ---------- 正则测试 ---------- */
.regex-highlight {
  min-height: 90px; max-height: 360px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface); color: var(--text);
  white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.7;
}
.regex-highlight mark { background: var(--accent-soft); color: var(--accent-text); padding: 1px 2px; border-radius: 4px; }
.rx-empty { color: var(--text-muted); }
.rx-list { display: flex; flex-direction: column; gap: 8px; }
.rx-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.rx-item-head { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.rx-match { font-family: var(--mono); font-size: 13.5px; color: var(--accent-text); font-weight: 700; word-break: break-all; }
.rx-groups { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.rx-group { font-size: 12.5px; color: var(--text-2); }
.rx-group em { color: var(--text-muted); font-style: normal; }
.rx-slash { color: var(--text-muted); font-family: var(--mono); align-self: center; }

/* ---------- 代码块（JWT 等） ---------- */
.code-block {
  margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.55;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto;
}

/* ---------- 进制转换 ---------- */
.bc-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.bc-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.bc-name { font-size: 12.5px; font-weight: 700; color: var(--text-2); letter-spacing: .03em; }
.bc-val { font-size: 14px; font-weight: 600; color: var(--accent-text); word-break: break-all; }

/* ---------- 颜色转换 ---------- */
.col-swatch { position: relative; width: 56px; height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); flex: 0 0 auto; overflow: hidden;
  background-image:
    linear-gradient(45deg, #c9c9c9 25%, transparent 25%),
    linear-gradient(-45deg, #c9c9c9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c9c9c9 75%),
    linear-gradient(-45deg, transparent 75%, #c9c9c9 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-color: #fff; }
.col-swatch-fill { position: absolute; inset: 0; }
.col-swatch-hex { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text); }
/* Pickr 触发按钮间距 */
.col-pick-btn { margin-top: 2px; }

/* Pickr 暗色适配 */
[data-theme="dark"] .pcr-app {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .pcr-app .pcr-interaction { color: var(--text); }
[data-theme="dark"] .pcr-app .pcr-interaction .pcr-result { color: var(--text); background: var(--bg); }
[data-theme="dark"] .pcr-app .pcr-swatches button { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset; }

/* Emoji 选择器 */
.emoji-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.emoji-cat { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.emoji-cat:hover { border-color: var(--accent); color: var(--accent-text); }
.emoji-cat.active { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.emoji-wrap { max-height: 460px; overflow: auto; padding: 4px 2px 8px; }
.emoji-cat-block { margin-bottom: 8px; }
.emoji-cat-title { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 8px 2px 6px; display: flex; align-items: center; gap: 6px; }
.emoji-cat-title span { font-weight: 400; color: var(--text-2); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.emoji-list { display: flex; flex-direction: column; gap: 8px; }
.emoji-node { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; transition: background .12s, border-color .12s; }
.emoji-node:hover { background: var(--accent-soft); border-color: var(--accent); }
.emoji-glyph { font-size: 30px; line-height: 1; width: 44px; flex: none; text-align: center; }
.emoji-meta { flex: 1; min-width: 0; }
.emoji-name { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; word-break: break-word; }
.emoji-en { font-weight: 400; font-size: 12px; color: var(--text-2); }
.emoji-codes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.emoji-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; cursor: pointer; color: var(--text-2); transition: border-color .12s, color .12s; }
.emoji-codes code:hover { border-color: var(--accent); color: var(--accent-text); }
.emoji-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); background: var(--accent-strong); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.emoji-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 动画 ---------- */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tool-panel { animation: fade .25s ease; }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .scrim.show { display: block; }
  .content { padding: 20px 16px 56px; }
  .io-grid { grid-template-columns: 1fr; }
  .io-grid .ops { flex-direction: row; flex-wrap: wrap; }
  .io-grid .ops .btn { flex: 1; }
  .io-col .textarea { min-height: 160px; }
  /* 移动端单列：避免 JSON 变成两个满屏盒子，其余工具回到适中高度 */
  #panel-encoding .io-col .textarea,
  #panel-crypto .textarea,
  #panel-urlparams .io-col .textarea,
  #panel-uuid .textarea,
  #panel-http #http_body { min-height: 240px; }
  #panel-http #http_headers { min-height: 120px; }
  #panel-json .io-grid { min-height: 0; }
  #panel-json .io-col .textarea,
  #panel-json .json-tree { max-height: none; min-height: 56vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 账号 / 历史记录 ---------- */
.user-chip {
  font: inherit; cursor: pointer; max-width: 160px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chip:hover { border-color: var(--accent); }

/* 登录 / 注册 弹窗 */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .45); padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal-scrim.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 380px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x {
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
  width: 32px; height: 32px; border-radius: var(--radius);
  background: none; border: 0; color: var(--muted);
}
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius); margin-bottom: 16px; }
.seg-btn {
  flex: 1; font: inherit; cursor: pointer; padding: 8px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px);
  z-index: 200; background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 历史工具栏 */
.hist-toolbar { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* 历史抽屉 */
.scrim.show { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 110;
  width: min(420px, 92vw); height: 100%;
  background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.hist-loading, .hist-empty { color: var(--muted); font-size: 14px; padding: 18px 4px; text-align: center; }
.hist-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.hist-item:hover { border-color: var(--accent); background: var(--surface-2); }
.hist-item-main { flex: 1; min-width: 0; }
.hist-item-title { font-weight: 600; margin-bottom: 2px; }
.hist-item-time { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hist-item-preview { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; word-break: break-all; max-height: 54px; overflow: hidden; }
.hist-del {
  font: inherit; cursor: pointer; flex: none;
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12.5px;
}
.hist-del:hover { border-color: var(--danger); color: var(--danger); }
.hist-del.confirming { color: #fff; background: var(--danger); border-color: var(--danger); font-weight: 700; }

/* ---------- 按文本框历史组件（HistoryBox） ---------- */
.histbox { position: relative; display: block; }
.histbox > textarea, .histbox > .textarea { width: 100%; }

.histbox-ico {
  position: absolute;
  top: -11px;                /* 骑在上边框线上（被上边框穿过） */
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-2);
  cursor: pointer; padding: 0; z-index: 6;
  box-shadow: var(--shadow-sm);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.histbox-ico:hover { color: var(--accent); border-color: var(--accent); }
.histbox-hist { right: 10px; }                  /* 距右侧 10px（最右图标） */
.histbox-save { right: 42px; }                  /* 与历史图标间距 10px（图标 22 + 间隙 10） */
.histbox-save.saved { color: #fff; background: var(--accent); border-color: var(--accent); }

/* 单行 input（颜色 HEX/RGB/HSL、正则等）：图标置于框内右侧，避免与上方标签重叠 */
.histbox--inline { display: flex; flex: 1 1 auto; min-width: 0; }
.histbox--inline > input { width: 100%; flex: 1; padding-right: 56px; }
.histbox--inline .histbox-ico { top: 50%; transform: translateY(-50%); }

/* 历史记录：右侧抽屉 */
.hb-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 1190; display: none; opacity: 0; transition: opacity .2s ease;
}
.hb-scrim.show { display: block; opacity: 1; }
.hb-drawer {
  position: fixed; top: 0; right: 0; z-index: 1200;
  width: min(440px, 92vw); height: 100%;
  background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.hb-drawer.open { transform: none; }
.hb-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.hb-drawer-title { font-size: 16px; font-weight: 700; }
.hb-drawer-close { font: inherit; cursor: pointer; flex: none; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: var(--radius-sm); width: 30px; height: 30px; line-height: 1; padding: 0; }
.hb-drawer-close:hover { border-color: var(--danger); color: var(--danger); }
.hb-drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.hb-drawer-empty { color: var(--muted); font-size: 14px; padding: 18px 4px; text-align: center; line-height: 1.6; }
.hb-drawer-row { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; transition: border-color .15s ease, background .15s ease; }
.hb-drawer-row:hover { border-color: var(--accent); background: var(--surface-2); }
.hb-drawer-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; font-family: var(--mono, ui-monospace, monospace); }
.hb-drawer-main { display: flex; align-items: flex-start; gap: 8px; }
.hb-drawer-text { flex: 1; min-width: 0; font-size: 13px; white-space: pre-wrap; word-break: break-all; cursor: pointer; font-family: var(--mono, ui-monospace, monospace); color: var(--text); }
.hb-drawer-apply { flex: none; font: inherit; cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); border-radius: var(--radius-sm); padding: 0 12px; height: 28px; font-size: 12.5px; white-space: nowrap; }
.hb-drawer-apply:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.hb-drawer-del { flex: none; font: inherit; cursor: pointer; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: var(--radius-sm); width: 28px; height: 28px; line-height: 1; padding: 0; }
.hb-drawer-del:hover { border-color: var(--danger); color: var(--danger); }

/* 历史组件轻提示 */
.hb-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px);
  z-index: 2200; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 86vw; text-align: center; box-shadow: var(--shadow);
}
.hb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hb-toast-success { background: #1f9d55; color: #fff; }
.hb-toast-error { background: var(--danger); color: #fff; }

@media (max-width: 880px) {
  .drawer { width: 100vw; }
}

/* ---------- HTTP 工具：WS / 代码块 / 请求详情 / 内嵌弹窗 ---------- */
.ws-status { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.ws-status.ok { background: var(--accent-soft); color: var(--accent-text); }
.ws-status.err { background: #fde8e8; color: #b42318; }
.ws-log {
  max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2);
}
.ws-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: var(--radius-sm); border-left: 3px solid var(--border-strong); background: var(--surface); }
.ws-item.ws-sent { border-left-color: var(--accent); }
.ws-item.ws-recv { border-left-color: #6366f1; }
.ws-item .ws-dir { font-size: 12px; font-weight: 700; color: var(--text-2); }
.ws-item .ws-time { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.ws-item .ws-data { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: 13px; color: var(--text); max-height: 200px; overflow-y: auto; font-family: var(--mono, ui-monospace, monospace); }

.code-block {
  margin: 0; padding: 14px 16px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--mono, ui-monospace, monospace); font-size: 13px; line-height: 1.55;
  white-space: pre; overflow-x: auto;
}
.kv { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.kv b { color: var(--text); }

.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .5); padding: 24px;
}
.modal-box {
  position: relative; width: 100%; max-width: 860px; max-height: 88vh; overflow: hidden;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: var(--radius); border: 0;
  background: var(--surface-2); color: var(--text-2); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ============================================================
   图片处理工具
   ============================================================ */
.img-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 130px; padding: 24px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  text-align: center;
}
.img-drop:hover { border-color: var(--accent-strong); }
.img-drop.drag { border-color: var(--accent-strong); background: var(--accent-soft); }
.img-drop-main { font-weight: 600; color: var(--text); font-size: 15px; }
.img-drop-sub { font-size: 12.5px; color: var(--text-muted); }
.img-drop-sm { flex-direction: row; min-height: 0; padding: 8px 12px; gap: 8px; }
.img-drop-sm .img-drop-main { font-size: 13px; }

.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .img-grid { grid-template-columns: 1fr; } }

.img-sub { padding: 16px; margin: 0; }
.img-sub-title { font-size: 13.5px; font-weight: 700; color: var(--text-2); margin-bottom: 12px; }
.wm-custom-label { font-size: 13px; font-weight: 700; color: var(--text-2); align-self: center; }

/* 高级调整总开关 */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: relative; display: inline-block; width: 40px; height: 22px;
  background: var(--border); border-radius: 999px; transition: background .18s ease;
}
.switch .slider::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--accent-strong); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.adv-disabled { opacity: .45; pointer-events: none; filter: grayscale(.6); }

.img-out {
  font-size: 13.5px; line-height: 1.7; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}

/* 拼接缩略图列表 */
.img-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.img-list-empty { color: var(--text-muted); font-size: 14px; padding: 8px 2px; }
.img-thumb {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: 320px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.img-thumb-idx { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.img-thumb img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: #fff; }
.img-thumb-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-thumb-ops { display: flex; gap: 4px; flex: 0 0 auto; }
.img-thumb-ops .btn { padding: 4px 9px; font-size: 12px; }

/* 裁切弹层 */
.img-crop-modal { max-width: 760px; }
.img-crop-stage {
  position: relative; margin: 0 auto; max-width: 100%;
  background:
    linear-gradient(45deg, #d8dde3 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #d8dde3 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #d8dde3 75%) 0 0 / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #d8dde3 75%) 0 0 / 16px 16px,
    #c4cad1;
  background-color: #c4cad1;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
[data-theme="dark"] .img-crop-stage {
  background:
    linear-gradient(45deg, #2a333f 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #2a333f 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #2a333f 75%) 0 0 / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #2a333f 75%) 0 0 / 16px 16px,
    #1c242e;
  background-color: #1c242e;
}
.img-crop-stage img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.img-crop-box {
  position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45);
  cursor: move; box-sizing: border-box;
}
.img-crop-box .h {
  position: absolute; width: 12px; height: 12px; background: #fff; border: 1.5px solid var(--accent-strong, #0f766e);
  border-radius: 3px; box-sizing: border-box;
}
.img-crop-box .h-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.img-crop-box .h-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.img-crop-box .h-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.img-crop-box .h-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.img-crop-box .h-n { left: 50%; top: -6px; margin-left: -6px; cursor: ns-resize; }
.img-crop-box .h-s { left: 50%; bottom: -6px; margin-left: -6px; cursor: ns-resize; }
.img-crop-box .h-w { top: 50%; left: -6px; margin-top: -6px; cursor: ew-resize; }
.img-crop-box .h-e { top: 50%; right: -6px; margin-top: -6px; cursor: ew-resize; }

/* ---------- 管理后台 ---------- */
.adm-create { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.tbl th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .acts { display: flex; gap: 6px; flex-wrap: wrap; white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-danger.is-disabled, .btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.tag-admin { color: #1d4ed8; background: color-mix(in srgb, #3b82f6 16%, transparent); border-color: color-mix(in srgb, #3b82f6 35%, transparent); }
.tag-ok { color: #15803d; background: color-mix(in srgb, #22c55e 16%, transparent); border-color: color-mix(in srgb, #22c55e 35%, transparent); }
.tag-bad { color: #b91c1c; background: color-mix(in srgb, #ef4444 16%, transparent); border-color: color-mix(in srgb, #ef4444 35%, transparent); }
.tag-sys { color: var(--text-2); background: var(--surface-2); }
.tag-int { color: #8a5800; background: color-mix(in srgb, #f59e0b 18%, transparent); border-color: color-mix(in srgb, #f59e0b 40%, transparent); }
.role-edit { margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.role-edit .input { width: 92px; padding: 3px 6px; font-size: 12px; }
.perm-denied { max-width: 520px; margin: 48px auto; text-align: center; color: var(--text-2); }
.perm-denied-ic { color: var(--text-2); opacity: .55; margin-bottom: 6px; }
.perm-denied h2 { color: var(--text); margin: 0 0 10px; font-size: 20px; }
.perm-denied p { margin: 6px 0; font-size: 14px; line-height: 1.6; }

/* ---------- 测试人员信息生成 ---------- */
.idc-wrap { max-width: 980px; }
.idc-note { margin-bottom: 12px; line-height: 1.7; }
.idc-form { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 14px; }
.idc-form .lbl { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.idc-form .lbl select, .idc-form .lbl input { width: auto; }
.idc-out-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.idc-table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 520px; background: var(--surface); }
.idc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.idc-table th, .idc-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.idc-table th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 600; z-index: 1; }
.idc-table tbody tr:hover { background: var(--surface-2); }
.idc-table .mono, .idc-table td.mono { font-family: var(--mono); }
.idc-table .idc-addr { white-space: normal; min-width: 220px; color: var(--text); }
.idc-table td .btn { white-space: nowrap; }
.idc-empty { padding: 28px; text-align: center; color: var(--text-2); font-size: 14px; }

/* ---------- 字数统计 ---------- */
.tc-wrap { max-width: 760px; }
.tc-input { width: 100%; font-family: var(--mono); resize: vertical; }
.tc-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.tc-stat { flex: 1 1 140px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tc-stat-v { font-size: 26px; font-weight: 700; color: var(--text); }
.tc-stat-l { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.tc-bytes-title { font-size: 14px; font-weight: 600; margin: 8px 0 6px; }
.tc-bytes td:last-child { text-align: right; }

/* ---------- SVG 生成 ---------- */
.svg-tool { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.svg-left { flex: 1 1 320px; min-width: 300px; }
.svg-right { flex: 1 1 320px; min-width: 300px; }
.svg-canvas-set { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.svg-canvas-set .lbl { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.svg-add { margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.svg-shapes { display: flex; flex-direction: column; gap: 10px; }
.svg-shape { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); }
.svg-shape-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; }
.svg-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.svg-fld { display: flex; flex-direction: column; font-size: 12px; color: var(--text-2); gap: 3px; }
.svg-preview { border: 1px solid var(--border); border-radius: 10px; background:
  repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 20px 20px;
  min-height: 200px; padding: 10px; overflow: auto; margin-bottom: 8px; }
.svg-preview svg { max-width: 100%; height: auto; display: block; }
.svg-out-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; }
.svg-source { width: 100%; font-size: 12px; font-family: var(--mono); }

/* ---------- 身份证号生成 ---------- */
.idc-wrap { max-width: 720px; }
.idc-note { margin-bottom: 12px; }
.idc-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.idc-form .lbl { font-size: 13px; color: var(--text-2); display: inline-flex; flex-direction: column; gap: 3px; }
.idc-out-head { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.idc-out-head .btn { margin-left: auto; }

/* ---------- 独立后台页 ---------- */
.admin-page { min-height: 100vh; background: var(--bg); }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.admin-top .brand { display: flex; align-items: center; gap: 10px; }
.admin-top .name { font-weight: 700; }
.admin-top .sub { font-size: 12px; color: var(--text-2); }
.admin-top .spacer { flex: 1; }
.admin-main { max-width: 980px; margin: 24px auto; padding: 0 20px; }
.admin-login { max-width: 360px; margin: 80px auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.admin-login h2 { margin: 0 0 16px; }
.admin-login .field { margin-bottom: 12px; }
.admin-login .label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.adm-create { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
