/* ============================================
   BEISAX 佰赛思 - 管理后台样式
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #0b2447;
  --primary: #0a84ff;
  --primary-dark: #0050b3;
  --danger: #e5493a;
  --ok: #0a9a8d;
  --text: #1c1f26;
  --text-dark: #0c1016;          /* 强调文字（比 --text 更深） */
  --text-light: #5f6b7a;
  --bg: #f3f5f9;
  --white: #ffffff;
  --border: #e3e7ee;
  --card-bg: #ffffff;          /* 卡片/表格行/弹窗背景 */
  --bg-soft: #f7f9fc;          /* 次级背景：hover/输入框/ghost 按钮 */
  --bg-blue: #eef5ff;          /* 选中/信息浅蓝背景 */
  --bg-green: #e6f7ec;         /* 成功/健康浅绿背景 */
  --text-faint: #b0b8c4;       /* 弱文字（次要提示） */
  --input-bg: #ffffff;         /* 输入框背景 */
  --radius: 12px;
  --shadow: 0 8px 24px rgba(11, 36, 71, .08);
  --shadow-sm: 0 2px 8px rgba(11, 36, 71, .10);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c93a2c; color: #fff; }
.btn-ghost { background: var(--bg-soft); border-color: var(--border); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  outline: none;
  transition: border .2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,132,255,.12); }
textarea.input { resize: vertical; min-height: 60px; }
.input-color {
  width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}
.input-file { display: block; margin: 10px 0; font-size: 13px; }

/* ---------- 通用控件 ---------- */
.page-actions { display: flex; gap: 10px; align-items: center; }
.page-hint {
  font-size: 12.5px;
  color: var(--text-light);
  background: var(--bg-blue);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 16px;
}
.field-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 状态徽标 */
.state-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.state-on { background: #ddf6f3; color: #0a9a8d; }
.state-off { background: var(--bg-soft); color: var(--text-light); }

/* 排序按钮 */
.sort-btns { display: inline-flex; gap: 4px; }
.sort-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-light);
  font-size: 13px;
  line-height: 1;
  transition: all .2s;
}
.sort-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.sort-btn:disabled { opacity: .3; cursor: not-allowed; }

/* 行状态 */
tr.row-off td { opacity: .55; }
tr.row-off .td-title { text-decoration: line-through; }

/* 启用开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #ccd3dd;
  border-radius: 11px;
  transition: background .25s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--card-bg);
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- 图标选择器 ---------- */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.icon-option {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
  transition: all .2s;
  background: #fafbfd;
}
.icon-option svg { width: 22px; height: 22px; }
.icon-option:hover { border-color: var(--primary); color: var(--primary); }
.icon-option.active {
  border-color: var(--primary);
  background: var(--bg-blue);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,132,255,.15);
}

/* ---------- 公告列表 ---------- */
.notice-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.notice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.notice-card .nc-main { flex: 1; min-width: 0; }
.notice-card .nc-title {
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.notice-card .nc-date { font-size: 12px; color: var(--text-light); font-weight: 400; }
.notice-card .nc-content {
  font-size: 13px;
  color: var(--text-light);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.notice-card.off .nc-title, .notice-card.off .nc-content { opacity: .5; }

/* ---------- 图片管理 ---------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.image-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.image-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.image-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-soft);
}
.image-card .ic-name {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.image-card .ic-size { font-size: 11px; color: var(--text-lighter, #9aa5b5); }
.image-card .ic-del {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-light);
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all .2s;
}
.image-card .ic-del:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 仪表盘：趋势图 + 排行 ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding: 10px 6px 0;
  border-bottom: 1px solid var(--border);
}
.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  min-width: 0;
}
.trend-col .tc-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.trend-col .bar {
  width: 14px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .4s;
}
.bar.pv { background: linear-gradient(180deg, #0a84ff, #5cabff); }
.bar.click { background: linear-gradient(180deg, #ff9a44, #ffb36e); }
.trend-col .tc-day { font-size: 11px; color: var(--text-light); }
.trend-col .tc-val { font-size: 10.5px; color: var(--text-light); }
.chart-note { font-size: 12px; color: var(--text-light); margin-top: 8px; }
.click-rank { display: flex; flex-direction: column; gap: 6px; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.rank-item .rk-no {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--text-light);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-item:nth-child(-n+3) .rk-no { background: #ffe9d6; color: #f07700; }
.rank-item .rk-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
}
.rank-item .rk-count {
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.rank-empty { color: var(--text-light); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------- 图床链接 ---------- */
.image-card.remote { border-style: dashed; }
.image-card .remote-badge {
  display: inline-block;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #00b3a4);
  padding: 1px 8px;
  border-radius: 8px;
  margin-top: 4px;
}

/* ---------- 附件列表 ---------- */
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 13px;
}
.file-item .fi-icon { font-size: 18px; }
.file-item .fi-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
}
.file-item .fi-size { color: var(--text-light); font-size: 12px; flex-shrink: 0; }
.file-item .fi-del {
  color: var(--text-light);
  font-size: 12.5px;
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: all .2s;
}
.file-item .fi-del:hover { border-color: var(--danger); color: var(--danger); }
.file-empty { color: var(--text-lighter, #9aa5b5); font-size: 12.5px; }

/* ---------- 购买链接编辑器 ---------- */
.buylink-add {
  display: grid;
  grid-template-columns: 110px 1fr 1.4fr auto;
  gap: 8px;
  margin-top: 8px;
}
.bl-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--p-color, #0a84ff);
  flex-shrink: 0;
}
.bl-chip.plain { background: #eef2f8; color: var(--text-light); }

/* ---------- 多语言输入 ---------- */
.ml-inputs { display: flex; flex-direction: column; gap: 6px; }
.ml-input {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.ml-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 8px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px 0 0 8px;
  letter-spacing: .5px;
}
.ml-input .input { border-radius: 0 8px 8px 0; }
.lang-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lang-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.lang-check:hover { border-color: var(--primary); }
.lang-check.on { border-color: var(--primary); background: var(--bg-blue); color: var(--primary-dark); font-weight: 600; }
.lang-check input { accent-color: var(--primary); }

/* ---------- AI 助手 ---------- */
.ai-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ai-tab {
  padding: 8px 18px;
  font-size: 13.5px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: var(--card-bg);
  color: #5a6b85;
  cursor: pointer;
  transition: all .2s;
}
.ai-tab:hover { border-color: var(--primary); color: var(--primary); }
.ai-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
/* 多选语言 chips */
.ai-lang-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.ai-lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 12.5px;
  color: #5a6b85;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.ai-lang-chip:hover { border-color: var(--primary); color: var(--primary); }
.ai-lang-chip.on {
  background: var(--bg-blue);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}
.ai-lang-chip input { display: none; }

/* 状态卡行布局 + 配置引导 */
.ai-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-status-row .card-desc { flex: 1; min-width: 200px; }
.ai-status-on { color: #2ea043; font-weight: 600; }
.ai-status-off { color: #e5493a; font-weight: 600; }

/* 快速开始引导卡 */
.ai-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ai-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.ai-quick-item {
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all .2s;
  background: var(--card-bg);
}
.ai-quick-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(10, 132, 255, .12); transform: translateY(-1px); }
.ai-quick-item .q-icon { font-size: 20px; display: block; margin-bottom: 6px; }
.ai-quick-item b { font-size: 13.5px; color: var(--text-dark); }
.ai-quick-item p { font-size: 12px; color: var(--text-light); margin: 4px 0 0; line-height: 1.5; }
@media (max-width: 900px) { .ai-quick-grid { grid-template-columns: repeat(2, 1fr); } }

/* 设置页定位闪烁 */
.highlight-flash { animation: hlflash 1.2s ease-out; }
@keyframes hlflash {
  0% { box-shadow: 0 0 0 3px rgba(10, 132, 255, .35); }
  100% { box-shadow: 0 0 0 3px transparent; }
}

/* 任务日志高亮 */
.log-line { display: flex; gap: 6px; align-items: flex-start; }
.log-line .log-time { color: #6b8bb8; flex-shrink: 0; }
.ai-log .log-ok { color: #7ce7b9; }
.ai-log .log-err { color: #ff9a8a; }
.ai-log .log-info { color: #9fd0ff; }
.ai-log .log-line::before { content: '·'; color: #6b8bb8; }
.ai-log .log-ok::before { content: '✓'; color: #7ce7b9; margin-right: 4px; }
.ai-log .log-err::before { content: '✗'; color: #ff9a8a; margin-right: 4px; }

.ai-log {
  margin-top: 14px;
  background: #0b2447;
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.8;
  color: #9fd0ff;
  font-family: Consolas, Monaco, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}
.ai-log .log-ok { color: #7ce7b9; }
.ai-log .log-err { color: #ff9a8a; }
.ai-log .log-info { color: #9fd0ff; }
.ai-status-on {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 12px;
  background: #ddf6f3;
  color: #0a9a8d;
  font-size: 12.5px;
  font-weight: 700;
}
.ai-status-off {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 12px;
  background: #ffe9e7;
  color: #e5493a;
  font-size: 12.5px;
  font-weight: 700;
}
.ai-preview {
  margin-top: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
  display: none;
}
.ai-preview.show { display: block; }
.ai-preview .pv-title { font-weight: 700; color: var(--navy); }
.ai-preview .pv-label { color: var(--text-light); font-size: 12px; margin-top: 6px; }

/* AI 高级配置折叠区 */
.ai-advanced {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0 14px;
  background: #fafbfd;
}
.ai-advanced summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-light);
  user-select: none;
}
.ai-advanced summary:hover { color: var(--primary); }
.ai-advanced[open] { padding-bottom: 14px; }

/* ---------- 备份列表 ---------- */
.backup-list { display: flex; flex-direction: column; gap: 8px; }
.backup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 13px;
}
.backup-item .bi-name { font-weight: 600; color: var(--navy); }
.backup-item .bi-time { color: var(--text-light); font-size: 12px; }
.backup-item .bi-size { color: var(--text-light); font-size: 12px; }
.backup-item .bi-restore {
  margin-left: auto;
  padding: 4px 14px;
  font-size: 12.5px;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  transition: all .2s;
}
.backup-item .bi-restore:hover { background: var(--primary); color: #fff; }
.backup-item .bi-rename,
.backup-item .bi-del {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #d9d9d9;
  color: #666;
  border-radius: 6px;
  background: var(--card-bg);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.backup-item .bi-rename:hover { border-color: var(--primary); color: var(--primary); }
.backup-item .bi-del:hover { border-color: #d33; color: #d33; }
.backup-empty { color: var(--text-light); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 11px 26px;
  background: rgba(11, 36, 71, .93);
  color: #fff;
  font-size: 14px;
  border-radius: 10px;
  z-index: 9999;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: rgba(10, 154, 141, .95); }
.toast.err { background: rgba(229, 73, 58, .95); }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b2447 0%, #0d3a6e 55%, #0a84ff 130%);
  padding: 20px;
}
.login-card {
  width: 380px;
  background: var(--white);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo { margin-bottom: 14px; }
.login-card h1 { font-size: 22px; color: var(--navy); margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-hint {
  font-size: 12px;
  color: var(--text-lighter, #9aa5b5);
  margin-top: 4px;
}
.login-err {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin-top: 12px;
}

/* ---------- 主界面布局 ---------- */
.main-view {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 800;
}
/* 移动端底部导航（默认隐藏，≤900px 显示） */
.mobile-tabbar { display: none; }
/* 移动端铃铛（≤900px 显示，固定右上角） */
.mob-bell {
  display: none;
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 19px;
  box-shadow: 0 6px 16px rgba(11, 36, 71, .15);
  z-index: 950;
  cursor: pointer;
}
.mob-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e5493a;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.side-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.side-sub { font-size: 11px; color: rgba(255,255,255,.55); }
.side-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }
.side-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 14px;
  transition: all .2s;
}
.side-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 8px; }
.side-link {
  color: rgba(255,255,255,.65);
  font-size: 13px;
  background: none;
  border: none;
  text-align: left;
  padding: 4px 6px;
  transition: color .2s;
}
.side-link:hover { color: #fff; }
.side-link.danger:hover { color: #ff8a80; }

.content {
  flex: 1;
  margin-left: 220px;
  padding: 28px 32px 60px;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 20px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-head .page-title { margin-bottom: 0; }

/* ---------- 仪表盘 ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card.clickable {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11, 36, 71, .12);
}
.stat-card.clickable::after {
  content: '查看 →';
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  color: var(--primary);
  opacity: 0;
  transition: opacity .15s;
}
.stat-card.clickable:hover::after { opacity: 1; }
.stat-card .num { font-size: 30px; font-weight: 800; color: var(--navy); }
.stat-card .label { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.dash-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.dash-panel h3 { font-size: 15px; margin-bottom: 12px; }
.h3-sub { font-size: 11.5px; font-weight: 400; color: var(--text-light); margin-left: 6px; }
.trend-col.clickable { cursor: pointer; }
.trend-col.clickable:hover .tc-bars .bar { filter: brightness(1.15); }
.rank-item.clickable { cursor: pointer; border-radius: 6px; padding: 3px 6px; margin: 0 -6px; transition: background .15s; }
.rank-item.clickable:hover { background: #f4f8ff; }

/* ---------- 仪表盘：AI 分析 ---------- */
.ai-analyze-panel { margin-bottom: 18px; }
.ai-analyze-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.ai-analyze-result {
  max-height: 460px;
  overflow: auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-analyze-result.loading {
  color: var(--text-light);
  font-style: italic;
}
.ai-analyze-result:empty { display: none; }
.ai-analyze-result h4 {
  font-size: 14px;
  color: var(--navy);
  margin: 14px 0 6px;
}
.ai-analyze-result h4:first-child { margin-top: 0; }
.ai-analyze-result ul { padding-left: 20px; margin: 4px 0; }
.ai-analyze-result li { margin: 3px 0; }
.ai-analyze-result b { color: var(--navy); }
.ai-analyze-result .ai-note { font-size: 12px; color: var(--text-light); margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.dash-tips { list-style: none; }
.dash-tips li {
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--text-light);
  border-bottom: 1px dashed var(--border);
}
.dash-tips li:last-child { border-bottom: none; }
.dash-tips code {
  background: #eef2f8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--primary-dark);
}

/* ---------- 表格 ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar .input { max-width: 260px; }
.toolbar-count { font-size: 13px; color: var(--text-light); margin-left: auto; }
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: 66vh;
}
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
.table tr:hover td { background: #fafcff; }
.td-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-soft);
}
.td-title {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-chip.hot { background: #ffe9e7; color: #e5493a; }
.badge-chip.new { background: #ddf6f3; color: #0a9a8d; }
.badge-chip.sale { background: #fff0df; color: #f07700; }
.badge-chip.none { background: var(--bg-soft); color: var(--text-light); }
.cat-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--bg-blue);
  color: var(--primary-dark);
  white-space: nowrap;   /* 分类名单行显示（如即热式电热壶饮水机8 字，换行会变成竖排） */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.op-btn {
  padding: 4px 12px;
  font-size: 12.5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-light);
  margin-right: 6px;
  transition: all .2s;
}
.op-btn.edit:hover { border-color: var(--primary); color: var(--primary); }
.op-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.empty-row td { text-align: center; padding: 40px; color: var(--text-light); }

/* ---------- 轮播卡片 ---------- */
.slide-list { display: flex; flex-direction: column; gap: 14px; }
.slide-card {
  display: flex;
  gap: 16px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  align-items: center;
}
.slide-preview {
  width: 240px;
  height: 90px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.slide-preview img {
  height: 72px;
  width: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.3));
}
.slide-preview .sp-text { flex: 1; min-width: 0; }
.slide-preview .sp-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-preview .sp-kicker {
  font-size: 11px;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-info { flex: 1; min-width: 0; }
.slide-info .si-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.slide-info .si-desc {
  font-size: 12.5px;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.slide-actions { flex-shrink: 0; }
.slide-card.off { opacity: .55; }
.slide-card.off .slide-preview { filter: grayscale(.6); }

/* ---------- 表单卡片 ---------- */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  max-width: 640px;
}
.form-card h3 { font-size: 15px; margin-bottom: 16px; color: var(--navy); }
.card-desc { font-size: 13px; color: var(--text-light); margin-bottom: 14px; }

/* ---------- SEO：Google 搜索结果预览 ---------- */
.seo-preview-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.sp-label { font-size: 11px; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.sp-title { font-size: 18px; color: #1a0dab; line-height: 1.35; margin-bottom: 2px; overflow-wrap: break-word; }
.sp-url { font-size: 13px; color: #0d652d; margin-bottom: 6px; overflow-wrap: break-word; }
.sp-desc { font-size: 13px; color: #4d5156; line-height: 1.5; overflow-wrap: break-word; }
.sp-meter { font-size: 12px; color: var(--text-light); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.sp-state { font-weight: 700; }
.sp-state.sp-warn { color: #b8860b; }
.sp-state.sp-good { color: #0d652d; }
.sp-state.sp-bad { color: #c5221f; }

/* ---------- 账号安全：状态面板 / 登录日志 / 密码强度条 ---------- */
.sec-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.sec-item { display: flex; flex-direction: column; gap: 2px; }
.sec-k { font-size: 11.5px; color: var(--text-light); }
.sec-v { font-size: 13.5px; font-weight: 600; color: var(--navy); overflow-wrap: break-word; }
.sec-log { max-height: 220px; overflow-y: auto; }
.sec-log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; font-size: 12.5px;
  background: var(--card-bg); margin-bottom: 6px;
}
.sec-log-time { color: var(--text-light); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.sec-log-ip { flex: 1; min-width: 0; overflow-wrap: break-word; font-weight: 600; }
.sec-log-badge { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.sec-log-ok { color: #0d652d; background: rgba(13,101,45,.12); }
.sec-log-fail { color: #c5221f; background: rgba(197,34,31,.12); }
.pwd-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pm-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--border,#ddd); overflow: hidden; }
.pm-bar span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .25s ease, background .25s ease; }
.pm-label { font-size: 12px; font-weight: 700; width: 44px; flex: 0 0 44px; text-align: right; }

/* ---------- 登录后右下角安全状态卡片 ---------- */
.sec-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  width: 320px; max-width: calc(100vw - 40px);
  background: var(--white, #fff);
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 40, 80, .18);
  overflow: hidden;
  animation: secToastIn .3s ease;
}
.sec-toast.hidden { display: none; }
.sec-toast.out { animation: secToastOut .35s ease forwards; }
@keyframes secToastIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes secToastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}
.sec-toast-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--navy, #0b2447); color: #fff;
  font-size: 13px; font-weight: 700;
}
.sec-toast-close {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.sec-toast-close:hover { background: rgba(255,255,255,.18); }
.sec-toast-body { padding: 12px 14px 10px; }
.sec-toast-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 12.5px; margin-bottom: 7px;
}
.sec-toast-row span { color: var(--text-light, #667); flex: 0 0 auto; }
.sec-toast-row b { font-weight: 700; color: var(--navy, #0b2447); text-align: right; overflow-wrap: break-word; }
.sec-toast-warn {
  margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px;
  background: rgba(197, 34, 31, .09); color: #c5221f;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.sec-toast-warn.hidden { display: none; }
.sec-toast-foot { text-align: right; margin-top: 6px; }
.sec-toast-foot a { font-size: 12px; color: var(--primary, #0a84ff); text-decoration: none; font-weight: 600; }
.sec-toast-foot a:hover { text-decoration: underline; }

/* ---------- 开发者设置 ---------- */
.dev-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px;
}
.dev-item { display: flex; flex-direction: column; gap: 2px; }
.dev-k { font-size: 11.5px; color: var(--text-light); }
.dev-v { font-size: 13.5px; font-weight: 600; color: var(--navy); overflow-wrap: break-word; }
.dev-check-list { margin-top: 12px; }
.dev-check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 12.5px;
  background: var(--card-bg); margin-bottom: 6px;
}
.dev-check-name { flex: 1; font-weight: 600; overflow-wrap: break-word; }
.dev-check-badge { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.dev-check-ms { flex: 0 0 auto; color: var(--text-light); font-variant-numeric: tabular-nums; }
.dev-errors { max-height: 260px; overflow-y: auto; }
.dev-err-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 12px;
  background: var(--card-bg); margin-bottom: 6px;
}
.dev-err-time { flex: 0 0 auto; color: var(--text-light); font-variant-numeric: tabular-nums; }
.dev-err-type { flex: 0 0 auto; font-weight: 700; color: #c5221f; background: rgba(197,34,31,.1); padding: 1px 8px; border-radius: 12px; }
.dev-err-msg { flex: 1; min-width: 0; overflow-wrap: break-word; color: var(--navy); }
.dev-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dev-title-row h3 { margin: 0; }
.dev-title-row .btn { margin-left: 6px; }
.dev-sec-title {
  font-size: 12.5px; font-weight: 700; color: var(--text-light);
  margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--border);
}
.dev-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dev-tool {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.dev-tool b { font-size: 13px; color: var(--navy); }
.dev-tool .btn { margin: 8px 8px 0 0; }
@media (max-width: 900px) {
  .dev-tools { grid-template-columns: 1fr; }
}

/* ---------- 日志管理 ---------- */
.logs-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.logs-autorefresh { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-light); cursor: pointer; white-space: nowrap; }
.logs-box {
  background: #0d1b2e; border-radius: 10px;
  padding: 10px 12px; height: 420px; overflow-y: auto;
  font-family: Consolas, Menlo, monospace; font-size: 12px;
  line-height: 1.7;
}
.logs-line { display: flex; gap: 10px; align-items: baseline; padding: 1px 0; }
.lg-time { flex: 0 0 auto; color: #5c7a99; font-variant-numeric: tabular-nums; }
.lg-badge { flex: 0 0 auto; width: 90px; font-weight: 700; }
.lg-text { flex: 1; min-width: 0; overflow-wrap: break-word; color: #b8c7d9; white-space: pre-wrap; }
.lg-error .lg-badge { color: #ff6b5e; }
.lg-error .lg-text { color: #ff9d95; }
.lg-warn .lg-badge { color: #ffb84d; }
.lg-warn .lg-text { color: #e8c88a; }
.lg-info .lg-badge { color: #8ab4ff; }
.lg-other .lg-badge { color: #7d8fa5; }
.logs-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.logs-footer .field-hint { overflow-wrap: anywhere; }

/* ---------- 询盘管理 ---------- */
.side-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  background: #e5493a; color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.side-badge.hidden { display: none; }
.enq-item {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; background: var(--card-bg);
}
.enq-item.unread { border-color: var(--primary); background: var(--bg-blue); }
.enq-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.enq-name { font-size: 14px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.enq-tag { font-size: 11px; font-weight: 700; color: #fff; background: #e5493a; padding: 1px 8px; border-radius: 10px; }
.enq-time { font-size: 12px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.enq-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-light); margin-bottom: 8px; }
.enq-ip { color: var(--text-faint); font-size: 11.5px; }
.enq-msg {
  font-size: 13px; color: var(--text); line-height: 1.7;
  background: var(--bg-soft); border-radius: 8px; padding: 10px 12px;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.enq-actions { display: flex; gap: 8px; margin-top: 10px; }
/* ---------- FAQ 管理 ---------- */
.faq-item {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 10px; background: var(--card-bg);
}
.faq-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.faq-q { font-size: 13.5px; font-weight: 700; color: var(--navy); flex: 1; }
.faq-item-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.faq-a { font-size: 12.5px; color: var(--text-light); margin-top: 6px; line-height: 1.6; overflow-wrap: break-word; }
.faq-item .btn-sm[disabled] { opacity: .35; cursor: default; }

/* ---------- 网站信息：favicon / og 图 ---------- */
.favicon-row { display: flex; align-items: flex-start; gap: 14px; }
.favicon-preview {
  width: 64px; height: 64px; flex: 0 0 64px;
  border: 1px dashed var(--border); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--card-bg);
}
.favicon-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.favicon-preview.og-preview { width: 120px; height: 68px; flex-basis: 120px; border-radius: 8px; }
.favicon-inputs { flex: 1; min-width: 0; }
.favicon-url-row { display: flex; gap: 8px; }
.favicon-url-row .input { flex: 1; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-input {
  width: 44px; height: 38px; flex: 0 0 44px;
  padding: 2px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg); cursor: pointer;
}
.code-input { font-family: Consolas, Menlo, monospace; font-size: 12.5px; line-height: 1.6; }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 16px; }
.save-tip { font-size: 13px; color: var(--ok); }

.img-picker { display: flex; gap: 14px; align-items: flex-start; }
.img-preview {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-actions { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.danger-card { border: 1px solid rgba(229,73,58,.25); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(11, 36, 71, .5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 16px;
  width: 640px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.modal-sm { width: 400px; }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  font-size: 18px;
  color: var(--text-light);
  transition: all .2s;
}
.modal-close:hover { background: #ffe9e7; color: var(--danger); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* v2.14：商品分页、分区编辑与结构化 SKU */
.table-pagination{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:12px 0;color:var(--text-light);font-size:13px}
.table-pagination label{display:flex;align-items:center;gap:6px}.table-pagination .input-sm{width:74px;padding:6px 8px}
.product-section-tabs{position:sticky;top:-1px;z-index:4;display:flex;gap:6px;padding:8px;margin:-4px -4px 12px;background:var(--card,#fff);border-bottom:1px solid var(--border)}
.product-section-tabs button{border:0;background:transparent;color:var(--text-light);padding:7px 10px;border-radius:7px;cursor:pointer}
.product-section-tabs button.active,.product-section-tabs button:hover{background:var(--primary-soft,#e8f2ff);color:var(--primary,#0a84ff)}
.product-validation{margin:0 0 12px;padding:10px 14px;border:1px solid #ef9a9a;background:#fff2f2;color:#b42318;border-radius:8px;font-size:13px}
.product-validation ul{margin:6px 0 0 20px}.product-validation.hidden{display:none}
.sku-list{display:grid;gap:8px}.sku-row{display:grid;grid-template-columns:1fr 1.4fr .8fr .7fr 1fr auto auto;gap:7px;align-items:center;padding:8px;border:1px solid var(--border);border-radius:8px;background:var(--bg-soft,#f8fafc)}
.sku-enabled{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:12px}.source-fields{align-items:end}
#productModal .modal-foot{position:sticky;bottom:0;z-index:5;background:var(--card,#fff);box-shadow:0 -8px 18px rgba(0,0,0,.06)}
@media(max-width:900px){.sku-row{grid-template-columns:1fr 1fr}.table-pagination{justify-content:center;flex-wrap:wrap}.product-section-tabs{overflow-x:auto}.product-section-tabs button{white-space:nowrap}}
.modal-foot .btn-danger { margin-right: auto; }
.confirm-text { font-size: 14px; line-height: 1.8; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }           /* 侧边栏隐藏，改用底部导航 */
  .content { margin-left: 0; padding: 16px 14px 90px; }
  /* 仅登录后显示底部导航和铃铛 */
  body.logged-in .mob-bell { display: flex; align-items: center; justify-content: center; }
  body.logged-in .mobile-tabbar { display: flex; }
  /* 移动端底部导航 */
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(11, 36, 71, .08);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 0;
    transition: color .2s;
  }
  .mob-tab span { font-size: 10.5px; }
  .mob-tab.active { color: var(--primary); }
  .mob-tab:active { background: #f2f7ff; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .slide-card { flex-direction: column; align-items: stretch; }
  .slide-preview { width: 100%; }
}

/* ---------- 后台移动端（≤640px） ---------- */
@media (max-width: 640px) {
  .content { margin-left: 0; padding: 14px 10px 90px; min-width: 0; max-width: 100%; overflow-x: hidden; }
  .page-title { font-size: 18px; }
  .page-head { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  /* 消息盒子移动端：全屏化 */
  .msg-box {
    top: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .page-actions .btn { padding: 8px 12px; font-size: 12.5px; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 24px; }
  .stat-card .label { font-size: 11.5px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-panel { padding: 16px; }
  .trend-chart { height: 150px; }
  /* 表格横向滚动 + 紧凑 */
  .table-wrap { max-height: none; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; }
  .table-wrap th, .table-wrap td { padding: 8px 10px; font-size: 12px; }
  /* 弹窗全屏化 */
  .modal-mask { padding: 0; }
  .modal { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-body { padding: 14px; }
  .modal-header { padding: 12px 14px; }
  .modal-header h3 { font-size: 15px; }
  .form-card { padding: 16px; }
  .form-card h3 { font-size: 14px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .input { font-size: 14px; padding: 9px 10px; }
  /* 工具栏换行 */
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar .input { flex: 1 1 auto; min-width: 100px; }
  /* 分类/公告列表卡片化 */
  .nc-item, .slide-item { padding: 12px; }
  /* AI 面板 */
  .ai-analyze-result { font-size: 12.5px; padding: 12px; }
  .favicon-row { flex-direction: column; }
  .favicon-url-row { flex-wrap: wrap; }
  .favicon-url-row .input { flex: 1 1 100%; }
  /* 登录页 */
  .login-card { width: calc(100vw - 40px); padding: 26px 22px; }
  /* 确认框跟随 modal 全屏规则 */
}

/* ---------- 消息盒子 ---------- */
.bell-link { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; }
.bell-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e5493a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.msg-box {
  position: fixed;
  top: 64px;
  right: 24px;
  width: 460px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 100px);
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(11, 36, 71, .22);
  z-index: 1001;           /* 必须高于 modal-mask(1000)，否则被遮罩盖住 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: msgIn .28s cubic-bezier(.22, .9, .3, 1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.msg-box-head h3 { font-size: 16px; color: var(--navy); margin: 0; }
.msg-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
}
.msg-tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: transparent;
  border-radius: 10px 10px 0 0;
  font-size: 13.5px;
  color: var(--text-light);
  cursor: pointer;
  position: relative;
  transition: all .2s;
}
.msg-tab.active { background: #f2f7ff; color: var(--primary); font-weight: 700; }
.msg-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e5493a;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 2px;
}
.msg-box-body {
  flex: 1;
  min-height: 0;           /* flex 子项可收缩，否则内容撑破容器无法滚动 */
  overflow-y: auto;
  padding: 14px 16px;
}
.msg-pane { display: none; }
.msg-pane.active { display: block; }
.msg-box-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.task-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fbfcfe;
  transition: border-color .2s;
}
.task-item.running { border-color: #0a84ff; background: #f4f9ff; }
.task-item.done { border-color: #d6f0dd; }
.task-item.failed { border-color: #ffd8d4; background: #fff7f6; }
.task-item.queued { border-color: #f0e3c8; }
.task-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.task-type { font-weight: 700; color: var(--navy); font-size: 13.5px; }
.task-status { font-size: 11px; padding: 2px 10px; border-radius: 10px; font-weight: 600; }
.task-status.queued { background: #fdf3dd; color: #b07d1f; }
.task-status.running { background: #e3f2ff; color: #0a6fd1; }
.task-status.done { background: #e1f6e7; color: #1e8e4a; }
.task-status.failed { background: #ffe9e7; color: #e5493a; }
.task-meta { font-size: 11.5px; color: var(--text-light); }
.task-progress { margin: 8px 0 4px; position: relative; }
.task-bar {
  height: 6px;
  background: #eef1f6;
  border-radius: 3px;
  overflow: hidden;
}
.task-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0a84ff, #5cabff);
  border-radius: 3px;
  transition: width .5s;
}
.task-bar-fill.done { background: linear-gradient(90deg, #2ea043, #57c46c); }
.task-bar-fill.failed { background: #e5493a; }
.task-pct { font-size: 11px; color: var(--text-lighter); margin-left: 6px; }
.task-running-info {
  font-size: 12px;
  color: var(--primary);
  margin: 2px 0 0;
  font-weight: 500;
}
.task-running-info.done { color: #2ea043; }
.task-running-info.failed { color: #e5493a; }
.task-log-preview {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-actions { margin-top: 8px; display: flex; gap: 8px; }
.task-actions .btn { padding: 5px 12px; font-size: 12px; }
.msg-item {
  display: flex;
  gap: 10px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s;
  border-radius: 8px;
}
.msg-item:hover { background: #f6f9fd; }
.msg-item.unread { background: #f0f7ff; }
.msg-icon { font-size: 20px; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-title { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.msg-content { font-size: 12.5px; color: var(--text-light); margin-top: 3px; }
.msg-time { font-size: 11px; color: var(--text-lighter); margin-top: 4px; }
.msg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5493a;
  flex-shrink: 0;
  margin-top: 6px;
}
.msg-empty { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 13px; }
.log-line {
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.8;
  padding: 3px 0;
  border-bottom: 1px dashed #f0f2f6;
  word-break: break-all;
}
.log-line .log-time { color: var(--text-lighter); margin-right: 8px; }
.log-line.log-ok { color: #1e8e4a; }
.log-line.log-err { color: #e5493a; }
.log-line.log-info { color: var(--text); }
.log-select { width: 100%; margin-bottom: 10px; }
.log-select-title { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.msg-preview {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
}
.msg-preview .pv-title { font-weight: 700; color: var(--navy); font-size: 13px; }
.msg-preview .pv-body { font-size: 12.5px; color: var(--text); margin-top: 4px; line-height: 1.7; }
.msg-preview-actions { margin-top: 10px; display: flex; gap: 8px; }

/* 图标在名称前内联显示（仅移动端卡片模式显示，桌面端隐藏避免重复）
   注意：此规则必须在 640px 媒体查询之前定义 */
.cat-icon-inline { display: none; }
/* ---------- 移动端覆盖（放末尾确保优先于基础样式） ---------- */
@media (max-width: 640px) {
  /* 消息盒子全屏化 */
  .msg-box {
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }
  /* 分类表格卡片化：行变卡片，名称完整横排（避免窄列竖排） */
  .table-wrap table#catTable { min-width: 0; }
  .table-wrap thead#catHead { display: none; }
  .table-wrap tbody#catTableBody { display: grid; gap: 10px; }
  .table-wrap tbody#catTableBody tr {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    gap: 6px 10px;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
  }
  .table-wrap tbody#catTableBody tr.empty-row { text-align: center; }
  /* 名称行：图标 + 名称 + 描述 横排，占满第一行 */
  .table-wrap tbody#catTableBody td[data-label="名称"] {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 8px;
  }
  .table-wrap tbody#catTableBody td[data-label="名称"] .cat-icon-inline { display: inline-flex; align-items: center; }
  .table-wrap tbody#catTableBody td[data-label="名称"] b { font-size: 14px; }
  .table-wrap tbody#catTableBody td[data-label="名称"] br { display: none; }
  .table-wrap tbody#catTableBody td[data-label="名称"] span[style] { display: inline-block; }
  /* 隐藏手机端冗余的图标/标识列 */
  .table-wrap tbody#catTableBody td[data-label="图标"] { display: none; }
  .table-wrap tbody#catTableBody td[data-label="标识"] { display: none; }
  /* 第二行：排序 | 状态 | 商品数 | 操作（4 列 grid） */
  .table-wrap tbody#catTableBody tr > td:not([data-label="名称"]):not([data-label="图标"]):not([data-label="标识"]) {
    grid-row: 2;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
  }
  .table-wrap tbody#catTableBody td[data-label="排序"] { grid-column: 1; }
  .table-wrap tbody#catTableBody td[data-label="状态"] { grid-column: 2; color: var(--text); }
  .table-wrap tbody#catTableBody td[data-label="商品"] { grid-column: 3; }
  .table-wrap tbody#catTableBody td:last-child { grid-column: 4; justify-self: end; }
  .table-wrap tbody#catTableBody td[data-label="排序"] .sort-btns { gap: 4px; }
  .table-wrap tbody#catTableBody td[data-label="排序"] .sort-btn { width: 24px; height: 24px; }
  .table-wrap tbody#catTableBody td:last-child .op-btn { padding: 4px 8px; font-size: 11.5px; }
  .table-wrap tbody#catTableBody td::before { display: none; }
}

/* ---------- AI 运营分析报告（后台任务版） ---------- */
.report-sched-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2, #666); }
.report-sched-label select, .report-sched-label input { padding: 4px 6px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; background: var(--card-bg); }
.btn-sm { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: #fff0f0; color: #d33; border: 1px solid #f5c6c6; }
.btn-danger:hover { background: #ffe3e3; }
.report-history { margin-top: 14px; }
.report-history h4 { font-size: 14px; margin: 0 0 8px; color: #333; }
.report-item { border: 1px solid #e5e5e5; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--card-bg); }
.report-item.report-new { border-color: #4c9dff; box-shadow: 0 0 0 1px rgba(76, 157, 255, .25); }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-head b { font-size: 13.5px; color: #333; }
.report-badge { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--bg-blue); color: #2d6fd6; }
.report-time { font-size: 12px; color: var(--text-faint); flex: 1; }
.report-actions { display: inline-flex; gap: 6px; }
.report-body { margin-top: 10px; padding: 10px 12px; background: #fafafa; border-radius: 8px; font-size: 13px; line-height: 1.7; color: #444; }
.report-body h4 { font-size: 13.5px; margin: 10px 0 4px; color: #2d6fd6; }
.report-body li { margin-left: 18px; }
.report-body b { color: #333; }

/* ---------- 消息盒子：删除按钮 + 工具栏 ---------- */
.msg-pane-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 8px; }
.msg-pane-count { font-size: 12px; color: var(--text-faint); }
.msg-del-btn { flex-shrink: 0; width: 22px; height: 22px; border: none; border-radius: 50%; background: transparent; color: #bbb; font-size: 12px; cursor: pointer; line-height: 1; margin-left: 8px; }
.msg-del-btn:hover { background: #ffeded; color: #d33; }

/* 消息内预览卡片（公告/品牌结果快照） */
.msg-preview-card {
  margin-top: 8px;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #fafcff;
  padding: 10px 12px;
}
.msg-preview-card .mp-slogan { font-size: 13px; font-weight: 600; color: var(--primary); line-height: 1.4; }
.msg-preview-card .mp-label { font-size: 11px; color: var(--text-light); margin: 7px 0 2px; font-weight: 600; }
.msg-preview-card .mp-label:first-child { margin-top: 0; }
.msg-preview-card .mp-text { font-size: 12px; color: var(--text-light); line-height: 1.55; }
.msg-preview-card .mp-points { font-size: 12px; color: var(--text-light); margin: 2px 0 0; padding-left: 16px; }
.msg-preview-card .mp-points li { margin: 2px 0; line-height: 1.5; }
.msg-preview-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.msg-preview-actions .btn { padding: 4px 12px; font-size: 12px; }
.mp-applied { color: #2ea043; font-size: 12px; font-weight: 600; }

/* ---------- 图片管理增强（搜索/筛选/引用/批量/重命名） ---------- */
.img-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.img-filter { display: inline-flex; gap: 4px; }
.img-filter-btn { border: 1px solid #d9d9d9; background: var(--card-bg); color: #666; }
.img-filter-btn.active { background: #0a84ff; border-color: #0a84ff; color: #fff; }
.img-count { font-size: 12px; color: var(--text-faint); }
.img-toolbar-spacer { flex: 1; }
.img-selected { font-size: 12px; color: #0a84ff; font-weight: 600; }
.image-card { position: relative; }
.image-card.card-unused { border-style: dashed; border-color: #e0a33a; }
.ic-check { position: absolute; top: 6px; left: 6px; z-index: 2; background: rgba(255,255,255,.85); border-radius: 4px; padding: 1px 2px; }
.ic-check input { width: 15px; height: 15px; cursor: pointer; }
.ic-ref { font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-top: 4px; }
.ic-ref.used { background: #eef7ee; color: #2d7d2d; }
.ic-ref.unused { background: #fff7e8; color: #b97a12; }
.ic-actions { display: flex; gap: 6px; margin-top: 6px; }
.ic-btn { flex: 1; font-size: 11.5px; padding: 3px 0; border: 1px solid #d9d9d9; border-radius: 6px; background: var(--card-bg); cursor: pointer; color: #555; }
.ic-btn:hover { border-color: #0a84ff; color: #0a84ff; }
.ic-btn.ic-del { color: #d33; }
.ic-btn.ic-del:hover { border-color: #d33; background: #fff5f5; }

/* ---------- 图片引用列表弹窗 ---------- */
.img-ref-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.img-ref-empty { text-align: center; color: var(--text-faint); padding: 30px; }
.img-ref-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e5e5e5; border-radius: 8px; background: var(--card-bg); cursor: pointer; transition: all .15s; }
.img-ref-item:hover { border-color: #0a84ff; background: var(--bg-blue); }
.img-ref-icon { font-size: 13px; color: #555; white-space: nowrap; }
.img-ref-label { flex: 1; font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-ref-field { font-size: 11px; color: var(--text-faint); background: #f5f5f5; padding: 1px 6px; border-radius: 8px; }
.img-ref-go { font-size: 12px; color: #0a84ff; white-space: nowrap; }
.ic-ref.used { border: none; cursor: pointer; font-size: 11px; }
.ic-ref.used:hover { background: #dff0df; }
/* 引用弹窗标题：长 URL 防溢出 */
#imgRefTitle { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#imgRefHint { word-break: break-all; }

/* ---------- 商品编辑弹窗增强（折叠式多语言 + 实时预览） ---------- */
.modal-lg { width: 1000px; }
.product-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}
/* 多语言折叠控件 */
.ml-ops {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ml-copyzh, .ml-toggle {
  padding: 4px 12px;
  border: 1px solid var(--border, #e3e8f0);
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--navy, var(--navy));
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.ml-copyzh:hover { background: var(--bg-blue); border-color: #9dc6ff; color: #0a84ff; }
.ml-toggle:hover { background: #eef1f6; }
.ml-hidden { display: block; }
.ml-hidden[hidden] { display: none; }
/* 校验错误标红 */
.input-error { border-color: var(--danger, #e34d4d) !important; box-shadow: 0 0 0 2px rgba(227,77,77,.12); }
/* 保存后行高亮 */
@keyframes rowFlash {
  0%, 60% { background: #fff8dc; }
  100% { background: transparent; }
}
.row-flash { animation: rowFlash 2.2s ease; }
/* 实时预览卡片（模拟前台商品卡） */
.pf-preview {
  position: sticky;
  top: 0;
}
.pf-preview-title {
  font-size: 13px;
  color: var(--text-light, var(--text-light));
  margin-bottom: 10px;
  font-weight: 600;
}
.p-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(10,42,90,.08);
}
.p-card-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.p-card-img img { width: 100%; height: 100%; object-fit: cover; }
.p-card-noimg { color: var(--text-faint); font-size: 13px; }
.p-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ff7a45, #ff9a3d);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.p-card-title {
  padding: 12px 14px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy, var(--navy));
  line-height: 1.5;
  min-height: 21px;
}
.p-card-tags {
  padding: 8px 14px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.p-card-tags span {
  background: #fff5ec;
  color: #f2811d;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
}
.p-card-price {
  padding: 10px 14px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.p-card-price b { color: #f04f4f; font-size: 19px; }
.p-card-price s { color: var(--text-faint); font-size: 12px; }
.p-card-hint {
  padding: 0 14px 14px;
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
}
/* 移动端：预览移到表单下方 */
@media (max-width: 860px) {
  .product-form-grid { grid-template-columns: 1fr; }
  .pf-preview { position: static; order: -1; }
  .pf-preview-title { display: none; }
  .p-card { max-width: 260px; margin: 0 auto 8px; }
}

/* ---------- 商品管理功能扩展（批量操作/回收站/CSV/AI翻译/调价） ---------- */
.page-sub { font-size: 12px; font-weight: 400; color: var(--text-light, var(--text-light)); margin-left: 6px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.batch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-blue);
  border: 1px solid #cfe3ff;
  border-radius: 10px;
  flex-wrap: wrap;
}
.batch-count { font-size: 12px; color: #0a84ff; font-weight: 600; white-space: nowrap; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.input-sm { width: 130px; padding: 5px 10px; font-size: 12.5px; }
.toolbar-spacer { flex: 1; }
.lang-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lang-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.lang-check:hover { background: #eef4ff; }
.modal-tip { font-size: 12.5px; color: var(--text-light, var(--text-light)); line-height: 1.7; margin: 0 0 10px; }
.price-mode { display: flex; gap: 16px; }
.radio-inline { display: flex; align-items: center; gap: 5px; font-size: 13.5px; cursor: pointer; }
@media (max-width: 860px) {
  .lang-checks { grid-template-columns: 1fr; }
  .page-actions { gap: 6px; }
}

/* ---------- 商品长图（图床链接）编辑器 ---------- */
.longimg-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.longimg-item { display: flex; align-items: center; gap: 10px; }
.longimg-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-soft);
}
.fi-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-blue);
  color: #0a84ff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.longimg-add { display: flex; gap: 8px; }
.longimg-add .input { flex: 1; }
@media (max-width: 860px) {
  .longimg-add { flex-direction: column; }
}

/* ---------- 商品图片/长图多语言适配 ---------- */
.imglang-wrap { margin-top: 10px; padding: 10px 12px; background: var(--bg-soft); border-radius: 10px; }
.ml-opt-label { font-size: 12px; color: var(--text-light, var(--text-light)); }
.li-lang-group { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.li-lang-group:last-child { border-bottom: none; }
.li-lang-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.li-lang-tip { font-size: 11px; color: var(--text-faint); }
.li-lang-group .longimg-list { margin-bottom: 6px; }

/* ---------- 仪表盘电商化（KPI 卡/快捷操作/待办/分类环形/趋势切换） ---------- */
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-action {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--navy, var(--navy));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dash-action:hover { border-color: #9dc6ff; color: #0a84ff; background: var(--bg-blue); }
.dash-action.primary { background: linear-gradient(135deg, #0a84ff, #5cabff); border-color: transparent; color: #fff; }
.dash-action.primary:hover { opacity: .9; color: #fff; }

.kpi-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.kpi-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(10,42,90,.04);
  transition: transform .15s, box-shadow .15s;
}
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(10,42,90,.08); }
.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.kpi-blue .kpi-icon { background: var(--bg-blue); }
.kpi-orange .kpi-icon { background: #fff1e5; }
.kpi-green .kpi-icon { background: var(--bg-green); }
.kpi-purple .kpi-icon { background: #f0eaff; }
.kpi-label { font-size: 12.5px; color: var(--text-light, var(--text-light)); }
.kpi-num { font-size: 24px; font-weight: 800; color: var(--navy, var(--navy)); line-height: 1.3; }
.kpi-delta { font-size: 11.5px; margin-top: 2px; }
.kpi-delta .up { color: #e34d4d; font-weight: 600; }
.kpi-delta .down { color: #2ea043; font-weight: 600; }
.kpi-delta .flat { color: var(--text-faint); }
.kpi-delta i { font-style: normal; color: var(--text-faint); font-weight: 400; }

.todo-panel { margin-bottom: 14px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  font-family: inherit;
}
.todo-item:hover { background: var(--bg-soft); }
.todo-item.warn { border-left: 3px solid #ff9a44; }
.todo-item.danger { border-left: 3px solid #e34d4d; }
.todo-item.info { border-left: 3px solid #0a84ff; }
.todo-go { margin-left: auto; color: var(--text-faint); font-size: 13px; }
.todo-empty { color: var(--success, #2ea043); font-size: 13.5px; padding: 4px 0; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut {
  width: 150px; height: 150px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.donut-hole {
  position: absolute; inset: 22px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-hole b { font-size: 22px; color: var(--navy, var(--navy)); }
.donut-hole span { font-size: 11px; color: var(--text-light, var(--text-light)); }
.donut-legend { display: flex; flex-direction: column; gap: 7px; min-width: 140px; flex: 1; }
.donut-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.donut-item:hover { background: #f6f9fd; }
.donut-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy, var(--navy)); }
.donut-val { font-weight: 700; color: var(--text-light, var(--text-light)); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 8px; padding: 2px; }
.seg-btn {
  border: none; background: transparent;
  padding: 4px 12px; border-radius: 6px;
  font-size: 12px; color: var(--text-light, var(--text-light));
  cursor: pointer; font-family: inherit;
}
.seg-btn.active { background: var(--card-bg); color: #0a84ff; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

@media (max-width: 860px) {
  .kpi-cards { grid-template-columns: repeat(2, 1fr); }
  .donut-wrap { justify-content: center; }
}

/* KPI 卡迷你趋势图 */
.kpi-spark { margin-top: 6px; width: 100%; height: 30px; }
.kpi-spark-svg { width: 100%; height: 30px; display: block; }

/* KPI sparkline 交互：hover tooltip + 点击明细浮层 */
.sp-tip {
  position: fixed;
  z-index: 9999;
  background: rgba(28, 43, 74, .92);
  color: #fff;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.sp-pop {
  position: fixed;
  z-index: 9999;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 150px;
  box-shadow: 0 8px 28px rgba(10, 42, 90, .16);
  padding: 8px 12px;
}
.sp-pop-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, var(--navy));
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sp-pop-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  padding: 3px 0;
  color: var(--text-light, var(--text-light));
}
.sp-pop-row b { color: var(--navy, var(--navy)); }

/* ---------- 基础设置页 Tab 分组 ---------- */
.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.st-tab {
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-light, var(--text-light));
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.st-tab:hover { background: var(--card-bg); color: #0a84ff; }
.st-tab.active {
  background: var(--card-bg);
  color: #0a84ff;
  border-color: #cfe3ff;
  box-shadow: 0 2px 8px rgba(10, 132, 255, .12);
}
@media (max-width: 860px) {
  .st-tab { padding: 7px 12px; font-size: 12.5px; }
}

/* 基础设置：每组独立保存按钮（跟随 Tab 显隐） */
.group-save { margin: 4px 0 16px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* ---------- 暗色模式（data-theme=dark，设置页开关） ---------- */
[data-theme="dark"] {
  --navy: #7fb4ff;
  --text: #e3e8f0;
  --text-dark: #f0f4fa;          /* 暗色下强调文字更亮 */
  --text-light: #9aa6b5;
  --text-faint: #6b7684;
  --bg: #10151e;
  --card-bg: #1a2230;
  --white: #1a2230;
  --bg-soft: #232e3f;
  --bg-blue: #1e2b40;
  --bg-green: #1c2e24;
  --border: #2b3648;
  --input-bg: #141b26;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .30);
}
[data-theme="dark"] .side-item { color: #c6cfdb; }
[data-theme="dark"] .table th { background: #1f2939; color: var(--text-light); }
[data-theme="dark"] .table td { border-bottom-color: var(--border); }
[data-theme="dark"] .table tbody tr:hover { background: #202b3c; }
[data-theme="dark"] .img-search-bar, [data-theme="dark"] .img-toolbar { background: var(--card-bg); }
[data-theme="dark"] .image-card { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] img[src*="images/"], [data-theme="dark"] .td-img { filter: brightness(.9); }
[data-theme="dark"] .detail-mask, [data-theme="dark"] .modal-mask { background: rgba(0, 0, 0, .6); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { color-scheme: dark; }
[data-theme="dark"] .row-flash { animation: rowFlashDark 2.2s ease; }
@keyframes rowFlashDark {
  0%, 60% { background: #2b2610; }
  100% { background: transparent; }
}
[data-theme="dark"] .kpi-green .kpi-icon { background: #1c2e24; }


/* ---------- 顶部栏（全局搜索 / 主题 / 通知 / 用户） ---------- */
.main-view { flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  margin-left: 220px;                    /* 与 .content 对齐，避开全高侧边栏遮挡 */
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(11, 36, 71, .05);
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.topbar-search { position: relative; flex: 1; max-width: 420px; }
.global-search {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: all .18s;
}
.global-search:focus { background: var(--card-bg); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,132,255,.12); }
.gs-results {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
}
.gs-group { padding: 8px 14px 2px; font-size: 11px; color: var(--text-faint); font-weight: 700; }
.gs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.gs-item:hover, .gs-item.sel { background: var(--bg-blue); }
.gs-item .gs-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-item .gs-meta { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.gs-empty { padding: 14px; font-size: 12.5px; color: var(--text-faint); text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topbar-btn {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--text-light);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  position: relative;
  white-space: nowrap;             /* 防止文字被挤压换行（如"退出登录"竖排） */
  flex-shrink: 0;                  /* 不被压缩 */
}
.topbar-btn:hover { background: var(--bg-soft); color: var(--text); }
.topbar-btn.danger:hover { background: #ffecec; color: var(--danger); }
[data-theme="dark"] .topbar-btn.danger:hover { background: rgba(229,73,58,.15); }
.topbar-user { font-size: 13px; color: var(--text-light); padding: 0 6px; white-space: nowrap; }
.topbar .bell-link { width: auto; display: inline-flex; align-items: center; justify-content: center; }
.topbar .bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

/* 侧边栏分组标题 */
.side-group {
  padding: 14px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.38);
  letter-spacing: .5px;
}

/* 移动端：顶栏精简 */
@media (max-width: 900px) {
  .topbar { height: 50px; padding: 0 12px; gap: 8px; margin-left: 0; }   /* 侧边栏已隐藏，顶栏全宽 */
  .topbar-title { display: none; }
  .topbar-search { max-width: none; }
  .topbar-user { display: none; }
  .topbar-btn { padding: 6px 9px; white-space: nowrap; }
  .topbar .bell-link { display: none; }   /* 移动端隐藏顶栏铃铛，保留浮动 mob-bell，避免双铃铛 */
  .gs-results { top: 40px; }
}

/* 分类拖拽排序 */
tr[draggable] { cursor: grab; }
tr[draggable]:active { cursor: grabbing; }
tr.dragging { opacity: .45; }
tr.drag-over { box-shadow: 0 -2px 0 0 var(--primary) inset, 0 2px 0 0 var(--primary) inset; }
.drag-hint { color: var(--text-faint); font-size: 13px; cursor: grab; user-select: none; }

/* 轮播编辑实时预览 */
#slideLivePreview { width: 100%; min-height: 190px; }
#slideLivePreview .sp-desc { font-size: 11px; opacity: .85; margin-top: 4px; color: #fff; }
#slideLivePreview .slide-note { color: #ffd9a8; font-size: 11px; font-weight: 600; }
#slideLivePreview .slide-btn { display: inline-block; margin-top: 10px; font-size: 11px; }

/* 公告置顶/紧急 badge */
.nc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin-right: 6px;
  vertical-align: 1px;
}
.nc-badge.top { background: #eef5ff; color: var(--primary); }
.nc-badge.urgent { background: #ffeded; color: var(--danger); }
[data-theme="dark"] .nc-badge.top { background: rgba(10,132,255,.15); }
[data-theme="dark"] .nc-badge.urgent { background: rgba(229,73,58,.15); }

/* ---------- 移动端更多菜单 ---------- */
.mob-menu {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1050;
  background: var(--white);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 32px rgba(11, 36, 71, .18);
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  max-height: 70vh;
  overflow-y: auto;
}
.mob-menu.hidden { display: none; }
body.logged-in .mob-menu { display: block; }
body.logged-in .mob-menu.hidden { display: none; }
.mob-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 10px; border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.mob-menu-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.mob-menu-close {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--bg-soft); font-size: 17px; color: var(--text-light); cursor: pointer;
}
.mob-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mob-menu-item {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-bg); padding: 12px 10px;
  font-size: 13px; color: var(--text); cursor: pointer; text-align: left;
  transition: all .15s;
}
.mob-menu-item:active { background: var(--bg-blue); border-color: var(--primary); }
.mob-menu-item.active { background: var(--bg-blue); border-color: var(--primary); color: var(--primary); font-weight: 700; }

/* ---------- 商品规格参数编辑 ---------- */
.spec-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.spec-row .spec-n { font-weight: 600; color: var(--navy); }
.spec-row .spec-v { color: var(--text); }
.spec-del { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
@media (max-width: 600px) { .spec-row { grid-template-columns: 1fr 1fr auto; } }

/* ---------- 审计日志 ---------- */
.audit-meta { font-size: 12.5px; color: var(--text-light); margin-bottom: 10px; }
.audit-item {
  display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid var(--border); padding: 8px 4px;
  font-size: 12.5px;
}
.audit-item:last-child { border-bottom: none; }
.audit-time { flex: 0 0 150px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.audit-op {
  flex: 0 0 110px; font-weight: 700; color: var(--navy);
}
.audit-detail { flex: 1; min-width: 0; color: var(--text); overflow-wrap: break-word; }
.audit-ip { flex: 0 0 auto; color: var(--text-faint); font-size: 11.5px; }
@media (max-width: 640px) {
  .audit-item { flex-wrap: wrap; gap: 4px 10px; }
  .audit-time { flex-basis: 100%; }
  .audit-ip { display: none; }
}

/* 移动端：商品表格隐藏次要列（销量/分类），保留 图/标题/价格/状态/操作 */
@media (max-width: 768px) {
  .table-wrap .table th:nth-child(5),
  .table-wrap .table td:nth-child(5),
  .table-wrap .table th:nth-child(6),
  .table-wrap .table td:nth-child(6) { display: none; }
}
@media (max-width: 560px) {
  /* 更窄：隐藏价格列，操作列按钮紧凑 */
  .table-wrap .table th:nth-child(4),
  .table-wrap .table td:nth-child(4) { display: none; }
  .table-wrap .table th:nth-child(3) { min-width: 90px; }
  .table-wrap .op-btn { padding: 4px 8px; font-size: 12px; }
}

/* ---------- AI token 统计 ---------- */
.token-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; }
.token-item {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; text-align: center;
}
.tk-label { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.tk-num { font-size: 22px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .token-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- 开关（switch） ---------- */
.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-row input { display: none; }
.switch-track {
  width: 44px; height: 24px; border-radius: 12px; background: #d5deeb;
  position: relative; transition: background .2s; flex: 0 0 auto;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s;
}
.switch-row input:checked + .switch-track { background: var(--primary); }
.switch-row input:checked + .switch-track::after { left: 22px; }
.switch-label { font-size: 13.5px; color: var(--text); }

/* ---------- v2.14 账号权限 / 外链健康 ---------- */
.role-hidden { display: none !important; }
.ic-health { font-size: 12px; color: var(--text-light); padding: 2px 10px 6px; }
.image-card.card-broken { border-color: var(--danger, #c5221f); background: color-mix(in srgb, var(--danger, #c5221f) 5%, var(--white)); }
.image-card.card-broken img { opacity: .35; }
.image-card.card-broken .ic-health { color: var(--danger, #c5221f); font-weight: 600; }
.twofa-box { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.twofa-box code { display: block; padding: 10px; margin: 8px 0 12px; overflow-wrap: anywhere; font-size: 15px; letter-spacing: 1px; user-select: all; }
.twofa-box .input { max-width: 320px; margin-right: 8px; }
.user-create-row { align-items: end; }
.user-list { margin-top: 16px; display: grid; gap: 8px; }
.user-item { display: grid; grid-template-columns: minmax(150px, 1fr) 130px 90px auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.user-item > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.user-item > div:first-child span { color: var(--text-light); font-size: 12px; }
.user-enabled { white-space: nowrap; font-size: 13px; }
.audit-actor { color: var(--primary); font-size: 12px; }
body[data-role="viewer"] .group-save,
body[data-role="viewer"] #addProductBtn,
body[data-role="viewer"] #addCategoryBtn,
body[data-role="viewer"] #addSlideBtn,
body[data-role="viewer"] #addNoticeBtn,
body[data-role="viewer"] #addRemoteImgBtn,
body[data-role="viewer"] .upload-btn { display: none !important; }

@media (max-width: 760px) {
  .user-item { grid-template-columns: 1fr 1fr; }
  .user-item .page-actions { grid-column: 1 / -1; }
  .twofa-box .input { max-width: 100%; margin: 0 0 8px; }
}

/* ================================================================
   v2.15.0 · Editorial Operations Workspace
   与前台共用暖白、深海军蓝、细边框的品牌语言。
   ================================================================ */
:root {
  --primary: #1265cf;
  --primary-dark: #0b4fa8;
  --navy: #0b2447;
  --text: #26384f;
  --text-light: #66758a;
  --text-faint: #94a0af;
  --bg: #f2f1ed;
  --bg-soft: #f5f6f7;
  --bg-blue: #eef3f8;
  --white: #fffefb;
  --card-bg: #fffefb;
  --border: #dfe3e7;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(11, 36, 71, .05);
}

body { background: var(--bg); color: var(--text); }

/* 登录：左右分栏，不再使用悬浮渐变卡片。 */
.login-view {
  display: grid;
  grid-template-columns: minmax(360px, 46%) minmax(420px, 54%);
  align-items: stretch;
  justify-content: stretch;
  background: #f3f0e9;
  padding: 0;
}
.login-intro {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: flex-end;
  padding: 72px clamp(44px, 6vw, 96px);
  background: #0b2447;
  color: #fff;
}
.login-intro::before {
  content: '';
  width: 64px;
  height: 2px;
  margin-bottom: 28px;
  background: #5da4ff;
}
.login-intro-mark { font-size: clamp(42px, 5vw, 72px); font-weight: 800; letter-spacing: -.045em; }
.login-intro p { max-width: 540px; margin: 22px 0 12px; font-size: clamp(22px, 2.2vw, 34px); line-height: 1.25; }
.login-intro span { max-width: 470px; color: #bac9db; font-size: 14px; line-height: 1.9; }
.login-card {
  align-self: center;
  justify-self: center;
  width: min(440px, calc(100vw - 48px));
  padding: 48px 44px;
  border: 1px solid #dfe3e7;
  border-radius: 3px;
  box-shadow: none;
  text-align: left;
}
.login-logo svg rect { fill: #0b2447; rx: 6px; }
.login-logo { margin-bottom: 28px; }
.login-card h1 { font-size: 27px; letter-spacing: -.03em; }
.login-sub { margin: 7px 0 34px; }
.login-form { gap: 12px; }
.login-form input { min-height: 46px; border-radius: 2px; background: #fff; }
.login-hint { text-align: left; }

/* 主框架 */
.main-view { background: var(--bg); }
.sidebar {
  width: 224px;
  background: #fffefb;
  color: var(--text);
  border-right: 1px solid var(--border);
}
.side-brand { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.side-brand svg rect { fill: #0b2447; rx: 7px; }
.side-name { color: var(--navy); font-size: 15px; letter-spacing: -.01em; }
.side-sub { color: var(--text-faint); }
.side-nav { padding: 18px 12px; gap: 2px; scrollbar-color: #c8d0d8 transparent; }
.side-nav::-webkit-scrollbar-thumb { background: #c8d0d8; }
.side-group {
  margin: 15px 10px 6px;
  color: #909baa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}
.side-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 2px;
  color: #42536a;
  font-size: 13px;
}
.side-item:hover { background: #f3f5f7; color: var(--navy); }
.side-item.active { background: #edf2f7; color: var(--navy); font-weight: 700; }
.side-item.active::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  background: var(--primary);
}
.side-foot { border-top: 1px solid var(--border); }
.side-link { color: var(--text-light); }
.side-link:hover { color: var(--primary); }

.topbar {
  margin-left: 224px;
  height: 64px;
  padding: 0 28px;
  background: #fffefb;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.topbar-title { color: var(--navy); font-size: 14px; }
.global-search { height: 38px; border-radius: 2px; background: #f6f6f4; border-color: #e0e3e6; }
.topbar-btn { min-height: 34px; border-radius: 2px; background: transparent; border: 1px solid transparent; color: var(--text-light); }
.topbar-btn:hover { background: #f3f5f7; border-color: var(--border); color: var(--navy); }
.content { margin-left: 224px; padding: 92px 32px 56px; }
.page-title { font-size: 22px; letter-spacing: -.025em; }

/* 卡片、表格与操作区 */
.stat-card,
.dash-panel,
.kpi-card,
.form-card,
.table-wrap,
.notice-card,
.slide-card,
.image-card,
.enq-card,
.modal,
.msg-box,
.token-item,
.twofa-box,
.user-item {
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: none;
}
.stat-cards,
.kpi-cards { gap: 12px; }
.stat-card { padding: 18px 20px; border-left: 1px solid var(--border); }
.stat-card.clickable:hover { transform: none; border-color: #b9c6d5; box-shadow: none; }
.stat-card .num { font-size: 28px; letter-spacing: -.04em; }
.stat-card .label { margin-top: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.kpi-card { background: #fffefb; }
.kpi-icon { display: none !important; }
.dash-panel { padding: 20px; }
.dash-panel h3 { color: var(--navy); }
.rank-item.clickable { border-radius: 2px; }
.rank-item.clickable:hover { background: #f1f4f7; }
.table-wrap { max-height: 68vh; }
.table th { padding: 11px 14px; background: #f4f5f5; color: #68768a; font-size: 11px; letter-spacing: .04em; }
.table td { padding: 11px 14px; font-size: 13px; }
.table tr:hover td { background: #f8f8f6; }
.td-img { border-radius: 2px; }
.toolbar { padding: 0; }

.btn,
.op-btn,
.dash-action,
.seg-btn,
.sort-btn,
.mob-menu-item { border-radius: 2px; box-shadow: none; }
.btn-primary,
.dash-action.primary { background: #0b2447 !important; border-color: #0b2447 !important; color: #fff !important; }
.btn-primary:hover,
.dash-action.primary:hover { background: #143861 !important; }
.dash-action { border: 1px solid var(--border); background: #fffefb; color: var(--navy); }
.dash-action:hover { transform: none; border-color: #b5c2d1; box-shadow: none; }
.bar.pv { background: #0b2447 !important; }
.bar.click,
.task-bar-fill { background: #1265cf !important; }
.remote-badge { background: #0b2447 !important; }
.badge,
.status-badge,
.side-badge,
.msg-tab-badge { border-radius: 2px; }
.input,
input,
select,
textarea { border-radius: 2px; }
.modal { border-radius: 3px; }
.modal-head,
.msg-box-head { background: #fffefb; border-bottom: 1px solid var(--border); }
.toast { border-radius: 2px; box-shadow: 0 10px 28px rgba(11, 36, 71, .18); }

/* 暗色模式保留功能，但保持低装饰。 */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .login-card { background: var(--white); }
[data-theme="dark"] .side-item { color: var(--text-light); }
[data-theme="dark"] .side-item.active { color: var(--navy); background: var(--bg-blue); }

@media (max-width: 900px) {
  .topbar { margin-left: 0; }
  .content { margin-left: 0; padding-top: 72px; }
  .mobile-tabbar { background: #fffefb; border-top: 1px solid var(--border); box-shadow: none; }
  .mob-tab { border-radius: 0; color: var(--text-light); }
  .mob-tab.active { color: var(--navy); background: #edf2f7; }
  .mob-bell { border-radius: 2px; box-shadow: none; }
}

@media (max-width: 760px) {
  .login-view { display: flex; align-items: center; justify-content: center; padding: 24px; background: #f3f0e9; }
  .login-intro { display: none; }
  .login-card { width: min(420px, 100%); padding: 36px 28px; }
  .content { padding: 70px 14px 92px; }
  .page-head { align-items: flex-start; gap: 12px; }
  .page-title { font-size: 20px; }
  .stat-card { padding: 15px; }
}

/* ============================================
   v2.15.1 · Softer Corner System
   统一后台卡片、表单和操作控件的中等圆角
   ============================================ */
:root { --radius: 14px; }

.login-card { border-radius: 18px; }
.login-form input { border-radius: 12px; }
.side-item { border-radius: 10px; }
.side-item.active::before { border-radius: 0 4px 4px 0; }
.global-search { border-radius: 12px; }
.topbar-btn { border-radius: 10px; }

.stat-card,
.dash-panel,
.kpi-card,
.form-card,
.table-wrap,
.notice-card,
.slide-card,
.image-card,
.enq-card,
.msg-box,
.token-item,
.twofa-box,
.user-item { border-radius: 14px; }

.rank-item.clickable,
.td-img,
.badge,
.status-badge,
.side-badge,
.msg-tab-badge { border-radius: 8px; }
.btn,
.op-btn,
.dash-action,
.seg-btn,
.sort-btn,
.mob-menu-item { border-radius: 10px; }
.input,
input,
select,
textarea { border-radius: 10px; }
.modal { border-radius: 18px; }
.toast { border-radius: 12px; }

@media (max-width: 900px) {
  .mob-tab { border-radius: 10px; }
  .mob-bell { border-radius: 10px; }
}

@media (max-width: 760px) {
  .modal { border-radius: 18px 18px 0 0; }
}
