:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --surface: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --chip: #eef2ff;
  --accent: #f59e0b;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* ========== 品牌主题背景（全页淡雅 + 蒙版） ========== */
body.brand-dcal {
  background-image: linear-gradient(rgba(255,255,255,.58), rgba(255,255,255,.58)), url('../images/bg-dcal.png');
}
body.brand-yikexin {
  background-image: linear-gradient(rgba(255,255,255,.60), rgba(255,255,255,.60)), url('../images/bg-yikexin.png');
}
a { color: var(--primary); text-decoration: none; }
header.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
/* 品牌 Logo + 名称（图标+文字本身即切换入口） */
.brand-area {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.brand-logo {
  height: 34px; width: auto; object-fit: contain; border-radius: 6px;
}
.brand-name {
  font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap;
  letter-spacing: .02em;
}

/* 可点击切换态 */
.brand-clickable {
  cursor: pointer; user-select: none;
  padding: 5px 10px; margin: -5px 0; border-radius: 10px;
  border: 1px solid transparent; transition: all .15s ease;
}
.brand-clickable:hover {
  background: var(--chip);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.brand-clickable:active { transform: scale(.98); }
.brand-clickable:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.brand-switch-hint {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--chip); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  opacity: .55; transition: opacity .15s ease;
}
.brand-clickable:hover .brand-switch-hint { opacity: 1; }

/* ===== 品牌切换转场特效（科技感网格迸发 + 光环涟漪 + 中央 Logo 闪现） ===== */
.brand-fx {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  overflow: hidden;
}
.brand-fx.show { opacity: 1; visibility: visible; pointer-events: auto; }

/* 科技网格圆：左上入场铺满 → 右下出场揭示新页（对角扫光，含明确的出场） */
.fx-circle {
  position: absolute; inset: 0;
  clip-path: circle(0% at 0% 0%);
  background:
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 32%, rgba(0,0,0,.5) 100%),
    var(--fx-color, #0d7c5e);
}
/* 0–30% 入场（左上→铺满）；30–54% 停留铺满（切换内容 + 文字停留）；54–100% 出场（右下退出） */
.fx-circle.sweep { animation: fxSweep 2.8s cubic-bezier(.7,0,.3,1) forwards; }
@keyframes fxSweep {
  0%   { clip-path: circle(0% at 0% 0%); }
  30%  { clip-path: circle(150% at 50% 50%); }
  54%  { clip-path: circle(150% at 50% 50%); }
  100% { clip-path: circle(0% at 100% 100%); }
}
/* 光环涟漪 */
.fx-ring {
  position: absolute; width: 130vmax; height: 130vmax;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
  box-shadow: 0 0 50px 10px rgba(255,255,255,.3), inset 0 0 70px rgba(255,255,255,.18);
  transform: translate(-50%,-50%) scale(0); opacity: 0;
}
.fx-ring.ripple { animation: fxRing .85s ease-out forwards; }
@keyframes fxRing {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: .9; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}
/* 中央两行字：上品牌名 / 下 slogan */
.fx-text {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; opacity: 0; pointer-events: none;
  z-index: 2;
}
.fx-text .ft-name {
  font-size: 46px; font-weight: 800; letter-spacing: .1em; color: #fff;
  text-shadow: 0 3px 26px rgba(0,0,0,.5);
}
.fx-text .ft-sub {
  font-size: 22px; font-weight: 600; letter-spacing: .04em; color: #fff;
  opacity: .92; margin-top: 10px; text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.fx-text.pop { animation: fxTextIn .5s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes fxTextIn {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.78); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
.fx-text.out { animation: fxTextOut .4s ease forwards; }
@keyframes fxTextOut {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.06); }
}

header.topbar nav { display: flex; gap: 8px; margin-left: auto; }
header.topbar nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
header.topbar nav a.active, header.topbar nav a:hover { background: var(--chip); color: var(--primary); }
.container { max-width: 1100px; margin: 0 auto; padding: 20px 24px; }

.search-box { display: flex; gap: 10px; margin-bottom: 16px; }
.search-box input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; outline: none; background: var(--panel);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border);
  cursor: pointer; color: var(--muted); user-select: none; font-size: 13px;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.cat { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.chip.cat.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.results-meta { color: var(--muted); margin-bottom: 10px; font-size: 13px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .05s;
}
.card:hover { border-color: var(--primary); }
.card .qp { font-weight: 600; font-size: 15px; margin-bottom: 8px; line-height: 1.45; }
.card .meta-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 6px; background: var(--chip); color: var(--primary); line-height: 1.3; }
.tag.cat { background: #fff7ed; color: #c2410c; }
.card .answer { color: #374151; line-height: 1.7; }
.card .answer.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .qp .qk { font-size: 11px; color: var(--muted); background: #f1f5f9; padding: 1px 6px; border-radius: 5px; margin-right: 4px; }
.tag.ttype { background: #e0f2fe; color: #0369a1; }
.tag.board { background: #ede9fe; color: #6d28d9; }
.tag.scene { background: #f0fdf4; color: #15803d; }
.modal .mfield { font-size: 14px; line-height: 1.75; }
.modal .mfield.muted { color: var(--muted); font-size: 12px; margin-top: 14px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; max-width: 900px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h2 { margin: 0 0 10px; font-size: 18px; }
.modal .answer { line-height: 1.75; font-size: 15px; white-space: pre-wrap; }
.modal .manswer { line-height: 1.85; font-size: 15px; }
.modal .manswer img { max-width: 100%; border: 1px solid #eee; border-radius: 8px; margin: 8px 0; }
.modal .manswer a { color: var(--primary); text-decoration: underline; }
.modal .close { float: right; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* 上传 / 统计卡片 */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.section-title { font-weight: 700; font-size: 16px; margin: 0 0 14px; }
.btn {
  display: inline-block; padding: 10px 18px; background: var(--primary); color: #fff; border: none;
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
table.tbl th { background: #f8fafc; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }

.kpi-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi { flex: 1; min-width: 150px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 700; color: var(--primary); }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 4px; }

.toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.toggle button { border: none; background: #fff; padding: 8px 18px; cursor: pointer; color: var(--muted); font-weight: 600; }
.toggle button.active { background: var(--primary); color: #fff; }

/* 简易柱状图 */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .name { width: 220px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { flex: 1; background: #f1f5f9; border-radius: 6px; height: 22px; position: relative; overflow: hidden; }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 6px; }
.bar-row .val { width: 42px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

.hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.preview-box { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin-top: 12px; }
.preview-box table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-box th, .preview-box td { border: 1px solid var(--border); padding: 5px 7px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.preview-box th { background: #f8fafc; position: sticky; top: 0; }
.col-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.col-picker label { font-size: 12px; display: flex; align-items: center; gap: 4px; background: #f8fafc; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); }
.alert { padding: 12px 14px; border-radius: 10px; margin-top: 12px; font-size: 13px; }
.alert.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.upload-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); cursor: pointer; }
.upload-drop.drag { border-color: var(--primary); background: #eff6ff; }

/* ========== 侧边栏布局（知识检索页） ========== */
.app-layout {
  display: flex;
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 24px;
  gap: 24px;
  align-items: flex-start;
}

/* 左侧筛选栏 */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 84px);
  display: flex;
  flex-direction: column;
  padding: 18px 16px 12px;
  transition: width .25s ease, min-width .25s ease, opacity .2s ease;
  overflow: hidden;
}
/* 侧边栏内部：树形内容超出时可独立滚动，头部与底部固定不随滚动 */
#sidebarGroups {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: -6px;
  padding-right: 6px;
}
#sidebarGroups::-webkit-scrollbar { width: 6px; }
#sidebarGroups::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
#sidebarGroups::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.sidebar .sb-head { flex: 0 0 auto; }
.sidebar .sb-footer { flex: 0 0 auto; }
.sidebar.collapsed { width: 46px; min-width: 46px; padding: 12px 6px 10px; overflow: hidden; }
.sidebar.collapsed .sb-group,
.sidebar.collapsed .sb-footer,
.sidebar.collapsed .sb-tree-title,
.sidebar.collapsed .sb-node,
.sidebar.collapsed .sb-tools { display: none; }

.sb-head-right { display: flex; align-items: center; gap: 6px; }
.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px 7px;
  transition: background .12s ease, color .12s ease;
}
.sidebar-toggle:hover { background: var(--chip); color: var(--text); }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.sb-group { margin-bottom: 16px; }
.sb-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 8px;
  padding-left: 2px;
}

/* 侧边栏内的 chips —— 紧凑竖排 */
.sb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sb-chips .chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
}
.sb-scroll {
  max-height: 160px;
  overflow-y: auto;
  padding-right: 3px;
}
.sb-scroll::-webkit-scrollbar { width: 4px; }
.sb-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.sb-footer {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 10px;
  text-align: center;
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }

/* 右侧主内容区 */
.main-content {
  flex: 1;
  min-width: 0;
}

/* ========== 数据管理页：标签 + 内容管理 ========== */
.tabnav { display: flex; gap: 0; margin-bottom: 18px; overflow-x: auto; }
.tab {
  flex: 1; min-width: 0; padding: 10px 10px; border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 0; cursor: pointer; font-weight: 600; font-size: 13.5px;
  margin-left: -1px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tab:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.tab:last-child { border-radius: 0 10px 10px 0; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); position: relative; z-index: 1; }

.manage-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.mg-search { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; background: var(--panel); }
.mg-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.mg-sel { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--panel); }

.mg-list { display: flex; flex-direction: column; gap: 10px; }
/* 账号权限：按角色分组收纳 */
.acct-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel); }
.acct-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--text); background: var(--chip); user-select: none; }
.acct-group-head:hover { background: var(--border); }
.acct-group-head .acct-arrow { font-size: 12px; color: var(--muted); transition: transform .12s ease; }
.acct-group-head .acct-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.acct-group-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.acct-group-body .mg-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.acct-group-body .mg-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.acct-group-body .mg-tag { font-size: 11px; color: var(--muted); font-weight: 400; }

.mg-card {
  display: flex; align-items: stretch; gap: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
}
.mg-card-main { flex: 1; min-width: 0; }
.mg-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mg-q { font-weight: 600; font-size: 15px; }
.mg-meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.mg-ans { color: #374151; font-size: 13px; line-height: 1.5; }
.mg-card-ops { display: flex; flex-direction: column; gap: 6px; justify-content: center; min-width: 64px; }
.mg-card-warn { border-left: 3px solid #ef4444; }
.mg-qm { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; font-weight: 600; white-space: nowrap; }
.mg-check { display: flex; align-items: center; padding: 0 4px; }
.mg-check input { width: 16px; height: 16px; cursor: pointer; }
.mg-batch { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mg-checkall { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mg-checkall input { width: 15px; height: 15px; cursor: pointer; }

/* 内容管理：左侧分类树 */
.mg-layout { display: flex; gap: 16px; align-items: flex-start; }
.mg-tree-panel { width: 232px; flex: 0 0 232px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; max-height: calc(100vh - 170px); overflow: auto; position: sticky; top: 16px; }
.mg-tree-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.mg-tree { display: flex; flex-direction: column; gap: 2px; }
.mg-tree-node { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.mg-tree-node:hover { background: var(--chip); }
.mg-tree-node.active { background: var(--primary); color: #fff; }
.mg-tree-node .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-tree-node .cnt { font-size: 11px; opacity: .65; flex: 0 0 auto; }
.mg-tree-node.parent { font-weight: 600; }
.mg-tree-node.leaf { font-size: 13px; }
.mg-tree-arrow { flex: 0 0 auto; width: 14px; text-align: center; font-size: 11px; opacity: .7; cursor: pointer; user-select: none; }
.mg-tree-arrow:hover { opacity: 1; }
.mg-tree-group { display: flex; flex-direction: column; gap: 2px; }
.mg-tree-children { margin: 2px 0 2px 12px; border-left: 1px dashed var(--border); padding-left: 6px; display: flex; flex-direction: column; gap: 2px; }
.mg-main { flex: 1; min-width: 0; }
/* ===== 内容管理：效期管理子模式 ===== */
.mg-subnav { display: flex; gap: 8px; margin-bottom: 14px; }
.mg-subnav .subtab { padding: 7px 18px; }
.eff-manage { display: flex; gap: 16px; align-items: flex-start; }
.eff-grid-panel { flex: 1; min-width: 0; }
.eff-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.eff-store-title { font-weight: 700; font-size: 15px; color: var(--text); }
.eff-grid { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.eff-grid table { border-collapse: collapse; width: 100%; }
.eff-grid th, .eff-grid td { border: 1px solid var(--border); padding: 0; }
.eff-grid .eff-th-in, .eff-grid .eff-td-in {
  width: 100%; box-sizing: border-box; border: none; outline: none; background: transparent;
  padding: 8px 10px; font-size: 13.5px; color: var(--text); font-family: inherit; min-width: 110px;
}
.eff-grid thead th { background: #f1f5f9; }
.eff-grid thead .eff-th-in { font-weight: 700; }
.eff-grid tbody tr:nth-child(even) td { background: #fafbfc; }
.eff-grid .eff-del {
  cursor: pointer; color: #d4391e; font-weight: 700; border: none; background: transparent;
  padding: 4px 8px; font-size: 13px; line-height: 1;
}
.eff-grid .eff-del:hover { background: #fde8e4; border-radius: 6px; }
.eff-grid .eff-colhead, .eff-grid .eff-rowhead { background: #f1f5f9; text-align: center; width: 34px; }
.eff-stores { width: 240px; flex: 0 0 240px; max-height: calc(100vh - 170px); overflow: auto; position: sticky; top: 16px; }
.eff-store-item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.eff-store-item:hover { background: var(--chip); }
.eff-store-item.active { background: var(--primary); color: #fff; }
.eff-store-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eff-store-item .cnt { font-size: 11px; opacity: .65; flex: 0 0 auto; }
.eff-paste-area { width: 100%; min-height: 210px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.6; resize: vertical; box-sizing: border-box; }
.eff-paste-area:focus { outline: none; border-color: var(--primary); }
.eff-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin-top: 10px; cursor: pointer; }
.eff-opt input { width: 15px; height: 15px; }
.tag.qa { background: #e0f2fe; color: #0369a1; }
.tag.product_card { background: #fef3c7; color: #b45309; }
.tag.gift { background: #fce7f3; color: #be185d; }
.tag.effect { background: #f3e8ff; color: #7c3aed; }
.mini {
  padding: 5px 10px; font-size: 12px; border: 1px solid var(--border); background: #fff; color: var(--primary);
  border-radius: 7px; cursor: pointer; font-weight: 600;
}
.mini:hover { background: var(--chip); }
.mini.danger { color: #dc2626; border-color: #fecaca; }
.mini.danger:hover { background: #fef2f2; }
.mini:disabled { opacity: .4; cursor: not-allowed; }
.mg-pager { margin-top: 14px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }

/* 编辑弹窗 */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none;
  align-items: flex-start; justify-content: center; z-index: 60; padding: 30px 16px; overflow: auto;
}
.edit-modal { max-width: 760px; width: 100%; max-height: calc(100vh - 60px); background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 17px; }
.modal-head .x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 22px; }
.edit-modal .modal-body { flex: 1 1 auto; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: #fafafa; border-radius: 0 0 16px 16px; }
.modal-foot .spacer { flex: 1; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid label.block { display: block; }
.gift-img-box { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.gift-img-label { }
.gift-img-cell { width: 100%; min-height: 120px; }
.form-grid input {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; font-weight: 400;
  color: var(--text); outline: none; background: #fff;
}
.form-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-grid select { padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; background: #fff; }

/* 富文本工具栏 */
.rt-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--border); border-bottom: none; border-radius: 10px 10px 0 0; }
.rt-toolbar button { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 5px 10px; cursor: pointer; font-size: 13px; min-width: 34px; }
.rt-toolbar button:hover { background: var(--chip); }
.rt-toolbar .mini { border: 1px solid var(--border); }
.rt-toolbar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.rt-toolbar input[type=color] { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; padding: 0; cursor: pointer; background: #fff; }
.rt-toolbar select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; background: #fff; }
.rt-editor {
  min-height: 200px; max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 0 0 10px 10px;
  padding: 14px 16px; font-size: 14px; line-height: 1.75; outline: none; background: #fff;
}
.rt-editor:focus { border-color: var(--primary); }
.rt-editor img { max-width: 100%; border: 1px solid #eee; border-radius: 6px; margin: 6px 0; }
.rt-status { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 16px; }
.rt-status:empty { display: none; }

/* ========== 美化增强 ========== */
/* 关键词高亮 */
.hl { background: #fff3bf; color: var(--primary); padding: 0 2px; border-radius: 3px; font-weight: 600; }

/* 品牌化页眉：底部品牌色描边 + 品牌名着色 */
header.topbar { border-bottom: 3px solid var(--primary); }
.brand-name { color: var(--primary); }
.brand-logo { background: var(--primary-light); padding: 3px; }

/* 卡片质感升级：左侧类型色竖条 + 悬停上浮 */
.card { border-left: 4px solid var(--primary); transition: transform .12s ease, box-shadow .15s ease; }
.card.card-qa { border-left-color: #0ea5e9; }
.card.card-product_card { border-left-color: #f59e0b; }
.card.card-gift { border-left-color: #ec4899; }
.card.card-effect { border-left-color: #8b5cf6; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.10); }
.card.selected { box-shadow: 0 0 0 2px var(--primary) inset; }
.card .card-icon { border-radius: 6px; }
.card.card-qa .card-icon { background: #e0f2fe; color: #0284c7; }
.card.card-product_card .card-icon { background: #fef3c7; color: #b45309; }
.card.card-gift .card-icon { background: #fce7f3; color: #be185d; }
.card.card-effect .card-icon { background: #f3e8ff; color: #7c3aed; }

/* 卡片类型图标 */
.card-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 6px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 600;
  margin-right: 8px; flex: 0 0 auto; }

/* 骨架屏 */
.skeleton { padding: 16px 18px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.sk-line { height: 12px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%); background-size: 400% 100%;
  animation: skShimmer 1.2s ease infinite; }
.sk-line.short { width: 40%; } .sk-line.mid { width: 70%; }
@keyframes skShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Toast 提示 */
#toastContainer { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 380px; padding: 12px 14px; border-radius: 10px; background: #fff; color: #1f2937; box-shadow: 0 8px 24px rgba(0,0,0,.12); border: 1px solid var(--border); pointer-events: auto; opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.toast-info .toast-icon { background: #e0f2fe; color: #0369a1; }
.toast-success .toast-icon { background: #dcfce7; color: #15803d; }
.toast-warn .toast-icon { background: #fef3c7; color: #b45309; }
.toast-error .toast-icon { background: #fee2e2; color: #b91c1c; }
.toast-msg { font-size: 13px; line-height: 1.45; }

/* 热门搜索 */
.hot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hot-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.hot-chip { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border);
  color: var(--primary); cursor: pointer; font-size: 13px; transition: all .12s ease; }
.hot-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 空状态插画 */
.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.empty svg { width: 120px; height: 120px; margin-bottom: 14px; }
.empty .et { font-size: 16px; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.empty > div:last-child { font-size: 13px; line-height: 1.6; }

/* 详情弹窗品牌头 */
.modal-brand { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--primary);
  color: #fff; flex: 0 0 auto; }
.modal-brand img { height: 26px; width: auto; border-radius: 5px; background: #fff; padding: 2px; }
.modal-brand .mb-name { font-weight: 600; font-size: 15px; }
.modal-brand .close { margin-left: auto; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.modal-scroll { flex: 1 1 auto; overflow-y: auto; padding: 20px 24px 24px; }

/* 页脚品牌署名 */
.kb-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 26px; }

/* 坐席话术生成 */
.gen-btn { width: 100%; margin-top: 16px; }
/* 弹窗里的「与其他产品对比」（仅产品卡出现） */
.cmp-in-modal { width: 100%; margin-top: 16px; }
.cmp-in-modal + .gen-btn { margin-top: 8px; }
.gen-box { margin-top: 14px; border: 1px solid var(--primary); border-radius: 12px; background: var(--primary-light); padding: 12px 14px; }
.gen-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.gen-text { font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.gen-text.fallback { color: var(--muted); font-style: italic; }
.gen-key-btn { cursor: pointer; font-size: 15px; opacity: .7; transition: opacity .12s ease; }
.gen-key-btn:hover { opacity: 1; }
.gen-setup { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.gen-setup-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.gen-setup-row { display: flex; gap: 8px; }
.gen-key-input { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; }
.gen-key-input:focus { border-color: var(--primary); }

/* ========== 侧边栏自定义（逻辑清理 + 个人化） ========== */
.sb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.sb-head-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sb-gear { border: 1px solid var(--border); background: #fff; border-radius: 7px; width: 28px; height: 26px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.sb-gear:hover { background: var(--chip); color: var(--primary); }
.sidebar.collapsed .sb-head { justify-content: center; padding: 0; margin-bottom: 8px; }
.sidebar.collapsed .sb-head-title,
.sidebar.collapsed .sb-gear { display: none; }

.sb-ghead { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; margin: 0 0 8px; padding: 3px 4px; border-radius: 6px; }
.sb-ghead:hover { background: var(--chip); }
.sb-caret { font-size: 16px; color: #377dff; font-weight: 700; transition: transform .15s ease; }
.sb-group.collapsed .sb-caret { transform: rotate(-90deg); }
.sb-group.collapsed .sb-chips { display: none; }

.sb-chips .chip.pinned { border-color: var(--accent); }
.sb-chips .pin { color: var(--accent); margin-right: 2px; font-size: 11px; }
.sb-divider { width: 100%; height: 1px; background: var(--border); margin: 6px 0; }

/* 已选条件汇总条 */
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.active-filters:empty { display: none; }
.af-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.af-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 600; }
.af-pill .af-x { cursor: pointer; opacity: .7; font-size: 11px; }
.af-pill .af-x:hover { opacity: 1; }
.af-clear { font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; margin-left: 2px; }
.af-clear:hover { color: var(--primary); }

/* 侧边栏自定义弹窗 */
.sb-modal { max-width: 460px; }
.sb-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
.sb-set-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.sb-set-name { flex: 1; font-weight: 600; font-size: 14px; }
.sb-mv { width: 30px; height: 28px; border: 1px solid var(--border); background: #fff; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--primary); }
.sb-mv:hover:not(:disabled) { background: var(--chip); }
.sb-mv:disabled { opacity: .35; cursor: not-allowed; }
.sb-hide { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; cursor: pointer; }
.sb-set-foot { margin-top: 16px; text-align: right; }

/* ========== 表格编辑器（类 WPS）+ 侧边栏 ========== */
.editor-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - 130px);
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.editor-toolbar .sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}
.spreadsheet-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.spreadsheet-wrap > div,
.spreadsheet-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 侧边栏 */
.sidebar-panel {
  width: 280px;
  min-width: 280px;
  border-left: 1px solid var(--border);
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease, opacity .2s ease, min-width .25s ease;
}
.sidebar-panel.collapsed {
  margin-left: -280px;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}
.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f0f2f5;
  flex-shrink: 0;
}
.sb-head h3 {
  font-size: 14px;
  margin: 0;
  color: var(--text);
}
.sb-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}
.sb-body label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #555;
}
.sb-body input[type="text"],
.sb-body textarea {
  width: 100%;
  margin-top: 4px;
  padding: 7px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.sb-body input[type="text"]:focus,
.sb-body textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13,124,94,.12);
}
.sb-sheets {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.sb-sheet-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #e0e3e8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  transition: background .12s, border-color .12s;
}
.sb-sheet-item:hover {
  background: #f0f7ff;
  border-color: var(--primary);
}
.sb-sheet-item.active {
  background: #e8f6f0;
  border-color: var(--primary);
  font-weight: 600;
}
.sb-sheet-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-sheet-del {
  opacity: 0;
  font-size: 14px;
  color: #c00;
  cursor: pointer;
  padding: 0 2px;
  transition: opacity .15s;
}
.sb-sheet-item:hover .sb-sheet-del { opacity: .7; }
.sb-sheet-del:hover { opacity: 1 !important; }
.sb-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* x-spreadsheet 微调（融入项目主题色） */
.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.active,
.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn:hover {
  color: var(--primary) !important;
}

/* ========== 标签四：AI 话术审核 ========== */
.review-summary { font-size: 13px; color: var(--muted); }
.review-summary b { color: var(--text); }
.review-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.review-toolbar .hint { color: var(--muted); font-size: 12px; }
.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; }
.rv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rv-title { font-weight: 600; color: var(--text); }
.rv-badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.rv-badge.pending { background: #fff4e5; color: #b45309; }
.rv-badge.approved { background: #e7f7ec; color: #15803d; }
.rv-badge.rejected { background: #fde8e8; color: #b91c1c; }
.rv-reuse, .rv-updated { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--primary); }
.rv-updated { background: #fde8e8; color: #b91c1c; }
.rv-q { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.rv-script { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; line-height: 1.6; color: var(--text); }
.rv-note { margin-top: 6px; font-size: 12px; color: #b91c1c; }
.rv-ops { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.rv-ops .mini.ok { background: #e7f7ec; color: #15803d; border-color: #bbf7d0; }
.rv-ops .mini.warn { background: #fde8e8; color: #b91c1c; border-color: #fecaca; }

/* ========== 标签五：文件管理（质检报告源文件） ========== */
.file-upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.file-upload-row input[type=file] { max-width: 260px; }
.file-upload-row .mg-sel { height: 36px; }
#pdfAlert { margin-top: 8px; }
#pdfAlert .alert { margin: 0; }
#pdfList .mg-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border, #e6e8ee); border-radius: 10px; background: var(--panel, #fff); }
#pdfList .mg-main { flex: 1; min-width: 0; }
#pdfList .mg-sub { color: var(--muted, #8a90a2); font-size: 12px; }
#pdfList .mg-ops { display: flex; gap: 8px; flex: 0 0 auto; }
.sec { font-size: 14px; font-weight: 500; margin: 0 0 8px; }
#examDetail .row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--color-border-tertiary); }
#examDetail .rk { width: 22px; height: 22px; border-radius: 50%; background: var(--color-background-secondary); color: var(--color-text-secondary); font-size: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
#examDetail .rk.t { background: var(--color-background-info); color: var(--color-text-info); }
#examDetail .pbar { flex: 1; height: 8px; border-radius: 99px; background: var(--color-background-tertiary); overflow: hidden; }
#examDetail .pbar i { display: block; height: 100%; border-radius: 99px; }

/* ========== 标签七：考试统计（周期列表卡片化） ========== */
#examList .mg-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border, #e6e8ee); border-radius: 10px; background: var(--panel, #fff); }
#examList .mg-main { flex: 1; min-width: 0; }
#examList .mg-title { font-size: 14px; font-weight: 600; color: var(--text); }
#examList .mg-sub { color: var(--muted, #8a90a2); font-size: 12px; margin-top: 3px; line-height: 1.5; }
#examList .mg-ops { display: flex; gap: 8px; flex: 0 0 auto; }

/* ========== 顶部分类条 + 售后SOP横幅（统一坐席端） ========== */
.brand-clickable { cursor: pointer; }
.nav-tab { cursor: pointer; }

/* 「实用工具」tab 悬停下拉菜单（鼠标移上去自动展开供选择） */
/* display:flex 让内部 .nav-tab 恢复为 flex item，高度基准与其它 tab 完全一致（否则会高低错位） */
.nav-dd { position: relative; display: flex; }
.nav-dd-caret { font-size: 10px; opacity: .65; display: inline-block; transition: transform .18s ease; }
.nav-dd:hover .nav-dd-caret { transform: translateY(1px) scale(1.15); }
.nav-dd .nav-dropdown {
  position: absolute; left: 0; top: 100%; padding-top: 8px; min-width: 320px; z-index: 70;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-dd:hover .nav-dropdown, .nav-dd:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* 点完某项后立即收起，鼠标离开 tab 后恢复可悬停 */
.nav-dd.nav-dd-suppressed:hover .nav-dropdown { opacity: 0; visibility: hidden; transform: translateY(-4px); }
.nav-dd-inner {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .16); padding: 6px;
}
.nav-dd-head {
  font-size: 11px; color: var(--muted); padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
header.topbar nav a.nav-dd-item {
  display: block; padding: 8px 10px; border-radius: 8px; white-space: normal;
  color: var(--text); font-weight: 400; line-height: 1.35;
}
header.topbar nav a.nav-dd-item:hover { background: var(--chip); }
header.topbar nav a.nav-dd-item.active { background: var(--chip); color: var(--primary); }
header.topbar nav a.nav-dd-item.active .nav-dd-name { font-weight: 700; }
.nav-dd-name { display: block; font-size: 14px; font-weight: 600; }
.nav-dd-item.active .nav-dd-name::before { content: '● '; font-size: 10px; vertical-align: 1px; }
.nav-dd-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.board-bar { display: flex; align-items: center; gap: 8px; padding: 10px 22px; background: #fff; border-bottom: 1px solid var(--border, #e6e8ee); flex-wrap: wrap; }
.bb-label { font-size: 13px; color: var(--muted, #8a90a2); margin-right: 2px; }
.bb-chip { border: 1px solid var(--border, #e6e8ee); background: #fff; color: var(--text, #1f2433); border-radius: 999px; padding: 6px 16px; font-size: 14px; cursor: pointer; transition: all .12s ease; }
.bb-chip:hover { border-color: var(--primary, #0d7c5e); color: var(--primary, #0d7c5e); }
.bb-chip.active { background: var(--primary, #0d7c5e); border-color: var(--primary, #0d7c5e); color: #fff; font-weight: 600; }

/* ========== 公告栏（替换原售后SOP横幅）：跑马灯 + 下拉最新10条 ========== */
.ann-bar { position: relative; display: flex; align-items: stretch; margin: 12px 22px 0; background: linear-gradient(90deg, var(--primary, #0d7c5e), rgba(0,0,0,.22) 135%); border: 1px solid rgba(0,0,0,.15); border-radius: 10px; overflow: visible; color: #fff; font-size: 14px; box-shadow: 0 2px 8px rgba(20,30,50,.14); }
.ann-label { display: flex; align-items: center; flex: 0 0 auto; padding: 0 14px; font-weight: 700; letter-spacing: 1px; background: rgba(0,0,0,.16); border-radius: 10px 0 0 10px; }
.ann-marquee { position: relative; flex: 1 1 auto; overflow: hidden; display: flex; align-items: center; height: 42px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.ann-track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform; animation: annScroll 64s linear infinite; }
.ann-bar:hover .ann-track { animation-play-state: paused; }
.ann-track.ann-empty { animation: none; justify-content: center; width: 100%; opacity: .85; }
.ann-track .ann-item { display: inline-flex; align-items: center; padding: 0 26px; font-size: 13.5px; opacity: .96; }
.ann-track .ann-item .ann-dot { color: #ffe08a; margin-right: 8px; }
.ann-track .ann-item .ann-tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.18); }
.ann-track .ann-item.ann-loading { opacity: .7; }
@keyframes annScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ann-toggle { flex: 0 0 auto; border: none; cursor: pointer; padding: 0 16px; background: rgba(0,0,0,.18); color: #fff; font-size: 13px; font-weight: 600; border-radius: 0 10px 10px 0; }
.ann-toggle:hover { background: rgba(0,0,0,.30); }
.ann-bar.open .ann-toggle { background: rgba(0,0,0,.32); }

.ann-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 420px; max-width: calc(100vw - 44px); background: #fff; border: 1px solid #e2e6ee; border-radius: 12px; box-shadow: 0 12px 34px rgba(20,30,50,.20); color: #1f2433; overflow: hidden; }
.ann-dropdown-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 14px; border-bottom: 1px solid #eef0f4; }
.ann-dropdown-sub { font-weight: 400; font-size: 12px; color: #8a90a2; }
.ann-list { max-height: 340px; overflow-y: auto; }
.ann-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f2f4f8; cursor: pointer; transition: background .12s ease; }
.ann-row:last-child { border-bottom: none; }
.ann-row:hover { background: #f5fbf9; }
.ann-row .ann-rtag { flex: 0 0 auto; margin-top: 1px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.ann-rtag.t-qa { background: #2f6fed; }
.ann-rtag.t-effect { background: #e0820b; }
.ann-rtag.t-gift { background: #c0347a; }
.ann-rtag.t-product_card { background: #0d7c5e; }
.ann-rtag.t-other { background: #6b7280; }
.ann-rbody { flex: 1 1 auto; min-width: 0; }
.ann-rtitle { font-size: 13.5px; line-height: 1.45; color: #1f2433; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ann-rsub { margin-top: 3px; font-size: 11.5px; color: #8a90a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-row.ann-empty { cursor: default; color: #8a90a2; justify-content: center; }
.ann-row.ann-empty:hover { background: none; }
.ann-foot { padding: 10px 14px; border-top: 1px solid #eef0f4; text-align: right; }
.ann-foot a { color: #2f6fed; text-decoration: none; font-size: 13px; font-weight: 600; }
.ann-foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .ann-bar { margin: 10px 12px 0; }
  .ann-dropdown { position: fixed; top: auto; left: 12px; right: 12px; width: auto; bottom: 12px; }
  .ann-track .ann-item { padding: 0 18px; font-size: 12.5px; }
}

/* ========== 视图一：迪巧一下（默认落地页） ========== */
.view-oneclick { max-width: 720px; margin: 0 auto; padding: 40px 16px 32px; }
.oc-hero { text-align: center; margin-bottom: 26px; }
.oc-logo { width: 66px; height: 66px; border-radius: 16px; object-fit: contain; box-shadow: 0 6px 18px rgba(0,0,0,.08); margin-bottom: 12px; }
.oc-brandname { font-size: 28px; font-weight: 800; color: var(--primary, #0d7c5e); letter-spacing: .5px; }
.oc-slogan { font-size: 14px; color: var(--muted, #8a90a2); margin-top: 6px; }
.oc-search { max-width: 600px; margin: 0 auto 26px; }
.oc-search-row { display: flex; align-items: center; gap: 6px; padding: 7px 7px 7px 18px; border: 2px solid var(--primary, #0d7c5e); border-radius: 999px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.oc-search-icon { font-size: 18px; opacity: .55; }
.oc-input { flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; padding: 9px 4px; color: var(--text, #1f2433); }
.oc-btn { flex: 0 0 auto; border: none; border-radius: 999px; background: var(--primary, #0d7c5e); color: #fff; padding: 11px 24px; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: filter .12s ease, transform .08s ease; }
.oc-btn:hover { filter: brightness(1.06); }
.oc-btn:active { transform: translateY(1px); }
.oc-results { max-width: 1180px; margin: 0 auto; text-align: left; }
.oc-layout { display: flex; gap: 24px; align-items: flex-start; justify-content: center; }
.oc-main { flex: 0 0 720px; width: 720px; min-width: 0; }
.oc-gen { margin-bottom: 18px; }
.oc-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.oc-cards .card { cursor: pointer; }
.oc-cards .empty { margin-top: 8px; text-align: center; color: var(--muted, #8a90a2); }

.oc-side { max-width: 660px; width: 100%; margin: 0 auto 22px; }
.oc-side-card {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(20,30,50,.08);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.oc-side-tabs { display: flex; border-bottom: 1px solid rgba(0,0,0,.08); background: rgba(255,255,255,.55); }
.oc-side-tab {
  flex: 1; padding: 13px 8px; border: none; background: transparent;
  font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: all .15s ease; position: relative;
}
.oc-side-tab:hover { color: var(--primary); background: rgba(255,255,255,.7); }
.oc-side-tab.active { color: var(--primary); background: #fff; }
.oc-side-tab.active::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px;
  background: var(--primary); border-radius: 3px 3px 0 0;
}
.oc-side-panels { position: relative; }
.oc-side-panel { display: none; padding: 14px; }
.oc-side-panel.active { display: block; }

/* 热知识 TOP10 */
.oc-hot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.oc-hot-title { font-size: 14px; font-weight: 700; color: var(--text); }
.oc-hot-ranges { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.oc-hot-range { border: none; background: #fff; padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.oc-hot-range:hover { color: var(--primary); }
.oc-hot-range.active { background: var(--primary); color: #fff; }
.oc-hot-list { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, auto); grid-auto-flow: column; gap: 8px 12px; }
.oc-hot-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }
.oc-hot-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .12s ease; }
.oc-hot-item:hover { background: rgba(13,124,94,.06); }
.oc-hot-rank {
  flex: 0 0 22px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12px; font-weight: 800; color: var(--muted); background: #f1f5f9;
}
.oc-hot-item.top1 .oc-hot-rank { color: #fff; background: linear-gradient(135deg,#f59e0b,#ef4444); }
.oc-hot-item.top2 .oc-hot-rank { color: #fff; background: linear-gradient(135deg,#94a3b8,#64748b); }
.oc-hot-item.top3 .oc-hot-rank { color: #fff; background: linear-gradient(135deg,#fbbf24,#d97706); }
.oc-hot-body { flex: 1; min-width: 0; }
.oc-hot-product { font-size: 11px; color: var(--muted); line-height: 1.3; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-hot-q { font-size: 13.5px; color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.oc-hot-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.oc-hot-count { font-size: 11px; color: var(--muted); }
.oc-hot-tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.oc-hot-tag.hot { color: #fff; background: linear-gradient(90deg,#f97316,#ef4444); }
.oc-hot-tag.new { color: #15803d; background: #dcfce7; }

.oc-side-panel .oc-pdf-card { margin-top: 0; }

@media (max-width: 980px) {
  .oc-layout { flex-direction: column; align-items: stretch; }
  .oc-main { flex: 1 1 auto; width: 100%; }
  .oc-side { max-width: 100%; }
}

/* ========== 质检报告下载（带水印） ========== */
.oc-pdf-card { margin-top: 18px; background: #fff; border: 1px solid var(--border, #e6e8ee); border-radius: 14px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(20,30,60,.05); }
.oc-pdf-head { font-size: 15px; font-weight: 700; color: var(--text, #1f2433); margin-bottom: 12px; }
.oc-pdf-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.oc-pdf-input { height: 38px; border: 1px solid var(--border, #e6e8ee); border-radius: 9px; padding: 0 12px; font-size: 14px; color: var(--text, #1f2433); background: #fff; flex: 1; min-width: 200px; }
.oc-pdf-msg { font-size: 13px; color: var(--primary, #d4391e); }
.oc-pdf-hint { font-size: 12px; color: var(--muted, #8a90a2); line-height: 1.6; margin-top: 2px; }
.oc-pdf-result { margin-top: 4px; }
.pdf-match { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f6f8fc; border: 1px solid var(--border, #e6e8ee); border-radius: 11px; padding: 12px 14px; margin-top: 8px; flex-wrap: wrap; }
.pdf-match-info { min-width: 0; }
.pdf-match-title { font-size: 14px; font-weight: 700; color: var(--text, #1f2433); }
.pdf-match-sub { font-size: 12px; color: var(--muted, #8a90a2); margin-top: 3px; word-break: break-all; }

/* ========== 知识检索业务树（两级：业务类型 → 子类） ========== */
.sb-tree-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 4px 10px; }
.sb-node { user-select: none; }
.sb-phead { display: flex; align-items: center; gap: 2px; padding: 9px 8px; cursor: pointer; border-radius: 9px; transition: background .15s; }
.sb-phead:hover { background: rgba(15,23,42,.05); }
.sb-caret { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; font-size: 15px; color: #377dff; font-weight: 700; transition: transform .15s; flex: 0 0 auto; background: rgba(55,125,255,.08); border-radius: 5px; }
.sb-caret.collapsed { transform: rotate(-90deg); }
.sb-plabel { font-weight: 700; font-size: 15px; flex: 1; color: var(--text); padding: 2px 0; position: relative; }
.sb-plabel.active { color: var(--primary); }
.sb-plabel.active::before { content: ''; position: absolute; left: -8px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--primary); }
.sb-children { padding-left: 14px; margin: 2px 0 6px 12px; border-left: 1px dashed var(--border); }
.sb-child { position: relative; padding: 7px 10px; margin: 2px 0; cursor: pointer; border-radius: 8px; font-size: 13.5px; color: #475569; transition: background .15s, color .15s; }
.sb-child::before { content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.sb-child:hover { background: rgba(15,23,42,.05); color: #1e293b; }
.sb-child.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.sb-child.active::before { background: #fff; }
.sb-child.active::after { content: ''; position: absolute; left: -15px; top: 50%; transform: translateY(-50%); width: 3px; height: 16px; border-radius: 2px; background: var(--primary); }

/* ========== 左侧树三级节点（分类 → 具体产品） ========== */
.sb-subparent .sb-subhead { padding: 6px 8px; }
.sb-sublabel { font-weight: 600; font-size: 13.5px; flex: 1; color: #334155; padding: 2px 0; position: relative; }
.sb-sublabel.active { color: var(--primary); }
.sb-sublabel.active::before { content: ''; position: absolute; left: -8px; top: 3px; bottom: 3px; width: 3px; border-radius: 2px; background: var(--primary); }
.sb-children-2 { padding-left: 12px; margin: 2px 0 4px 10px; border-left: 1px dotted var(--border); }
.sb-children-2 .sb-child { font-size: 12.5px; padding: 5px 8px; }
.sb-children-2 .sb-child::before { width: 4px; height: 4px; left: -7px; background: #e2e8f0; }
.sb-children-2 .sb-child:hover { color: var(--primary); }
.sb-children-2 .sb-child.active { background: var(--primary); color: #fff; }

/* ========== 主内容区单页详情（左侧树三级产品 / 侧栏搜索点击进入） ========== */
.detail-page { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px 20px; }
.detail-page-top { margin-bottom: 4px; }
.detail-page-q { font-size: 17px; font-weight: 700; margin: 8px 0 10px; }
.detail-page-body { margin-top: 16px; }

/* ========== 侧栏：树展开收纳工具（侧栏搜索卡片已移除，与主区搜索重合） ========== */
/* 头部改为「筛选分类」小标题 + 折叠按钮：收紧内边距，避免顶部留白突兀 */
.sidebar .sb-head { justify-content: space-between; padding: 0 2px; margin-bottom: 8px; }

.sb-tools { display: flex; gap: 6px; margin: 8px 0 2px; }
.sb-tool-btn {
  flex: 1; padding: 5px 0; font-size: 12px; color: var(--muted);
  background: transparent; border: 1px dashed var(--border); border-radius: 7px;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.sb-tool-btn:hover { color: var(--primary); border-color: var(--primary); }

/* 侧栏整体收起（彻底隐藏，主区自动占满） */

/* ========== 内嵌管理/统计视图（iframe 融合进坐席端） ========== */
.view-embed { height: calc(100vh - 58px); padding: 0; margin: 0; }
.embed-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; border-radius: 0; }

/* ========== 产品配置卡表格编辑器 ========== */
.pc-card-editor { margin-top: 12px; }
.pc-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13px; }
.pc-table th,
.pc-table td { border: 1px solid var(--border); padding: 8px; vertical-align: top; }
.pc-table th { background: #f0fdf4; color: #166534; font-weight: 600; text-align: center; width: auto; }
.pc-table td { background: #fff; min-width: 90px; }
.pc-table textarea { width: 100%; min-height: 72px; border: none; resize: vertical; font: inherit; line-height: 1.6; padding: 4px; background: transparent; outline: none; }
.pc-table textarea:focus { background: #f8fafc; }
.pc-img-cell { min-height: 90px; min-width: 90px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 6px; background: #f8fafc; border: 1px dashed #cbd5e1; position: relative; overflow: hidden; }
.pc-img-cell:hover { background: #eef2ff; border-color: var(--primary); }
.pc-img-cell.has-img { border-style: solid; border-color: var(--border); background: #fff; }
.pc-img-cell img { max-width: 100%; max-height: 120px; display: block; border-radius: 4px; }
.pc-placeholder { color: var(--muted); font-size: 12px; text-align: center; pointer-events: none; }
.pc-img-cell .pc-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 20px; text-align: center; background: rgba(212,57,30,.9); color: #fff; border-radius: 50%; font-size: 12px; cursor: pointer; display: none; z-index: 2; }
.pc-img-cell.has-img:hover .pc-del { display: block; }
.pc-img-cell.active-cell { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pc-img-cell.drag-over { border-color: var(--primary); border-style: solid; background: #eef2ff; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.pc-img-table th { background: #dcfce7; color: #166534; }
.pc-text-table th { background: #ecfccb; color: #3f6212; }

/* 产品配置卡详情展示 */
.pc-card-view { width: 100%; }
.pc-detail-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13.5px; table-layout: fixed; }
.pc-detail-table th,
.pc-detail-table td { border: 1px solid var(--border); padding: 12px; vertical-align: top; }
.pc-detail-table th { background: #f0fdf4; color: #166534; font-weight: 600; text-align: center; }
.pc-detail-table td { background: #fff; }
.pc-detail-table td b { display: block; font-size: 12.5px; color: var(--text); margin-bottom: 6px; }
.pc-detail-table img { max-width: 100%; max-height: 180px; border-radius: 6px; cursor: pointer; display: block; }
.pc-detail-table .pc-empty { color: var(--muted); font-size: 12px; }
.pc-img-table td { width: calc(100% / 6); text-align: center; }
.pc-img-table td b { text-align: center; }
.pc-text-table td { width: calc(100% / 5); line-height: 1.75; }
.pc-detail-remark { margin-top: 10px; padding: 12px; background: #f8fafc; border-radius: 8px; line-height: 1.7; }

/* ========== 产品效期（表格视图 + 临期预警） ========== */
.eff-table-wrap { overflow-x: auto; padding: 4px 2px; }
.eff-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.eff-table th { background: var(--primary); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; white-space: nowrap; }
.eff-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; }
.eff-table tbody tr:hover { background: #fff7f5; cursor: pointer; }
.eff-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.exp-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.exp-ok { background: #e7f7ec; color: #1a8a4a; }
.exp-warn { background: #fff3d6; color: #b7791f; }
.exp-danger { background: #ffe1e1; color: #d4391e; }
.exp-past { background: #e2e8f0; color: #64748b; }

/* ========== 活动赠品（卡片网格 + 详情） ========== */
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 6px 2px; }
.gift-card { background: #fff; border: 1px solid #eef2f7; border-radius: 12px; overflow: hidden; cursor: pointer; transition: .15s; display: flex; flex-direction: column; }
.gift-card:hover { box-shadow: 0 6px 18px rgba(212,57,30,.12); transform: translateY(-2px); }
.gift-img { height: 160px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gift-img img { width: 100%; height: 100%; object-fit: contain; }
.gift-img-empty { color: #cbd5e1; font-size: 13px; }
.gift-body { padding: 10px 12px; }
.gift-name { font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.gift-tags { margin-bottom: 6px; }
.gift-row { font-size: 13px; color: #475569; margin: 3px 0; }
.gift-row b { color: #94a3b8; font-weight: 600; margin-right: 4px; }
.gift-detail { display: flex; gap: 18px; flex-wrap: wrap; }
.gift-detail-img { width: 220px; max-height: 280px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: 10px; overflow: hidden; }
.gift-detail-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gift-detail-info { flex: 1; min-width: 220px; }
.gift-detail-name { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.gift-detail-info .mfield { margin: 6px 0; }

/* 图片放大预览 */
.img-zoom {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.82);
  display: none; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; overflow: hidden;
}
.img-zoom.show { display: flex; }
.img-zoom img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; transition: transform .15s ease; transform-origin: center; will-change: transform; }
.img-zoom-close {
  position: absolute; top: 18px; right: 24px; color: #fff; font-size: 34px; line-height: 1;
  cursor: pointer; opacity: .85; transition: opacity .15s; z-index: 2;
}
.img-zoom-close:hover { opacity: 1; }
.img-zoom-tools {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; z-index: 2;
  background: rgba(0,0,0,.55); padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.img-zoom-tools button {
  width: 34px; height: 34px; border: none; border-radius: 50%; background: rgba(255,255,255,.16);
  color: #fff; font-size: 20px; line-height: 1; cursor: pointer; transition: background .15s;
}
.img-zoom-tools button:hover { background: rgba(255,255,255,.32); }
.img-zoom-tools #imgZoomPct {
  color: #fff; font-size: 14px; min-width: 48px; text-align: center; cursor: pointer; user-select: none;
  font-variant-numeric: tabular-nums;
}

/* ===== 迪巧一下 · 求助按钮 ===== */
.oc-help-btn { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #fb7185, #f43f5e); border: none; font-weight: 700; color: #fff; box-shadow: 0 2px 8px rgba(244,63,94,.28); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.oc-help-btn:hover { background: linear-gradient(135deg, #fb7185, #f43f5e); filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(244,63,94,.38); }
.oc-help-btn .oc-help-ico, .help-title .oc-help-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.help-title { display: inline-flex; align-items: center; gap: 8px; color: #f43f5e; }
.help-modal .modal-body { flex: 1 1 auto; overflow-y: auto; }

/* ===== 求助弹窗 ===== */
.help-modal { max-width: 540px; }
.help-hint { margin: 0 0 14px; }
.help-field { margin-bottom: 14px; }
.help-field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.help-opt { color: #9aa3af; font-weight: 400; font-size: 12px; }
.help-field .req { color: #ef4444; }
.help-textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; font-size: 14px; resize: vertical; font-family: inherit; box-sizing: border-box; }
.help-img-drop { position: relative; min-height: 120px; border: 1.5px dashed #cbd5e1; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #f8fafc; transition: border-color .15s, background .15s; overflow: hidden; }
.help-img-drop:hover { border-color: var(--primary); background: #f1f5ff; }
.help-img-ph { color: #94a3b8; font-size: 14px; }
.help-img-prev { max-width: 100%; max-height: 260px; display: block; }
.help-img-del { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.help-status { font-size: 13px; min-height: 18px; margin-top: 4px; }
.help-status.warn { color: #ef4444; }
.help-status.ok { color: #16a34a; }

/* 求助弹窗：类型分段选择器 + 动态字段 */
.help-type-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.help-type-seg .seg { flex: 1 1 0; min-width: 90px; padding: 10px 8px; border: 1.5px solid var(--border, #e2e8f0); background: #f8fafc; border-radius: 10px; font-size: 14px; font-weight: 600; color: #475569; cursor: pointer; transition: all .15s ease; }
.help-type-seg .seg:hover { border-color: var(--primary); color: var(--primary); }
.help-type-seg .seg.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,.25); }
.help-dyn { margin-top: 4px; }
.help-subdivider { margin: 16px 0 10px; padding-top: 12px; border-top: 1px dashed #e2e8f0; font-size: 12px; color: #94a3b8; font-weight: 600; }
.help-foot-note { margin: 12px 0 4px; font-size: 12px; color: #94a3b8; line-height: 1.6; }
.ask-type { font-size: 12px; color: #fff; background: #6366f1; border-radius: 6px; padding: 2px 8px; margin-left: 6px; }
.ask-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ask-meta span { font-size: 12px; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 3px 8px; }

/* ===== 审核专区 · 子 tab ===== */
.subtabs { display: flex; gap: 8px; margin-bottom: 14px; }
.subtab { padding: 8px 18px; border: 1px solid var(--border, #e2e8f0); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 600; transition: all .15s; }
.subtab:hover { border-color: var(--primary); }
.subtab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 解答QA 列表 ===== */
.ask-list { display: flex; flex-direction: column; gap: 12px; }
.ask-item { border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 14px 16px; background: #fff; }
.ask-shop, .ask-rid { font-size: 12px; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 2px 8px; margin-left: 6px; }
.ask-img { margin: 8px 0; }
.ask-img img { max-width: 240px; max-height: 200px; border-radius: 8px; border: 1px solid #e2e8f0; cursor: zoom-in; }

/* 单会话强踢：被新登录顶掉时的提示弹窗 */
.kb-kick-overlay { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px); font-family: -apple-system,"PingFang SC","Microsoft YaHei",sans-serif; }
.kb-kick-box { width: 320px; max-width: 88vw; background: #fff; border-radius: 16px; padding: 30px 26px 24px; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.35); animation: kbKickIn .35s cubic-bezier(.22,1,.36,1) both; }
@keyframes kbKickIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.kb-kick-icon { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.kb-kick-title { font-size: 18px; font-weight: 700; color: #1f2433; margin-bottom: 8px; }
.kb-kick-sub { font-size: 13px; color: #6b7280; line-height: 1.6; margin-bottom: 20px; }
.kb-kick-btn { width: 100%; padding: 11px; border: none; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #0d7c5e, #0a6b50); transition: filter .15s, transform .1s; }
.kb-kick-btn:hover { filter: brightness(1.06); }
.kb-kick-btn:active { transform: scale(.98); }

/* ============================================================
   美化增强：滚动条 / 弹窗动画 / 骨架屏 / 返回顶部 / 赠品画廊 / 仪表盘
============================================================ */

/* ---------- 自定义滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(13,124,94,.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(13,124,94,.45); }
.brand-yikexin ::-webkit-scrollbar-thumb { background: rgba(194,24,88,.28); }
.brand-yikexin ::-webkit-scrollbar-thumb:hover { background: rgba(194,24,88,.45); }
* { scrollbar-width: thin; scrollbar-color: rgba(13,124,94,.28) transparent; }
.brand-yikexin * { scrollbar-color: rgba(194,24,88,.28) transparent; }

/* ---------- 弹窗/抽屉动画 ---------- */
.modal-mask, .modal-back {
  display: flex; opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease;
}
.modal-mask { align-items: center; justify-content: center; }
.modal-back { align-items: flex-start; justify-content: center; }
.modal-mask.show, .modal-back.show {
  opacity: 1; visibility: visible;
}
.modal-mask .modal, .modal-back .edit-modal, .modal-back .help-modal {
  transform: translateY(18px) scale(.98); opacity: 0;
  transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .28s cubic-bezier(.22,1,.36,1);
}
.modal-mask.show .modal, .modal-back.show .edit-modal, .modal-back.show .help-modal {
  transform: none; opacity: 1;
}

/* ---------- 按钮微交互 ---------- */
.btn, .mini, .subtab, .tab { transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.btn:active, .mini:active, .subtab:active, .tab:active { transform: scale(.97); }
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,.35) 0%, transparent 70%);
  transform: scale(0); opacity: 0; transition: transform .35s ease, opacity .4s ease;
}
.btn:active::after { transform: scale(2.5); opacity: 1; transition: 0s; }

/* ---------- 操作成功微动画 ---------- */
.kb-check-pop { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #16a34a; color: #fff; margin-right: 6px; animation: kbCheckPop .35s cubic-bezier(.22,1,.36,1) both; }
@keyframes kbCheckPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- 骨架屏 ---------- */
.skeleton { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: skeletonShine 1.2s infinite; border-radius: 6px; }
@keyframes skeletonShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 96px; margin-bottom: 12px; border-radius: 12px; }
.skeleton-line { height: 14px; margin-bottom: 10px; border-radius: 4px; }
.skeleton-line.short { width: 60%; }
.skeleton-box { padding: 20px; }

/* ---------- 文章详情页优化 ---------- */
.manswer table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.manswer table th, .manswer table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.manswer table th { background: #f8fafc; font-weight: 600; }
.manswer code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .92em; color: #c2185b;
}
.manswer pre {
  background: #1e293b; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.6;
}
.manswer p { margin: 0 0 0.8em 0; }
.manswer p:last-child { margin-bottom: 0; }
.manswer ul, .manswer ol { margin: 0.5em 0; padding-left: 1.5em; }
.manswer li { margin-bottom: 0.3em; }
.manswer h1, .manswer h2, .manswer h3, .manswer h4, .manswer h5, .manswer h6 { margin: 1em 0 0.5em 0; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 18px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); opacity: 0; visibility: hidden;
  transform: translateY(10px); transition: all .2s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.22); }

/* ---------- 赠品图片网格画廊 ---------- */
.gift-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.gift-gallery img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border); cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease;
}
.gift-gallery img:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 20px rgba(0,0,0,.12); }

/* 搜索结果赠品卡片网格增强 */
.gift-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.gift-card {
  border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gift-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.12); }
.gift-img { height: 170px; background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.gift-img img { object-fit: contain; transition: transform .2s ease; padding: 6px; }
.gift-card:hover .gift-img img { transform: scale(1.04); }
.gift-name { font-size: 15px; }
.gift-row { font-size: 12px; }

/* ---------- 管理后台仪表盘 ---------- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dashboard-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.dashboard-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.dashboard-card .dc-icon { font-size: 26px; margin-bottom: 8px; line-height: 1; }
.dashboard-card .dc-brand-icon {
  height: 30px; width: auto; max-width: 100px; object-fit: contain;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.dashboard-card .dc-value { font-size: 28px; font-weight: 700; color: var(--text); }
.dashboard-card .dc-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dashboard-card.warn { border-left: 4px solid #f59e0b; }
.dashboard-card.err { border-left: 4px solid #ef4444; }
.dashboard-card.ok { border-left: 4px solid #22c55e; }
.dashboard-section { margin-top: 20px; }
.dashboard-section h3 { font-size: 15px; margin: 0 0 12px; color: var(--text); }
.dashboard-list { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dashboard-list .di { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dashboard-list .di:last-child { border-bottom: none; }
.dashboard-list .di .di-meta { color: var(--muted); }
/* 数据概览告警项可点击：跳转到内容管理按缺失项筛选 */
.dashboard-list .di-clickable { cursor: pointer; transition: background .12s; }
.dashboard-list .di-clickable:hover { background: rgba(245, 158, 11, .08); }
.dashboard-list .di-clickable:hover .di-meta { color: #f59e0b; font-weight: 600; }
/* 内容管理：缺失项筛选提示条 */
.mg-missing-banner { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; margin-bottom: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: 13px; color: #92400e; }
.mg-missing-banner b { color: #b45309; }
.mg-missing-clear { background: transparent; border: 1px solid #fde68a; color: #92400e; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.mg-missing-clear:hover { background: #fef3c7; }
.empty-dashboard { text-align: center; padding: 40px 20px; color: var(--muted); }

/* Toast 图标入场微动画 */
.toast-icon { animation: toastIconPop .35s cubic-bezier(.22,1,.36,1) both; }
@keyframes toastIconPop { from { transform: scale(0); } to { transform: scale(1); } }

/* 临时隐藏：自动生成话术相关区域（保留入口，仅隐藏生成结果/重新生成/提交审核/API Key/详情页生成按钮） */
#ocGenBox, #ocKeySetup, #ocGenBtn, #ocSaveCard, #ocKeyBtn, #genBtn { display: none !important; }

/* ============================================================
   我的成绩弹窗（考试成绩 / 质检分数）
   ============================================================ */
.kb-exam-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.kb-exam-modal { background: #fff; border-radius: 16px; max-width: 680px; width: 100%; max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.kb-exam-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eef0f4; }
.kb-exam-title { font-size: 16px; font-weight: 700; color: #111827; }
.kb-exam-close { border: none; background: #f3f4f6; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px; color: #4b5563; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.kb-exam-close:hover { background: #e5e7eb; color: #111827; }
.kb-exam-tabs { display: flex; border-bottom: 1px solid #eef0f4; }
.kb-exam-tab { flex: 1; padding: 11px 10px; border: none; background: none; font-size: 13px; font-weight: 600; cursor: pointer; color: #6b7280; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s, background .15s; }
.kb-exam-tab:hover { color: #374151; background: #f9fafb; }
.kb-exam-tab.active { color: #0f6e56; border-bottom-color: #0f6e56; }
.kb-exam-body { padding: 16px; overflow: auto; }
.kb-exam-trend { width: 100%; max-height: 140px; margin-bottom: 12px; }
.kb-exam-empty { text-align: center; padding: 28px 16px; color: #6b7280; font-size: 13px; }

/* 考试成绩卡片 */
.kb-exam-card { border: 1px solid #e6e8ee; border-radius: 12px; padding: 14px; margin-bottom: 10px; background: #fff; }
.kb-exam-card.absent { border-color: #fecaca; background: #fff7f7; }
.kb-exam-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-exam-period { font-size: 14px; font-weight: 600; color: #374151; flex: 1; min-width: 120px; }
.kb-exam-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.kb-exam-status.pass { background: #e7f5ee; color: #0f6e56; }
.kb-exam-status.fail { background: #fee2e2; color: #b91c1c; }
.kb-exam-status.absent { background: #fecaca; color: #991b1b; }
.kb-exam-score-row { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.kb-exam-score { font-size: 30px; font-weight: 700; color: #0f6e56; line-height: 1; }
.kb-exam-score.fail { color: #b91c1c; }
.kb-exam-score.absent { color: #991b1b; font-size: 18px; font-weight: 600; }
.kb-exam-meta { font-size: 12px; color: #6b7280; }
.kb-exam-all-right { font-size: 12px; color: #0f6e56; margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.kb-exam-wrong-toggle { margin-top: 10px; }
.kb-exam-wrong-toggle button { border: none; background: transparent; color: #b91c1c; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.kb-exam-wrong-toggle button:hover { text-decoration: underline; }
.kb-exam-wrong-list { margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; display: none; }
.kb-exam-wrong-list.open { display: block; }
.kb-exam-wrong-item { padding: 8px 0; border-bottom: 0.5px solid #f3f4f6; }
.kb-exam-wrong-item:last-child { border-bottom: none; }
.kb-exam-wrong-q { font-weight: 600; color: #374151; margin-bottom: 3px; }
.kb-exam-wrong-ans { color: #b91c1c; }
.kb-exam-wrong-ans .label { color: #6b7280; }

/* 质检分数 */
.kb-qc-header { text-align: center; padding: 4px 0 18px; }
.kb-qc-month { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.kb-qc-score { font-size: 44px; font-weight: 800; color: #0f6e56; line-height: 1; }
.kb-qc-score.fail { color: #b91c1c; }
.kb-qc-count { font-size: 12px; color: #6b7280; margin-top: 6px; }
.kb-qc-detail { border: 1px solid #e6e8ee; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.kb-qc-detail-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.kb-qc-detail-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 0.5px solid #f3f4f6; gap: 10px; }
.kb-qc-detail-row:last-child { border-bottom: none; }
.kb-qc-detail-type { font-size: 13px; color: #374151; flex: 1; }
.kb-qc-detail-count { font-size: 12px; color: #6b7280; }
.kb-qc-detail-score { font-size: 14px; font-weight: 700; color: #0f6e56; }
.kb-qc-detail-score.fail { color: #b91c1c; }
.kb-qc-deductions { margin-top: 12px; }
.kb-qc-deductions-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #374151; }
.kb-qc-deduction { border: 1px solid #e6e8ee; border-radius: 10px; padding: 12px; margin-bottom: 8px; background: #fff; border-left: 3px solid #ef4444; }
.kb-qc-deduction-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.kb-qc-deduction-date { font-size: 12px; color: #6b7280; flex: 1; }
.kb-qc-deduction-deduct { font-size: 12px; font-weight: 700; color: #ef4444; background: #fee2e2; padding: 2px 7px; border-radius: 999px; }
.kb-qc-deduction-score { font-size: 12px; color: #9ca3af; }
.kb-qc-deduction-cats { font-size: 12px; color: #b91c1c; margin-bottom: 6px; line-height: 1.5; }
.kb-qc-deduction-remark { font-size: 12px; color: #374151; line-height: 1.6; padding: 7px 9px; background: #f9fafb; border-radius: 6px; margin-bottom: 4px; }
.kb-qc-deduction-meta { font-size: 11px; color: #9ca3af; }
.kb-qc-empty { text-align: center; padding: 10px; margin-top: 4px; font-size: 12px; color: #0f6e56; }
.kb-qc-sync { font-size: 11px; color: #9ca3af; text-align: center; margin-top: 10px; }

/* 我的成绩弹窗窄屏适配 */
@media (max-width: 640px) {
  .kb-exam-modal { max-height: 92vh; border-radius: 12px; }
  .kb-exam-body { padding: 12px; }
  .kb-exam-score { font-size: 26px; }
  .kb-qc-score { font-size: 36px; }
}

/* ==========================================================================
   产品对比：至多 3 款并排
   首列「对比项」固定宽，产品列等分；3 款时整体收窄，保证一屏内可读
   ========================================================================== */
.results-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.results-tools .rt-hint { font-size: 12.5px; color: var(--muted); }

.cmp-view { width: 100%; }
.cmp-view .detail-page-top { display: flex; align-items: center; gap: 10px; }
.cmp-title { font-weight: 700; font-size: 16px; }
.cmp-sub { font-size: 12.5px; color: var(--muted); }

.cmp-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
.cmp-table col.cmp-col-f { width: 132px; }
.cmp-table col.cmp-col-add { width: 176px; }
.cmp-table.cmp-narrow col.cmp-col-f { width: 106px; }
.cmp-table.cmp-narrow col.cmp-col-add { width: 132px; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: 10px 12px; vertical-align: top; word-break: break-word; }
.cmp-table thead th { background: #f8fafc; }
.cmp-table tbody tr:hover td { background: #fcfdff; }
.cmp-fth { background: #f1f5f9 !important; font-weight: 600; text-align: left; color: var(--text); font-size: 13px; }
.cmp-table.cmp-narrow .cmp-fth { font-size: 12.5px; padding: 9px 8px; }
.cmp-table.cmp-narrow th, .cmp-table.cmp-narrow td { padding: 9px 9px; }
.cmp-pth { text-align: center; padding: 9px !important; }
.cmp-pimg { display: flex; align-items: center; justify-content: center; min-height: 96px; margin: 6px 0; }
.cmp-pimg img { max-width: 100%; max-height: 118px; border-radius: 6px; cursor: pointer; }
.cmp-table.cmp-narrow .cmp-pimg img { max-height: 96px; }
.cmp-pname { font-weight: 700; font-size: 14px; line-height: 1.45; }
.cmp-table.cmp-narrow .cmp-pname { font-size: 13px; }
.cmp-ptags { margin-top: 5px; }
.cmp-pick { display: flex; gap: 4px; align-items: center; margin-bottom: 2px; }
.cmp-select { flex: 1 1 auto; min-width: 0; padding: 5px 6px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; background: #fff; color: var(--text); font-family: inherit; }
.cmp-select:focus { outline: none; border-color: var(--primary, #0d7c5e); }
.cmp-select-add { border-style: dashed; color: var(--muted); }
.cmp-x { flex: 0 0 auto; width: 24px; height: 27px; border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 8px; cursor: pointer; line-height: 1; font-size: 14px; }
.cmp-x:hover { color: #dc2626; border-color: #dc2626; }
.cmp-addth { vertical-align: middle; }
.cmp-addhint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.cmp-addtd { background: #fbfdff; }
.cmp-tip { margin-top: 14px; padding: 12px 14px; background: var(--chip); border-radius: 10px; color: var(--primary, #0d7c5e); font-size: 13px; }
.cmp-empty { color: var(--muted); }

/* 成分及含量：逐项名值对齐，数值加粗高亮 */
.cmp-ing-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.cmp-ing-row:last-of-type { border-bottom: 0; }
.cmp-ing-n { color: var(--muted); }
.cmp-ing-v { font-weight: 700; color: var(--primary, #0d7c5e); white-space: nowrap; }
.cmp-ing-t { padding: 3px 0; line-height: 1.6; }
.cmp-ing-g { margin: 6px 0 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cmp-ing-g:first-child { margin-top: 0; }
.cmp-ing-exc { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.cmp-ing-exc b { color: var(--text); margin-right: 6px; }

@media (max-width: 900px) {
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table th, .cmp-table td { display: block; width: auto !important; }
  .cmp-table colgroup { display: none; }
  .cmp-table tr { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .cmp-table td, .cmp-table th { border: 0; border-bottom: 1px solid var(--border); }
  .cmp-table .cmp-fth { border-bottom: 0; }
}

/* ===== 实用工具（仅迪巧）：钙量叠加校准 ===== */
.view-tools .tools-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; margin-bottom: 16px; max-width: 760px; }
.view-tools .tools-head { margin-bottom: 12px; }
.view-tools .tools-title { font-size: 20px; font-weight: 700; }
.view-tools .tools-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.view-tools .tools-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-tools .tools-label { font-weight: 600; }
.view-tools .tools-select { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; min-width: 300px; }
.view-tools .tools-panel { min-height: 200px; overflow-x: auto; }
.view-tools .tools-empty { color: var(--muted); padding: 40px; text-align: center; }
.calc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px 20px; max-width: 760px; }
.calc-card.calc-wide { max-width: 960px; }
.calc-card .detail-page-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.calc-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--bg); }
.calc-block-title { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.calc-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calc-sel-sm { min-width: 220px; }
.calc-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-chk { display: flex; align-items: center; gap: 5px; font-size: 13px; border: 1px solid var(--border); border-radius: 16px; padding: 5px 10px; background: var(--bg); cursor: pointer; }
.calc-chk:hover { border-color: var(--primary); color: var(--primary); }
.calc-chk input { margin: 0; }
.calc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.calc-table th, .calc-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.calc-table th { background: var(--bg); font-weight: 600; white-space: nowrap; }
.calc-table td:first-child { min-width: 170px; }
.calc-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--bg); border: 1px solid var(--border); white-space: nowrap; }
.calc-tag.ok { background: #e8f7ef; color: #0d7c5e; border-color: #b9e2cf; }
.calc-tag.near { background: #fff5e6; color: #b9770e; border-color: #f3d9ab; }
.calc-tag.over { background: #fdecea; color: #c0392b; border-color: #f3bdba; }
.calc-summary-2 { grid-template-columns: repeat(2, 1fr); }
.calc-hit { border-left: 3px solid var(--border); padding: 6px 10px; margin-bottom: 8px; background: var(--bg); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.65; }
.calc-hit-over { border-left-color: #c0392b; }
.calc-hit-near { border-left-color: #b9770e; }
.calc-hit-low { border-left-color: #2c5aa0; }
.calc-hit-tag { display: inline-block; margin-left: 8px; font-size: 12px; color: var(--muted); }
.calc-row { margin-bottom: 14px; }
.calc-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.calc-sel, .calc-input { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.calc-sel { min-width: 340px; }
.calc-input { width: 150px; }
.calc-note { font-size: 12.5px; color: var(--muted); background: rgba(13,124,94,.08); border-left: 3px solid var(--primary); padding: 6px 10px; border-radius: 4px; margin: -4px 0 14px; line-height: 1.6; }
.calc-radio { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.calc-radio label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.calc-hint { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.calc-presets { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.calc-preset { padding: 5px 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12.5px; cursor: pointer; }
.calc-preset:hover { border-color: var(--primary); color: var(--primary); }
.calc-actions { margin: 8px 0 4px; }
.calc-result { margin-top: 16px; }
.calc-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.calc-sitem { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; }
.calc-sitem span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.calc-sitem b { font-size: 16px; }
.calc-total { color: var(--primary); }
.calc-level { padding: 8px 12px; border-radius: 8px; font-weight: 700; margin-bottom: 10px; }
.calc-level-over { background: #fdecea; color: #c0392b; }
.calc-level-near { background: #fff5e6; color: #b9770e; }
.calc-level-ok { background: #e8f7ef; color: #0d7c5e; }
.calc-level-low { background: #eef3fb; color: #2c5aa0; }
.calc-advice { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; line-height: 1.7; }
.calc-reason { font-size: 13px; color: var(--text); line-height: 1.7; margin-bottom: 12px; }
.calc-pnote { color: var(--muted); }
.calc-script { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.calc-script-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg); font-weight: 600; font-size: 13px; }
.calc-script pre { margin: 0; padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.7; font-family: inherit; }
.calc-warn { background: #fff5e6; color: #b9770e; padding: 12px; border-radius: 8px; }
