/* ============================================================
 * style.css — 前端工具箱样式（支持浅色/深色主题）
 * ============================================================ */
:root {
  --bg: #f5f6fa;
  --bg-elev: #ffffff;
  --bg-soft: #eef0f6;
  --border: #e3e6ef;
  --text: #1f2430;
  --text-soft: #6b7280;
  --text-faint: #9aa1ad;
  --primary: #4f6ef7;
  --primary-soft: #eaf0ff;
  --primary-text: #ffffff;
  --shadow: 0 6px 24px rgba(31, 36, 48, 0.08);
  --shadow-sm: 0 2px 8px rgba(31, 36, 48, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --ok: #1aae6f;
  --err: #e5484d;
  --code-bg: #f3f4f8;
}
html[data-theme='dark'] {
  --bg: #161922;
  --bg-elev: #1f2330;
  --bg-soft: #252a39;
  --border: #303646;
  --text: #e8eaf0;
  --text-soft: #a3a9b8;
  --text-faint: #6b7280;
  --primary: #6d8bff;
  --primary-soft: #232a45;
  --primary-text: #ffffff;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --code-bg: #2a2f3e;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .2s ease, transform .25s ease;
}
.sidebar.collapsed { width: 64px; }
.sidebar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid var(--border);
}
.logo {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #8a5cf6);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
}
.logo-text { font-weight: 700; font-size: 16px; white-space: nowrap; }
.sidebar.collapsed .logo-text, .sidebar.collapsed .cat-name, .sidebar.collapsed .tool-name, .sidebar.collapsed .side-search { display: none; }
.side-search {
  margin: 12px 12px 4px; display: flex; gap: 8px;
}
.side-search input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); font-size: 13px; outline: none;
}
.side-search input:focus { border-color: var(--primary); }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 8px 20px; }
.nav-cat { margin-top: 6px; }
.nav-cat-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer;
  color: var(--text-soft); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border-radius: var(--radius-sm); user-select: none;
}
.nav-cat-head:hover { background: var(--bg-soft); }
.nav-cat-head .caret { margin-left: auto; transition: transform .2s; font-size: 10px; }
.nav-cat.collapsed .caret { transform: rotate(-90deg); }
.nav-cat.collapsed .nav-tools { display: none; }
.nav-tools { list-style: none; margin: 2px 0 0; padding: 0 0 0 6px; }
.nav-tool {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; margin: 1px 0;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: 13.5px;
}
.nav-tool:hover { background: var(--bg-soft); }
.nav-tool.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-tool .ico { font-size: 15px; width: 18px; text-align: center; }
.sidebar.collapsed .nav-tool { justify-content: center; }

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 60px;
  background: var(--bg-elev); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.topbar .spacer { flex: 1; }
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-title small { color: var(--text-faint); font-weight: 400; margin-left: 8px; font-size: 12px; }

.content { flex: 1; overflow-y: auto; padding: 22px 26px 60px; }

/* ---------- 首页卡片 ---------- */
.home-hero {
  background: linear-gradient(120deg, var(--primary-soft), transparent);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px;
}
.home-hero h1 { margin: 0 0 6px; font-size: 24px; }
.home-hero p { margin: 0; color: var(--text-soft); }
.home-search {
  margin-top: 16px; max-width: 460px; display: flex; gap: 8px;
}
.home-search input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font-size: 14px; outline: none;
}
.home-search input:focus { border-color: var(--primary); }

.cat-section { margin-bottom: 26px; }
.cat-section h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.cat-section h2 .count { color: var(--text-faint); font-size: 13px; font-weight: 500; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tool-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  display: flex; flex-direction: column; gap: 8px;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.tool-card .tc-ico {
  width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft);
  display: grid; place-items: center; font-size: 20px;
}
.tool-card .tc-name { font-weight: 600; font-size: 14.5px; }
.tool-card .tc-desc { color: var(--text-faint); font-size: 12.5px; line-height: 1.5; }

/* ---------- 工具视图 ---------- */
.tool-view { max-width: 1100px; margin: 0 auto; }
.tool-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.tool-head .th-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 22px; }
.tool-head h2 { margin: 0; font-size: 19px; }
.tool-head p { margin: 2px 0 0; color: var(--text-soft); font-size: 13px; }
.back-btn { margin-right: auto; }

.tb-pane { display: flex; flex-direction: column; gap: 8px; }
.tb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tb-split .tb-pane .tb-input { min-height: 320px; }
@media (max-width: 760px) { .tb-split { grid-template-columns: 1fr; } }
.tb-pane-head { display: flex; align-items: center; justify-content: space-between; }
.tb-pane-title { font-weight: 600; font-size: 13px; color: var(--text-soft); }
.tb-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.tb-link:hover { text-decoration: underline; }
.tb-input {
  width: 100%; min-height: 200px; resize: vertical; padding: 13px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; line-height: 1.6; outline: none;
}
.tb-input:focus { border-color: var(--primary); }
.tb-output { background: var(--code-bg); }

.tb-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.tb-spacer { margin-left: auto; }
.tb-btn {
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.tb-btn:hover { border-color: var(--primary); color: var(--primary); }
.tb-btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.tb-btn.primary:hover { filter: brightness(1.07); color: #fff; }
.tb-btn.ghost { background: transparent; color: var(--text-soft); }
.tb-btn:disabled { opacity: .5; cursor: not-allowed; }
.tb-btn.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.tb-btn.active:hover { filter: brightness(1.07); color: var(--primary-text); }

/* ---------- 英文大小写 / 命名转换 ---------- */
.case-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.case-grid .tb-btn { padding: 8px 12px; font-size: 12.5px; }
.case-tip { font-size: 12.5px; color: var(--text-faint); margin-bottom: 8px; }

/* ---------- 符号 / Emoji 选择器 ---------- */
.pick-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pick-search { flex: 1; min-width: 200px; }
.pick-hint { font-size: 12.5px; color: var(--text-faint); }
.pick-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pick-tab {
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; user-select: none;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev);
  color: var(--text-soft); transition: all .15s;
}
.pick-tab:hover { border-color: var(--primary); color: var(--primary); }
.pick-tab.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 4px; }
.pick-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); cursor: pointer; transition: all .12s; min-height: 58px;
}
.pick-cell:hover { border-color: var(--primary); background: var(--primary-tint); transform: translateY(-1px); }
.pick-ch { font-size: 22px; line-height: 1.1; color: var(--text); }
.pick-name { font-size: 11px; color: var(--text-faint); text-align: center; word-break: break-all; }
.pick-empty { grid-column: 1 / -1; text-align: center; color: var(--text-faint); padding: 30px 0; }
.emoji-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.emoji-ch { font-size: 26px; }
.emoji-cell { min-height: 64px; }

/* ---------- 文本批量替换 ---------- */
.replace-rules { margin-bottom: 14px; }
.replace-rules-input { width: 100%; min-height: 110px; resize: vertical; font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.tb-opts { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.replace-stat { font-size: 12.5px; color: var(--text-faint); margin-left: auto; }

.tb-field { display: flex; align-items: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.tb-label { min-width: 84px; color: var(--text-soft); font-size: 13px; }
.tb-select, .tb-text {
  padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font-size: 13px; outline: none;
}
.tb-select:focus, .tb-text:focus { border-color: var(--primary); }
.tb-check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 13px; cursor: pointer; }
.tb-note { color: var(--text-faint); font-size: 12.5px; margin-top: 10px; line-height: 1.6; }
.tb-result {
  margin-top: 12px; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--code-bg);
  border: 1px solid var(--border); font-family: Consolas, monospace; font-size: 13px; word-break: break-all; white-space: pre-wrap;
}
.tb-stat { display: inline-flex; flex-direction: column; align-items: center; padding: 12px 18px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 92px; }
.tb-stat b { font-size: 20px; color: var(--primary); }
.tb-stat span { font-size: 12px; color: var(--text-faint); }
.tb-stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }

.swatch { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--border); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.color-cell { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.color-cell b { font-family: Consolas, monospace; }
.color-cell span { display: block; color: var(--text-faint); font-size: 12px; }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); width: fit-content; }
.qr-box canvas, .qr-box img { display: block; }

.diff-add { background: rgba(26,174,111,.18); color: var(--ok); display: block; padding: 0 6px; }
.diff-del { background: rgba(229,72,77,.18); color: var(--err); display: block; padding: 0 6px; text-decoration: line-through; }

/* ---------- URL 工具箱：选项卡 / 键值网格 ---------- */
.tb-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tb-tab {
  padding: 8px 18px; border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text-soft); border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.tb-tab:hover { color: var(--primary); border-color: var(--primary); }
.tb-tab.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.tb-tabpane { display: none; }
.tb-tabpane.active { display: block; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.kv { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.kv .k { font-size: 12px; color: var(--text-soft); }
.kv .v { font-family: Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; word-break: break-all; }
.sub { font-size: 14px; margin: 18px 0 4px; color: var(--text); }

/* ---------- API 接口测试 ---------- */
.api-wrap { display: flex; flex-direction: column; gap: 16px; }

/* 方法彩色徽章 */
.api-m { display: inline-flex; align-items: center; justify-content: center; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-family: Consolas, 'Liberation Mono', Menlo, monospace; font-size: 11.5px; letter-spacing: .02em; line-height: 1.5; white-space: nowrap; }
.api-m-GET { color: #1aae6f; background: rgba(26,174,111,.15); }
.api-m-POST { color: #4f6ef7; background: rgba(79,110,247,.15); }
.api-m-PUT { color: #d98b00; background: rgba(217,139,0,.16); }
.api-m-PATCH { color: #8a5cf6; background: rgba(138,92,246,.16); }
.api-m-DELETE { color: #e5484d; background: rgba(229,72,77,.14); }
.api-m-HEAD { color: #0ea5e9; background: rgba(14,165,233,.15); }
.api-m-OPTIONS { color: #64748b; background: rgba(100,116,139,.18); }
html[data-theme='dark'] .api-m-GET { color: #5dd6a0; background: rgba(26,174,111,.24); }
html[data-theme='dark'] .api-m-POST { color: #8da6ff; background: rgba(79,110,247,.28); }
html[data-theme='dark'] .api-m-PUT { color: #f0b247; background: rgba(217,139,0,.24); }
html[data-theme='dark'] .api-m-PATCH { color: #b79bff; background: rgba(138,92,246,.26); }
html[data-theme='dark'] .api-m-DELETE { color: #ff7b80; background: rgba(229,72,77,.24); }
html[data-theme='dark'] .api-m-HEAD { color: #4cc6f5; background: rgba(14,165,233,.24); }
html[data-theme='dark'] .api-m-OPTIONS { color: #9aa6b8; background: rgba(100,116,139,.28); }

/* 标签页栏 */
.api-tabbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-bottom: 2px; }
.api-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 8px; border: 1px solid var(--border);
  background: var(--bg-elev); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text-soft); max-width: 260px;
  transition: border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; box-shadow: var(--shadow-sm);
}
.api-tab:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.api-tab.active { color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.api-tab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.api-tab-close { color: var(--text-faint); font-size: 12px; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; transition: all .15s; }
.api-tab-close:hover { color: #fff; background: var(--err); }
.api-tab-add { padding: 6px 14px; border: 1px dashed var(--border); background: transparent; border-radius: 10px; cursor: pointer; color: var(--text-soft); font-size: 13px; transition: all .15s; }
.api-tab-add:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* 请求行（卡片化） */
.api-line { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.api-method { min-width: 110px; font-weight: 700; font-family: Consolas, monospace; color: var(--primary); }
.api-url { flex: 1; min-width: 240px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 13.5px; outline: none; font-family: Consolas, monospace; transition: border-color .15s, box-shadow .15s; }
.api-url:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.api-line .tb-btn.primary { padding: 11px 22px; font-size: 14px; }

/* 代理选项（提示条） */
.api-proxy-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 2px 0; padding: 9px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); font-size: 13px; }
.api-proxy-row .tb-check { margin: 0; }
.api-proxy-sub { display: flex; gap: 16px; align-items: center; }

/* 子标签 + 面板 */
.api-subwrap { margin-top: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); overflow: hidden; box-shadow: var(--shadow-sm); }
.api-subtabs { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.api-subtab { padding: 8px 16px; background: transparent; border: none; border-radius: 8px; cursor: pointer; color: var(--text-soft); font-size: 13.5px; font-weight: 500; transition: all .15s; }
.api-subtab:hover { color: var(--primary); background: var(--bg-elev); }
.api-subtab.active { color: var(--primary); background: var(--bg-elev); box-shadow: inset 0 -2px 0 var(--primary); }
.api-subpane { display: none; padding: 16px; }
.api-subpane.active { display: block; }
.api-bodytool { margin-bottom: 8px; }
.api-body { min-height: 220px; margin-top: 10px; }

/* 键值编辑器（grid 对齐） */
.kv-edit { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: grid; grid-template-columns: 18px minmax(0,1fr) minmax(0,1.6fr) 34px; gap: 8px; align-items: center; padding: 4px; border-radius: 8px; transition: background .15s; }
.kv-row:hover { background: var(--bg-soft); }
.kv-row input[type=checkbox] { width: 16px; height: 16px; justify-self: center; accent-color: var(--primary); }
.kv-k, .kv-v { width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 13px; outline: none; font-family: Consolas, monospace; transition: border-color .15s, box-shadow .15s; }
.kv-k:focus, .kv-v:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.kv-k { background: var(--bg-soft); }
.kv-del { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--bg-elev); border-radius: 8px; cursor: pointer; color: var(--text-faint); transition: all .15s; }
.kv-del:hover { color: #fff; background: var(--err); border-color: var(--err); }
.kv-add { align-self: flex-start; margin-top: 4px; padding: 8px 16px; border: 1px dashed var(--border); background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-soft); font-size: 13px; transition: all .15s; }
.kv-add:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* 响应区 */
.api-resp { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); padding: 16px; box-shadow: var(--shadow-sm); }
.api-respempty { color: var(--text-faint); font-size: 13px; padding: 28px 0; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.api-respbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.api-status { font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 999px; letter-spacing: .01em; }
.api-status.ok { color: #1aae6f; background: rgba(26,174,111,.15); }
.api-status.warn { color: #d98b00; background: rgba(217,139,0,.15); }
.api-status.err { color: #e5484d; background: rgba(229,72,77,.15); }
.api-pill { color: var(--text-soft); font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); }
.api-meta { color: var(--text-faint); font-size: 12.5px; }
.api-errmsg { color: var(--err); font-family: Consolas, monospace; font-size: 13px; background: rgba(229,72,77,.08); border: 1px solid rgba(229,72,77,.25); padding: 12px; border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-all; }
.api-respbody { margin: 0; padding: 16px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: Consolas, monospace; font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-all; max-height: 520px; overflow: auto; }
.api-hdrtbl { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.api-hdrtbl th, .api-hdrtbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.api-hdrtbl tr:last-child th, .api-hdrtbl tr:last-child td { border-bottom: none; }
.api-hdrtbl th { color: var(--text-soft); font-weight: 600; font-size: 12px; background: var(--bg-soft); width: 38%; }
.api-hdrtbl td { font-family: Consolas, monospace; word-break: break-all; }
.j-key { color: #c0399a; } .j-str { color: #1aae6f; } .j-num { color: #2f6fdb; } .j-bool { color: #d98b00; } .j-null { color: #9aa1ad; }

/* cURL 导入弹窗（带动画） */
.api-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); z-index: 200; display: grid; place-items: center; animation: api-fade .15s ease; }
.api-modal { width: min(640px, 92vw); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); animation: api-pop .18s ease; }
.api-modal-head { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.api-modal-sub { color: var(--text-faint); font-size: 12.5px; margin: 6px 0 14px; line-height: 1.6; }
.api-curl { min-height: 180px; margin-bottom: 14px; }
.api-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
@keyframes api-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes api-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
html[data-theme='dark'] .j-key { color: #ff79c6; }
html[data-theme='dark'] .j-str { color: #50fa7b; }
html[data-theme='dark'] .j-num { color: #8be9fd; }
html[data-theme='dark'] .j-bool { color: #ffb86c; }

/* ---------- Toast ---------- */
.toast-box { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text); color: var(--bg-elev); padding: 9px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .25s; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--err); color: #fff; }

/* ---------- 响应式 ---------- */
.menu-toggle { display: none; }
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 50; height: 100%; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .sidebar.collapsed { width: 260px; }
  .sidebar.collapsed .logo-text, .sidebar.collapsed .cat-name, .sidebar.collapsed .tool-name, .sidebar.collapsed .side-search { display: revert; }
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
.scrim.show { display: block; }

/* ---------- HL7 解析 ---------- */
.hl7-out { display: flex; flex-direction: column; gap: 12px; max-height: 620px; overflow: auto; padding-right: 4px; }
.hl7-out > * { flex-shrink: 0; }   /* 防止段卡片被 flex 压缩（滚动容器内应保持自然高度） */
.hl7-empty { color: var(--text-faint); font-size: 13px; padding: 20px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.hl7-seg { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); overflow: hidden; }
.hl7-seg-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.hl7-seg-name { font-family: Consolas, monospace; font-weight: 700; color: var(--primary); font-size: 14px; }
.hl7-seg-badge { font-size: 11.5px; color: var(--text-soft); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; }
.hl7-seg-count { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.hl7-fields { display: flex; flex-direction: column; }
.hl7-field { display: grid; grid-template-columns: 64px 130px 1fr; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--border); align-items: start; }
.hl7-field:last-child { border-bottom: none; }
.hl7-fnum { font-family: Consolas, monospace; color: var(--text-faint); font-size: 12.5px; }
.hl7-fname { color: var(--text-soft); font-size: 12.5px; }
.hl7-fval { font-size: 13px; min-width: 0; }
.hl7-raw { font-family: Consolas, monospace; word-break: break-all; }
.hl7-det { margin: 0; }
.hl7-det > summary { cursor: pointer; color: var(--text); }
.hl7-det > summary::-webkit-details-marker { color: var(--text-faint); }
.hl7-nested { list-style: none; margin: 6px 0 2px; padding-left: 14px; border-left: 2px solid var(--border); }
.hl7-nested .hl7-nested { margin-top: 2px; }
.hl7-idx { color: var(--text-faint); font-size: 11.5px; margin-right: 6px; font-family: Consolas, monospace; }
.hl7-v { font-family: Consolas, monospace; word-break: break-all; }
.hl7-nested li { padding: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; }

/* ---------- 全屏填充型工具：页面不自滚动，由工具内部面板各自滚动 ---------- */
.content.no-scroll { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 22px; }
.tool-view.fill { flex: 1; min-height: 0; max-width: 100%; display: flex; flex-direction: column; }
.tool-view.fill .tool-head { flex-shrink: 0; }
.tool-view.fill .tool-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tool-view.fill .tb-toolbar { flex-shrink: 0; }
.tool-view.fill .tb-split { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.tool-view.fill .tb-pane { min-height: 0; overflow: hidden; }
.tool-view.fill .tb-pane > .tb-input { flex: 1; min-height: 120px; resize: none; }
.tool-view.fill .tb-stats { flex-shrink: 0; }
.tool-view.fill .hl7-out { flex: 1; max-height: none; min-height: 0; overflow-y: auto; }
@media (max-width: 760px) {
  .tool-view.fill .tb-split { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- HL7 节点搜索 ---------- */
.hl7-search { display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 0 8px; flex-wrap: wrap; }
.hl7-search-label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.hl7-search input {
  width: 220px; padding: 6px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font-size: 12.5px; outline: none;
}
.hl7-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.hl7-search-cnt { min-width: 48px; text-align: center; font-family: Consolas, monospace; font-size: 12px; color: var(--text-faint); }
.hl7-nav {
  width: 26px; height: 26px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-elev); color: var(--text-soft); font-size: 12px;
}
.hl7-nav:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.hl7-nav:disabled { opacity: .45; cursor: not-allowed; }

.hl7-hit { background: rgba(255, 193, 7, .16); box-shadow: inset 3px 0 0 #f0ad00; }
.hl7-hit-cur { background: rgba(255, 160, 0, .3); box-shadow: inset 3px 0 0 #e08900; }
.hl7-mark { background: #ffd34d; color: #3a2c00; border-radius: 3px; padding: 0 1px; font-weight: 600; }
html[data-theme='dark'] .hl7-mark { background: #b58900; color: #fff6da; }

/* ---------- 条码生成 ---------- */
.bc-wrap { margin-bottom: 16px; }
.bc-output { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.bc-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; overflow: auto; max-width: 100%; }
.bc-preview svg { display: block; }
.bc-info { color: var(--text-soft); font-size: 12.5px; font-family: Consolas, monospace; }

/* ---------- 五子棋 ---------- */
.gm-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gm-canvas { max-width: 100%; height: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow); touch-action: none; cursor: pointer; }
.gm-status { font-size: 15px; font-weight: 600; color: var(--text); }
.gm-mode-label { color: var(--text-soft); font-size: 13px; }

/* ---------- 连连看 ---------- */
.llk-wrap { display: flex; justify-content: center; overflow: auto; padding: 4px; }
.llk-grid { display: grid; gap: 5px; justify-content: center; }
.llk-cell {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; line-height: 1;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
  user-select: none; transition: transform .1s, box-shadow .15s, border-color .15s, background .15s;
}
.llk-cell:hover { transform: translateY(-2px); border-color: var(--primary); }
.llk-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.llk-cell.empty:hover { transform: none; border-color: transparent; }
.llk-cell.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); background: var(--primary-soft); }
.llk-cell.hint { animation: llk-pulse .5s ease 2; border-color: var(--ok); }
@keyframes llk-pulse { 0%,100% { background: var(--bg-elev); } 50% { background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); } }
.llk-status { color: var(--text-soft); font-size: 13px; min-height: 18px; }
.llk-left, .llk-time { font-family: Consolas, monospace; font-size: 13px; color: var(--text-soft); }

/* ---------- 顶部常驻时钟 ---------- */
.topbar-clock { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.18; margin-left: 2px; font-variant-numeric: tabular-nums; }
.clk-date { font-size: 11.5px; color: var(--text-faint); }
.clk-time { font-size: 15px; font-weight: 700; color: var(--primary); letter-spacing: .5px; }

/* ---------- 财务 / IP 结果卡片 ---------- */
.fin-out { padding: 14px 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fin-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.fin-row:last-child { border-bottom: none; }
.fin-k { color: var(--text-soft); }
.fin-v { color: var(--text); font-weight: 600; text-align: right; font-family: Consolas, 'PingFang SC', monospace; }
.rmb-out { font-size: 17px; font-weight: 700; color: var(--primary); letter-spacing: .5px; word-break: break-all; }
.sec-title { font-weight: 700; font-size: 13px; color: var(--text-soft); margin: 14px 0 6px; }
.tb-note { font-size: 12.5px; color: var(--text-faint); margin: 10px 2px 0; line-height: 1.6; }

/* ---------- 秒表 ---------- */
.sw-wrap { display: flex; justify-content: center; margin: 18px 0; }
.sw-display { font-family: Consolas, monospace; font-size: 54px; font-weight: 700; color: var(--text); letter-spacing: 2px; }
.sw-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.sw-controls .tb-btn { min-width: 84px; padding: 10px 0; font-size: 14px; }
.sw-laps-title { font-weight: 700; font-size: 13px; color: var(--text-soft); margin: 6px 0; }
.sw-laps { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sw-lap { display: grid; grid-template-columns: 80px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; }
.sw-lap-no { color: var(--text-soft); }
.sw-lap-diff { color: var(--text); }
.sw-lap-total { font-family: Consolas, monospace; color: var(--primary); font-weight: 600; }

/* ---------- 二维码识别 ---------- */
.qr-preview { display: flex; justify-content: center; margin: 12px 0; }
.qr-preview canvas, .qr-preview video { max-width: 100%; max-height: 320px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr-canvas { background: #fff; }

/* ---------- Cron 表达式 ---------- */
.cron-wrap { max-width: 680px; margin: 4px auto 0; }
.cron-input { font-family: Consolas, monospace; font-size: 15px; padding: 11px 12px; }
.cron-ex-label { font-size: 12.5px; color: var(--text-soft); margin: 12px 0 6px; }
.cron-examples { display: flex; flex-wrap: wrap; gap: 7px; }
.cron-err { display: none; margin-top: 12px; padding: 9px 12px; background: var(--err-soft, #fdecec); border: 1px solid var(--err, #e5484d); color: var(--err, #e5484d); border-radius: var(--radius-sm); font-size: 13.5px; }
.cron-desc { margin-top: 14px; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; color: var(--text); font-weight: 600; }
.cron-desc-label { color: var(--text-soft); font-weight: 500; }

/* ---------- 键盘测试 ---------- */
.kb-note { margin-bottom: 12px; }
.kb-layout { overflow-x: auto; padding-bottom: 6px; }
.kb-board { display: flex; gap: 18px; align-items: flex-start; min-width: min-content; }
.kb-group { display: flex; flex-direction: column; gap: 6px; }
.kb-main { width: 660px; max-width: 100%; }
.kb-row { display: flex; gap: 6px; }
.kb-key {
  flex-shrink: 1; min-width: 30px; height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 2px 0 var(--border); user-select: none; cursor: default;
  padding: 0 4px; transition: transform .06s, background .06s, box-shadow .06s, border-color .06s;
}
.kb-key.active {
  background: var(--primary); color: #fff; transform: translateY(3px);
  box-shadow: 0 0 0 2px var(--primary-soft); border-color: var(--primary);
}
.kb-label { font-size: 13px; font-weight: 700; line-height: 1; }
.kb-code { font-size: 9px; opacity: .55; line-height: 1; font-family: Consolas, monospace; }
.kb-key.active .kb-code { opacity: .85; }
.kb-wide .kb-label { font-size: 11px; }
.kb-space .kb-label { font-size: 11px; letter-spacing: 1px; }
.kb-gap { height: 44px; align-self: stretch; }
.kb-nav { width: auto; }
.kb-arrows { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 6px; margin-top: 6px; }
.kb-arrows .kb-key { flex: none; width: 46px; height: 46px; }
.kb-numpad { display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; width: 202px; }
.kb-numpad .kb-key { flex: none; width: 46px; }
.kb-numpad .wide { grid-column: span 2; width: auto; }

.kb-cols { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.kb-card { flex: 1 1 280px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.kb-card-title { font-weight: 700; font-size: 13.5px; color: var(--text-soft); margin-bottom: 10px; }
.kb-bigkey { font-size: 40px; font-weight: 800; color: var(--primary); text-align: center; min-height: 48px; font-family: Consolas, monospace; }
.kb-bigkey.down { color: var(--ok); }
.kb-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.kv-key { color: var(--text-soft); }
.kv-val { color: var(--text); font-weight: 600; font-family: Consolas, monospace; text-align: right; word-break: break-all; }
.kb-stats { display: flex; gap: 18px; margin-bottom: 12px; }
.kb-stat { display: flex; flex-direction: column; align-items: center; }
.kb-stat b { font-size: 22px; color: var(--primary); }
.kb-stat span { font-size: 12px; color: var(--text-soft); }
.kb-pressed-wrap { font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.kb-pressed { color: var(--text); font-family: Consolas, monospace; word-break: break-all; }
.kb-pressed.on { color: var(--ok); font-weight: 600; }
.kb-log { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-family: Consolas, monospace; font-size: 12.5px; }
.kb-log-row { display: grid; grid-template-columns: 44px 80px 1fr auto; gap: 8px; padding: 3px 6px; border-radius: 5px; background: var(--bg-elev); }
.kb-log-row.dn .lg-type { color: var(--ok); }
.kb-log-row.up .lg-type { color: var(--text-faint); }
.lg-type { font-weight: 700; }
.lg-key { color: var(--text); }
.lg-code { color: var(--text-soft); }
.lg-time { color: var(--text-faint); }
.cron-list { margin-top: 14px; }
.cron-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 13.5px; font-family: Consolas, 'PingFang SC', monospace; }
.cron-idx { color: var(--primary); font-weight: 700; min-width: 30px; }
.cron-empty { padding: 10px 12px; color: var(--text-faint); font-size: 13px; }

/* ---------- 计算器 ---------- */
.calc-wrap { max-width: 420px; margin: 4px auto 0; }
.calc-display { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; text-align: right; }
.calc-expr { font-size: 14px; color: var(--text-soft); min-height: 20px; word-break: break-all; font-family: Consolas, monospace; }
.calc-res { font-size: 30px; font-weight: 700; color: var(--text); margin-top: 4px; word-break: break-all; font-family: Consolas, monospace; }
.calc-res.err { font-size: 16px; color: var(--err, #e5484d); font-weight: 600; }
.calc-toolbar { display: flex; gap: 8px; justify-content: space-between; margin: 10px 0 6px; }
.calc-toolbar .tb-btn.small { flex: 1; }
.calc-funcs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 6px; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.calc-key { padding: 14px 0; font-size: 16px; font-weight: 600; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 10px; cursor: pointer; user-select: none; transition: background .12s, transform .05s, border-color .12s; }
.calc-key:hover { border-color: var(--primary); background: var(--primary-soft); }
.calc-key:active { transform: scale(.96); }
.calc-key.op { color: var(--primary); }
.calc-key.ctl { color: var(--text-soft); }
.calc-key.eq { background: var(--primary); color: #fff; border-color: var(--primary); }
.calc-key.eq:hover { filter: brightness(1.06); background: var(--primary); }
.calc-key.zero { grid-column: span 1; }
.calc-hist { margin-top: 8px; max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.calc-hist-item { padding: 7px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: Consolas, monospace; color: var(--text); cursor: pointer; }
.calc-hist-item:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 万年历 ---------- */
.cal-wrap { max-width: 560px; margin: 4px auto 0; }
.cal-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.cal-bar .cal-title { font-size: 17px; font-weight: 700; color: var(--text); min-width: 110px; text-align: center; }
.cal-pick { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 10px; color: var(--text-soft); font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wk { text-align: center; font-size: 12.5px; color: var(--text-soft); font-weight: 600; padding: 4px 0; }
.cal-cell { min-height: 56px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; transition: background .12s, border-color .12s; }
.cal-cell:hover { border-color: var(--primary); }
.cal-cell.prev, .cal-cell.next { opacity: .4; }
.cal-cell.today { border-color: var(--primary); background: var(--primary-soft); }
.cal-cell.sel { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-d { font-size: 16px; font-weight: 700; color: var(--text); }
.cal-l { font-size: 11px; color: var(--text-soft); }
.cal-l.fest { color: var(--err, #e5484d); font-weight: 600; }

/* ---------- DICOM 查看器 ---------- */
.dcm-head { margin-bottom: 14px; }
.dcm-drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s; color: var(--text-soft);
}
.dcm-drop:hover { border-color: var(--primary); }
.dcm-drop.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dcm-drop-text { font-size: 14.5px; }
.dcm-result { margin-top: 4px; }
.dcm-info {
  padding: 9px 12px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text); word-break: break-all; margin-bottom: 12px;
}
.dcm-info.err { background: var(--err-soft, #fdecec); border-color: var(--err, #e5484d); color: var(--err, #e5484d); }
.dcm-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.dcm-search { flex: 1 1 240px; min-width: 180px; }
.dcm-group { flex: 0 1 180px; min-width: 140px; }
.dcm-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-soft); white-space: nowrap; cursor: pointer; }
.dcm-section { margin-bottom: 18px; }
.dcm-section-title { font-weight: 700; font-size: 14px; color: var(--text-soft); margin-bottom: 8px; }
.dcm-imgwrap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.dcm-canvas {
  max-width: 100%; max-height: 460px; background: #000; border: 1px solid var(--border);
  border-radius: var(--radius-sm); image-rendering: pixelated;
}
.dcm-imgstatus { font-size: 12.5px; color: var(--text-faint); }
.dcm-tablewrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.dcm-thead, .dcm-row {
  display: grid; grid-template-columns: 120px 52px 1fr 2fr 64px;
  gap: 0; font-size: 12.5px;
}
.dcm-thead { background: var(--bg-soft); border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text-soft); position: sticky; top: 0; }
.dcm-thead span, .dcm-row span { padding: 7px 10px; border-right: 1px solid var(--border); overflow: hidden; }
.dcm-thead span:last-child, .dcm-row span:last-child { border-right: none; }
.dcm-tbody { max-height: 460px; overflow-y: auto; }
.dcm-row { border-bottom: 1px solid var(--border); }
.dcm-row:nth-child(even) { background: var(--bg-soft); }
.dcm-row:hover { background: var(--primary-soft); }
.dcm-row.dcm-depth .c-tag { color: var(--text-soft); font-style: italic; }
.dcm-row .c-tag { font-family: Consolas, monospace; }
.dcm-row .c-vr { font-family: Consolas, monospace; color: var(--primary); }
.dcm-row .c-val { font-family: Consolas, monospace; word-break: break-all; }
.dcm-row .c-len { color: var(--text-faint); text-align: right; }
.dcm-empty { padding: 18px; text-align: center; color: var(--text-faint); font-size: 13px; }
