:root {
  --bg: #f5f7fa;
  --panel: #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: 6px; }
.card .meta-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--primary); }
.tag.cat { background: #fff7ed; color: #c2410c; }
.card .answer { color: #374151; line-height: 1.6; }
.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 { 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; }
.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-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-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; }
.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: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-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; } }

/* 热门搜索 */
.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: 15px; color: var(--text); margin-bottom: 6px; font-weight: 500; }

/* 详情弹窗品牌头 */
.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; }
.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: 11px; color: var(--muted); 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; }

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

.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-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; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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: 18px; height: 18px; font-size: 10px; color: var(--muted); transition: transform .15s; flex: 0 0 auto; }
.sb-caret.collapsed { transform: rotate(-90deg); }
.sb-plabel { font-weight: 700; font-size: 15px; flex: 1; color: var(--text); }
.sb-plabel.active { color: 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; }
.sb-child.active::before { background: #fff; }

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

/* ========== 内嵌管理/统计视图（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% / 7); 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); }
