/* ==================== 全局变量 ==================== */
/* 日间主题（默认）：浅色背景 + 深色文字 */
:root {
  --bg-primary: #f4f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef0f6;
  --bg-hover: #e6e9f2;
  --text-primary: #1f2430;
  --text-secondary: #4b5263;
  --text: #1f2430;
  --text-muted: #767d92;
  --text-on-accent: #ffffff;
  --text-on-banner: #1f2430;
  --accent: #4f7cff;
  --accent-hover: #3a63d9;
  --accent-2: #8b5cf6;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --danger: #dc2626;
  --surface: #ffffff;
  --border: #e3e6ee;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(17, 24, 39, 0.10);
  --shadow-strong: 0 6px 20px rgba(17, 24, 39, 0.14);
  --overlay: rgba(17, 24, 39, 0.45);
  --split-sep: rgba(255, 255, 255, 0.55);
  --neutral-bg: #f7f8fc;
  --neutral-border: #e3e6ee;
  --neutral-text: #8a90a2;
  --banner-bg: #fde68a;
  --banner-text: #1f2430;
  --result-success-bg: rgba(22, 163, 74, 0.10);
  --result-success-border: rgba(22, 163, 74, 0.30);
  --result-error-bg: rgba(220, 38, 38, 0.10);
  --result-error-border: rgba(220, 38, 38, 0.30);
  --result-skip-bg: rgba(217, 119, 6, 0.10);
  --result-skip-border: rgba(217, 119, 6, 0.30);
  --ok-status-bg: rgba(22, 163, 74, 0.10);
  --ok-status-border: rgba(22, 163, 74, 0.30);
  --fail-status-bg: rgba(220, 38, 38, 0.10);
  --fail-status-border: rgba(220, 38, 38, 0.30);
  --tag-warn-bg: rgba(217, 119, 6, 0.14);
  --tag-ok-bg: rgba(22, 163, 74, 0.14);
  --tag-muted-bg: rgba(138, 144, 162, 0.16);
  --auth-ok-bg: rgba(22, 163, 74, 0.10);
  --auth-ok-border: rgba(22, 163, 74, 0.30);
  --auth-fail-bg: rgba(220, 38, 38, 0.10);
  --auth-fail-border: rgba(220, 38, 38, 0.30);
  --log-success-bg: rgba(22, 163, 74, 0.14);
  --log-error-bg: rgba(220, 38, 38, 0.14);
  --wps-ok-bg: rgba(22, 163, 74, 0.08);
  --wps-ok-border: rgba(22, 163, 74, 0.30);
  --wps-unbound-bg: rgba(217, 119, 6, 0.07);
  --wps-unbound-border: rgba(217, 119, 6, 0.35);
}

/* 夜间主题（原深色）：通过 html.theme-dark 启用，保留旧观感 */
html.theme-dark {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d28;
  --bg-tertiary: #252836;
  --bg-hover: #2d3142;
  --text-primary: #e4e6eb;
  --text-secondary: #9ca3af;
  --text: #e4e6eb;
  --text-muted: #6b7280;
  --text-on-accent: #ffffff;
  --text-on-banner: #1a1d28;
  --accent: #4f7cff;
  --accent-hover: #3a63d9;
  --accent-2: #8b5cf6;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --danger: #e11d48;
  --surface: #1a1d28;
  --border: #2d3142;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-strong: 0 6px 20px rgba(0, 0, 0, 0.12);
  --overlay: rgba(0, 0, 0, 0.6);
  --split-sep: rgba(255, 255, 255, 0.2);
  --neutral-bg: #252836;
  --neutral-border: #2d3142;
  --neutral-text: #6b7280;
  --banner-bg: #f59e0b;
  --banner-text: #1a1d28;
  --result-success-bg: rgba(34, 197, 94, 0.1);
  --result-success-border: rgba(34, 197, 94, 0.3);
  --result-error-bg: rgba(239, 68, 68, 0.1);
  --result-error-border: rgba(239, 68, 68, 0.3);
  --result-skip-bg: rgba(245, 158, 11, 0.1);
  --result-skip-border: rgba(245, 158, 11, 0.3);
  --ok-status-bg: rgba(34, 197, 94, 0.1);
  --ok-status-border: rgba(34, 197, 94, 0.3);
  --fail-status-bg: rgba(239, 68, 68, 0.1);
  --fail-status-border: rgba(239, 68, 68, 0.3);
  --tag-warn-bg: rgba(245, 158, 11, 0.2);
  --tag-ok-bg: rgba(34, 197, 94, 0.2);
  --tag-muted-bg: rgba(120, 120, 128, 0.15);
  --auth-ok-bg: rgba(34, 197, 94, 0.1);
  --auth-ok-border: rgba(34, 197, 94, 0.3);
  --auth-fail-bg: rgba(239, 68, 68, 0.1);
  --auth-fail-border: rgba(239, 68, 68, 0.3);
  --log-success-bg: rgba(34, 197, 94, 0.15);
  --log-error-bg: rgba(239, 68, 68, 0.15);
  --wps-ok-bg: rgba(34, 197, 94, 0.08);
  --wps-ok-border: rgba(34, 197, 94, 0.3);
  --wps-unbound-bg: rgba(245, 158, 11, 0.06);
  --wps-unbound-border: rgba(245, 158, 11, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ==================== 导航栏 ==================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 8px; }
.nav-logo { font-size: 22px; }
.nav-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.nav-links { display: flex; gap: 4px; }
.nav-settings-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
  opacity: 0.6;
}
.nav-settings-icon:hover { opacity: 1; background: var(--bg-hover); }
.nav-settings-icon.active { opacity: 1; background: var(--bg-hover); }
.nav-link {
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-user-name { font-size: 13px; color: var(--text-secondary); padding: 0 8px; }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.nav-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2, #8b5cf6));
  color: #fff; font-size: 13px; font-weight: 600; flex: none;
}
.nav-account, .nav-wps { display: flex; align-items: center; gap: 4px; }
.nav-wps { padding-left: 8px; border-left: 1px solid var(--border); }
.nav-wps-name { font-size: 12px; color: var(--accent); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 用户名下拉菜单 */
.nav-dropdown { position: relative; cursor: pointer; }
.nav-dropdown-toggle { user-select: none; }
.nav-dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-strong); padding: 4px; z-index: 100;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-item {
  display: block; padding: 8px 12px; font-size: 13px; color: var(--text-secondary);
  border-radius: 6px; text-decoration: none; white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-dropdown-danger { color: var(--danger); }
.nav-dropdown-danger:hover { background: var(--danger); color: #fff; }
.nav-dropdown-sep { height: 1px; background: var(--border); margin: 4px 8px; }
.btn-small { padding: 6px 12px; font-size: 13px; }

/* 登录提示 */
.login-required { border: 1px solid var(--warning); background: var(--result-skip-bg); }
.login-required-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}
.login-required-icon { font-size: 32px; }
.login-required-content strong { font-size: 15px; color: var(--text-primary); }
.login-required-content p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* 演示模式横幅 */
.demo-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  padding: 8px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

/* ==================== 容器 ==================== */
.container { max-width: 1300px; margin: 0 auto; padding: 24px 20px; }
.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
h2 { font-size: 22px; margin-bottom: 20px; }
h3 { font-size: 16px; margin-bottom: 12px; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-header h3 { margin: 0; }

/* ==================== 表单元素 ==================== */
.input, .select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus, .select:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ==================== 按钮 ==================== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-danger { background: var(--error); color: var(--text-on-accent); }
.btn-danger:hover { opacity: 0.9; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; margin: 8px 0; }

/* ==================== 步骤 ==================== */
.step { margin-bottom: 20px; }
.step-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ==================== 子表列表 ==================== */
.sheets-list { margin-top: 12px; }
.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.sheet-item-info { flex: 1; }
.sheet-item-name { font-weight: 500; font-size: 14px; }
.sheet-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sheet-preview {
  max-height: 300px;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sheet-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sheet-preview th, .sheet-preview td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.sheet-preview th { background: var(--bg-tertiary); position: sticky; top: 0; }

/* ==================== 导入结果 ==================== */
.import-result { margin-top: 16px; }
.result-item {
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-item.success { background: var(--result-success-bg); border: 1px solid var(--result-success-border); }
.result-item.error { background: var(--result-error-bg); border: 1px solid var(--result-error-border); }
.result-item.skipped { background: var(--result-skip-bg); border: 1px solid var(--result-skip-border); }
.result-status { font-size: 13px; font-weight: 500; }
.result-status.success { color: var(--success); }
.result-status.error { color: var(--error); }
.result-status.skipped { color: var(--warning); }
.result-msg { font-size: 12px; color: var(--text-muted); padding: 0 12px 8px; margin-top: -4px; }
.result-msg.error { color: var(--error); }

/* 导入配置概览 */
.import-config-preview {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.config-preview-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.config-preview-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.config-preview-item.incomplete {
  border-left-color: var(--warning);
  opacity: 0.7;
}
.config-preview-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.config-preview-mappings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}
.mapping-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  background: var(--bg-hover);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* 子表选择列表（复选框） */
.mapping-check-list, .sheet-select-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
}
.mapping-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.mapping-check-item:hover { background: var(--bg-hover); }
.mapping-check-item.disabled { opacity: 0.5; cursor: not-allowed; }
.mapping-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}
.mapping-check-item.disabled input[type="checkbox"] { cursor: not-allowed; }
.sheet-select-list .mapping-check-item {
  background: var(--bg-tertiary);
}
.sheet-radio-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
}
.sheet-radio-list .mapping-check-item {
  background: var(--bg-tertiary);
}
.sheet-radio-list .mapping-check-item input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}
.config-preview-target {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tag { padding: 1px 6px; font-size: 11px; border-radius: 3px; }
.tag-warn { background: var(--tag-warn-bg); color: var(--warning); }
.tag-ok { background: var(--tag-ok-bg); color: var(--success); }
.tag-muted { background: var(--tag-muted-bg); color: var(--text-muted); }

/* ==================== 云盘导入 ==================== */
.cloud-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  table-layout: fixed;            /* 让列宽可控，避免被内容撑爆 */
}
.cloud-table th, .cloud-table td {
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: top;
}
.cloud-table th { color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }
/* 行分隔线：仅店铺末行（店铺之间）显示，同一店铺内不同类型间不显示 */
.cloud-table td { border-bottom: none; }
.cloud-table tr.cloud-shop-end td { border-bottom: 1px solid var(--border); }
.cloud-table tbody tr:last-child td { border-bottom: none; }
/* 列宽分配：店铺 180 / 类型 135 / 时间 95 / 文件 520 / 状态 120 / 操作 110 */
.cloud-table col.c-shop  { width: 180px; }
.cloud-table col.c-types { width: 135px; }
.cloud-table col.c-time  { width: 95px; }
.cloud-table col.c-file  { width: 520px; }
.cloud-table col.c-stat  { width: 120px; }
.cloud-table col.c-act   { width: 110px; }
/* 店铺列：店名 + ID 紧凑不换行 */
.cloud-table td.cloud-shop .cloud-shop-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cloud-table td.cloud-shop strong { flex: 0 0 auto; }
/* 时间列：单行等宽数字 */
.cloud-table td.cloud-time {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cloud-table td.cloud-time .file-time-inline { font-size: 13px; }
/* 匹配文件列：文件名 ellipsis 截断 + 悬浮显示完整 */
.cloud-table td.cloud-file .file-ok {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--success);
}
.cloud-table td.cloud-file .file-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }
.cloud-table td.cloud-file .file-time strong { color: var(--text); }
.cloud-table td.cloud-file .file-none { color: var(--text-muted); }
/* 类型列：tag 单行、紧凑排列 */
.cloud-table td.cloud-types .tag {
  display: inline-block;
  white-space: nowrap;
  margin: 1px 3px 1px 0;
}
/* 表格类型标签配色（2026-08-26：云盘导入「类型」列按 tableType 名称分色） */
.tag-type-analysis { background: rgba(59,130,246,0.14); color: #1e40af; }
.tag-type-ads { background: rgba(249,115,22,0.16); color: #c2410c; }
.tag-type-ads-all { background: rgba(168,85,247,0.14); color: #6b21a8; }
.tag-type-ads-shop { background: rgba(20,184,166,0.16); color: #0f766e; }
.tag-type-brand { background: rgba(236,72,153,0.14); color: #9d174d; }
.tag-type-1 { background: rgba(234,179,8,0.16); color: #854d0e; }
.tag-type-2 { background: rgba(99,102,241,0.14); color: #3730a3; }
.tag-type-3 { background: rgba(132,204,22,0.16); color: #4d7c0f; }
.tag-type-4 { background: rgba(120,53,15,0.16); color: #78350f; }
.tag-type-5 { background: rgba(217,70,239,0.16); color: #86198f; }
.tag-type-6 { background: rgba(220,38,38,0.16); color: #7f1d1d; }
.tag-type-7 { background: rgba(8,145,178,0.16); color: #155e75; }
.tag-type-8 { background: rgba(101,163,13,0.16); color: #3f6212; }
.theme-dark .tag-type-analysis { color: #93c5fd; }
.theme-dark .tag-type-ads { color: #fdba74; }
.theme-dark .tag-type-ads-all { color: #d8b4fe; }
.theme-dark .tag-type-ads-shop { color: #5eead4; }
.theme-dark .tag-type-brand { color: #f9a8d4; }
.theme-dark .tag-type-1 { color: #fde047; }
.theme-dark .tag-type-2 { color: #a5b4fc; }
.theme-dark .tag-type-3 { color: #bef264; }
.theme-dark .tag-type-4 { color: #fdba74; }
.theme-dark .tag-type-5 { color: #f0abfc; }
.theme-dark .tag-type-6 { color: #fca5a5; }
.theme-dark .tag-type-7 { color: #67e8f9; }
.theme-dark .tag-type-8 { color: #d9f99d; }
/* 状态列：tag 单行、可被 ellipsis 截断（title 显示完整） */
.cloud-table td.cloud-stat .tag {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
/* 导入进度条（状态列内） */
.cloud-progress {
  position: relative;
  width: 100%;
  max-width: 130px;
  height: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.cloud-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 8px;
  transition: width 0.25s ease;
}
.cloud-progress-txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 16px;
}
/* 操作列：按钮宽度够、不让文字竖排 */
.cloud-table td.cloud-act { text-align: left; padding-left: 6px; padding-right: 6px; }
.cloud-table td.cloud-act .btn {
  white-space: nowrap;
  min-width: 64px;
  padding: 6px 14px;
}
.cloud-table td.cloud-act .btn:disabled { padding: 6px 8px; }
/* 分割按钮（操作列）：固定宽度 = 主按钮 64px(4 字符) + 箭头 24px = 88px，下拉菜单并齐 */
.cloud-split { position: relative; display: inline-flex; align-items: stretch; vertical-align: middle; }
.cloud-split .btn { min-width: 0 !important; padding: 6px 8px !important; }
.cloud-split .cloud-split-main {
  width: 64px;             /* 4 个汉字 ≈ 52px + padding 12px */
  text-align: center;
  flex: 0 0 64px;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: 1px solid var(--split-sep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cloud-split .cloud-split-arrow {
  flex: 0 0 24px;
  width: 24px;
  min-width: 24px !important;
  padding: 6px 0 !important;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 11px;
  line-height: 1;
}
.cloud-split-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 88px;             /* = 主按钮 64 + 箭头 24，与按钮组整体并齐 */
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  z-index: 100;
  overflow: hidden;
}
.cloud-split.open .cloud-split-menu { display: block; }
.cloud-split-item {
  display: block;
  width: 100%;
  padding: 9px 8px;
  font-size: 13px;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
}
.cloud-split-item:hover { background: var(--bg-hover); color: var(--accent); }
/* 店铺列：第一行显示名称+ID，其它行为空但占位（视觉上是同一列） */
.cloud-table td.cloud-shop { color: var(--text); }
.cloud-table tr:last-child td { border-bottom: none; }
.cloud-import-body { margin-bottom: 12px; }
/* 日期选择行：下拉 + 按钮不换行 */
.cloud-date-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.cloud-date-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.cloud-date-row .select { flex: 0 0 auto; width: auto; min-width: 150px; margin: 0; }
.cloud-date-row .btn { flex-shrink: 0; white-space: nowrap; }
/* 切换日期时的加载提示（不遮挡下方快照） */
.cloud-loading-tip { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.cloud-loading-tip::before { content: '⟳ '; display: inline-block; animation: cloud-spin 1s linear infinite; }
@keyframes cloud-spin { to { transform: rotate(360deg); } }

/* ==================== 文件上传 ==================== */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-secondary);
}
.file-upload-area:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}
.file-upload-area.dragover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.file-upload-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.file-upload-text {
  font-size: 15px;
  color: var(--text-secondary);
}
.file-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.file-info {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}
.file-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.file-parsing {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.error-text {
  color: var(--error);
  font-size: 12px;
}

/* ==================== 配置页 ==================== */
.config-layout { display: flex; gap: 16px; }
.config-left { width: 380px; flex-shrink: 0; }
.config-right { flex: 1; }
.config-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.list-item:hover { background: var(--bg-hover); }
.list-item.active { border-color: var(--accent); background: var(--bg-hover); }
.list-item-name { font-size: 14px; }
.list-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.list-item-actions .btn { white-space: nowrap; padding: 4px 10px; }

.config-section { margin-bottom: 20px; }
.config-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mapping-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 13px;
}

/* ==================== 授权状态 ==================== */
.auth-status {
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 14px;
}
.auth-status.ok { background: var(--auth-ok-bg); border: 1px solid var(--auth-ok-border); color: var(--success); }
.auth-status.fail { background: var(--auth-fail-bg); border: 1px solid var(--auth-fail-border); color: var(--error); }

/* ==================== 日志表格 ==================== */
.logs-table { margin-top: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.logs-table table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 13px;
}
.logs-table thead { position: sticky; top: 0; z-index: 1; }
.logs-table th, .logs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.logs-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: none;
  white-space: nowrap;
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}
.logs-table td { font-size: 13px; }
/* 列宽分配 */
.logs-table th:nth-child(1), /* 时间 */
.logs-table td:nth-child(1) { width: 150px; min-width: 140px; }
.logs-table th:nth-child(2), /* 店铺 */
.logs-table td:nth-child(2) { width: 100px; min-width: 80px; }
.logs-table th:nth-child(3), /* 表格类型 */
.logs-table td:nth-child(3) { width: 110px; min-width: 90px; white-space: nowrap; }
.logs-table th:nth-child(4), /* 行数 */
.logs-table td:nth-child(4) { width: 60px; min-width: 50px; text-align: center; }
.logs-table th:nth-child(5), /* 状态 */
.logs-table td:nth-child(5) { width: 55px; min-width: 50px; text-align: center; }
.logs-table th:nth-child(6), /* 耗时 */
.logs-table td:nth-child(6) { width: 70px; min-width: 65px; text-align: center; white-space: nowrap; }
.logs-table th:nth-child(7), /* 导入日期 */
.logs-table td:nth-child(7) { width: 100px; min-width: 90px; white-space: nowrap; }
.logs-table th:nth-child(8), /* 消息/操作人 */
.logs-table td:nth-child(8) { width: auto; }
.log-status { padding: 2px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.log-status.success { background: var(--log-success-bg); color: var(--success); }
.log-status.error { background: var(--log-error-bg); color: var(--error); }
.log-duration { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.log-duration.fast { color: var(--success); }
.log-duration.slow { color: var(--warning); }

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 400px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal h3 { margin-bottom: 16px; }
.modal-form .form-group { margin-bottom: 14px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ==================== 权限点网格（子账号细粒度权限） ==================== */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-subtle, #f8fafc);
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.perm-item input { margin: 0; }

/* ==================== 提示 ==================== */
.toast {
  position: fixed;
  top: 70px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); color: var(--text-on-accent); }
.toast.error { background: var(--error); color: var(--text-on-accent); }
.toast.info { background: var(--accent); color: var(--text-on-accent); }

.hint { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.hint a { color: var(--accent); }

.empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }
.loading { text-align: center; padding: 20px; color: var(--text-secondary); }

.loading { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ==================== T04：登录 / 凭证 / 账号页 ==================== */

.login-card { max-width: 420px; margin: 48px auto; }
.btn-block { width: 100%; }
.card-header .btn-small { margin-left: auto; }

/* 凭证卡片 */
.cred-card {
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--neutral-bg);
}
.cred-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
}
.cred-field { display: flex; flex-direction: column; font-size: 13px; }
.cred-label { color: var(--neutral-text); font-size: 12px; }
.cred-list { display: flex; flex-direction: column; gap: 12px; }
.cred-item { border: 1px solid var(--neutral-border); border-radius: var(--radius); padding: 10px; }
.cred-item .btn-row { margin-top: 8px; }
.cred-edit { margin-top: 14px; border-top: 1px dashed var(--neutral-border); padding-top: 12px; }
.cred-cloud-readonly {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--neutral-border);
  border-radius: var(--radius);
  background: var(--neutral-bg);
}

/* 账号管理表 */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--neutral-border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.admin-table th { color: var(--neutral-text); font-weight: 600; }
.admin-table tbody tr:hover { background: var(--bg-hover); }
.admin-actions { white-space: nowrap; }
.admin-actions .btn-small { margin-right: 4px; }

/* 弹窗多选下拉 */
select[multiple].select { height: auto; }

/* ==================== WPS 授权绑定页（v1.3，#/wps-bind） ==================== */
.wps-bind-status {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.wps-bind-status.ok { background: var(--wps-ok-bg); border-color: var(--wps-ok-border); }
.wps-bind-status.unbound { background: var(--wps-unbound-bg); border-color: var(--wps-unbound-border); }
.wps-bind-ok { font-size: 16px; font-weight: 600; color: var(--success); margin-bottom: 10px; }
.wps-bind-unbound { font-size: 16px; font-weight: 600; color: var(--warning); margin-bottom: 8px; }
.wps-bind-link { color: var(--accent); text-decoration: none; }
.wps-bind-link:hover { text-decoration: underline; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .config-layout { flex-direction: column; }
  .config-left { width: 100%; }
  .modal { min-width: 90%; }
}
