/* ============================================================
   ArmsBank Web — 第14版界面「糖果工作台 SWEET WORKBENCH」
   导航结构：第7版工作台（首页磁贴 → 模块全屏 + 面包屑 + 圆形切换器）
   视觉语言：第8版 Bento 糖果风（明亮高饱和多彩 / 柔和彩色阴影）
   亮色默认（设置弹窗可切深色）
   ============================================================ */

:root {
  --win-bg: #f4f6ff;
  --win-bg2: #eaeefb;
  --panel: #ffffff;
  --panel-rgb: 255 255 255;
  --panel-solid: #ffffff;
  --panel2: #f8faff;
  --panel2-rgb: 248 250 255;
  --border: #e3e8f5;
  --border-strong: #c9d4ec;
  --text: #1b2333;
  --text-strong: #0f1524;
  --sub: #5f6d8c;
  --faint: #96a2ba;
  --tab-bg: rgba(40, 70, 160, 0.055);
  --btn-hover: rgba(40, 70, 160, 0.085);
  --input-bg: #f1f4fa;
  --accent: #4f8cff;
  --accent-2: #ff8a3d;
  --accent-grad: linear-gradient(135deg, #4f8cff, #ff8a3d);
  --item-sel: rgba(79, 140, 255, 0.18);
  --radius: 18px;
  --radius-sm: 13px;
  --shadow-sm: 0 3px 14px rgba(50, 80, 170, 0.09);
  --shadow-md: 0 20px 50px rgba(50, 80, 170, 0.16);
  --shadow-glow: 0 8px 26px rgba(79, 140, 255, 0.26);
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --font-stack: "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

body[data-theme="dark"] {
  --win-bg: #0b1020;
  --win-bg2: #111834;
  --panel: #141b30;
  --panel-rgb: 20 27 48;
  --panel-solid: #141b30;
  --panel2: #0f1528;
  --panel2-rgb: 15 21 40;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #e7ecf9;
  --text-strong: #ffffff;
  --sub: #97a3c0;
  --faint: #5e6c90;
  --tab-bg: rgba(255, 255, 255, 0.06);
  --btn-hover: rgba(255, 255, 255, 0.1);
  --input-bg: rgba(8, 12, 24, 0.6);
  --accent: #6ea0ff;
  --accent-2: #ffa05e;
  --item-sel: rgba(110, 160, 255, 0.3);
  --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-stack);
  font-size: var(--base-font, 13px);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 520px at 85% -10%, rgba(79, 140, 255, 0.16), transparent 62%),
    radial-gradient(820px 440px at -8% 104%, rgba(255, 110, 199, 0.11), transparent 62%),
    radial-gradient(720px 400px at 52% 116%, rgba(255, 138, 61, 0.1), transparent 62%),
    linear-gradient(165deg, var(--win-bg), var(--win-bg2));
}

#app { height: 100vh; display: flex; flex-direction: column; }

/* ---------------- 顶栏 ---------------- */
#topbar {
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 22px;
  gap: 14px;
  flex: none;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) calc(var(--panel-opacity, 0.95) * 100%), transparent);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 19px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(79, 140, 255, 0.38);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 15px; font-weight: 800; letter-spacing: 0.3px;
  color: var(--text-strong);
}
.brand-sub {
  font-family: var(--mono);
  font-size: 9px; color: var(--faint);
  letter-spacing: 2px;
}

/* 全局搜索 */
.gs-wrap { position: relative; width: min(440px, 38vw); margin-left: 8px; }
.gs-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
#global-search {
  width: 100%;
  padding: 8px 14px 8px 35px;
  border-radius: 13px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.16s;
}
#global-search::placeholder { color: var(--faint); }
#global-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.16);
}
.gs-dropdown {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  max-height: 400px;
  overflow-y: auto;
  background: var(--panel2);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  z-index: 80;
}
.gs-group {
  padding: 8px 13px 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-2);
}
.gs-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.gs-item:hover { background: rgba(79, 140, 255, 0.12); }
.gs-item .gs-type {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  flex: none;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--tab-bg);
  border: 1px solid var(--border);
}
.gs-item .gs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { padding: 15px 13px; color: var(--faint); font-size: 12px; text-align: center; }

.tb-spacer { flex: 1; }

.src-ind {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--faint);
  transition: all 0.2s;
  flex: none;
}
.src-ind.r2 {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 12px rgba(34, 197, 94, 0.5);
  animation: blink 2.4s ease-in-out infinite;
}
.src-ind.local {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16), 0 0 12px rgba(251, 191, 36, 0.48);
}
.src-ind.err {
  background: #ff5d73;
  box-shadow: 0 0 0 3px rgba(255, 93, 115, 0.16), 0 0 12px rgba(255, 93, 115, 0.52);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.tb-status {
  color: var(--sub);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 13px;
  border-radius: 20px;
  background: var(--tab-bg);
  border: 1px solid var(--border);
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gear {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tab-bg);
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.16s;
  flex: none;
}
.gear:hover { color: var(--accent); border-color: var(--accent); transform: rotate(18deg); }

/* ---------------- 频道条 ---------------- */
.channel-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  flex: none;
  padding: 12px 0 4px;
}
.channel-tabs {
  display: flex; gap: 5px;
  padding: 5px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.channel-tab {
  --sc: #4f8cff;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 24px;
  border: none;
  border-radius: 21px;
  background: transparent;
  color: var(--sub);
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
}
.channel-tab:hover { color: var(--text); background: var(--tab-bg); }
.channel-tab.active {
  color: #fff;
  background: linear-gradient(120deg, var(--sc), color-mix(in srgb, var(--sc) 60%, #7c5cff));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--sc) 36%, transparent);
}
.channel-tab svg { flex: none; }
body[data-theme="dark"] .channel-tab.active { color: #fff; }
.ch-arrow {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--sub);
  cursor: pointer;
  transition: all 0.16s;
  box-shadow: var(--shadow-sm);
}
.ch-arrow:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.ch-arrow:disabled { opacity: 0.35; cursor: default; }

/* ---------------- 滑轨主体 ---------------- */
#content {
  flex: 1; min-height: 0;
  overflow: hidden;
  padding: 8px 22px 14px;
  display: flex; flex-direction: column;
}
.track-wrap { flex: 1; min-height: 0; overflow: hidden; }
.track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.38s cubic-bezier(0.3, 0.9, 0.3, 1);
  will-change: transform;
}
.channel {
  width: calc(100% / 3);
  height: 100%;
  flex: none;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 0 4px;
}
.ch-head { flex: none; padding: 6px 6px 12px; }
.ch-code {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-2);
}
.ch-title {
  font-size: 24px; font-weight: 800;
  margin-top: 2px;
  letter-spacing: 0.4px;
  background: linear-gradient(120deg, #2f3d5c, #4f8cff 60%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body[data-theme="dark"] .ch-title {
  background: linear-gradient(120deg, #e2e9f8, #8fb0ff 60%, #ffb078);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ch-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.db-body-holder { }

.sub-tabs { display: flex; gap: 6px; margin-top: 10px; }
.sub-tab {
  background: var(--tab-bg);
  color: var(--sub);
  border: 1px solid var(--border);
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all 0.16s;
}
.sub-tab:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.sub-tab.active {
  color: #fff;
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.3);
}

.sub-page { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------------- 底部状态栏 ---------------- */
#statusbar {
  display: flex; align-items: center;
  height: 30px;
  padding: 0 22px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  color: var(--faint);
  font-size: 11px;
  flex: none;
  gap: 8px;
}
#statusbar .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}
.status-spacer { flex: 1; }

/* ---------------- 加载 ---------------- */
.loading-panel {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
  color: var(--sub);
  background: var(--win-bg);
}
.spinner {
  width: 46px; height: 46px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: #ff8a3d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 24px rgba(79, 140, 255, 0.16);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.card:hover { border-color: var(--border-strong); }

/* ---------------- 按钮 ---------------- */
button { font-family: inherit; }
.btn {
  position: relative;
  overflow: hidden;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: filter 0.14s, transform 0.14s, box-shadow 0.14s;
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.32);
  letter-spacing: 0.2px;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.5s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:hover::after { transform: translateX(120%); }
.btn:disabled { background: rgba(130, 145, 175, 0.35); color: rgba(255, 255, 255, 0.6); box-shadow: none; cursor: default; }
.btn.secondary { background: var(--tab-bg); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.small { padding: 4px 12px; font-size: 11px; border-radius: 9px; }

/* ---------------- 表单 ---------------- */
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 7px 11px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.14);
}
select option { background: var(--panel); color: var(--text); }
textarea { resize: vertical; }

.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.form-row label { width: 86px; color: var(--sub); font-size: 12px; flex: none; }
.form-row input[type="text"], .form-row select { flex: 1; min-width: 0; }

.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; color: var(--text); }
.checkbox input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ---------------- 数据库页 ---------------- */
.db-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.db-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 2px 12px; flex: none; }
.db-header select { max-width: 150px; }
.db-header input[type="search"] { width: 230px; }
.db-header .filters { display: flex; align-items: center; gap: 6px; }
.db-header .filters label { color: var(--sub); font-size: 11px; white-space: nowrap; }
.db-body { flex: 1; min-height: 0; display: flex; gap: 14px; }

/* 分类彩色胶囊 */
.cat-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.cat-chip {
  --cc: #8a93a6;
  background: var(--panel);
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 15px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s;
  box-shadow: var(--shadow-sm);
}
.cat-chip:hover { color: var(--text); background: var(--btn-hover); transform: translateY(-1px); }
.cat-chip.active {
  color: #fff;
  background: var(--cc);
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--cc) 36%, transparent);
}
body[data-theme="dark"] .cat-chip.active { color: #fff; }

.db-list-panel {
  width: 320px; flex: none;
  display: flex; flex-direction: column;
  padding: 10px;
  overflow: hidden;
}
.db-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  list-style: none;
  display: flex; flex-direction: column; gap: 5px;
  padding: 2px;
}
.db-list li {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px 8px 14px;
  min-height: 48px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 1px 5px rgba(50, 80, 170, 0.06);
  transition: all 0.15s;
}
.db-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 18%;
  height: 64%; width: 4px;
  border-radius: 4px;
  background: var(--cc, var(--accent));
  opacity: 0.5;
}
.db-list li[data-type="character"] { --cc: #4f8cff; }
.db-list li[data-type="enemy"] { --cc: #ff5d73; }
.db-list li[data-type="environment"] { --cc: #17c98b; }
.db-list li[data-type="job"] { --cc: #38bdf8; }
.db-list li[data-type="framework"] { --cc: #ff9f5e; }
.db-list li[data-type="plugin"] { --cc: #ff6ec7; }
.db-list li[data-type="azban"] { --cc: #9d5cff; }
.db-list li:hover {
  transform: translateX(3px);
  border-color: color-mix(in srgb, var(--cc, var(--accent)) 45%, var(--border));
  box-shadow: 0 6px 18px rgba(50, 80, 170, 0.1);
}
.db-list li.active {
  border-color: color-mix(in srgb, var(--cc, var(--accent)) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc, var(--accent)) 28%, transparent), 0 6px 18px rgba(50, 80, 170, 0.1);
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc, var(--accent)) 12%, var(--panel)), var(--panel));
}
.db-list li::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px;
  background: var(--cc, var(--accent));
  opacity: 0;
}
.db-list li.active::after { opacity: 1; }
.db-list li .li-thumb {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.14), rgba(255, 138, 61, 0.1));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform 0.16s;
}
.db-list li:hover .li-thumb { transform: scale(1.07); }
.db-list li .li-thumb img { width: 32px; height: 32px; object-fit: contain; }

.db-detail {
  flex: 1; min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 16px 20px;
}
.db-detail-scroll { height: 100%; overflow-y: auto; padding-right: 6px; }

/* 角色立绘舞台 */
.doll-stage {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: transparent;
  display: none;
}
.doll-stage img.doll-bg {
  position: absolute; inset: -8%;
  width: 116%; height: 116%;
  object-fit: cover;
  opacity: 0.5;
  pointer-events: none;
}
.doll-stage img.doll-faction {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.28;
  pointer-events: none;
}
.doll-stage img.doll-char {
  position: absolute;
  transform-origin: center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  max-width: none;
  filter: drop-shadow(0 18px 40px rgba(30, 50, 100, 0.35));
}
.doll-stage img.doll-char.dragging { cursor: grabbing; }
.doll-stage::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.04) 0%, transparent 30%, rgba(240, 244, 252, 0.38) 76%, rgba(235, 240, 250, 0.7) 100%);
  pointer-events: none;
  z-index: 1;
}
body[data-theme="dark"] .doll-stage::after {
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.05) 0%, transparent 32%, rgba(8, 10, 16, 0.4) 76%, rgba(8, 10, 16, 0.66) 100%);
}

/* 详情文本 */
.detail-html {
  position: relative;
  z-index: 2;
  font-size: 13px;
  line-height: 1.62;
  color: var(--text);
}
.detail-html .dl-name {
  /* v48：角色名称初始 +2 号（26px）；当 --dl-fs 迭代放大超过 21.7px 时按 1.2 倍跟随，保证任意变化后仍比详情区其它文字大。
     !important 防 v28 全局 1em 规则覆盖（同特异性后者胜出） */
  font-size: max(26px, calc(var(--dl-fs, 13px) * 1.35)) !important;
  font-weight: 800;
  margin-bottom: 3px;
  letter-spacing: 0.4px;
  background: linear-gradient(120deg, #2f3b57, #4f7df2 60%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
body[data-theme="dark"] .detail-html .dl-name {
  background: linear-gradient(120deg, #eef1f8, #9db8ff 60%, #ffb078);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.detail-html .dl-sub { color: var(--sub); font-size: 11px; }
.detail-html a { color: var(--text); text-decoration: none; }
.detail-html a:hover { text-decoration: underline; }
.detail-html img.ic { vertical-align: -4px; margin-right: 1px; }
.detail-html .sec {
  font-weight: 700;
  margin-top: 11px;
  margin-bottom: 3px;
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 1.5px;
  position: relative;
  padding-bottom: 3px;
}
.detail-html .sec::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 34px; height: 2px;
  border-radius: 2px;
  background: var(--accent-grad);
  opacity: 0.7;
}
.right-col .sec::after { left: auto; right: 0; }
.detail-html .skill-row { margin: 3px 0; }
.detail-html .skill-desc {
  margin-left: 34px;
  color: var(--sub);
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.55;
  border-left: 2px solid var(--border-strong);
  padding-left: 8px;
}
.detail-html table.stats { margin-top: 5px; border-collapse: collapse; }
.detail-html table.stats td { padding: 2px 10px 2px 0; }
.detail-html table.stats b {
  font-weight: 700;
  background: linear-gradient(120deg, #2f3b57, #4f7df2 65%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
body[data-theme="dark"] .detail-html table.stats b {
  background: linear-gradient(120deg, #eef1f8, #9db8ff 60%, #ffb078);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.detail-html .pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 18px; padding: 4px 11px; margin: 2px 5px 2px 0;
  cursor: pointer; font-size: 12px;
  transition: all 0.14s;
}
.detail-html .pill:hover { background: var(--btn-hover); border-color: var(--border-strong); }
.detail-html .pill.active { background: var(--item-sel); border-color: var(--accent); }
.detail-html .pill img { width: 24px; height: 24px; object-fit: contain; }

/* 技能行 */
.skill-row {
  display: flex;
  align-items: center;
  min-height: 29px;
  padding: 2px 7px;
  border-radius: 9px;
  transition: background 0.12s;
  position: relative;
}
.skill-row::before {
  content: '';
  position: absolute;
  left: 0; top: 22%;
  height: 56%; width: 3px;
  border-radius: 3px;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.14s;
}
.skill-row:hover { background: var(--btn-hover); }
.skill-row:hover::before { opacity: 0.8; }
.skill-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  line-height: 1;
  font-size: 12.5px;
}
.right-col .skill-row { justify-content: flex-end; }
.right-col .skill-row .skill-name { text-align: left; }
.right-col .skill-desc {
  /* 右列描述：text-align + margin-left:auto 用 !important 覆盖 _skillRow 的 inline margin-left:36px */
  margin-left: auto !important;
  margin-right: 34px !important;
  border-left: none;
  border-right: 2px solid var(--border-strong);
  padding-left: 0;
  padding-right: 8px;
  text-align: right !important;
  width: fit-content;
  max-width: calc(100% - 50px);
}
.dl-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bar-track {
  display: inline-block;
  width: 190px; height: 12px;
  border-radius: 6px;
  background: var(--tab-bg);
  vertical-align: middle;
  overflow: hidden;
}
.bar-fill {
  /* v45：fill 必须 block/inline-block——span 默认 inline，width/height 不生效导致进度条填充不可见 */
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--accent-grad);
}

/* ---------------- 计算页 ---------------- */
.calc-page { flex: 1; min-height: 0; display: flex; gap: 14px; }
.calc-col { width: 330px; flex: none; padding: 15px; overflow-y: auto; /* v52：阻止下拉列表溢出时浏览器给 .calc-col 加横向滚动条挤压内容（用户实测"打开敌方下拉左侧面板元素向左位移"的真正根因） */ overflow-x: clip; }
.calc-mid { flex: 1; min-width: 0; padding: 10px; overflow: auto; position: relative; overflow-x: clip; }
.calc-right { width: 330px; flex: none; padding: 15px; overflow-y: auto; overflow-x: clip; }
.calc-col h3, .calc-right h3, .calc-mid h3 {
  font-size: 13px;
  margin-bottom: 13px;
  color: var(--accent-2);
  letter-spacing: 1.5px;
  font-weight: 700;
}
.calc-fields { display: flex; flex-direction: column; gap: 8px; }

.result-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.65;
  min-height: 90px;
  max-height: 260px;
  overflow-y: auto;
}

/* ---------------- 批量表格 ---------------- */
.batch-table-wrap {
  flex: 1; min-height: 0; overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
table.batch {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}
table.batch th {
  position: sticky; top: 0;
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.16), rgba(79, 140, 255, 0.07));
  color: var(--text-strong);
  padding: 7px 9px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
table.batch th:hover { background: linear-gradient(180deg, rgba(79, 140, 255, 0.28), rgba(79, 140, 255, 0.13)); }
table.batch td {
  padding: 5px 9px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid rgba(50, 80, 170, 0.06);
  color: var(--text);
}
table.batch tr:nth-child(even) td { background: rgba(50, 80, 170, 0.03); }
table.batch tr:hover td { background: rgba(79, 140, 255, 0.06); }
table.batch td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.batch td.editable { cursor: pointer; }
table.batch td.editable:hover { background: var(--item-sel); }
.batch-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 0 10px; }

/* ---------------- 设置弹窗 ---------------- */
.settings-page { padding: 0; background: transparent; border-radius: 0; margin: 0; }
.settings-card {
  padding: 14px 18px;
  margin-bottom: 10px;
  background: rgba(var(--panel2-rgb) / var(--panel-opacity, 0.95));
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
}
.settings-card h3 { font-size: 13px; margin-bottom: 12px; color: var(--accent-2); letter-spacing: 1.2px; }
.settings-row { display: flex; align-items: center; gap: 0; margin-bottom: 8px; flex-wrap: nowrap; }
.settings-row label { width: 64px; color: var(--sub); flex: none; font-size: 0.9em; padding-right: 8px; }
.settings-row input[type="text"],
.settings-row input[type="range"] { flex: 1; min-width: 140px; max-width: 360px; }
.settings-row > span { flex: none; margin-left: 10px; min-width: 40px; text-align: right; }
.settings-page input[type="range"] { width: 100% !important; max-width: 360px; }
.settings-row input[type="text"] { flex: 1; min-width: 240px; }
.color-swatch {
  width: 64px; height: 26px; border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(128, 128, 128, 0.4);
}

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(25, 35, 65, 0.42);
  /* v37：移除弹窗遮罩自带毛玻璃（用户要求），页面背景清晰可见 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fade-in 0.16s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background-color: rgba(var(--panel2-rgb) / var(--panel-opacity, 0.95));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur, 0px));
}
.modal-head, .modal-body { background-color: rgba(var(--panel2-rgb) / var(--panel-opacity, 0.95)); }
  min-width: 440px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-strong);
}
.modal-close {
  background: transparent; border: none; color: var(--sub);
  font-size: 16px; cursor: pointer; padding: 2px 9px; border-radius: 8px;
  transition: all 0.12s;
}
.modal-close:hover { background: var(--btn-hover); color: var(--text); }
.modal-body { padding: 0 18px 16px 18px; overflow-y: auto; }

/* 插件选择网格 */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.plugin-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(180deg, #ffffff, #edf1f8);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 7px 4px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  transition: all 0.14s;
  color: var(--text);
}
.plugin-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.16);
}
.plugin-cell img { width: 54px; height: 54px; object-fit: contain; }
body[data-theme="dark"] .plugin-cell {
  background: linear-gradient(180deg, #1d2436, #151a29);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ---------------- 提示/错误 ---------------- */
.error-panel {
  padding: 28px 32px;
  border: 1px solid rgba(255, 93, 115, 0.35);
  background: linear-gradient(180deg, rgba(255, 93, 115, 0.07), rgba(255, 93, 115, 0.03));
  border-radius: 16px;
  color: var(--text);
  line-height: 1.7;
  max-width: 760px;
  margin: 40px auto;
  box-shadow: var(--shadow-md);
}
.error-panel code {
  background: var(--input-bg);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
}
.error-panel pre {
  background: var(--input-bg);
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
  overflow-x: auto;
  margin-top: 10px;
  white-space: pre-wrap;
}

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 140, 190, 0.26);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 140, 190, 0.46); }

.toast {
  position: fixed;
  bottom: 46px; left: 50%;
  transform: translateX(-50%);
  background: var(--panel2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 11px 22px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  font-size: 13px;
  color: var(--text);
  animation: toast-in 0.22s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   v14 追加层：第7版工作台导航结构 × 糖果风呈现
   （首页磁贴 / 快捷分类 / 最近浏览 / 面包屑 / 圆形模块切换器）
   ============================================================ */

/* ---------------- 工作台首页 ---------------- */
.home-page { overflow-y: auto; padding: 6px 4px 20px; }
.home-head { flex: none; padding: 6px 2px 18px; }
.home-code {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
}
.home-title {
  font-size: 27px; font-weight: 800;
  margin-top: 3px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #16222e, #4f8cff 52%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body[data-theme="dark"] .home-title {
  background: linear-gradient(120deg, #eef4ff, #6ea0ff 52%, #ffa05e);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-sub { color: var(--sub); font-size: 12.5px; margin-top: 5px; }

/* 模块磁贴（糖果白卡 + 渐变顶线 + 彩色悬浮） */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  flex: none;
}
.module-tile {
  --mc: #4f8cff; --mc2: #ff8a3d;
  position: relative;
  display: flex; flex-direction: column; gap: 7px;
  padding: 20px 20px 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  overflow: hidden;
}
.module-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mc), var(--mc2));
  opacity: 0.95;
}
.module-tile::after {
  content: '进入 →';
  position: absolute; right: 16px; top: 18px;
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 700;
  color: var(--mc);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.16s, transform 0.16s;
}
.module-tile:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--mc) 55%, transparent);
  box-shadow: 0 22px 44px color-mix(in srgb, var(--mc) 24%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mc) 22%, transparent);
}
.module-tile:hover::after { opacity: 1; transform: none; }
.mt-head { display: flex; align-items: center; gap: 11px; }
.module-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--mc), var(--mc2));
  box-shadow: 0 9px 22px color-mix(in srgb, var(--mc) 38%, transparent);
  flex: none;
  transition: transform 0.18s;
}
.module-tile:hover .module-icon { transform: scale(1.07) rotate(-3deg); }
.module-name { font-size: 1.27em; font-weight: 800; color: var(--text-strong); }
.module-desc { font-size: 0.88em; color: var(--sub); line-height: 1.55; min-height: 34px; }
.module-stat { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.module-stat b {
  font-family: var(--mono);
  font-size: 1.7em; font-weight: 800;
  color: var(--mc);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px color-mix(in srgb, var(--mc) 42%, transparent);
}
.module-stat .stat-unit { font-size: 10.5px; color: var(--faint); }

/* 区块标签 */
.home-sec-label {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 3px;
  color: var(--faint);
  margin-bottom: 10px;
}

/* 最近浏览 */
.home-recent { flex: none; margin-top: 26px; }
.recent-list { display: flex; gap: 9px; flex-wrap: wrap; }
.recent-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.recent-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(79, 140, 255, 0.18);
}
.recent-item .recent-type {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--tab-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  flex: none;
}
.recent-item .recent-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-empty { color: var(--faint); font-size: 12px; padding: 2px 2px; }

/* 快速分类 chips + 计数徽章（糖果胶囊） */
.home-quick { flex: none; margin-top: 26px; }
.quick-chips { display: flex; gap: 9px; flex-wrap: wrap; }
.quick-chip {
  --qc: #4f8cff;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px;
  background-color: rgba(var(--panel-rgb) / var(--panel-opacity, 0.95));
  border: 1px solid var(--border);
  border-radius: 999px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--sub);
  font-size: 12.5px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s;
}
.quick-chip .chip-count {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--qc) 14%, transparent);
  color: var(--qc);
  font-variant-numeric: tabular-nums;
}
.quick-chip:hover {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--qc) 60%, transparent);
  background: color-mix(in srgb, var(--qc) 9%, var(--panel));
  transform: translateY(-2px);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--qc) 24%, transparent);
}

/* ---------------- 模块页（面包屑 + 圆形切换器） ---------------- */
.module-bar {
  display: flex; align-items: center; gap: 10px;
  flex: none;
  padding: 2px 6px 10px;
}
.crumb {
  background: transparent; border: none;
  color: var(--sub); font-size: 12px;
  cursor: pointer;
  padding: 5px 11px; border-radius: 9px;
  transition: all 0.14s;
}
.crumb:hover { color: var(--accent); background: var(--btn-hover); }
.crumb-sep { color: var(--faint); }
.crumb-cur { font-weight: 700; font-size: 12.5px; color: var(--text-strong); }
.mb-spacer { flex: 1; }
.mb-switch { display: flex; gap: 8px; }
.mb-dot {
  --sc: #4f8cff;
  position: relative;
  width: 34px; height: 34px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  color: var(--sub);
  cursor: pointer;
  transition: all 0.16s;
}
.mb-dot::before { content: '●'; font-size: 9px; }
.mb-dot:hover {
  color: var(--sc);
  border-color: color-mix(in srgb, var(--sc) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--sc) 30%, transparent);
}
.mb-dot.active {
  color: #fff;
  background: linear-gradient(135deg, var(--sc), color-mix(in srgb, var(--sc) 55%, #ff8a3d));
  border-color: transparent;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--sc) 45%, transparent);
}

/* 模块页头（糖果渐变标题） */
.page-hero { flex: none; padding: 2px 6px 12px; }
.hero-code {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--accent);
  text-transform: uppercase;
}
.hero-title {
  font-size: 26px; font-weight: 800;
  margin-top: 2px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #16222e, #4f8cff 52%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body[data-theme="dark"] .hero-title {
  background: linear-gradient(120deg, #eef4ff, #6ea0ff 52%, #ffa05e);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--sub); font-size: 12px; margin-top: 3px; }

/* ============================================================
   v14 修复层：tab-page 纵向布局 + 高度链
   根因：v8 底稿无 .tab-page 定义，switchTab 设置 display:flex 后
   子元素被横向排成一行（导航页挤压 / 列表无法滚动 / 计算页错乱）
   ============================================================ */
.tab-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.home-page { overflow-y: auto; }  /* 首页需自身滚动 */
.module-bar { flex: none; }
.page-hero { flex: none; }
.sub-tabs { flex: none; }

/* 模块页右侧第8版功能切换胶囊（module-bar 内自适应） */
.module-bar .channel-tabs { flex: none; }
.module-bar .channel-tab,
.tb-center-nav .channel-tab { padding: 7px 16px; font-size: 1em; }
.module-bar .channel-tab,
.tb-center-nav .channel-tab {
  background: transparent;
  color: var(--sub);
}
.module-bar .channel-tab:hover,
.tb-center-nav .channel-tab:hover {
  background: color-mix(in srgb, var(--sc, #4f8cff) calc(var(--panel-opacity, 0.95) * 50%), transparent);
  backdrop-filter: blur(var(--glass-blur, 0px));
  color: var(--text);
}
.module-bar .channel-tab.active,
.tb-center-nav .channel-tab.active {
  background: color-mix(in srgb, var(--sc, #4f8cff) calc(var(--panel-opacity, 0.95) * 85%), transparent) !important;
  backdrop-filter: blur(var(--glass-blur, 0px));
  color: #fff;
}

/* ============================================================
   v14 修复层 2：顶栏居中导航 / 模块页头同行 / 预览立绘遮罩 / 详情字号自适应
   ============================================================ */

/* ---- 顶栏居中功能切换胶囊 ---- */
#topbar { position: relative; }
.tb-center-nav {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
}
.tb-center-nav .channel-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.tb-center-nav .channel-tab {
  position: relative;
  padding: 6px 18px;
  font-size: 12.5px;
  border-radius: 19px;
  overflow: hidden;
}
/* 切换动效：激活胶囊渐变填充 + 光晕 + 上浮；hover 微移 */
.tb-center-nav .channel-tab {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s, box-shadow 0.18s, background 0.18s;
}
.tb-center-nav .channel-tab:hover { transform: translateY(-2px); }
.tb-center-nav .channel-tab.active { transform: translateY(-1px); }

/* ---- 模块页头：标题与子标签同一行 ---- */
.mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 6px 12px;
  flex: none;
}
.mod-head .hero-title { margin: 0; }
.mod-head .sub-tabs { margin: 0; flex: none; }
.mod-head .hero-code { flex: none; }

/* ---- 预览区立绘遮罩（保证文字可读） ---- */
.preview-root::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0) 26%, rgba(248, 250, 255, 0.42) 74%, rgba(240, 244, 252, 0.82) 100%);
  pointer-events: none;
  z-index: 1;
}
body[data-theme="dark"] .preview-root::after {
  background: linear-gradient(180deg, rgba(8, 10, 16, 0) 26%, rgba(8, 10, 16, 0.4) 74%, rgba(8, 10, 16, 0.78) 100%);
}

/* ---- 数据库详情字号自适应（左侧文字随详情高度缩放，右侧跟随） ---- */
.db-detail { --dl-fs: 13px; }
.db-detail .detail-html {
  font-size: var(--dl-fs);
  line-height: 1.55;
}
.db-detail .detail-html .dl-name { font-size: 1.75em; margin-bottom: 0.14em; }
.db-detail .detail-html .dl-sub { font-size: 0.85em; }
.db-detail .detail-html .sec { font-size: 0.92em; }
.db-detail .detail-html table.stats td { font-size: 1em; }
.db-detail .detail-html .skill-desc { font-size: 0.9em; }
/* 图标随字号等比缩放（仅限小图标 .ic 与叠加图标，避免误伤框架 90px 大图等） */
.db-detail .detail-html img.ic {
  height: 1.45em !important;
  width: auto !important;
  vertical-align: -0.18em !important;
}
/* 稀有度大图标：明显大于普通图标且随字号缩放 */
.db-detail .detail-html img.ic-em { height: 2.4em !important; }
.db-detail .detail-html .ic-layer {
  height: 1.45em !important;
  width: auto !important;
  vertical-align: -0.18em !important;
}
.db-detail .detail-html .ic-layer img.ic-img { height: 1.45em !important; }
/* 技能区显式 em 跟随（文字与图标随 --dl-fs 同步缩放） */
.db-detail .detail-html .pill { font-size: 0.92em; padding: 0.3em 0.85em; }
.db-detail .detail-html .pill img {
  height: 1.3em !important;
  width: auto !important;
}
/* 数据库详情技能行：去掉整行 hover 背景与 ::before 装饰条（避免"可选区"远超图标+文字范围） */
.db-detail .detail-html .skill-row { min-height: 2.1em; padding: 2px 0; background: transparent; transition: none; }
.db-detail .detail-html .skill-row::before { display: none; }
.db-detail .detail-html .skill-row:hover { background: transparent; }
.db-detail .detail-html .skill-name {
  font-size: 1em;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 9px;
  transition: background 0.12s;
}
.db-detail .detail-html .skill-name:hover { background: var(--btn-hover); }
.db-detail .detail-html .skill-row { min-height: 2.1em; }
.db-detail .detail-html .skill-row .ic-layer,
.db-detail .detail-html .skill-row .ic-layer img.ic-img { height: 1.35em !important; }

/* ============================================================
   v14 第6轮增强：切换动效 + 背景图叠加
   ============================================================ */

/* ---- 切换动效：channel-tab 激活胶囊底部滑条 + tab-page 内容淡入 ---- */
.tb-center-nav .channel-tabs {
  position: relative;
}
.tb-center-nav .channel-tab {
  z-index: 1;
}
.tb-center-nav .channel-tab.active {
  z-index: 2;
}
/* 内容区淡入过渡 */
.tab-page.anim {
  animation: tabFadeIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---- 背景图叠加（已由下方 v14 第12轮规则统一处理：图片在最上层） ---- */

/* ---- 顶栏 P59 图标 ---- */
.tb-p59 {
  width: 48px; height: 48px;
  border-radius: 9px;
  object-fit: contain;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 3px;
  flex: none;
}
.tb-center-nav { gap: 10px; }

/* ---- 第7轮修复：brand-logo 换 Tigercat 图（透明） + P59 透明与居中补偿 ---- */
.brand .brand-logo {
  background: transparent;
  box-shadow: none;
  border-radius: 10px;
  object-fit: contain;
  width: 38px; height: 38px;
  cursor: pointer;
  flex: none;
}
.tb-p59 {
  width: 48px; height: 48px;
  object-fit: contain;
  flex: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 8px;
}
/* P59 不参与居中：整体左移 21px，使切换按钮保持顶栏正中 */
.tb-center-nav {
  transform: translate(calc(-50% - 21px), -50%);
}

/* ============================================================
   v14 第11轮：P59 不挤切换按钮（grid 两列）+ 切换平移动画（indicator 滑动）
   ============================================================ */

/* 顶栏切换容器：P59 在左列、channel-tabs 在右列真正居中（不受 P59 影响） */
.tb-center-nav {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}
.tb-center-nav .tb-p59 {
  grid-column: 1;
  justify-self: start;
}
.tb-center-nav .channel-tabs {
  grid-column: 2;
  justify-self: center;
  position: relative; /* indicator 定位锚点 */
}

/* 切换平移动画：彩色指示条在 channel-tabs 内绝对定位，随激活 tab 平移+变宽 */
.tb-center-nav .channel-tabs .tab-indicator {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  width: 0; /* 由 JS 设置 */
  border-radius: 19px;
  background: linear-gradient(120deg, var(--mc, #4F8CFF), color-mix(in srgb, var(--mc, #4F8CFF) 60%, #9b6eff));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--mc, #4F8CFF) 36%, transparent);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), width 0.38s cubic-bezier(0.22, 1, 0.36, 1), background 0.38s;
  pointer-events: none;
  z-index: 0;
}
.tb-center-nav .channel-tab {
  background: transparent !important; /* 清除原 .channel-tab.active 的渐变背景，由 indicator 显示 */
  z-index: 1;
}
.tb-center-nav .channel-tab.active { color: #fff !important; }
body[data-theme="light"] .tb-center-nav .channel-tab.active { color: #fff !important; }

/* v14 第11轮：技能图标完整显示 + 与名称间距 */
.db-detail .detail-html .skill-row { min-height: 2.4em; padding: 3px 0; }
.db-detail .detail-html .skill-name {
  font-size: 1em;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  width: fit-content;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 9px;
  transition: background 0.12s;
}
.db-detail .detail-html .skill-row .ic-layer,
.db-detail .detail-html .skill-row .ic-layer img.ic-img { height: 1.35em !important; }

/* ============================================================
   v14 第12轮：背景图置顶 / 详情左边界留白 / 图标垂直对齐 / Type*Icon2 缩小
   ============================================================ */

/* ---- 5. 背景图由 JS 注入的 #arms-bg 固定定位 div 承载（z-index:-1），
       body 只保留渐变底色。避免 body background-attachment:fixed
       在部分系统不绘制背景图的已知问题 ---- */
#arms-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  /* v21：毛玻璃 = 模糊背景图本身（filter 而非 backdrop-filter，对所有面板统一生效）
     scale 1.03 补偿模糊边缘透出底层；v68：由 --bg-scale 驱动——毛玻璃 0 时恢复 1（不放大，更锐利） */
  filter: blur(var(--glass-blur, 0px));
  transform: scale(var(--bg-scale, 1.03));
}
body,
body[data-theme="dark"] {
  background:
    radial-gradient(1000px 520px at 85% -10%, rgba(79, 140, 255, 0.5), transparent 62%),
    radial-gradient(820px 440px at -8% 104%, rgba(255, 110, 199, 0.35), transparent 62%),
    radial-gradient(720px 400px at 52% 116%, rgba(255, 138, 61, 0.3), transparent 62%),
    linear-gradient(165deg, var(--win-bg), var(--win-bg2));
}
body[data-theme="dark"] {
  background:
    radial-gradient(1000px 520px at 85% -10%, rgba(110, 160, 255, 0.6), transparent 62%),
    radial-gradient(820px 440px at -8% 104%, rgba(255, 110, 199, 0.45), transparent 62%),
    radial-gradient(720px 400px at 52% 116%, rgba(255, 138, 61, 0.4), transparent 62%),
    linear-gradient(165deg, var(--win-bg), var(--win-bg2));
}

/* ---- 3/4. 详情区左侧边界留白 + 图标与文字同行垂直对齐 ---- */
.db-detail .detail-html { padding-left: 10px; }
.db-detail .detail-html .ic-layer { vertical-align: -0.24em !important; }
.db-detail .detail-html img.ic { vertical-align: -0.22em !important; }
.db-detail .detail-html .skill-name { vertical-align: middle; }

/* ---- 6. 知性框架属性条 Type*Icon2 图标缩小（v19：src*="Icon2" 匹配 R2 哈希 URL，见第13轮块） ---- */

/* ============================================================
   v14 第12轮补充：详情布局 + 图标垂直对齐根治
   ============================================================ */

/* 1+3+4. db-detail 不再裁切左侧内容（v8 底稿 overflow:hidden 改为 visible，
   内容向左溢出可见；同时移除 .db-detail 自己的 padding 让滚动容器接管） */
.db-detail { overflow: visible !important; padding: 0 !important; }
.db-detail-scroll { padding: 16px 20px 16px 24px !important; overflow-y: auto; overflow-x: hidden; }

/* 1+3+4. 技能行/名称：改回 inline + vertical-align 完美对齐（避开 inline-flex
   的 line-height 干扰，文字与图标真正同一基线居中） */
.db-detail .detail-html .skill-row { min-height: 0 !important; padding: 4px 0 !important; background: transparent; }
.db-detail .detail-html .skill-row::before { display: none; }
.db-detail .detail-html .skill-name {
  font-size: 1em;
  display: inline !important;
  vertical-align: -0.2em;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 9px;
  transition: background 0.12s;
}
.db-detail .detail-html .skill-name:hover { background: var(--btn-hover); }
.db-detail .detail-html .skill-name .ic-layer,
.db-detail .detail-html .skill-name img.ic { vertical-align: -0.2em !important; }

/* 2. 敌人详情 dl-name-row 与 AP 消耗：统一 vertical-align: -0.2em */
.db-detail .detail-html .dl-name-row .ic-layer,
.db-detail .detail-html .dl-name-row { display: flex; align-items: center; line-height: 1.9; }
.db-detail .detail-html .dl-name-row > span { display: inline-flex; align-items: center; }

/* 6. AP 图标（src*="AP.png" 对 R2 哈希 URL 也不匹配，但 AP.png 本地占位/无哈希场景仍有用，保留） */
.db-detail .detail-html img[src*="AP.png"] { height: 0.95em !important; width: auto !important; vertical-align: -0.2em !important; }

/* ============================================================
   v14 第13轮：插件放大 3 倍 / Type*Icon2 缩至 70% / 技能行 flex 居中
   ============================================================ */

/* 1. Type*Icon2 图标：img[src*="Icon2"]（R2 URL 带哈希 Type5Icon2-xxx.png，旧选择器 Icon2.png 匹配不上）
      当前生效尺寸来自 img.ic 的 1.45em；缩至其 70% → 1em */
/* v46：删除 v23 残留 img[src*="Icon2"] 规则——它用 !important 误伤 overlay skilllevel 旁 typeicon2（代码 h:27 被压成 0.7em）；进度条图标已由 .fw-bar-ic 专属 class 控制 */

/* 2. 技能行：恢复 inline-flex + align-items:center + line-height:1
   （inline 无 gap 导致图标文字负间距；flex center + line-height 1 让图标与文字真正同行居中） */
.db-detail .detail-html .skill-name {
  font-size: 1em;
  display: inline-flex !important;
  align-items: center !important;
  gap: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 9px;
  transition: background 0.12s;
  vertical-align: middle;
}
.db-detail .detail-html .skill-name:hover { background: var(--btn-hover); }
.db-detail .detail-html .skill-name .ic-layer,
.db-detail .detail-html .skill-name img.ic { vertical-align: middle !important; }

/* ============================================================
   v15 第15轮：预览区与数据库详情一致 —— 字号随高度缩放 + 可选区收窄
   ============================================================ */
.preview-root { --dl-fs: 13px; }
.preview-root .detail-html {
  font-size: var(--dl-fs);
  line-height: 1.55;
}
.preview-root .detail-html .dl-name { font-size: 1.75em; margin-bottom: 0.14em; }
.preview-root .detail-html .sec { font-size: 0.92em; }
.preview-root .detail-html table.stats td { font-size: 1em; }
.preview-root .detail-html .skill-desc { font-size: 0.9em; }
/* 图标随字号等比缩放（小图标 .ic 与叠加图标；与 db-detail 同款规则） */
.preview-root .detail-html img.ic {
  height: 1.45em !important;
  width: auto !important;
  vertical-align: -0.18em !important;
}
.preview-root .detail-html img.ic-em { height: 2.4em !important; }
/* 预览区技能行：去掉整行 hover 背景与 ::before 装饰条（可选区收窄到图标+名称） */
.preview-root .skill-row {
  min-height: 2.1em;
  padding: 2px 0;
  background: transparent !important;
  transition: none;
}
.preview-root .skill-row::before { display: none; }
.preview-root .skill-row:hover { background: transparent !important; }
.preview-root .skill-name {
  font-size: 1em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  transition: background 0.12s;
  vertical-align: middle;
}
.preview-root .skill-name:hover { background: var(--btn-hover); }
.preview-root .skill-name .ic-layer,
.preview-root .skill-name img.ic { vertical-align: middle !important; }

/* ============================================================
   v19 第18轮：面板透明度 + 毛玻璃（修正版）
   - --panel-opacity: 主要面板背景 alpha（默认 0.95，范围 0~1）
   - --glass-blur: backdrop-filter 模糊半径（默认 0，关闭毛玻璃）
   只作用于"顶层容器面板"，不作用于内容层（.detail-html 等），
   避免蒙层挡住文字/图标/点击
   ============================================================ */
:root {
  --panel-opacity: 0.95;
  --glass-blur: 0px;
}

/* 主要面板容器：背景改为可调透明 + 毛玻璃 */
#topbar,
.card,
.settings-page,
.module-tile,
.db-detail,
.preview-root,
.calc-col,
.calc-col-mid,
.calc-col-side {
  background-color: rgba(var(--panel-rgb) / var(--panel-opacity, 0.95));
}

/* 立绘舞台层（数据库详情区的 doll-stage 绝对定位覆盖整个面板）：
   pointer-events:none 让点击穿透到下方详情文字，避免"无法点击交互" */
.doll-stage {
  pointer-events: none;
}

/* 不透明面板（开关/输入/select 等）保持 --panel 完全不透明，避免与文字对比度问题 */
input, select, textarea, button.btn {
  background-color: var(--panel);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 顶栏用 panel2 色调（与下方页面略有差异） */
#topbar {
  background-color: rgba(var(--panel2-rgb) / var(--panel-opacity, 0.95));
}

/* ============================================================
   v20 第19轮：图标放大 / 计算页可选区收窄 / icon 下拉组件 / 按钮同行
   ============================================================ */
/* 角色兵种/技能图标跟随文字放大（db-detail + 预览区）：1.45em -> 1.7em */
.db-detail .detail-html img.ic,
.preview-root .detail-html img.ic { height: 1.7em !important; width: auto !important; vertical-align: -0.18em !important; }
.db-detail .detail-html img.ic-em { height: 2.6em !important; }
.db-detail .detail-html .ic-layer,
.preview-root .detail-html .ic-layer { height: 1.7em !important; width: auto !important; vertical-align: -0.18em !important; }
.db-detail .detail-html .ic-layer img.ic-img,
.preview-root .detail-html .ic-layer img.ic-img { height: 1.7em !important; }

/* 计算页（.calc-col / .fwArea）技能行可选区收窄：只点亮图标+名称 */
.calc-col .skill-row,
.calc-page .skill-row { background: transparent !important; padding: 1px 0; min-height: 1.6em; }
.calc-col .skill-row::before,
.calc-page .skill-row::before { display: none; }
.calc-col .skill-row:hover,
.calc-page .skill-row:hover { background: transparent !important; }
.calc-col .skill-name,
.calc-page .skill-name { padding: 2px 6px; border-radius: 8px; }
.calc-col .skill-name:hover,
.calc-page .skill-name:hover { background: var(--btn-hover); }

/* 计算/肉度按钮与导出按钮同行（flex 行） */
.calc-right .btn-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.calc-right .btn-row .btn { margin: 0; }

/* ---------------- icon 下拉组件（角色/敌方/环境/技能） ---------------- */
.icon-dd { position: relative; flex: 1; min-width: 0; }
.icon-dd {
  /* v50：保证下拉列表相对输入框定位 */
  position: relative;
  /* v52：grid/flex 子项不按内容 max-content 撑开列宽（.icon-dd-list 内的搜索框+长内容计算 max-content 会撑开父级列 → 左侧面板列宽变化 + 标签被截断/元素"位移"） */
  min-width: 0;
  max-width: 100%;
}
.icon-dd-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-sizing: border-box;
  min-height: 34px;
}
.icon-dd-input .icon-dd-icons img { height: 1.35em; width: auto; vertical-align: middle; }
.icon-dd-input .icon-dd-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-dd-input .icon-dd-arrow { color: var(--faint); font-size: 10px; flex: none; }
.icon-dd-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  /* v46：列表宽度按内容自适应（至少与输入框同宽），名称完整显示 */
  width: max-content;
  min-width: 100%;
  max-width: min(340px, calc(100vw - 32px));
  z-index: 60;
  max-height: 260px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: none;
  padding: 4px;
}
.icon-dd.open .icon-dd-list { display: block; }
.icon-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap;
}
.icon-dd-item:hover { background: var(--btn-hover); }
.icon-dd-item.active { background: var(--item-sel); }
.icon-dd-item img { height: 1.4em; width: auto; object-fit: contain; flex: none; }
.icon-dd-item .icon-dd-item-name { overflow: visible; text-overflow: clip; }
.icon-dd-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  margin-bottom: 4px;
}

/* 数据库详情区：背景图选择按钮 */
.db-bg-btn { font-size: 11.5px; }

/* ============================================================
   v21 第20轮：图标再放大 / 标签主题色 / 预览居中 / gap 加大
   ============================================================ */
/* 角色兵种/技能图标再放大：1.7em -> 1.9em（db-detail + 预览区） */
.db-detail .detail-html img.ic,
.preview-root .detail-html img.ic { height: 2.1em !important; width: auto !important; }
.db-detail .detail-html img.ic-em { height: 3em !important; }
.db-detail .detail-html .ic-layer,
.preview-root .detail-html .ic-layer { height: 2.1em !important; width: auto !important; }
.db-detail .detail-html .ic-layer img.ic-img,
.preview-root .detail-html .ic-layer img.ic-img { height: 2.1em !important; }

/* 数据库详情区技能图标与名称间隔加大：16px -> 20px */
.db-detail .detail-html .skill-name { gap: 18px; }

/* 预览区：技能图标-名称间隔加大 + 图标与同行文字垂直居中 */
.preview-root .detail-html .skill-name { gap: 16px; }
.preview-root .detail-html img.ic,
.preview-root .detail-html .ic-layer { vertical-align: middle !important; }

/* 数据库工具栏筛选标签跟随主题（浅色=深字，深色=亮字） */
.db-header .filters label { color: var(--text); }

/* 批量计算页下拉（icon-dd 组件在表格内） */
.batch .icon-dd { min-width: 130px; }
.batch .icon-dd-input { min-height: 30px; padding: 5px 8px; font-size: 12px; }

/* ============================================================
   v22 第21轮：导航胶囊受控 / 多图标叠加修复 / FOR HENOSIS / 批量对齐 / 预览高度 / 黑夜按钮
   ============================================================ */
/* 1. 多图标叠加（ic-layer-multi）：保持固定方形容器，绝对定位叠加不被打散 */
.db-detail .detail-html .ic-layer.ic-layer-multi,
.preview-root .detail-html .ic-layer.ic-layer-multi,
.detail-html .ic-layer.ic-layer-multi { width: 2.1em !important; height: 2.1em !important; }
.db-detail .detail-html .ic-layer.ic-layer-multi img.ic-img,
.preview-root .detail-html .ic-layer.ic-layer-multi img.ic-img { height: 2.1em !important; }

/* 2. 导航页"最近浏览/快速分类"胶囊、功能切换按钮受面板不透明度控制 */
.home-quick .quick-chip,
.module-bar .channel-tab,
.sub-tabs .sub-tab {
  background-color: transparent;
  backdrop-filter: none;
}
/* v38：最近浏览胶囊未选中也有颜色（v22 transparent 覆盖后丢失） */
.home-recent .recent-item {
  background-color: rgba(var(--panel-rgb) / var(--panel-opacity, 0.95));
  backdrop-filter: none;
}
.home-recent .recent-item:hover,
/* v32：胶囊未选中/未悬停也有颜色（受 panel-opacity 控制） */
.home-quick .quick-chip { background-color: rgba(var(--panel-rgb) / var(--panel-opacity, 0.95)); }
.home-quick .quick-chip:hover { background-color: rgba(var(--panel-rgb) / calc(var(--panel-opacity, 0.95) * 1.15)); }

/* 3. FOR HENOSIS 与 ArmsBank 字号放大 1 号 */
.brand-name { font-size: 19px; }
.brand-sub { font-size: 10.5px; letter-spacing: 1.5px; }

/* 4. 批量计算工具栏：按钮右对齐 + 高度统一 */
.batch-toolbar .btn-group-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.batch-toolbar .btn { min-height: 34px; }
.batch-toolbar .btn.small { min-height: 34px; padding-top: 5px; padding-bottom: 5px; }

/* 5. 计算页预览区高度与左右一致（calc-mid 撑满） */
.calc-mid { display: flex; flex-direction: column; }
.calc-mid .preview-root { flex: 1; min-height: 100%; height: 100%; overflow: auto; }

/* 6. 黑夜模式切换按钮图标：浅色=太阳，深色=月亮 */
#btn-darkmode .dm-icon-sun { display: block; }
#btn-darkmode .dm-icon-moon { display: none; }
body[data-theme="dark"] #btn-darkmode .dm-icon-sun { display: none; }
body[data-theme="dark"] #btn-darkmode .dm-icon-moon { display: block; }

/* 7. 设置页版本信息行 */
.settings-version {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  padding: 10px 0 4px;
  user-select: none;
}

/* 8. 数据库筛选下拉 icon-dd（表格内紧凑） */
.db-header .filters .icon-dd { min-width: 96px; max-width: 150px; }
.db-header .filters .icon-dd-input { min-height: 28px; padding: 4px 8px; font-size: 11.5px; }

/* v23 第22轮：设置页内 input/select 半透明（消除"圆角面板下的直角矩形块"） */
.settings-page input[type="text"],
.settings-page select,
.settings-page textarea {
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 12px;
}
/* range 滑块：融入卡片，去除直角矩形背景 */
.settings-page input[type="range"] {
  -webkit-appearance: none; appearance: none;
  background-color: transparent; border: 0; outline: 0;
  width: 100%; max-width: 240px; height: 24px;
  padding: 0 10px; box-sizing: border-box;
  display: block; margin: 0 auto;
  cursor: pointer;
}
.settings-page input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--accent) 0 var(--pct, 0%), rgba(var(--panel-rgb) / 0.4) var(--pct, 0%) 100%);
  border: 1px solid var(--border);
  border-radius: 10px; height: 8px;
}
.settings-page input[type="range"]::-moz-range-track {
  background: linear-gradient(to right, var(--accent) 0 var(--pct, 0%), rgba(var(--panel-rgb) / 0.4) var(--pct, 0%) 100%);
  border: 1px solid var(--border);
  border-radius: 10px; height: 8px;
}
.settings-page input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-grad);
  border: 2px solid rgba(255,255,255,0.65);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  margin-top: -6px;
}
.settings-page input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-grad);
  border: 2px solid rgba(255,255,255,0.65);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* v24：职能/技能图标与名称间隔调整（技能行 flex gap + 内联 img 间距） */
.db-detail .detail-html .skill-name { gap: 5px; }
.preview-root .detail-html .skill-name { gap: 5px; }
/* v28：详情/预览的 detail-html 字号直接跟随 --dl-fs（不受 body 字号设置影响） */
.db-detail .detail-html,
.preview-root .detail-html { font-size: var(--dl-fs, 13px) !important; }

/* 职能行：图标与职能名无间隔（紧贴 v26 要求） */
.db-detail .detail-html > div > img.ic,
.preview-root .detail-html > div > img.ic { margin-right: 0px; }
.db-detail .detail-html > div > .ic-layer,
.preview-root .detail-html > div > .ic-layer { margin-right: 0px; }

/* v25：进度条旁 typeicon2 缩 70% —— fw-bar-ic 专属 class（不受 src 占位 dataURI 影响） */
.db-detail .detail-html img.fw-bar-ic { height: 1.05em !important; width: auto !important; }

/* ============================================================
   v25：界面字号全局生效 —— 主要 UI 组件字号改为 1em（跟随 body 的 --base-font）
   ============================================================ */
.btn, .btn.small, .btn.secondary,
.form-row label, .form-row input[type="text"], .form-row select,
.icon-dd-input, .icon-dd-item,
.db-list li, .settings-row label, .settings-row input,
.checkbox, .sub-tab, .channel-tab,
.settings-card h3, .settings-card label, .settings-version,
.db-header .filters label, .db-header .filters input,
.calc-col h3, .calc-right h3, .calc-mid h3,
.batch .btn, .batch-toolbar input,
.gs-wrap input, .brand-name, .brand-sub,
.tb-status, .src-ind {
  font-size: 1em;
}

/* ============================================================
   v26：界面字号全局生效（彻底）—— 所有容器 font-size: 1em 让 inherit 直通 body→html
   ============================================================ */
.form-row, .form-row label, .form-row input, .form-row select,
.settings-row, .settings-row label, .settings-row input,
.db-header .filters, .db-header .filters label, .db-header .filters input,
.batch-toolbar, .batch-toolbar input, .batch-toolbar label,
.calc-col, .calc-right, .calc-mid,
.channel-tabs, .sub-tabs, .gs-wrap, .gs-wrap input,
.modal-body, .settings-card,
.batch-table-wrap, .icon-dd, .icon-dd-input, .icon-dd-item,
.db-list, .db-list-panel, .db-detail, .preview-root, .tab-page,
.home-page, .home-recent, .home-quick,
/* v28：详情/预览的 detail-html 字号直接跟随 --dl-fs（从 .detail-html font-size 派生，em 相对 --dl-fs） */
.db-detail .skill-name, .preview-root .skill-name,
.db-detail .sec, .preview-root .sec,
.db-list li,
.cat-chip, .home-recent .recent-item, .home-quick .quick-chip,
.sub-tab, .channel-tab, .checkbox, .modal, .settings-card h3,
.db-header, .batch, .db-page {
  font-size: 1em !important;
}

/* v26：进度条 fill 更明显（加过渡 + 阴影 + accent 加深） */
.bar-track { box-shadow: inset 0 1px 2px rgba(0,0,0,0.15); }
.bar-fill { box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent); transition: width 0.3s ease; }

/* v50：敌人详情 dl-name-row 内敌人图标与 AP 图标放大倍率减小（覆盖通用 ic-img/AP 规则） */
.db-detail .detail-html .dl-name-row .ic-layer img.ic-img { height: 1.25em !important; }
.db-detail .detail-html .dl-name-row img[src*="AP.png"] { height: 0.5em !important; }

/* v59：顶栏资源版本（状态灯旁边） */
.src-ver {
  font-size: 11px;
  color: var(--faint);
  margin-left: 8px;
  white-space: nowrap;
  user-select: none;
}

/* v59：插件选择窗口最大高度 = 4 行插件（cell ~105px + gap 8px → 4 行约 460px） */
.plugin-grid {
  max-height: 472px;
  overflow-y: auto;
  padding-right: 4px;
}

/* v59：设置页外观滑动条/数字左对齐，与左侧文字隔开 */
.settings-row label { padding-right: 14px; }
.settings-row > span { text-align: left; }

/* v59：设置页 label 不换行（空间足够时"显示站内背景图/自定义背景"单行显示） */
.settings-page label { white-space: nowrap; }
/* v59：背景行 label 不受 64px 宽度限制，完整显示不换行 */
.settings-row .bg-label { width: auto !important; white-space: nowrap; padding-right: 10px; }

/* v60b：覆盖 v30 遗留 .settings-page input[type="range"] { width:100%; margin:0 auto }
   —— flex 容器里 auto margin 吸收剩余空间，把 slider 推到行中间（实测 165px 空隙）。
   高特异性 + !important 强制 slider+数字紧凑左对齐 */
.settings-page .settings-row input[type="range"] {
  flex: 0 0 240px !important;
  width: 240px !important;
  max-width: 240px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ============================================================
   v70 移动端适配（响应式媒体查询）
   设计原则：保留桌面视觉风格，仅做布局堆叠与尺寸压缩
   ============================================================ */

/* 移动端地址栏：100vh 会超出可视区，用 100dvh（fallback 保留） */
#app { height: 100vh; height: 100dvh; }

/* ---- ≤900px：平板竖屏 / 手机 ---- */
@media (max-width: 900px) {
  /* 顶栏两行：第一行 brand+搜索+按钮，第二行导航胶囊全宽居中 */
  #topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 7px 12px;
    gap: 6px 10px;
  }
  .brand { order: 1; }
  .brand-logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
  .brand-name { font-size: 13.5px; }
  .brand-sub { display: none; }
  .gs-wrap { order: 2; flex: 1 1 110px; min-width: 0; width: auto; margin-left: 0; }
  .tb-spacer { display: none; }
  .src-ind, .src-ver, .bg-volume, #btn-darkmode, #btn-settings { order: 3; }
  .src-ver { display: none; }
  #btn-darkmode, #btn-settings { width: 32px; height: 32px; }
  .bg-volume { margin-left: 2px; }
  .tb-center-nav {
    order: 4;
    position: static;
    transform: none;
    min-width: 100vw;
    display: flex;
    justify-content: center;
    margin-top: 2px;
  }
  .tb-center-nav .tb-p59 { display: none; }
  .tb-center-nav .channel-tab { padding: 6px 15px; font-size: 12.5px; }

  /* 首页：磁贴单列 + 标题压缩 + 触控加大 */
  .module-grid { grid-template-columns: 1fr; gap: 10px; }
  .module-tile { padding: 16px 16px 14px; gap: 6px; }
  .home-head { padding: 2px 2px 12px; }
  .home-title { font-size: 22px; }
  .home-sub { font-size: 11.5px; }
  .quick-chips { gap: 7px; }
  .quick-chip { padding: 9px 14px; font-size: 12px; }
  .recent-list, .home-recent { padding-top: 2px; }

  /* 数据库页：列表/详情上下堆叠 */
  .db-body { flex-direction: column; gap: 10px; }
  .db-list-panel { width: 100%; max-height: 34vh; }
  .db-list li { min-height: 44px; font-size: 12.5px; }
  .db-header input[type="search"] { width: 100%; }
  .db-header select { max-width: none; }
  .cat-chip { padding: 6px 13px; font-size: 11.5px; }
  .db-detail { padding: 12px 14px; }
  .db-detail .detail-html .dl-name { font-size: 1.5em; }

  /* 计算器：三栏纵向堆叠 */
  .calc-page { flex-direction: column; gap: 10px; }
  .calc-col, .calc-right { width: 100%; max-height: 36vh; padding: 12px; }
  .calc-mid { width: 100%; min-height: 180px; padding: 8px; }

  /* 弹窗与设置 */
  .modal { min-width: 0; width: 94vw; max-width: 94vw; }
  .settings-row { flex-wrap: wrap; }
  .settings-row label { width: auto; min-width: 56px; }
  .settings-row input[type="text"] { min-width: 0; width: 100%; }
  .settings-card { padding: 12px 14px; }
}

/* ---- ≤520px：手机竖屏精细化 ---- */
@media (max-width: 520px) {
  #topbar { padding: 6px 10px; gap: 5px 8px; }
  .gs-wrap { flex-basis: 96px; }
  .tb-center-nav .channel-tab { padding: 5px 11px; font-size: 12px; }
  .home-title { font-size: 20px; }
  .home-code { font-size: 9px; }
  .db-list-panel { max-height: 30vh; }
  .calc-col, .calc-right { max-height: 32vh; }
  .modal { width: 96vw; max-width: 96vw; max-height: 92vh; }
  .modal-body { padding: 0 12px 12px; }
  .detail-html { font-size: 0.95em; }
}
