/* ===== 全局 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #0aaf5c;
  --primary-dark: #008f49;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #1a1a1a;
  --text-light: #666;
  --text-lighter: #999;
  --border: #e0e0e0;
  --link: #1a73e8;
  --danger: #d0021b;
  --warning: #f5a623;
  --star: #f5a623;
}
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.hidden { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 按钮 ===== */
.btn-primary {
  background: var(--primary); color: #fff; border: none;
  padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn-secondary:hover { background: #f0f0f0; }
.btn-text {
  background: none; color: var(--text-light); border: none; cursor: pointer;
  font-size: 13px; padding: 4px 8px;
}
.btn-text:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-export {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn-export:hover { border-color: var(--primary); color: var(--primary); }
.btn-export:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 登录页 ===== */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.login-card {
  background: var(--card-bg); padding: 40px; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1); width: 360px; max-width: 90vw;
}
.login-card h1 {
  font-size: 22px; text-align: center; margin-bottom: 24px; color: var(--text);
}
.form-label {
  display: block; margin-bottom: 16px; font-size: 13px; color: var(--text-light);
}
.form-label input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.form-label input:focus { outline: none; border-color: var(--primary); }
.login-error {
  color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px;
}

/* ===== 顶部栏 ===== */
.topbar {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.topbar .brand { font-size: 18px; font-weight: 600; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
#userInfo { color: var(--text-light); font-size: 13px; }

/* ===== 指标说明浮层 ===== */
.help-popover {
  position: fixed; top: 60px; right: 24px;
  width: 360px; max-width: calc(100vw - 48px);
  max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 16px 18px; z-index: 200;
  font-size: 13px; line-height: 1.6; color: var(--text);
}
.help-popover h3 { font-size: 14px; margin: 14px 0 6px; color: var(--primary); }
.help-popover h3:first-of-type { margin-top: 8px; }
.help-popover ul { padding-left: 18px; }
.help-popover li { margin: 3px 0; }
.help-popover b { color: var(--text); }
.help-popover .help-intro { color: var(--text-light); margin-bottom: 4px; }
.help-popover .help-note {
  color: var(--text-lighter); font-size: 12px; margin-top: 12px;
  padding-top: 10px; border-top: 1px dashed var(--border); line-height: 1.7;
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 8px; color: #fff; font-size: 14px;
  z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--primary); }
.toast.info { background: #333; }
@keyframes toastIn { from { opacity: 0; top: 50px; } to { opacity: 1; top: 70px; } }

/* ===== 查询条件区 ===== */
.filter-panel {
  background: var(--card-bg); margin: 16px; padding: 20px;
  border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.filter-panel.collapsed .filter-line,
.filter-panel.collapsed .filter-row,
.filter-panel.collapsed .filter-group { display: none; }
.filter-row {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px;
}
.filter-row:last-of-type { margin-bottom: 0; }
.filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 120px; flex: 1 1 120px; max-width: 200px; position: relative; }
.filter-item.filter-wide { flex: 2 1 260px; max-width: 320px; }
.filter-item label { font-size: 12px; color: var(--text-light); font-weight: 500; }
.filter-item input, .filter-item select, .filter-item textarea {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; font-family: inherit;
}
.filter-item input:focus, .filter-item select:focus, .filter-item textarea:focus {
  outline: none; border-color: var(--primary);
}
.filter-item textarea { resize: vertical; min-height: 35px; }
.filter-item select[multiple] { min-height: 70px; }
.filter-item input[type="number"] { max-width: 88px; }
.filter-item:has(input[type="number"]) { max-width: 95px; min-width: 70px; }

/* 下拉多选框（品牌/库存状态/操作类型）：触发器 + checkbox 浮层 */
.ms-trigger {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: var(--card-bg); cursor: pointer;
  display: flex; align-items: center; gap: 8px; min-height: 34px;
}
.ms-trigger:hover { border-color: var(--primary); }
.ms-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-text.placeholder { color: var(--text-lighter); }
.ms-arrow { color: var(--text-light); font-size: 11px; }
.ms-panel {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  margin-top: 2px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 4px;
  max-height: 240px; overflow-y: auto; padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 100%;
}
.ms-panel.open { display: block; }
.ms-opt {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  font-size: 13px; cursor: pointer; white-space: nowrap; border-radius: 3px;
}
.ms-opt:hover { background: #f5f5f5; }
.ms-opt input {
  margin: 0; width: 14px; height: 14px; padding: 0;
  border: none; box-shadow: none; flex: 0 0 auto;
}
.ms-actions { display: flex; gap: 8px; padding: 4px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; position: sticky; top: 0; background: var(--card-bg); }
.ms-actions button { font-size: 12px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--card-bg); cursor: pointer; }
.ms-actions button:hover { border-color: var(--primary); color: var(--primary); }
.inline-select {
  font-size: 11px; padding: 2px 4px; margin-left: 6px;
  border: 1px solid var(--border); border-radius: 3px;
}
/* 标题关键词：input + 模式选择横排 */
.title-row { display: flex; gap: 6px; align-items: stretch; }
.filter-field .title-row input { flex: 1 1 0; min-width: 0; width: 180px; }
.filter-field .title-row .inline-select { margin-left: 0; flex: 0 0 auto; width: auto; min-height: 34px; }
/* ===== 查询条件区：按行分组，每行内「标签: 控件」横向流式排列 ===== */
.filter-line {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px 20px; padding: 4px 0;
}
.filter-line .filter-field,
.filter-line .filter-range {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  position: relative; min-width: 0;
}
.filter-field > label {
  flex: 0 0 auto; font-size: 13px; color: var(--text); font-weight: 600;
  white-space: nowrap;
}
.filter-field > label::after { content: '：'; }
/* 通用输入框样式：排除 checkbox/radio（下拉多选、分类面板内的勾选框必须保持原生小尺寸，
   否则被 width:100% 拉伸后布局错乱且大量原生复选框重绘会导致页面卡死） */
.filter-field input:not([type="checkbox"]):not([type="radio"]),
.filter-field select, .filter-field textarea {
  width: 180px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: var(--card-bg);
}
/* 产品名称或产品ID：合并字段，输入框加宽 */
.filter-field.filter-field-keyword input { width: 300px; }
.filter-field input:not([type="checkbox"]):not([type="radio"]):focus,
.filter-field select:focus, .filter-field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(10, 175, 92, 0.08);
}
.filter-field textarea { resize: vertical; min-height: 34px; }
.filter-field.filter-field-cat { min-width: 0; }

/* ===== 类目单选选择器（cat-select.js，首页查询面板专用） ===== */
.cat-select-wrap { position: relative; display: flex; align-items: center; width: 660px; }
.filter-field .cat-select-input {
  flex: 1 1 auto; width: 100%; padding: 6px 30px 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: var(--card-bg); cursor: pointer;
}
.cat-select-input.placeholder { color: var(--text-lighter); }
.cat-select-input:focus { outline: none; border-color: var(--primary); }
.cat-select-arrow {
  position: absolute; right: 10px; color: var(--text-light); font-size: 11px; pointer-events: none;
}
.cat-select-panel {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  margin-top: 4px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  width: max-content; min-width: 420px; max-width: 92vw; overflow: hidden;
}
.cat-select-panel.open { display: block; }
.cat-select-panel .cat-cols {
  display: flex; gap: 1px; background: var(--border); max-height: 320px;
  overflow-x: auto; overflow-y: hidden; width: max-content;
}
.cat-select-panel .cat-col {
  flex: 0 0 380px; background: var(--card-bg); overflow-y: auto; padding: 4px 0; min-width: 380px;
}
.cat-select-panel .cat-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  font-size: 13px; cursor: pointer;
}
.cat-select-panel .cat-row:hover { background: #e8f8f0; }
.cat-select-panel .cat-row.active { background: var(--primary); color: #fff; }
.cat-select-panel .cat-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-select-panel .cat-row-arrow { color: var(--text-light); font-size: 12px; }
.cat-select-panel .cat-row.active .cat-row-arrow { color: #fff; }
.cat-select-panel .cat-empty { padding: 12px; font-size: 12px; color: var(--text-lighter); text-align: center; }
.cat-select-panel .cat-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border); background: var(--card-bg);
}
.cat-select-panel .cat-selected-text { font-size: 13px; color: var(--text-light); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-select-panel .cat-selected-text b { color: var(--primary); }
.cat-select-panel .cat-footer-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cat-select-panel .cat-btn-cancel,
.cat-select-panel .cat-btn-search {
  padding: 5px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text);
}
.cat-select-panel .cat-btn-cancel:hover { border-color: var(--text-light); }
.cat-select-panel .cat-btn-search { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-select-panel .cat-btn-search:hover { background: var(--primary-dark); }

/* 范围条件（标签在左 + 双输入框 + ~）：价格/评分/评论数/月销量 */
.range-label { flex: 0 0 auto; font-size: 13px; color: var(--text); font-weight: 600; white-space: nowrap; }
.range-label::after { content: '：'; }
.range-sep { color: var(--text-lighter); font-size: 13px; }
.range-word { font-size: 12px; color: var(--text-light); }
.filter-range input[type="number"] {
  width: 84px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: var(--card-bg);
}
.filter-range input[type="date"] {
  width: 136px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: var(--card-bg);
}
.filter-range input:focus { outline: none; border-color: var(--primary); }

/* 窄屏：条件纵向排列，控件占满整行 */
@media (max-width: 760px) {
  .filter-line { gap: 10px 16px; }
  .filter-line .filter-field { flex: 1 1 100%; }
  .filter-field input:not([type="checkbox"]):not([type="radio"]),
  .filter-field select, .filter-field textarea { flex: 1 1 auto; width: auto; }
  .cat-select-wrap { width: 100%; }
  .filter-field .cat-select-input { width: auto; }
}

.filter-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.preset-group {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.preset-group select { padding: 4px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 4px; }

/* 分类级联面板：点击触发器弹出浮层，逐级展开 L1->L2->L3->... */
.filter-item.filter-cat { position: relative; min-width: 180px; flex: 1 1 180px; max-width: 280px; align-self: flex-start; }
.cat-trigger {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: var(--card-bg); cursor: pointer;
  display: flex; align-items: center; gap: 8px; min-height: 34px;
}
.cat-trigger:hover { border-color: var(--primary); }
.cat-trigger-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-trigger-text.placeholder { color: var(--text-lighter); }
.cat-trigger-arrow { color: var(--text-light); font-size: 11px; }
.cat-cascader {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  margin-top: 2px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--card-bg);
  max-height: 360px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  width: max-content; max-width: 90vw;
}
.cat-cascader.open { display: flex; flex-direction: column; }
.cat-cols { display: flex; gap: 1px; background: var(--border); flex: 1 1 auto; min-height: 0; overflow: hidden; }
.cat-cascader .cat-col {
  flex: 0 0 auto; min-width: 150px; max-width: 280px;
  background: var(--card-bg); overflow-y: auto; padding: 2px 0;
}
.cat-item {
  padding: 4px 10px; font-size: 13px; cursor: pointer;
  white-space: normal; overflow-wrap: break-word; word-break: break-word;
  display: flex; align-items: center; gap: 6px;
}
.cat-item:hover { background: #e8f8f0; }
.cat-item.active { background: var(--primary); color: #fff; }
.cat-item.any { color: var(--text-light); }
.cat-item.all { color: var(--primary); font-weight: 600; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.cat-item-name { flex: 1; min-width: 0; }
.cat-cb-input { margin: 0; cursor: pointer; flex: 0 0 auto; width: 14px; height: 14px; padding: 0; border: none; box-shadow: none; }
.cat-item-zh { margin-left: 6px; font-size: 11px; color: var(--text-light); }
.cat-item.active .cat-item-zh { color: rgba(255,255,255,0.85); }
.cat-cascader .cat-col:empty::before {
  content: "-"; display: block; padding: 8px; text-align: center;
  color: var(--text-lighter);
}
/* 多选底部：已选 chips + 确定按钮 */
.cat-footer {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-top: 1px solid var(--border); background: var(--card-bg); flex: 0 0 auto;
}
.cat-selected-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.cat-chips-empty { font-size: 12px; color: var(--text-lighter); }
.cat-chip-sel {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 10px;
  background: #f5f5f5; color: var(--text);
}
.cat-chip-sel .chip-x { cursor: pointer; color: var(--text-light); font-weight: bold; }
.cat-chip-sel .chip-x:hover { color: var(--danger); }
.cat-confirm-btn {
  flex: 0 0 auto; padding: 4px 14px; height: 28px; border: none; border-radius: 4px;
  background: var(--primary); color: #fff; font-size: 13px; cursor: pointer;
}
.cat-confirm-btn:hover { background: var(--primary-dark); }

/* ===== 统计条 ===== */
.stats-bar {
  margin: 0 16px; padding: 10px 16px; background: var(--card-bg);
  border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-light);
}
.stats-sep { color: var(--border); }

/* ===== 套餐升级引导条（套餐设计.md v1.6：单次查询可见上限触发） ===== */
.plan-upgrade-banner {
  margin: 10px 16px 0; padding: 10px 16px; border-radius: 8px;
  background: #fff7e6; border: 1px solid #ffd591; color: #874d00;
  display: flex; align-items: center; gap: 12px; font-size: 13px;
}
.plan-upgrade-banner a { white-space: nowrap; font-weight: 500; }
.plan-upgrade-banner .btn-text { margin-left: auto; color: #874d00; }

/* ===== 锁定预览区（套餐设计.md v1.6）：模糊卡紧接结果 + 遮罩勾引 ===== */
.results-area { position: relative; }
/* 遮罩容器：绝对定位覆盖在模糊卡区域上（top/height 由 JS 按模糊卡位置计算） */
.locked-teaser { position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 4; pointer-events: none; }
.locked-veil {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  background: radial-gradient(ellipse 62% 66% at 50% 50%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.88) 55%, rgba(255,255,255,0.55) 100%);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
/* 面板：压在模糊卡片区正中央 */
.locked-panel {
  text-align: center; padding: 8px 24px; width: 100%; max-width: 680px;
  pointer-events: auto; position: relative; z-index: 5;
}
/* 整卡模糊：真实商品图与文字全部模糊化，只留轮廓 */
.locked-card { pointer-events: none; }
.locked-card .locked-img,
.locked-card .card-title,
.locked-card .card-brand,
.locked-card .card-price,
.locked-card .card-rating {
  filter: blur(6px); -webkit-user-select: none; user-select: none;
}
.locked-card .card-title { color: #8b93a0; }
/* 打码块：模糊占位（后端未下发价格/评分） */
.locked-blur {
  display: inline-block; color: #aab1bb; letter-spacing: 2px;
  filter: blur(4px); -webkit-user-select: none; user-select: none;
}
.locked-more-badge {
  position: absolute; bottom: 6px; right: 6px; z-index: 3;
  background: rgba(212,56,13,0.92); color: #fff; font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 12px;
}
.locked-eyebrow {
  display: inline-block; font-size: 16px; font-weight: 700; color: #d4380d;
  background: #fff2e8; border: 1px solid #ffbb96; border-radius: 16px;
  padding: 5px 18px; margin-bottom: 18px;
}
.locked-title {
  font-size: 22px; color: var(--text); line-height: 1.7; margin-bottom: 20px; font-weight: 500;
}
.locked-title b { color: #d4380d; font-size: 38px; font-weight: 800; margin: 0 6px; vertical-align: -3px; }
.locked-progress {
  height: 12px; background: #f0f0f0; border-radius: 6px; overflow: hidden;
  margin: 0 auto 24px; max-width: 420px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}
.locked-progress i { display: block; height: 100%; background: linear-gradient(90deg, #ffa940, #fa541c); border-radius: 6px; transition: width 0.4s; }
.locked-btn {
  background: linear-gradient(135deg, #ff7a45, #d4380d); color: #fff; border: none;
  padding: 18px 54px; border-radius: 32px; font-size: 20px; font-weight: 700;
  cursor: pointer; box-shadow: 0 6px 20px rgba(212,56,13,0.34); transition: transform 0.15s, box-shadow 0.15s;
}
.locked-btn b { font-size: 23px; margin: 0 3px; }
.locked-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(212,56,13,0.44); }
.locked-compare { margin-top: 18px; font-size: 15px; color: var(--text-light); }
.locked-compare b { color: #d4380d; }
.locked-compare { margin-top: 10px; font-size: 12px; color: var(--text-light); }

/* ===== 工具条 ===== */
.toolbar {
  margin: 12px 16px; padding: 10px 16px; background: var(--card-bg);
  border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.toolbar-center, .toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.view-btn {
  background: #fff; border: 1px solid var(--border); padding: 5px 14px;
  border-radius: 4px; cursor: pointer; font-size: 13px;
}
.view-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.checkbox-inline { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-light); cursor: pointer; }

/* ===== 卡片网格 ===== */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; padding: 0 16px 16px;
}
.product-card {
  background: var(--card-bg); border-radius: 8px; padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); position: relative;
  transition: transform 0.15s, box-shadow 0.15s; border: 2px solid transparent;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.product-card.selected { border-color: var(--primary); }

/* ===== 卡片悬停外链提示（card.js LinkTip）===== */
.link-tip {
  position: fixed; z-index: 9999; cursor: pointer;
  background: rgba(28,28,28,0.92); color: #fff;
  font-size: 14.4px; line-height: 1.4;
  padding: 6px 12px; border-radius: 6px; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  opacity: 0; transform: translate(-50%, 6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.link-tip.show { opacity: 1; transform: translate(-50%, 0); }
.link-tip .link-tip-host { color: #fa5151; font-weight: 600; }
/* 透明"桥"：衔接浮层与卡片间的 8px 空隙，鼠标移向浮层不丢失提示 */
.link-tip::before {
  content: ''; position: absolute; top: 100%; left: -8px; right: -8px; height: 10px;
}
.link-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(28,28,28,0.92);
}
.link-tip.below::before { top: auto; bottom: 100%; }
.link-tip.below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent; border-bottom-color: rgba(28,28,28,0.92);
}

/* 复选框 */
.card-checkbox {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  background: rgba(255,255,255,0.85); border-radius: 4px; padding: 3px;
  cursor: pointer;
}
.card-checkbox input { margin: 0; cursor: pointer; }

/* 图片容器 */
.card-image-wrap {
  position: relative; aspect-ratio: 1; margin-bottom: 8px;
  background: #fafafa; border-radius: 6px; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.card-image-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* 评分行收藏按钮后面的外链图标（跳转 takealot 商品页），风格与收藏按钮一致 */
.card-outer-link {
  display: inline-flex; align-items: center; justify-content: center;
  color: #555; line-height: 1; vertical-align: middle;
  opacity: 0.6; transition: opacity 0.15s ease;
  cursor: pointer;
}
.card-outer-link:hover { opacity: 1; color: var(--primary); }
.sponsored-pill {
  position: absolute; top: 6px; left: 36px; background: rgba(0,0,0,0.6);
  color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px;
}
.card-badges-top {
  position: absolute; top: 6px; right: 6px;
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end;
  max-width: calc(100% - 12px);
}
.discount-badge {
  background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}
.card-badges-top .badge-text {
  background: var(--accent, #1976d2);
  color: #fff; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  white-space: nowrap;
}

/* 卡片详情 */
.card-details { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title {
  font-size: 14px; font-weight: 500; line-height: 1.3; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 36px;
}
.card-title:hover { color: var(--link); }
.card-brand { color: var(--link); font-size: 12px; }
.card-price { list-style: none; display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.price-current { font-size: 16px; font-weight: 700; color: #000; }
.price-list { font-size: 13px; color: var(--text-lighter); }
.price-list s { color: var(--text-lighter); }

.card-stock { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; }
.stock-status { font-weight: 500; }
.stock-status.in-stock { color: var(--primary); }
.stock-status.ships { color: var(--warning); }
.stock-status.out-of-stock { color: var(--danger); }
.stock-pill {
  background: #eee; border-radius: 3px; padding: 1px 6px; font-size: 11px; color: var(--text-light);
}
.card-delivery { font-size: 12px; color: var(--text-light); }
.card-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.stars { color: var(--star); letter-spacing: 1px; }
.rating-score { font-weight: 600; }
.review-count { color: var(--text-light); }

.card-color-variant {
  display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-light);
}
.spectrum-icon {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(red, orange, yellow, green, blue, indigo, violet, red);
}

.card-action { margin-top: auto; padding-top: 8px; }
.card-action button {
  width: 100%; padding: 8px; border-radius: 6px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500;
}
.btn-cart { background: var(--primary); color: #fff; }
.btn-ghost { background: #e9e9e9; color: #000; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* 月销量估算（价格行最右，上界单值） */
.price-monthly { margin-left: auto; font-size: 12px; color: var(--text-light); font-weight: 500; }

.card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.promo-badge-img { width: 40px; height: 16px; object-fit: contain; border-radius: 2px; }
.badge-text {
  background: #fff3e0; color: #e65100; font-size: 10px; padding: 1px 6px;
  border-radius: 3px; border: 1px solid #ffe0b2;
}

/* ===== 表格视图 ===== */
.table-view { padding: 0 16px 16px; overflow-x: auto; }
.table-view table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 8px; overflow: hidden; }
.table-view th, .table-view td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.table-view th { background: #f9f9f9; font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.th-check { width: 40px; }
.table-view tbody tr { cursor: pointer; }
.table-view tbody tr:hover { background: #f5f5f5; }
.table-view tr.selected { background: #e8f5e9; }
.table-view td img.thumb { width: 40px; height: 40px; object-fit: contain; }
.table-view .cell-title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 状态 ===== */
.state { text-align: center; padding: 60px 20px; color: var(--text-light); font-size: 15px; }
.state.error { color: var(--danger); }

/* ===== 分页 ===== */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 20px 16px 40px; flex-wrap: wrap;
}
.pagination button {
  min-width: 36px; height: 36px; border: 1px solid var(--border); background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 13px; padding: 0 8px;
}
.pagination button:hover { border-color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
/* 跳转到指定页 */
.pagination .page-jump { display: flex; align-items: center; gap: 4px; margin-left: 16px; font-size: 13px; color: var(--text-light); }
.pagination .page-jump-input {
  width: 56px; height: 36px; border: 1px solid var(--border); background: #fff;
  border-radius: 4px; text-align: center; font-size: 13px; padding: 0;
}
.pagination .page-jump-input:focus { outline: none; border-color: var(--primary); }
/* 隐藏 number input 的上下箭头，保持紧凑 */
.pagination .page-jump-input::-webkit-outer-spin-button,
.pagination .page-jump-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pagination .page-jump-input { -moz-appearance: textfield; }

/* ===== 左右侧悬浮翻页箭头（箭头 + 竖排页向文字，明确指意） ===== */
.side-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; padding: 14px 0; border: 1px solid var(--border); background: rgba(255,255,255,0.95);
  border-radius: 8px; cursor: pointer; z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14); opacity: 0.8;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.side-nav-arrow {
  font-size: 30px; line-height: 1; color: var(--primary); font-weight: 600;
}
.side-nav-text {
  writing-mode: vertical-rl; letter-spacing: 4px;
  font-size: 12px; line-height: 1; color: var(--text-light);
}
.side-nav:hover,
.side-nav:focus-visible {
  opacity: 1; border-color: var(--primary); outline: none; transform: translateY(-50%) translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.side-nav:hover .side-nav-text { color: var(--primary); }
.side-nav-prev { left: 8px; }
.side-nav-next { right: 8px; }
.side-nav.hidden { display: none; }

/* ===== 模态框 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
  background: #fff; border-radius: 12px; padding: 28px; width: 420px; max-width: 90vw;
}
.modal-content h3 { margin-bottom: 20px; font-size: 18px; }
.radio-label { display: block; margin-bottom: 12px; cursor: pointer; font-size: 14px; }
.export-hint { font-size: 12px; color: var(--text-light); margin: 8px 0 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.export-status { font-size: 13px; color: var(--text-light); margin-top: 12px; }

/* 以图搜图拖拽遮罩（拖图片到页面任意位置触发） */
.drop-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; /* 纯视觉，drop 事件穿透到 window */
}
.drop-overlay-box {
  border: 3px dashed #fff; border-radius: 16px;
  padding: 48px 72px; text-align: center; color: #fff;
  background: rgba(0,0,0,0.35);
}
.drop-overlay-icon { font-size: 56px; line-height: 1; }
.drop-overlay-text { font-size: 20px; margin-top: 14px; font-weight: 600; }
.export-status.error { color: var(--danger); }

/* ===== 右侧悬浮联系客服（垂直居中偏下，避开同侧"下一页"悬浮箭头）+ 微信二维码弹出 ===== */
.contact-widget {
  position: fixed; right: 8px; top: 62%; transform: translateY(-50%);
  z-index: 400; display: flex; align-items: center;
}
.contact-trigger {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 72px; padding: 12px 6px 10px;
  background: linear-gradient(160deg, #3b82f6, #2563eb); border: 1px solid #2f6fe4;
  border-radius: 12px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(37,99,235,0.35);
  transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  opacity: 0.92;
}
.contact-trigger:hover,
.contact-trigger:focus-visible {
  opacity: 1; border-color: #1d4ed8; outline: none;
  box-shadow: 0 4px 16px rgba(37,99,235,0.5); transform: translateY(-1px);
}
.contact-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.95); display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.contact-label {
  font-size: 14px; line-height: 1.1; color: #fff;
  font-weight: 600; white-space: nowrap;
}
/* 悬停气泡提示（出现在头像左侧，带右箭头；点击不直接显示，避免遮挡） */
.contact-tip {
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%);
  background: #303030; color: #fff; font-size: 13px; line-height: 1.5;
  padding: 10px 14px; border-radius: 6px; width: max-content; max-width: 280px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none; white-space: normal;
}
.contact-tip::after {
  content: ''; position: absolute; left: 100%; top: 50%; margin-top: -6px;
  border: 6px solid transparent; border-left-color: #303030;
}
.contact-widget:hover .contact-tip,
.contact-trigger:focus-visible .contact-tip { opacity: 1; visibility: visible; }

/* 微信二维码面板 */
.contact-panel {
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%);
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; width: 236px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2); text-align: center;
}
.contact-panel.hidden { display: none; }
.contact-panel h4 { font-size: 15px; margin-bottom: 4px; color: var(--text); }
.contact-panel-sub { font-size: 12px; color: var(--text-light); margin-bottom: 12px; }
.contact-qr { width: 180px; height: 180px; display: block; margin: 0 auto; border-radius: 8px; }
.contact-qr-fallback {
  width: 180px; height: 180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 8px;
  background: #fafafa; color: var(--text-lighter); font-size: 12px;
}
.contact-panel-id {
  font-size: 12px; color: var(--text-lighter); margin-top: 10px; word-break: break-all;
}
.contact-panel-close {
  position: absolute; top: 4px; right: 6px; border: none; background: none;
  font-size: 20px; line-height: 1; color: var(--text-lighter); cursor: pointer; padding: 2px 6px;
}
.contact-panel-close:hover { color: var(--text); }

/* 小屏：标题隐藏，仅保留头像入口 */
@media (max-width: 640px) {
  .contact-trigger { width: 92px; padding: 14px 6px; }
  .contact-avatar { width: 60px; height: 60px; border-width: 3px; }
  .contact-label { display: none; }
  .contact-panel { width: 206px; padding: 14px; }
  .contact-qr { width: 158px; height: 158px; }
  .contact-tip { display: none; }
}

/* ===== 详情页 ===== */
.detail-header {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.detail-header h1 { font-size: 18px; font-weight: 600; }
.detail-container { padding: 24px; max-width: 1000px; margin: 0 auto; }

.detail-top { display: flex; gap: 32px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-image {
  width: 400px; max-width: 100%; aspect-ratio: 1; background: #fafafa;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.detail-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail-info { flex: 1; min-width: 300px; }
.detail-info h2 { font-size: 20px; margin-bottom: 8px; line-height: 1.4; }
.detail-id { color: var(--text-lighter); font-size: 13px; margin-bottom: 12px; }
.detail-brand { color: var(--link); font-size: 14px; margin-bottom: 12px; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.detail-price-current { font-size: 24px; font-weight: 700; }
.detail-price-list { font-size: 16px; color: var(--text-lighter); }
.detail-discount {
  background: var(--danger); color: #fff; font-size: 13px; font-weight: 600;
  padding: 2px 10px; border-radius: 4px;
}
.detail-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 14px; }
.detail-stock { margin-bottom: 8px; font-size: 14px; }
.detail-delivery { color: var(--text-light); font-size: 14px; margin-bottom: 12px; }
.detail-sponsored {
  display: inline-block; background: #eee; color: var(--text-light); font-size: 11px;
  padding: 2px 10px; border-radius: 10px; margin-bottom: 12px;
}
.detail-color-variant { font-size: 13px; color: var(--text-light); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.detail-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.detail-actions a, .detail-actions button {
  padding: 8px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid var(--border);
  background: #fff; color: var(--text); text-decoration: none;
}
.detail-actions a:hover, .detail-actions button:hover { border-color: var(--primary); color: var(--primary); }

.detail-section {
  background: var(--card-bg); border-radius: 8px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.detail-section h3 { font-size: 15px; margin-bottom: 12px; color: var(--text); border-left: 3px solid var(--primary); padding-left: 10px; }
.detail-section table { width: 100%; font-size: 13px; }
.detail-section table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.detail-section table td:first-child { color: var(--text-light); width: 140px; white-space: nowrap; }
.detail-cat-level { padding-left: 0; }
.detail-cat-level.l2 { padding-left: 20px; }
.detail-cat-level.l3 { padding-left: 40px; }
.detail-badge-list { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-badge-item {
  background: #fff3e0; color: #e65100; font-size: 12px; padding: 2px 10px;
  border-radius: 3px; border: 1px solid #ffe0b2;
}
.detail-promo-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.detail-promo-imgs img { width: 60px; height: 24px; object-fit: contain; border-radius: 3px; border: 1px solid var(--border); }

/* 折叠的调试信息（抓取元数据） */
.detail-collapse { padding: 12px 20px; }
.detail-collapse > summary {
  font-size: 14px; color: var(--text-light); cursor: pointer; list-style: none;
  border-left: 3px solid var(--border); padding-left: 10px;
}
.detail-collapse > summary::-webkit-details-marker { display: none; }
.detail-collapse > summary::before { content: '▶ '; font-size: 10px; }
.detail-collapse[open] > summary::before { content: '▼ '; }
.detail-collapse > table { margin-top: 12px; }

/* ===== 详情页分析面板 ===== */
.analytics-panel {
  background: var(--card-bg); margin: 16px 0 24px; padding: 20px;
  border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.analytics-panel .tab-bar { margin-bottom: 16px; }
.atab-pane { min-height: 80px; }

.metric-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.metric-card {
  flex: 1 1 160px; background: var(--bg); border-radius: 6px; padding: 12px 14px;
  border: 1px solid var(--border);
}
.metric-card .metric-label { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.metric-card .metric-value { font-size: 18px; font-weight: 700; color: var(--text); }
.metric-empty { color: var(--text-lighter); font-size: 13px; padding: 20px 0; text-align: center; }
.metric-note { font-size: 12px; color: var(--text-light); line-height: 1.7; margin-top: 8px; }
.metric-note b { color: var(--text); }

/* 百分位条 */
.pct-list { margin-bottom: 16px; }
.pct-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.pct-label { width: 70px; font-size: 13px; color: var(--text-light); flex-shrink: 0; }
.pct-bar { flex: 1; height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.pct-fill { height: 100%; background: var(--primary); border-radius: 5px; transition: width 0.3s; }
.pct-value { width: 44px; font-size: 13px; font-weight: 600; color: var(--text); text-align: right; flex-shrink: 0; }
.pct-hint { width: 70px; font-size: 11px; color: var(--text-lighter); flex-shrink: 0; }

/* 竞品表 */
.competitor-title { font-size: 14px; margin: 16px 0 8px; color: var(--text); }
.competitor-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.competitor-table th { text-align: left; padding: 8px 10px; background: var(--bg); color: var(--text-light); font-weight: 500; border-bottom: 1px solid var(--border); }
.competitor-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.competitor-table .cell-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.competitor-table .cell-title a { color: var(--link); }

/* ===== 详情页核心洞察卡片区 ===== */
.insight-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.insight-card {
  flex: 1 1 200px; min-width: 180px;
  background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.insight-card .insight-icon { font-size: 22px; margin-bottom: 6px; }
.insight-card .insight-title { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.insight-card .insight-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.4; }
.insight-card .insight-value .lifecycle-badge { font-size: 18px; padding: 6px 16px; margin: 0; }
.insight-card .insight-hint { font-size: 12px; color: var(--text-lighter); margin-top: 8px; line-height: 1.6; }

/* 分类面包屑（替代原技术性分类表格） */
.detail-crumbs { font-size: 13px; color: var(--text-light); padding: 10px 2px; }

/* 生命周期徽章 */
.lifecycle-badge {
  display: inline-block; font-size: 18px; font-weight: 700; padding: 10px 20px;
  border-radius: 8px; margin-bottom: 8px;
}
.lifecycle-badge.stage-new { background: #e0f2fe; color: #0369a1; }
.lifecycle-badge.stage-growth { background: #dcfce7; color: #16a34a; }
.lifecycle-badge.stage-mature { background: #f3f4f6; color: #555; }
.lifecycle-badge.stage-decline { background: #fef2f2; color: #d0021b; }
.lifecycle-badge.stage-unknown { background: #f5f5f5; color: #999; }

/* 关联信号 */
.signal-box { padding: 12px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.signal-box.signal-flagged { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.signal-box.signal-normal { background: var(--bg); color: var(--text-light); border: 1px solid var(--border); }

/* ===== 评论变化 ===== */
.change-up { color: #16a34a; font-weight: 600; }
.change-down { color: #d0021b; font-weight: 600; }
.change-flat { color: #999; }

.change-badge {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px;
  font-weight: 600;
}
.change-badge.change-up { background: #dcfce7; color: #16a34a; }
.change-badge.change-down { background: #fef2f2; color: #d0021b; }
.change-badge.change-flat { background: #f5f5f5; color: #999; }

.card-change-badge {
  position: absolute; bottom: 4px; left: 4px;
  display: flex; flex-wrap: wrap; gap: 2px;
  z-index: 2;
}

.signal-icon { font-size: 14px; cursor: default; }
.signal-icon.anomaly { animation: anomaly-pulse 1.5s ease-in-out infinite; }

@keyframes anomaly-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 关注按钮 ===== */
.watch-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; cursor: pointer; font-size: 14px; line-height: 1;
  transition: all 0.15s;
}
.watch-btn:hover { border-color: var(--star); }
.watch-btn.active { border-color: var(--star); background: #fff8e1; }

.watch-btn-sm {
  background: none; border: none; cursor: pointer; font-size: 14px;
  padding: 0 2px; line-height: 1; vertical-align: middle;
  opacity: 0.6; transition: opacity 0.15s;
}
.watch-btn-sm:hover, .watch-btn-sm.active { opacity: 1; }

/* ===== 监控看板 ===== */
.dashboard-controls {
  margin: 12px 16px; background: var(--card-bg); border-radius: 8px;
  padding: 12px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.tab-bar { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tab-item {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); cursor: pointer; font-size: 13px;
  transition: all 0.15s;
}
.tab-item:hover { border-color: var(--primary); }
.tab-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.result-count { font-size: 13px; color: var(--text-light); margin-left: auto; }

.metric-label {
  font-size: 10px;
  color: #6b7280;
  margin-bottom: 3px;
}
.metric-value {
  font-size: 14px;
  font-weight: 700;
}
.dashboard-table-wrap {
  margin: 0 16px; background: var(--card-bg); border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); overflow-x: auto;
}
.dashboard-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.dashboard-table th {
  text-align: left; padding: 10px 8px; background: #fafafa;
  border-bottom: 2px solid var(--border); font-weight: 600;
  white-space: nowrap;
}
.dashboard-table td {
  padding: 8px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dashboard-table tr:hover { background: #f8fafc; }
.dashboard-table tr.row-anomaly { background: #fff5f5; }
.dashboard-table tr.row-anomaly:hover { background: #fee2e2; }
.dashboard-table .cell-title {
  max-width: 300px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer; color: var(--link);
}
.dashboard-table tr[data-id] { cursor: pointer; }
.dashboard-table th.sortable {
  cursor: pointer; user-select: none;
}
.dashboard-table th.sortable:hover {
  background: #e8ecf1;
}
.dashboard-table .sort-arrow {
  font-size: 0.75em; color: var(--text-light);
}

/* ===== 套餐权益对照（5 张卡片并排：免费 / 卖家·月 / 卖家·年 / 专业·月 / 专业·年） ===== */
/* 5 张等宽并排；窄屏自动换行 */
.plan-cards { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.plan-card {
  position: relative; flex: 1 1 180px; min-width: 168px;
  border: 1px solid var(--border); border-radius: 12px; padding: 22px 14px 16px;
  display: flex; flex-direction: column; background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.plan-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.plan-card.popular { border-color: #1677ff; box-shadow: 0 4px 16px rgba(22,119,255,0.12); }
.plan-card.current { border-color: #0aaf5c; background: #f6fdf9; }
.plan-card-ribbon {
  position: absolute; top: -1px; right: -1px; font-size: 12px; font-weight: 600;
  color: #fff; background: #1677ff; padding: 4px 12px; border-radius: 0 12px 0 12px;
}
.plan-card-ribbon.current-ribbon { background: #0aaf5c; }

.plan-card-name { font-size: 15px; font-weight: 700; color: var(--text); }
.plan-card-tagline { font-size: 12px; color: var(--text-lighter); margin: 4px 0 12px; min-height: 18px; }
.plan-card-price { margin-bottom: 14px; }
.plan-price-main { font-size: 26px; font-weight: 700; color: #d4380d; line-height: 1.1; }
.plan-price-unit { font-size: 14px; font-weight: 500; color: #d4380d; }
.plan-price-was { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.plan-price-was s { color: var(--text-lighter); }
.plan-price-save { font-size: 12px; color: #d46b08; font-weight: 600; margin-top: 2px; line-height: 1.4; }
.plan-off-tag {
  display: inline-block; background: #ff4d1c; color: #fff; font-size: 11px;
  border-radius: 4px; padding: 0 5px; margin-left: 2px; font-weight: 600;
}
.plan-price-note { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* 权益清单 */
.plan-card-feats { list-style: none; margin: 0 0 16px; padding: 0; flex: 1; }
.plan-card-feats li {
  position: relative; padding: 6px 0 6px 18px; font-size: 12px; color: var(--text);
  border-top: 1px dashed #f0f0f0; line-height: 1.4;
}
.plan-card-feats li:first-child { border-top: none; }
.plan-card-feats li::before {
  content: '✓'; position: absolute; left: 0; top: 6px;
  color: var(--primary); font-weight: 700;
}
/* 该档不含此项：灰显打叉，与含有的项形成对比 */
.plan-card-feats li.off { color: var(--text-lighter); }
.plan-card-feats li.off::before { content: '✗'; color: #d9d9d9; }

/* 卡片按钮 */
.plan-card-btn {
  width: 100%; padding: 9px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.plan-card-btn.buy { background: #ff4d1c; color: #fff; }
.plan-card-btn.buy:hover { background: #e63c0c; }
.plan-card-btn.renew { background: #fff; color: #1677ff; border: 1px solid #1677ff; }
.plan-card-btn.renew:hover { background: #1677ff; color: #fff; }
.plan-card-btn.disabled { background: #f0f0f0; color: var(--text-lighter); cursor: default; }

/* ===== 个人中心（我的订阅）布局 ===== */
/* 居中容器：卡片整体水平居中，左右留边，避免出现右侧大片空白 */
.profile-page {
  max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px;
}
.profile-page .dashboard-table-wrap { margin: 0; }
.profile-card { padding: 20px 24px; }
.profile-card + .profile-card { margin-top: 16px; }
.profile-card-title {
  margin: 0 0 16px; font-size: 17px; font-weight: 600; color: var(--text);
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  .profile-page { padding: 16px 12px 32px; }
  .profile-card { padding: 16px; }
}

/* ===== 支付弹窗折扣码 ===== */
.pay-discount-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.pay-discount-label {
  flex: 0 0 auto; font-size: 14px; color: var(--text-light); width: 56px; text-align: right;
}
.pay-discount-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; text-transform: uppercase;
}
.pay-discount-input:focus { outline: none; border-color: var(--primary); }
.pay-discount-hint {
  font-size: 12px; min-height: 16px; margin: 0 0 8px 66px; text-align: left;
}
.pay-discount-hint.ok { color: #16a34a; }
.pay-discount-hint.error { color: var(--danger); }

/* ===== 支付弹窗：续费/变更周期的固定摘要 ===== */
.pay-fixed-summary {
  margin-bottom: 12px; padding: 14px 16px; border-radius: 8px;
  background: #f0f7ff; border: 1px solid #bae0ff; text-align: center;
}
.pay-fixed-main { font-size: 17px; font-weight: 700; color: #1677ff; }
.pay-fixed-sub { font-size: 12px; color: var(--text-lighter); margin-top: 4px; }
/* 提示为空时不占位（如续费场景，说明已并入摘要） */
#payPriceHint:empty { display: none; }

/* ===== 支付弹窗费用明细 ===== */
.pay-summary {
  margin: 4px 0 12px; padding: 12px 14px; border-radius: 8px;
  background: #fafafa; border: 1px solid var(--border); text-align: left;
}
.pay-summary.has-off { background: #fffdf5; border-color: #ffe7ba; }
.pay-sum-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--text-light); line-height: 1.6;
}
.pay-sum-row + .pay-sum-row { margin-top: 6px; }
.pay-sum-label { flex: 0 0 auto; }
.pay-sum-was { color: var(--text-lighter); text-decoration: line-through; }
.pay-sum-off { color: #d46b08; font-weight: 600; }
.pay-sum-tag {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px;
  font-size: 12px; font-weight: 500; color: #d46b08;
  background: #fff3e0; border: 1px solid #ffd591;
}
/* 应付金额行：顶部细分隔线 + 大号醒目金额 */
.pay-sum-pay {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 15px; color: var(--text);
}
.pay-sum-pay .pay-sum-label { font-weight: 600; }
.pay-sum-amount { font-size: 24px; font-weight: 700; color: #d4380d; line-height: 1.2; }

/* ===== 已购服务操作按钮 ===== */
.sub-act {
  display: inline-block; min-width: 56px; padding: 4px 12px; margin-right: 8px;
  border-radius: 4px; font-size: 13px; cursor: pointer; border: 1px solid var(--border);
  background: #fff; color: var(--text); transition: all 0.15s;
}
.sub-act:last-child { margin-right: 0; }
.sub-renew { border-color: #1677ff; color: #1677ff; }
.sub-renew:hover { background: #1677ff; color: #fff; }
.sub-upgrade { border-color: #d46b08; color: #d46b08; }
.sub-upgrade:hover { background: #d46b08; color: #fff; }
@media (max-width: 900px) {
  .plan-card { flex: 1 1 45%; }
}
@media (max-width: 640px) {
  .plan-cards { gap: 12px; }
  .plan-card { flex: 1 1 100%; padding: 18px 16px 14px; }
  .plan-price-main { font-size: 24px; }
}

/* ===== 图表 ===== */
#historySection { margin-top: 16px; }
#historyChart {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff;
}
.history-summary {
  font-size: 13px; color: var(--text-light); margin-bottom: 8px;
}
.chart-tooltip {
  position: absolute; pointer-events: none;
  background: rgba(0,0,0,0.8); color: #fff; padding: 6px 10px;
  border-radius: 4px; font-size: 12px; white-space: nowrap;
  z-index: 100;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 10px 10px; }
  .product-card { padding: 8px; }
  .card-title { font-size: 13px; }
  .price-current { font-size: 14px; }
  .filter-panel, .stats-bar, .toolbar { margin: 10px; }
  .detail-top { flex-direction: column; }
  .detail-image { width: 100%; }
}

/* ===== 分类管理 ===== */
.cat-controls {
  margin: 12px 32px; background: var(--card-bg); border-radius: 16px;
  padding: 14px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cat-controls .cat-controls-row { flex-wrap: nowrap; border-top: none; padding-top: 0; align-items: center; gap: 10px; }
.cat-controls-row > input, .cat-controls-row > button { height: 32px; box-sizing: border-box; }
.cat-search { flex: 1; min-width: 180px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-family: inherit; }
.cat-search:focus { outline: none; border-color: var(--primary); }
.cat-controls-row .cat-stats { white-space: nowrap; flex: 0 0 auto; }
.cat-stats { font-size: 13px; color: var(--text-light); }

.cat-tree-wrap {
  margin: 0 32px 16px; background: var(--card-bg); border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px 0;
}
.cat-tree { max-height: calc(100vh - 260px); overflow: auto; text-align: left; padding: 12px 16px; }

/* 分组垂直树形图：按顶级分类分卡片，卡片内带连接线的垂直树 */
.tree-list { display: flex; flex-direction: column; gap: 16px; }

/* 一级大类多列并排 */
.cat-columns {
  white-space: nowrap;
  width: max-content; min-width: 100%;
}
.cat-col {
  display: inline-block; vertical-align: top;
  margin: 0 8px 8px 0;
  border: 1px solid #e8e8e8; border-radius: 10px; overflow: hidden;
  background: var(--card-bg);
}
.cat-col.enabled { border-color: #c8e6c9; }
.cat-col.partial { border-color: #d7ead9; }
.cat-col-body { white-space: nowrap; padding: 8px; width: max-content; }
.cat-col-body.cat-col-body-vert { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; width: auto; white-space: normal; }
.cat-col-body-vert > .cat-col { display: block; margin: 0; border: none; border-radius: 6px; background: transparent; }
.cat-col-body-vert > .cat-col.enabled { background: #e8f5e9; }
.cat-col-body-vert > .cat-col.partial { background: #f1f8f4; }
.cat-col-body-vert > .cat-col .cat-group-header { padding: 4px 8px; background: transparent; border-bottom: none; }
/* 非叶子节点按层级背景色 */
.cat-col-depth-0 { --depth-bg: #e3f2fd; --depth-bg-h: #cfdefb; }
.cat-col-depth-1 { --depth-bg: #e8f5e9; --depth-bg-h: #d4ecd7; }
.cat-col-depth-2 { --depth-bg: #fff3e0; --depth-bg-h: #ffe5c2; }
.cat-col-depth-3 { --depth-bg: #f3e5f5; --depth-bg-h: #e6d0ec; }
.cat-col-depth-4 { --depth-bg: #fce4ec; --depth-bg-h: #f6c9d8; }
.cat-col-depth-5 { --depth-bg: #e0f7fa; --depth-bg-h: #c6eef4; }
.cat-col > .cat-group-header { background: var(--depth-bg, #fafafa); }
.cat-col > .cat-group-header:hover { background: var(--depth-bg-h, #f3f3f3); }

/* 分组卡片 */
.cat-group { border: 1px solid #e8e8e8; border-radius: 12px; overflow: hidden; background: var(--card-bg); }
.cat-group.enabled { border-color: #c8e6c9; }
.cat-group.partial { border-color: #d7ead9; }
.cat-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer; user-select: none;
  background: #fafafa; border-bottom: 1px solid #f0f0f0;
}
.cat-group-header:hover { background: #f3f3f3; }
.cat-group.enabled > .cat-group-header { background: #e8f5e9; }
.cat-group.enabled > .cat-group-header:hover { background: #dcf2e2; }
.cat-group.partial > .cat-group-header { background: #f1f8f4; }
.cat-group.partial > .cat-group-header:hover { background: #e9f3ee; }
.cat-group-body { padding: 8px 8px 12px; }
.cat-group-name .cat-en { font-size: 15px; font-weight: 600; }
.cat-group-name .cat-zh { font-size: 13px; }
.cat-group-header .tree-dot { background: #d0d0d0; }
.cat-group.enabled > .cat-group-header .tree-dot { background: #16a34a; }

.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px; cursor: pointer; user-select: none;
  border: 1px solid transparent;
}
.tree-row:hover { background: #f0f0f0; }
.tree-row.enabled { background: #e8f5e9; }
.tree-row.enabled:hover { background: #dcf2e2; }
.tree-row.partial { background: #f1f8f4; }
.tree-row.partial:hover { background: #e9f3ee; }

/* 树形连接线列：竖线 / 拐角，靠 CSS 伪元素绘制以保证对齐 */
.tree-line-col { width: 20px; flex: 0 0 auto; align-self: stretch; position: relative; }
.tree-line-col.tree-vline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid #d0d0d0;
}
.tree-line-col.tree-corner-mid::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid #d0d0d0;
}
.tree-line-col.tree-corner-mid::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 50%; border-top: 1px solid #d0d0d0;
}
.tree-line-col.tree-corner-last::before {
  content: ''; position: absolute; left: 50%; top: 0; height: 50%; border-left: 1px solid #d0d0d0;
}
.tree-line-col.tree-corner-last::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 50%; border-top: 1px solid #d0d0d0;
}

.tree-marker { width: 16px; flex: 0 0 auto; display: flex; justify-content: center; }
.tree-arrow { font-size: 14px; color: var(--text-light); cursor: pointer; }
.tree-arrow:hover { color: var(--text); }
.tree-dot { width: 8px; height: 8px; border-radius: 50%; background: #d0d0d0; }
.tree-row.enabled .tree-dot { background: #16a34a; }

.tree-name { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; overflow: hidden; }
.cat-zh-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tree-name .cat-en { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-name .cat-zh { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.tree-name mark { background: #fff3cd; border-radius: 3px; padding: 0 2px; }
.tree-branch .tree-name .cat-en { font-weight: 600; }

.tree-tail { font-size: 13px; color: var(--text-light); white-space: nowrap; flex: 0 0 auto; }
.tree-tail.cat-badge-ok { color: #16a34a; }
.tree-tail.cat-badge-err { color: var(--danger); }
.tree-tail.cat-badge-none { color: var(--text-lighter); }

.cat-node.cat-root { border-bottom: 1px solid #f0f0f0; }
.cat-node.cat-root:last-child { border-bottom: none; }
.cat-row {
  display: flex; align-items: center; gap: 20px; padding: 20px 40px;
  font-size: 30px;
}
.cat-row-root { font-weight: 600; background: #fafafa; cursor: default; }
.cat-row-root:hover { background: #f3f3f3; }
.cat-row-leaf { padding-left: 96px; font-weight: 400; }
.cat-row-leaf:hover { background: #f9f9f9; }

.cat-arrow {
  display: inline-block; width: 36px; text-align: center; cursor: pointer;
  color: var(--text-light); user-select: none; font-size: 28px;
}
.cat-arrow:hover { color: var(--text); }
.cat-indent { display: inline-block; width: 36px; }
.cat-cb { margin: 0; cursor: pointer; width: 36px; height: 36px; }

.cat-name { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cat-en { font-size: 32px; color: var(--text); }
.cat-zh { font-size: 26px; color: var(--text-light); }
.cat-name mark { background: #fff3cd; color: inherit; border-radius: 4px; padding: 0 2px; }

.cat-count { font-size: 26px; color: var(--text-light); font-weight: 500; white-space: nowrap; }
.cat-slug {
  font-size: 24px; color: var(--text-lighter); font-family: ui-monospace, Consolas, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px;
}
.cat-badge {
  font-size: 24px; padding: 6px 20px; border-radius: 20px; white-space: nowrap; font-weight: 500;
}
.cat-badge-ok { background: #e8f5e9; color: #16a34a; }
.cat-badge-err { background: #fef2f2; color: var(--danger); }
.cat-badge-none { background: #f0f0f0; color: var(--text-light); }

/* 卡片 + 标签云 */
.cat-card {
  margin: 0 32px 24px; background: var(--card-bg); border: 1px solid #eee;
  border-radius: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden;
}
.cat-card-head {
  display: flex; align-items: center; gap: 20px; padding: 24px 32px;
  background: #fafafa; cursor: pointer; user-select: none;
}
.cat-card-head:hover { background: #f3f3f3; }
.cat-card-head .cat-name { flex: 1; min-width: 0; }
.cat-card-head .cat-cb { flex: 0 0 auto; }
.cat-progress {
  flex: 0 0 240px; height: 16px; background: #e8e8e8; border-radius: 8px; overflow: hidden;
}
.cat-progress-bar {
  height: 100%; background: var(--primary); border-radius: 8px; transition: width .25s ease;
}
.cat-card-head .cat-count {
  font-size: 26px; color: var(--text-light); font-weight: 500;
  white-space: nowrap; min-width: 152px; text-align: right;
}
.cat-chips { display: flex; flex-wrap: wrap; gap: 16px; padding: 28px 32px; }
.cat-chips-empty { color: var(--text-lighter); font-size: 26px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 26px;
  border-radius: 36px; font-size: 26px; cursor: pointer; user-select: none;
  border: 1px solid #d4d4d4; background: #fff; color: var(--text-light);
  transition: background .12s, border-color .12s, color .12s;
}
.cat-chip:hover { border-color: var(--primary); color: var(--text); }
.cat-chip.on {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500;
}
.cat-chip-en { font-size: 26px; }
.cat-chip-zh { font-size: 22px; opacity: .75; }
.cat-chip.on .cat-chip-zh { opacity: .9; }

/* 卡片内递归缩进子树 */
.cat-card-body { padding: 4px 0 16px; }
.cat-sub-empty { padding: 14px 40px; color: var(--text-lighter); font-size: 24px; }
.cat-sub-row {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 32px 10px 12px; font-size: 26px; cursor: default;
}
.cat-sub-row:hover { background: #f7f7f7; }
.cat-sub-row .cat-arrow { font-size: 24px; }
.cat-sub-row .cat-arrow-dot { color: var(--text-lighter); cursor: default; }
.cat-sub-row .cat-cb { width: 30px; height: 30px; }
.cat-sub-row .cat-en { font-size: 26px; }
.cat-sub-row .cat-zh { font-size: 22px; }
.cat-sub-row .cat-count { font-size: 22px; min-width: 116px; text-align: right; }
.cat-sub-leaf .cat-name { opacity: .95; }
.cat-sub-children {
  margin-left: 30px;
  border-left: 1px dashed #e2e2e2;
}
.cat-sub-status { font-size: 22px; white-space: nowrap; min-width: 116px; text-align: right; }
.cat-sub-status.cat-badge-ok { color: #16a34a; }
.cat-sub-status.cat-badge-err { color: var(--danger); }
.cat-sub-status.cat-badge-none { color: var(--text-lighter); }

/* 列视图（Miller Columns）：每一级一列，横向排列，逐列下钻 */
.cat-cols-wrap {
  margin: 0 32px 48px; background: var(--card-bg); border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px 0;
}
.cat-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 24px 16px; border-bottom: 1px solid #f0f0f0;
  font-size: 24px; color: var(--text-light);
}
.cat-crumb { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cat-crumb:hover { color: var(--primary); }
.cat-crumb.cur { color: var(--text); font-weight: 600; cursor: default; }
.cat-crumb .cat-en { font-size: 24px; }
.cat-crumb .cat-zh { font-size: 20px; }
.cat-crumb-sep { color: var(--text-lighter); }
.cat-cols {
  display: flex; align-items: stretch;
  max-height: calc(100vh - 480px);
  overflow-x: auto; overflow-y: hidden;
}
.cat-col:last-child { border-right: none; }
.cat-col-empty { padding: 20px 24px; color: var(--text-lighter); font-size: 24px; }
.cat-col-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 12px 20px 10px 16px;
  border-bottom: 1px solid #f0f0f0; background: #fafafa;
  position: sticky; top: 0; z-index: 1;
}
.cat-col-title { font-size: 24px; font-weight: 600; color: var(--text); }
.cat-col-sub { font-size: 20px; color: var(--text-lighter); white-space: nowrap; }
.cat-col-list { padding: 4px 0; }
.cat-col-item {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px 12px 16px; cursor: pointer; user-select: none;
  border-left: 4px solid transparent;
}
.cat-col-item:hover { background: #f5f5f5; }
.cat-col-item.enabled { background: #e8f5e9; }
.cat-col-item.partial { background: #f1f8f4; }
.cat-col-item.enabled:hover { background: #dcefdd; }
.cat-col-item.partial:hover { background: #e6f1ea; }
.cat-col-item.selected {
  border-left-color: var(--primary); font-weight: 600;
}
.cat-col-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-col-info .cat-en { font-size: 26px; color: var(--text); }
.cat-col-info .cat-zh { font-size: 22px; color: var(--text-light); }
.cat-col-info mark { background: #fff3cd; color: inherit; border-radius: 4px; padding: 0 2px; }
.cat-col-tail {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; color: var(--text-light); white-space: nowrap;
}
.cat-col-tail.cat-badge-ok { color: #16a34a; }
.cat-col-tail.cat-badge-err { color: var(--danger); }
.cat-col-tail.cat-badge-none { color: var(--text-lighter); }
.cat-col-count { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.cat-col-item .cat-en { font-size: 26px; }
.cat-col-item .cat-zh { font-size: 22px; }
.cat-col-item .cat-cb { width: 30px; height: 30px; }
.cat-col-item .cat-count { font-size: 22px; min-width: 96px; text-align: right; }
.cat-col-item .cat-sub-status { font-size: 22px; min-width: 96px; text-align: right; }
.cat-col-arrow { color: var(--text-lighter); font-size: 26px; flex: 0 0 auto; cursor: pointer; padding: 4px 8px; margin: -4px -8px; }
.cat-col-item.selected .cat-col-arrow { color: var(--primary); }

@media (max-width: 640px) {
  .cat-row-leaf { padding-left: 64px; }
  .cat-slug { display: none; }
  .cat-card-head .cat-progress { flex-basis: 120px; }
  .cat-card-head .cat-count { min-width: 112px; }
}

/* ===== 注册 / 改密页 ===== */
.login-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-light); }
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 38px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: #f5f5f5; }

/* ===== 分类强制重爬标记（⟳）：灰=未标记，橙=已标记；主爬虫全量跑时绕过"已完成"判定 ===== */
.cat-force-rescrape {
  margin-left: 6px; padding: 0 6px; height: 20px; line-height: 18px;
  font-size: 12px; border: 1px solid #d0d0d0; border-radius: 4px;
  background: #fff; color: var(--text-light); cursor: pointer; flex: 0 0 auto;
}
.cat-force-rescrape:hover { border-color: var(--primary); color: var(--primary); }
.cat-force-rescrape.on {
  background: #fff3e0; border-color: #ff9800; color: #e65100; font-weight: 600;
}
.cat-force-rescrape.on:hover { background: #ff9800; color: #fff; border-color: #ff9800; }

/* ===== 分类外链标志（↗）：点击在新标签打开 Takealot 真实页面 ===== */
.cat-ext-link {
  margin-left: 6px; padding: 0 6px; height: 20px; line-height: 18px;
  font-size: 12px; border: 1px solid #d0d0d0; border-radius: 4px;
  background: #fff; color: var(--text-light); cursor: pointer; flex: 0 0 auto;
  text-decoration: none; display: inline-flex; align-items: center;
}
.cat-ext-link:hover { border-color: var(--primary); color: var(--primary); }

/* ===== ICP 备案号（页面底部，icp-footer.js 注入） ===== */
.icp-footer {
  width: 100%; text-align: center;
  padding: 18px 0 14px;
  font-size: 12px; color: var(--text-light);
}
.icp-footer a { color: var(--text-light); text-decoration: none; }
.icp-footer a:hover { color: var(--primary); text-decoration: underline; }
/* 登录/注册等 flex 居中布局页：绝对定位贴底，不参与 flex 排布 */
.icp-footer--overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  width: auto; padding: 8px 0;
}
