/* GoScanBI 样式：科技大屏主题 + 画布编辑器（在 TwinK style.css 之上追加，类名统一 bi- 前缀） */

/* ============ 主题变量 ============ */
.bi-theme-tech-dark {
  --bi-bg: #060E1F;
  --bi-bg2: #0A1730;
  --bi-panel: rgba(12, 28, 54, 0.72);
  --bi-panel-solid: #0C1C36;
  --bi-line: rgba(64, 158, 255, 0.28);
  --bi-line-soft: rgba(64, 158, 255, 0.14);
  --bi-text: #E8F4FF;
  --bi-muted: #8FB3D9;
  --bi-brand: #0B5CAD;
  --bi-cyan: #00E5FF;
  --bi-purple: #7C5CFF;
  --bi-green: #22C55E;
  --bi-orange: #FF9F43;
  --bi-red: #FF5A5A;
  --bi-glow: 0 0 18px rgba(0, 229, 255, 0.35);
}
.bi-theme-dark {
  --bi-bg: #0F172A;
  --bi-bg2: #16203A;
  --bi-panel: rgba(24, 34, 60, 0.72);
  --bi-panel-solid: #18223C;
  --bi-line: rgba(148, 163, 184, 0.26);
  --bi-line-soft: rgba(148, 163, 184, 0.14);
  --bi-text: #E2E8F0;
  --bi-muted: #94A3B8;
  --bi-brand: #3B82F6;
  --bi-cyan: #22D3EE;
  --bi-purple: #A78BFA;
  --bi-green: #4ADE80;
  --bi-orange: #FBBF24;
  --bi-red: #F87171;
  --bi-glow: 0 0 16px rgba(59, 130, 246, 0.3);
}
.bi-theme-light {
  --bi-bg: #F3F5F9;
  --bi-bg2: #FFFFFF;
  --bi-panel: rgba(255, 255, 255, 0.9);
  --bi-panel-solid: #FFFFFF;
  --bi-line: #E5E7EB;
  --bi-line-soft: #F1F3F7;
  --bi-text: #1F2937;
  --bi-muted: #6B7280;
  --bi-brand: #0B5CAD;
  --bi-cyan: #0891B2;
  --bi-purple: #7C3AED;
  --bi-green: #16A34A;
  --bi-orange: #EA580C;
  --bi-red: #DC2626;
  --bi-glow: 0 2px 10px rgba(31, 41, 55, 0.08);
}

/* ============ 大屏舞台 ============ */
.bi-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bi-bg);
  color: var(--bi-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
/* 科技底纹：网格 + 顶部光晕 */
.bi-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bi-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--bi-line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
  pointer-events: none;
}
.bi-stage::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; height: 320px;
  background: radial-gradient(ellipse at 50% 0%, rgba(11, 92, 173, 0.35), transparent 70%);
  pointer-events: none;
}
.bi-canvas-wrap {
  position: absolute;
  transform-origin: 0 0;
}
.bi-canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ============ 组件外壳：四角装饰 + 发丝边框 ============ */
.bw {
  position: absolute;
  box-sizing: border-box;
  color: var(--bi-text);
}
.bw-frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--bi-line);
  background: var(--bi-panel);
  border-radius: 4px;
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.bw-frame::before, .bw-frame::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--bi-cyan);
  opacity: 0.85;
}
.bw-frame::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.bw-frame::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.bw-corners i {
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--bi-cyan);
  opacity: 0.85;
}
.bw-corners i:nth-child(1) { right: -1px; top: -1px; border-left: 0; border-bottom: 0; }
.bw-corners i:nth-child(2) { left: -1px; bottom: -1px; border-right: 0; border-top: 0; }
.bw-body { position: absolute; inset: 0; padding: 12px 14px; overflow: hidden; }
.bw-has-title .bw-body { top: 44px; }

/* 标题条 */
.bw-title {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--bi-text);
}
.bw-title::before {
  content: "";
  width: 4px; height: 16px;
  margin-right: 10px;
  background: linear-gradient(180deg, var(--bi-cyan), var(--bi-brand));
  border-radius: 2px;
  box-shadow: var(--bi-glow);
}
.bw-title::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--bi-brand), transparent 85%);
  opacity: 0.6;
}

/* ============ 大屏标题组件 ============ */
.bw-w-title .bw-body {
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.bi-bigtitle {
  position: relative;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #FFFFFF 20%, var(--bi-cyan) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 26px rgba(0, 229, 255, 0.25);
}
.bi-bigtitle::before, .bi-bigtitle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--bi-cyan));
}
.bi-bigtitle::before { right: calc(100% + 24px); }
.bi-bigtitle::after { left: calc(100% + 24px); transform: scaleX(-1); }

/* ============ KPI 指标卡 ============ */
.bw-w-kpi .bw-body {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0;
}
.bi-kpi-value {
  font-size: 46px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--kpi-color, var(--bi-cyan));
  text-shadow: 0 0 22px color-mix(in srgb, var(--kpi-color, #00E5FF) 45%, transparent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.bi-kpi-unit { font-size: 16px; margin-left: 6px; color: var(--bi-muted); }
.bi-kpi-label { margin-top: 8px; font-size: 14px; color: var(--bi-muted); letter-spacing: 1px; }
.bi-kpi-bar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px;
  width: 62%; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--kpi-color, var(--bi-cyan)), transparent);
  opacity: 0.75;
}

/* ============ 排行榜 ============ */
.bi-rank-list { height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.bi-rank-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.bi-rank-no {
  flex: 0 0 22px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #04121F; font-weight: 500;
  background: linear-gradient(135deg, var(--bi-cyan), var(--bi-brand));
}
.bi-rank-item:nth-child(n+4) .bi-rank-no { background: rgba(143, 179, 217, 0.35); color: var(--bi-text); }
.bi-rank-name { flex: 0 0 40%; color: var(--bi-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-rank-track { flex: 1; height: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bi-theme-light .bi-rank-track { background: rgba(15, 23, 42, 0.08); }
.bi-rank-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--bi-brand), var(--bi-cyan));
  box-shadow: var(--bi-glow);
  transition: width 0.6s ease;
}
.bi-rank-val { flex: 0 0 62px; text-align: right; color: var(--bi-cyan); font-variant-numeric: tabular-nums; }

/* ============ 表格 ============ */
.bi-table { width: 100%; height: 100%; overflow: auto; font-size: 13px; }
.bi-table table { width: 100%; border-collapse: collapse; }
.bi-table th {
  position: sticky; top: 0;
  background: color-mix(in srgb, var(--bi-brand) 22%, var(--bi-panel-solid));
  color: var(--bi-text); font-weight: 500; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--bi-line);
  white-space: nowrap;
}
.bi-table td { padding: 7px 10px; border-bottom: 1px solid var(--bi-line-soft); color: var(--bi-muted); }
.bi-table tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.03); }
.bi-theme-light .bi-table tbody tr:nth-child(odd) td { background: rgba(15, 23, 42, 0.025); }

/* ============ 文本 / 时钟 / 跑马灯 / 进度 ============ */
.bw-w-text .bw-body { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.bi-clock { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bi-clock-time {
  font-size: 44px; font-variant-numeric: tabular-nums; letter-spacing: 2px;
  color: var(--bi-text); text-shadow: 0 0 20px rgba(0, 229, 255, 0.25);
}
.bi-clock-date { margin-top: 6px; color: var(--bi-muted); font-size: 14px; letter-spacing: 1px; }
.bi-marquee { height: 100%; display: flex; align-items: center; overflow: hidden; }
.bi-marquee-inner { white-space: nowrap; animation: bi-marquee 18s linear infinite; color: var(--bi-cyan); font-size: 15px; letter-spacing: 1px; }
@keyframes bi-marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.bi-progress-wrap { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.bi-progress-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bi-progress-name { flex: 0 0 34%; color: var(--bi-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-progress-track { flex: 1; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bi-theme-light .bi-progress-track { background: rgba(15, 23, 42, 0.08); }
.bi-progress-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--bi-brand), var(--bi-cyan));
  box-shadow: var(--bi-glow); transition: width 0.6s ease;
}
.bi-progress-val { flex: 0 0 56px; text-align: right; color: var(--bi-cyan); font-variant-numeric: tabular-nums; }

/* 图片 / iframe */
.bw-w-image .bw-body { padding: 0; }
.bw-w-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bw-w-iframe .bw-body { padding: 0; }
.bw-w-iframe iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.bi-iframe-placeholder {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--bi-muted); font-size: 13px; text-align: center; padding: 16px;
}
.bi-iframe-placeholder .dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--bi-line); border-top-color: var(--bi-cyan);
  animation: bi-spin 1s linear infinite;
}
@keyframes bi-spin { to { transform: rotate(360deg); } }
.bw-w-echarts .bw-body { padding: 8px; }
.bi-chart { width: 100%; height: 100%; }

/* ============ 编辑器 ============ */
.bi-editor { display: flex; flex-direction: column; height: 100vh; background: var(--bg); color: var(--ink); }
.bi-topbar {
  flex: 0 0 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.bi-topbar > * { flex: 0 0 auto; }
.bi-topbar .sp { flex: 1; }
.bi-brand-mark { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--brand); }
.bi-body { flex: 1; display: flex; min-height: 0; }
.bi-lib {
  flex: 0 0 232px; overflow: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 12px;
}
/* 面板折叠收纳 */
.bi-editor.lib-collapsed .bi-lib { display: none; }
.bi-editor.props-collapsed .bi-props { display: none; }
.bi-toggle.on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.bi-toggle:not(.on) { opacity: 0.6; }
.bi-lib h4 { margin: 14px 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.bi-lib h4:first-child { margin-top: 0; }
.bi-lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bi-lib-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 6px;
  text-align: center; font-size: 12px; color: var(--ink); cursor: pointer; background: var(--panel);
  transition: all 0.15s;
}
.bi-lib-item:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.bi-lib-item.wide { grid-column: span 2; }
.bi-workspace { flex: 1; position: relative; overflow: auto; display: flex; align-items: safe center; justify-content: safe center; background: #EFF2F7; }
.bi-theme-dark .bi-workspace, [data-theme="dark"] .bi-workspace { background: #0B1220; }
.bi-canvas-host { position: relative; margin: auto; flex: none; transform-origin: 0 0; box-shadow: 0 8px 40px rgba(15, 23, 42, 0.25); }
.bi-canvas-host .bi-stage { position: relative; }
.bi-scroll { position: absolute; inset: 0; overflow: auto; }
.bi-props {
  flex: 0 0 300px; overflow: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 12px;
}
.bi-props h4 { margin: 14px 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.bi-props h4:first-child { margin-top: 0; }
.bi-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.bi-field label { flex: 0 0 76px; color: var(--muted); }
.bi-field input[type="text"], .bi-field input[type="number"], .bi-field select, .bi-field textarea {
  flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px; background: var(--panel); color: var(--ink);
}
.bi-field textarea { min-height: 90px; font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.bi-field input[type="color"] { flex: 0 0 44px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.bi-sec { display: flex; flex-direction: column; gap: 8px; }

/* 选中框与控制点 */
.bw.selected .bw-frame { border-color: var(--bi-cyan); box-shadow: 0 0 0 1px var(--bi-cyan), 0 0 20px rgba(0, 229, 255, 0.3); }
.bi-handle {
  position: absolute; width: 9px; height: 9px; background: #fff; border: 1px solid var(--bi-brand);
  border-radius: 2px; z-index: 9;
}
.bi-handle.tl { left: -5px; top: -5px; cursor: nwse-resize; }
.bi-handle.tr { right: -5px; top: -5px; cursor: nesw-resize; }
.bi-handle.bl { left: -5px; bottom: -5px; cursor: nesw-resize; }
.bi-handle.br { right: -5px; bottom: -5px; cursor: nwse-resize; }
.bi-guide { position: absolute; background: var(--bi-cyan); z-index: 999; pointer-events: none; }
.bi-guide.v { width: 1px; }
.bi-guide.h { height: 1px; }

/* 图层树 */
.bi-layer-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px;
  font-size: 12px; cursor: pointer; color: var(--ink);
}
.bi-layer-item:hover { background: var(--hover); }
.bi-layer-item.active { background: var(--brand-soft); color: var(--brand); }
.bi-layer-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 后台卡片网格 */
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.bi-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: all 0.15s;
}
.bi-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.bi-thumb {
  height: 148px; background: linear-gradient(135deg, #07132A, #0B5CAD 70%, #00E5FF 130%);
  position: relative; overflow: hidden;
}
.bi-thumb::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.bi-thumb .mini {
  position: absolute; inset: 14px; border: 1px solid rgba(0, 229, 255, 0.35); border-radius: 3px;
}
.bi-thumb .mini::before, .bi-thumb .mini::after {
  content: ""; position: absolute; width: 8px; height: 8px; border: 2px solid var(--bi-cyan, #00E5FF);
}
.bi-thumb .mini::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.bi-thumb .mini::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.bi-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.bi-card-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.bi-card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.bi-card-actions { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }
.bi-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px;
  background: var(--brand-soft); color: var(--brand);
}
.bi-badge.pub { background: #E7F7EE; color: #16A34A; }
.bi-badge.draft { background: var(--hover); color: var(--muted); }

/* 登录页 */
.bi-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #0B5CAD 0%, #060E1F 65%);
}
.bi-login-box {
  width: 380px; padding: 32px; border-radius: 18px;
  background: rgba(10, 23, 48, 0.86); border: 1px solid rgba(64, 158, 255, 0.28);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); color: #E8F4FF;
  backdrop-filter: blur(8px);
}
.bi-login-box h2 { margin: 0 0 4px; font-size: 22px; font-weight: 500; letter-spacing: 1px; }
.bi-login-box .sub { margin: 0 0 22px; font-size: 13px; color: #8FB3D9; }
.bi-login-box input {
  width: 100%; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px;
  border: 1px solid rgba(64, 158, 255, 0.3); background: rgba(6, 14, 31, 0.6); color: #E8F4FF;
  font-size: 14px; box-sizing: border-box;
}
.bi-login-box input:focus { outline: none; border-color: #00E5FF; box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15); }
.bi-login-box button {
  width: 100%; padding: 11px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(90deg, #0B5CAD, #00A6D6); color: #fff; font-size: 15px; font-weight: 500;
}
.bi-login-box button:hover { filter: brightness(1.08); }
.bi-login-err { min-height: 18px; font-size: 12px; color: #FF8080; margin-bottom: 8px; }
.bi-lang-switch { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 14px; }
.bi-lang-switch button {
  padding: 3px 9px; font-size: 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(64, 158, 255, 0.3); background: transparent; color: #8FB3D9;
}
.bi-lang-switch button.on { background: rgba(0, 229, 255, 0.16); color: #00E5FF; border-color: #00E5FF; }

/* 模态 */
.bi-modal-mask {
  position: fixed; inset: 0; background: rgba(6, 14, 31, 0.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.bi-modal-box {
  width: 560px; max-width: 100%; max-height: 86vh; overflow: auto;
  background: var(--panel); border-radius: var(--radius); padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.bi-modal-box h3 { margin: 0 0 14px; font-size: 16px; font-weight: 500; }
.bi-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.bi-code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  background: var(--hover); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; white-space: pre-wrap; word-break: break-all; color: var(--ink);
}
.bi-qr { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: 10px; width: fit-content; margin: 0 auto; }

/* 通用小工具 */
.bi-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bi-grow { flex: 1; }
.bi-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.bi-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(6, 14, 31, 0.92); color: #E8F4FF; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 2000; opacity: 0; transition: all 0.2s; pointer-events: none;
  border: 1px solid rgba(64, 158, 255, 0.3);
}
.bi-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* AI 生成预览 */
.bi-ai-preview { width: 883px; height: 497px; overflow: hidden; background: #060E1F; border: 1px solid var(--line); border-radius: 12px; margin: 0 auto; }
@media (max-width: 1024px) { .bi-ai-preview { width: 100%; height: 46vw; } #aiPreviewHost { transform: scale(0.46) !important; transform-origin: top left; } }

/* ============ 后台布局（对齐 TwinK：侧边栏 + 主内容卡片） ============ */
.app-body { padding: 14px; gap: 14px; align-items: stretch; }
.app-body > .main { flex: 1; min-width: 0; }
.app-body > .sidebar { margin: 0; flex-shrink: 0; }

/* ============ 画布尺寸等宽输入 ============ */
.bi-csize { display: flex; gap: 6px; flex: 1; }
.bi-csize input { flex: 1 1 0; min-width: 0; width: 100%; }

/* ============ 图层树面板 ============ */
.bi-layers {
  flex: 0 0 224px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line);
}
.bi-editor.layers-collapsed .bi-layers { display: none; }
.bi-panel-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; font-size: 13px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.bi-panel-sub { font-size: 11px; font-weight: 500; color: var(--brand); background: var(--brand-soft); padding: 1px 8px; border-radius: 8px; }
.bi-layers-scroll { flex: 1; overflow: auto; padding: 8px; }
.bi-tree-group { margin-bottom: 4px; }
.bi-tree-head {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em;
  user-select: none;
}
.bi-tree-head:hover { background: var(--hover); }
.bi-caret { width: 12px; text-align: center; font-size: 10px; color: var(--muted); }
.bi-tree-label { flex: 1; }
.bi-tree-count { font-size: 10px; color: var(--muted); background: var(--hover); border-radius: 8px; padding: 0 6px; }
.bi-tree-kids { padding: 2px 0 2px 14px; }
.bi-tree-group.collapsed .bi-tree-kids { display: none; }
.bi-tree-empty { font-size: 11px; color: var(--muted); padding: 2px 8px; }
.bi-tree-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }

/* ============ 对齐工具条（画布上浮动） ============ */
.bi-align-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(10px);
  display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30;
}
.bi-align-bar.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.bi-ab-label { font-size: 12px; color: var(--muted); padding: 0 4px 0 2px; }
.bi-ab-btn {
  width: 30px; height: 30px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink); transition: all .15s; padding: 0;
}
.bi-ab-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.bi-ab-btn svg { width: 18px; height: 18px; }
.bi-ab-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }


/* ===== 用户弹层：语言分段开关（.on 与 Twink .active 同义） ===== */
.up-tg { min-width: 30px; font-size: 12px; font-weight: 600; }
.up-tg.on { background: var(--panel); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.up-item .up-ic svg { width: 18px; height: 18px; }
.up-item--static { cursor: default; }
.up-item--static:hover { background: transparent; }
.up-item--static:hover .up-ic { color: var(--muted); }
