/* ═══════════════════════════════════════════════════════════════════
   全域电商系统 - 专用样式
   支持：经营驾驶舱、财务利润、红灯问题、目标管理等 9 大模块
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 主题变量别名：ec-* 样式沿用 --text-primary/--text-secondary/--surface-alt 命名，
   而项目实际定义为 --text/--text-2/--surface-2，此处映射对齐避免颜色失效 ─── */
:root {
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --surface-alt: var(--surface-2);
}

/* ─── 企业级 SABC 系统 ─── */
.ec-page-header {
  margin-bottom: 24px;
}
.ec-page-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
}
.ec-page-header .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.ec-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}
.ec-tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
}
.ec-tab-btn:hover {
  background: var(--surface-alt);
  color: var(--text-primary);
}
.ec-tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.ec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.ec-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.ec-form-group {
  margin-bottom: 16px;
}
.ec-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.ec-input, .ec-select, .ec-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 0.2s;
}
.ec-input:focus, .ec-select:focus, .ec-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* 历史列表头搜索框：紧跟标题左侧、固定宽度不拉满整行；div. 前缀用于压过 .combo-select 的 width:100% */
div.ec-hsearch { position: relative; flex: 0 0 auto; width: 260px; max-width: 100%; }
.ec-hsearch > input {
  width: 100%; box-sizing: border-box;
  padding: 7px 26px 7px 30px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font-size: 13px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ec-hsearch > input:focus {
  outline: none;
  border-color: var(--primary-2); background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.ec-hsearch > input::placeholder { color: var(--text-3); }
.ec-hsearch-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; line-height: 1; color: var(--text-3); pointer-events: none;
}
.ec-hsearch-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: none;
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 3px 6px; border-radius: 4px;
}
/* History list action buttons: unified style, more prominent */
.ec-act {display:inline-flex;align-items:center;gap:5px;padding:6px 14px;border-radius:8px;font-size:12px;font-weight:700;cursor:pointer;border:none;transition:all .15s;white-space:nowrap}
.ec-act:hover{text-decoration:none;transform:translateY(-1px);box-shadow:0 2px 6px rgba(0,0,0,.08)}
.ec-act-view{color:var(--blue);background:var(--blue-bg);border:1px solid transparent}
.ec-act-view:hover{background:var(--blue);color:#fff}
.ec-act-del{color:var(--red);background:var(--red-bg);border:1px solid transparent}
.ec-act-del:hover{background:var(--red);color:#fff}
.ec-act-primary{color:var(--primary);background:var(--primary-bg);border:1px solid transparent}
.ec-act-primary:hover{background:var(--primary);color:#fff}
/* Refresh button: slightly wider + icon alignment */
.ec-refresh{display:inline-flex;align-items:center;gap:6px;padding:7px 18px;font-size:13px;font-weight:700;color:var(--primary);background:var(--primary-bg);border:none;border-radius:8px;cursor:pointer;transition:all .15s}
.ec-refresh:hover{background:var(--primary);color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.12)}

.ec-textarea {
  resize: vertical;
  font-family: inherit;
}

.ec-form-row {
  display: flex;
  gap: 16px;
}
.ec-col-6 {
  flex: 0 0 50%;
}

.ec-mt-3 {
  margin-top: 16px;
}
.ec-mb-3 {
  margin-bottom: 24px;
}

.ec-text-muted {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

.ec-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.ec-alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid #3b82f6;
  color: var(--text-primary);
}

.ec-search-dropdown {
  position: absolute;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
  width: 100%;
}

.ec-sabc-tab {
  display: block;
}

/* ─── 经营驾驶舱 ─── */
.cockpit-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.cockpit-controls .btn {
  padding: 8px 16px;
  font-size: 14px;
}
.cockpit-controls .btn-primary {
  background: var(--primary);
  color: #fff;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.metric-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border-radius: 12px;
}
.metric-info { flex: 1; }
.metric-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}
.metric-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}
.metric-rate {
  color: var(--primary);
  font-weight: 600;
}

.cockpit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.cockpit-section h2 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* ─── 排名列表 ─── */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  transition: background 0.2s;
}
.ranking-item:hover { background: var(--surface); }
.ranking-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-secondary);
}
.ranking-badge.ranking-top {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}
.ranking-name { flex: 1; font-weight: 500; }
.ranking-value { font-weight: 700; color: var(--primary); }
.ranking-value.profit { color: #10b981; }
.ranking-value.loss { color: #ef4444; }
.ranking-meta { font-size: 12px; color: var(--text-secondary); }

/* ─── 财务利润 ─── */
.finance-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.finance-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.finance-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.finance-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.finance-form input,
.finance-form select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-alt);
  color: var(--text-primary);
}

.profit-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface-alt);
  border-radius: 12px;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--surface);
  border-radius: 8px;
}
.result-item.highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
  border: 2px solid var(--primary);
}
.result-label { font-size: 12px; color: var(--text-secondary); }
.result-value { font-size: 20px; font-weight: 700; }
.result-value.cost { color: #ef4444; }
.result-value.profit { color: #10b981; }

/* ─── 红灯问题 ─── */
.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.alert-item.alert-pending { border-left-color: #f59e0b; }
.alert-item.alert-overdue { border-left-color: #ef4444; }
.alert-item.alert-resolved { border-left-color: #10b981; opacity: 0.7; }
.alert-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.alert-status { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-overdue { background: #fee2e2; color: #991b1b; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-processing { background: #dbeafe; color: #1e40af; }
.alert-impact { font-weight: 700; color: #ef4444; }
.alert-desc { font-size: 14px; margin-bottom: 8px; }
.alert-footer { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--text-secondary); }

/* ─── 目标管理 ─── */
.goal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.goal-item {
  padding: 16px;
  background: var(--surface-alt);
  border-radius: 8px;
  margin-bottom: 8px;
}
.goal-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  border-radius: 4px;
  transition: width 0.3s;
}

/* ─── 建议列表 ─── */
.suggestion-item {
  padding: 12px 16px;
  background: var(--surface-alt);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.suggestion-text { flex: 1; }
.suggestion-value { font-weight: 600; color: var(--primary); }
.suggestion-priority { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.priority-高 { background: #fee2e2; color: #991b1b; }
.priority-中 { background: #fef3c7; color: #92400e; }

/* ─── 产品生命周期看板 ─── */
.lifecycle-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kanban-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 300px;
}
.kanban-column h3 { font-size: 16px; margin-bottom: 12px; text-align: center; }
.lifecycle-card {
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── 智能上下架 ─── */
.listing-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.task-item {
  padding: 12px 16px;
  background: var(--surface-alt);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid var(--border);
}
.task-item.status-completed { border-left-color: #10b981; }
.task-item.status-failed { border-left-color: #ef4444; }
.task-item.status-processing { border-left-color: #3b82f6; }

/* ─── 竞品监控 ─── */
.competitor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
}

/* ─── 状态徽章 ─── */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.status-pending { background: #fef3c7; color: #92400e; }
.status-badge.status-completed { background: #d1fae5; color: #065f46; }
.status-badge.status-in_progress { background: #dbeafe; color: #1e40af; }
.status-badge.status-overdue { background: #fee2e2; color: #991b1b; }

/* ─── 空状态 ─── */
.empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 14px; }
.empty.success { color: #10b981; }

/* ─── 品类词矿向导 ─── */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 24px;
  gap: 0;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 0 20px;
  transition: opacity 0.2s;
}
.wizard-step:hover { opacity: 0.85; }
.wizard-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  transition: all 0.3s;
}
.wizard-step.active .wizard-step-num {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}
.wizard-step.done .wizard-step-num {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.wizard-step-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.wizard-step.active .wizard-step-label {
  color: var(--primary);
  font-weight: 700;
}
.wizard-step.done .wizard-step-label { color: #10b981; }
.wizard-line {
  width: 48px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.wizard-line.done { background: #10b981; }

/* ─── 向导面板 ─── */
.wizard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  animation: wizFadeIn 0.3s ease;
}
@keyframes wizFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── 关键词分析看板 ─── */
.kw-category-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  border-top: 3px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.kw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.kw-card.blue-ocean { border-top-color: #10b981; }
.kw-card.potential { border-top-color: #3b82f6; }
.kw-card.red-ocean { border-top-color: #ef4444; }
.kw-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kw-card-count {
  font-size: 28px;
  font-weight: 700;
}
.kw-card.blue-ocean .kw-card-count { color: #10b981; }
.kw-card.potential .kw-card-count { color: #3b82f6; }
.kw-card.red-ocean .kw-card-count { color: #ef4444; }
.kw-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  max-height: 60px;
  overflow: hidden;
}

/* ─── 关键词热力图 ─── */
.kw-heatmap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 16px;
  background: var(--surface-alt);
  border-radius: 10px;
  margin-bottom: 16px;
}
.kw-heat-cell {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
.kw-heat-cell:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1;
  position: relative;
}

/* ─── 关键词徽章 ─── */
.kw-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.kw-badge.blue-ocean { background: #d1fae5; color: #065f46; }
.kw-badge.potential { background: #dbeafe; color: #1e40af; }
.kw-badge.red-ocean { background: #fee2e2; color: #991b1b; }
.kw-badge.trend { background: #fef3c7; color: #92400e; }

/* ─── 平台对比卡片 ─── */
.platform-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.platform-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.platform-card.recommended {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), rgba(99, 102, 241, 0.04));
}
.platform-card .rank-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.rank-1 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); }

/* ─── 利润仪表盘 ─── */
.profit-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.profit-metric {
  text-align: center;
  padding: 16px;
  background: var(--surface-alt);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.profit-metric:hover { transform: translateY(-2px); }
.profit-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.profit-metric-value {
  font-size: 22px;
  font-weight: 700;
}
.profit-metric-value.positive { color: #10b981; }
.profit-metric-value.negative { color: #ef4444; }
.profit-metric-value.neutral { color: #d97706; }

/* ─── 风险信号 ─── */
.risk-signals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.risk-signal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 13px;
}
.risk-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.risk-light.high { background: #ef4444; box-shadow: 0 0 6px #ef444480; }
.risk-light.medium { background: #f59e0b; box-shadow: 0 0 6px #f59e0b80; }
.risk-light.low { background: #10b981; box-shadow: 0 0 6px #10b98180; }

/* ─── 时间线 ─── */
.timeline-plan {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}
.timeline-phase {
  position: relative;
  padding: 12px 16px 12px 32px;
  border-left: 2px solid var(--primary);
  margin-left: 12px;
}
.timeline-phase::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
}
.timeline-phase:last-child { border-left-color: transparent; }
.timeline-phase-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 2px;
}
.timeline-phase-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.timeline-task {
  font-size: 12px;
  padding: 2px 0;
  color: var(--text-primary);
}

/* ─── 响应式 ─── */
@media (max-width: 768px) {
  .metric-cards { grid-template-columns: 1fr; }
  .lifecycle-kanban { grid-template-columns: 1fr; }
  .finance-form .form-grid { grid-template-columns: 1fr; }
  .kw-category-cards { grid-template-columns: 1fr; }
  .profit-dashboard { grid-template-columns: 1fr; }
  .platform-card-grid { grid-template-columns: 1fr; }
  .wizard-stepper { flex-wrap: wrap; gap: 4px; }
  .wizard-step { padding: 0 10px; }
  .wizard-line { width: 24px; }
}

/* ─── 产品打爆引擎 ─── */
.exp-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.exp-platform-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.exp-platform-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.exp-platform-btn.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 3px rgba(59,109,17,0.18);
}
.exp-platform-btn.selected .exp-platform-name { color: var(--primary); }
.exp-platform-icon { font-size: 22px; }
.exp-platform-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.exp-platform-mode { font-size: 10px; color: var(--text-secondary); }

.exp-grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.exp-grade-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.exp-grade-btn:hover { transform: translateY(-1px); }
.exp-grade-btn.selected {
  border-color: var(--exp-accent, var(--primary));
  background: var(--exp-accent-soft, var(--primary-bg));
  box-shadow: 0 0 0 3px var(--exp-accent-ring, rgba(59,109,17,0.18));
}
.exp-grade-btn.selected .exp-grade-name { color: var(--exp-accent, var(--primary)); }
.exp-platform-btn.selected::after,
.exp-grade-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--exp-accent, var(--primary));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exp-grade-badge { display: inline-block; font-size: 13px; font-weight: 700; color: #fff; padding: 1px 8px; border-radius: 4px; width: fit-content; }
.exp-grade-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.exp-grade-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

.exp-tool-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.exp-metric-mini { background: var(--surface-alt); border-radius: 8px; padding: 12px; }
.exp-metric-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.exp-metric-value { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }

.exp-timeline { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.exp-stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.exp-stage-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.exp-stage-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; margin-right: 8px; }
.exp-stage-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.exp-stage-meta { display: flex; gap: 12px; font-size: 12px; }
.exp-stage-days { color: var(--text-secondary); }
.exp-stage-budget { color: #dc2626; font-weight: 600; }
.exp-stage-goal { font-size: 13px; color: var(--text-primary); background: var(--surface-alt); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
.exp-kpi-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.exp-kpi-chip { font-size: 12px; padding: 4px 10px; border-radius: 6px; background: rgba(59,130,246,0.1); color: var(--text-primary); border: 1px solid rgba(59,130,246,0.2); }
.exp-actions-block { margin-bottom: 10px; }
.exp-actions-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.exp-action-item { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.exp-action-item:last-child { border-bottom: none; }
.exp-action-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.exp-action-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.exp-tool-chip { font-size: 11px; padding: 1px 8px; border-radius: 4px; background: var(--primary); color: #fff; white-space: nowrap; }
.exp-action-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.exp-tools-row { font-size: 12px; margin: 8px 0; color: var(--text-secondary); }
.exp-risks-block { font-size: 12px; margin-top: 8px; padding: 8px 10px; background: rgba(220,38,38,0.05); border-radius: 6px; border-left: 3px solid #dc2626; }
.exp-risks-block ul { margin: 4px 0 0 16px; padding: 0; color: var(--text-secondary); }
.exp-risks-block li { margin: 2px 0; }

.exp-stages-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.exp-stage-mini { background: var(--surface-alt); border-radius: 8px; padding: 10px; }
.exp-stage-mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.exp-stage-mini-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.exp-stage-mini-count { font-size: 11px; color: var(--text-secondary); }
.exp-stage-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.exp-action-chip { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); }

.exp-plan-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.exp-plan-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.exp-plan-grade { font-size: 11px; font-weight: 700; color: #fff; padding: 1px 6px; border-radius: 4px; margin: 0 6px; }
.exp-plan-platform { font-size: 12px; color: var(--text-secondary); }
.exp-plan-status { font-size: 12px; font-weight: 600; }
.exp-plan-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .exp-platform-grid, .exp-grade-grid { grid-template-columns: 1fr 1fr; }
  .exp-stages-mini { grid-template-columns: 1fr; }
}

/* 打爆引擎：详情视图 / SABC 引用选择器 / 执行进度条 */
.exp-detail-bar { margin-bottom: 12px; }
.exp-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10001; display: flex; align-items: center; justify-content: center; }
.exp-modal-box { background: var(--surface); border-radius: 12px; padding: 20px; width: 560px; max-width: 92vw; max-height: 80vh; overflow-y: auto; }
.exp-modal-box h3 { margin: 0 0 12px; }
.exp-picker-list { border: 1px solid var(--border); border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.exp-picker-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.exp-picker-row:last-child { border-bottom: none; }
.exp-picker-row:hover { background: var(--surface-alt); }
.exp-progress-track { height: 8px; border-radius: 4px; background: var(--surface-alt); overflow: hidden; }
.exp-progress-fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width .3s; }

/* ─── 任务列表缩略图：悬停浮层预览 + 点击全屏 ─── */
.thumb-zoom {
  cursor: zoom-in;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.thumb-zoom:hover {
  border-color: var(--primary, #16a34a) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* 悬停时的浮动大图预览（position:fixed 不受表格 overflow 裁切） */
.thumb-hover-preview {
  position: fixed;
  z-index: 9998;
  width: 300px;
  height: 300px;
  border-radius: 10px;
  border: 2px solid var(--primary, #16a34a);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.32);
  overflow: hidden;
  pointer-events: none;
  animation: thumbPreviewFade .12s ease;
}
.thumb-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f9fafb;
}

/* 点击后全屏预览遮罩 */
.thumb-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: thumbPreviewFade .15s ease;
}
.thumb-preview-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
@keyframes thumbPreviewFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   企业级模块补充组件样式（SABC 分层判定 / 财务核算 等）
   补齐此前引用但未定义的 ec-* 组件类，使用项目实际主题变量
   ═══════════════════════════════════════════════════════════════════ */
/* 栅格 */
.ec-grid { display: grid; gap: 16px; }
.ec-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ec-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .ec-grid-2, .ec-grid-3 { grid-template-columns: 1fr; } }

/* 选品决策 · 官方数据选款：双文件上传响应式网格（窄屏自动折单列，auto-fit 保证铺满） */
.ms-dp-upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
@media (max-width: 768px) {
  .ms-dp-upload-grid { grid-template-columns: 1fr; }
  /* 窄屏下表单内边距收紧，避免两侧留白过大挤压内容 */
  #page-market-selection .form-card { padding: 12px; }
}

/* 按钮 */
.ec-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: all .18s;
}
.ec-btn:hover { background: var(--surface-2); }
.ec-btn + .ec-btn { margin-left: 8px; }
.ec-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ec-btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.ec-btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.ec-btn-success:hover { filter: brightness(1.06); }
.ec-btn-secondary { background: var(--surface); color: var(--text); }
.ec-btn-secondary:hover { background: var(--surface-2); }
.ec-btn-sm { padding: 6px 12px; font-size: 13px; }

/* 徽标 */
.ec-badge {
  display: inline-block; padding: 3px 12px; font-size: 12px; font-weight: 600;
  border-radius: 999px; background: var(--surface-2); color: var(--text-2);
}
.ec-badge-success { background: var(--primary-bg); color: var(--primary); }

/* 空状态 */
.ec-empty-state {
  padding: 32px 16px; text-align: center;
  border: 1px dashed var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text-2);
}
.ec-empty-state p { margin: 0; }

/* 判定得分网格 */
.ec-score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 640px) { .ec-score-grid { grid-template-columns: repeat(2, 1fr); } }
.ec-score-item {
  text-align: center; padding: 12px 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.ec-score-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.ec-score-value { font-size: 18px; font-weight: 700; color: var(--text); }

/* KPI 卡片 */
.ec-kpi-grid { display: grid; gap: 16px; }
.ec-kpi-card {
  padding: 16px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.ec-kpi-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.ec-kpi-value { font-size: 26px; font-weight: 800; color: var(--primary); }

/* 最终判定结果卡片 */
.ec-result-card {
  padding: 20px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--primary-bg);
}
.ec-result-label { font-size: 13px; color: var(--text-2); }
.ec-result-value { font-size: 40px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.ec-result-note { margin-top: 16px; padding: 12px 16px; background: var(--surface-2); border-radius: 8px; }
.ec-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 表格 */
.ec-table-container { overflow-x: auto; }
.ec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ec-table th, .ec-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.ec-table th { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--text); }
.ec-table tbody tr:hover { background: var(--surface-2); }

/* 搜索下拉 */
.ec-search-dropdown {
  margin-top: 4px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow);
  max-height: 240px; overflow-y: auto;
}
.ec-search-dropdown > * { padding: 8px 12px; cursor: pointer; }
.ec-search-dropdown > *:hover { background: var(--surface-2); }

/* 杂项工具类 */
.ec-metric-value { font-size: 22px; font-weight: 800; }
.ec-text-success { color: var(--primary); }
.ec-text-center { text-align: center; }
.ec-text-small { font-size: 13px; color: var(--text-2); }
.ec-mt-4 { margin-top: 24px; }
.ec-dist-chart { min-height: 60px; }

/* ── 2026-09-18 从本地历史快照找回（被误回滚丢失）：统一表单控件 + 选品池/MVP 弹窗样式 ── */
/* ─── 统一表单控件（.input 此前无定义，控件全是浏览器裸样式） ─── */
.input {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px;
  outline: none; transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.input:focus { border-color: var(--primary-2, #639922); box-shadow: 0 0 0 3px rgba(99, 153, 34, .13); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; line-height: 1.55; }
.input:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }

/* ─── 统一弹窗外壳（选品池 / MVP 试水台账共用） ─── */
.msk-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px);
  z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.msk-card {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 720px;
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
}
.msk-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.msk-title { flex: 1; font-size: 15px; font-weight: 700; color: var(--text); }
.msk-body { padding: 18px 20px; overflow-y: auto; }
.msk-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
/* 弹窗内表单骨架 */
.msk-sec {
  display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; padding: 6px 10px;
  border-radius: 8px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text);
}
.msk-sec:first-child { margin-top: 0; }
.msk-sec-sub { font-weight: 400; font-size: 11px; color: var(--text-2); }
.msk-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.msk-g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.msk-g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.msk-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.msk-field label .req { color: #dc2626; }
.msk-field .input { width: 100%; }
.msk-ig { position: relative; }
.msk-ig .input { padding-right: 40px; }
.msk-ig-u {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-3); pointer-events: none;
}
.msk-hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }
/* 来源联动横幅 / 溯源小徽标 */
.msk-src {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px;
  border: 1px dashed #b5d99c; border-radius: 10px; background: var(--primary-bg, #eaf3de);
  font-size: 12px; color: var(--text);
}
.msk-src-empty {
  padding: 8px 12px; border: 1px dashed var(--border); border-radius: 10px;
  background: var(--surface-2); font-size: 12px; color: var(--text-2);
}
.msk-chip-src {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px;
  background: #e0f2fe; color: #0891b2; font-size: 11px; font-weight: 600;
}
.msk-chip-src.manual { background: var(--surface-2); color: var(--text-2); }
/* 阈值卡口判定行 */
.msk-gate-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px; border-top: 1px dashed var(--border); }
.msk-gate-row:first-child { border-top: none; }
.msk-gate-dim { width: 118px; color: var(--text-2); }
.msk-gate-val { width: 168px; }
@media (max-width: 640px) {
  .msk-g4 { grid-template-columns: 1fr 1fr; }
  .msk-g3 { grid-template-columns: 1fr 1fr; }
}
