* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f6fa;
  color: #1a1a2e;
  font-size: 14px;
}

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #eee;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  font-size: 20px;
  font-weight: 700;
  color: #4f46e5;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon { font-size: 22px; }

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.nav-item:hover { background: #f5f5ff; color: #4f46e5; }
.nav-item.active { background: #f0effe; color: #4f46e5; border-left-color: #4f46e5; font-weight: 600; }
.nav-icon { font-size: 16px; }

/* ===== 主内容 ===== */
.main {
  margin-left: 220px;
  flex: 1;
  padding: 24px;
  min-height: 100vh;
}

/* ===== 页面 ===== */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.btn-primary:hover { background: #4338ca; }
.btn-outline { background: #fff; color: #4f46e5; border-color: #4f46e5; }
.btn-outline:hover { background: #f0effe; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-oauth { background: #fff; color: #4f46e5; border: 1.5px solid #4f46e5; }
.btn-oauth:hover { background: #f0effe; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-grid.small { grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.stat-card.small { padding: 14px; }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.small { width: 36px; height: 36px; font-size: 16px; }

.stat-value { font-size: 26px; font-weight: 700; color: #1a1a2e; }
.stat-card.small .stat-value { font-size: 20px; }
.stat-label { font-size: 12px; color: #999; margin-top: 2px; }

/* ===== 表格 ===== */
.table-wrap {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

table { width: 100%; border-collapse: collapse; }
thead { background: #f9fafb; }
th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #555;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f8f8f8;
  vertical-align: middle;
  color: #333;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

.empty-row { text-align: center; color: #999; padding: 40px; }

/* ===== 徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: #e8fdf0; color: #16a34a; }
.badge-warning { background: #fdf3e8; color: #d97706; }
.badge-danger { background: #fde8e8; color: #dc2626; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-blue { background: #e8f4fd; color: #2563eb; }
.badge-purple { background: #f3e8fd; color: #7c3aed; }
.badge-count { background: #e8f4fd; color: #2563eb; padding: 2px 8px; border-radius: 20px; font-size: 14px; }

/* ===== 过滤栏 ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ===== 表单 ===== */
.form-group { flex: 1; margin-bottom: 16px; min-width: 200px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.form-hint { color: #999; font-size: 12px; margin-bottom: 6px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}

.form-control:focus { border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,.1); }
.form-control[readonly] { background: #f9fafb; color: #999; }

.required { color: #ef4444; font-size: 12px; }

/* ===== 模态框 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
}

.modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}

.modal-wide { width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #999; }
.modal-close:hover { color: #333; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  position: sticky;
  bottom: 0;
  background: #fff;
}

/* ===== 系统配置 ===== */
.config-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.config-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon { font-size: 18px; }

.config-notice {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.notice-title { font-weight: 600; color: #4f46e5; margin-bottom: 8px; }
.config-notice ul { padding-left: 18px; }
.config-notice li { margin-bottom: 4px; color: #555; font-size: 13px; }

/* 访问级别 */
.access-level-card { margin-bottom: 20px; }
.access-level-title { font-weight: 600; margin-bottom: 4px; }
.access-level-desc { color: #999; font-size: 12px; margin-bottom: 12px; }

.access-level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.access-card {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.access-card.active {
  border-color: #4f46e5;
  background: #f0effe;
}

.access-card-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.access-card-limit { color: #4f46e5; font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.access-card-note { color: #999; font-size: 12px; }

/* Auth method */
.auth-method-select { margin-bottom: 16px; }
.auth-method-box {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.auth-method-box.selected { border-color: #4f46e5; background: #f0effe; }
.auth-method-title { font-weight: 600; }
.auth-method-desc { color: #666; font-size: 12px; }
.tag-recommend { background: #fbbf24; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 6px; }

/* Secret input */
.secret-input { position: relative; }
.status-tag {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: #16a34a;
}

/* Form actions */
.form-actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }

/* AI config */
.ai-notice {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.ai-notice-title { font-weight: 600; color: #7c3aed; margin-bottom: 4px; }

/* Proxy config */
.proxy-notice {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}
.proxy-format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.proxy-format-card { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 10px; font-size: 12px; }
.proxy-format-card.kookeey { grid-column: 1 / -1; }
.format-tag { background: #3b82f6; color: #fff; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.format-tag.green { background: #16a34a; }
.format-tag.purple { background: #7c3aed; }
.format-example { background: #f5f5f5; border-radius: 4px; padding: 6px 8px; font-family: monospace; margin-top: 6px; word-break: break-all; color: #555; }

.proxy-row {
  display: grid;
  grid-template-columns: 160px 1fr 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

/* ===== 下拉菜单 ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  min-width: 140px;
  display: none;
  z-index: 100;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  cursor: pointer;
  color: #333;
  font-size: 13px;
}
.dropdown-menu a:hover { background: #f5f5ff; color: #4f46e5; }

/* ===== Offer 操作菜单 ===== */
.action-menu { position: relative; display: inline-block; }
.action-menu-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
}
.action-menu-btn:hover { background: #f5f5f5; }
.action-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 160px;
  z-index: 200;
  display: none;
}
.action-menu.open .action-menu-list { display: block; }
.action-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.action-menu-item:hover { background: #f5f5ff; }
.action-menu-item.danger { color: #ef4444; }
.action-menu-item.danger:hover { background: #fef2f2; }
.action-tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.tag-go { background: #4f46e5; color: #fff; }
.tag-url { background: #06b6d4; color: #fff; }
.tag-bl { background: #f97316; color: #fff; }
.tag-del { background: #ef4444; color: #fff; }

/* ===== 创意生成 ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 16px;
}

.day-toggle { display: flex; gap: 4px; }
.day-btn {
  background: #f3f4f6;
  border: none;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.day-btn.active { background: #4f46e5; color: #fff; }

/* Chart */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.chart-title { font-weight: 600; margin-bottom: 12px; font-size: 14px; }

/* Intent cards */
.intent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.intent-card {
  border: 2px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  overflow: hidden;
}
.intent-card input[type=checkbox] { margin: 14px 0 0 12px; flex-shrink: 0; }
.intent-card-content { padding: 12px 12px 12px 0; }
.intent-title { font-weight: 600; font-size: 13px; }
.intent-desc { color: #7c3aed; font-size: 12px; }
.intent-hint { color: #999; font-size: 12px; margin-top: 4px; }
.intent-card:has(input:checked) { border-color: #4f46e5; background: #f0effe; }

/* Generate progress */
.step-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: #4f46e5; }

.gen-progress-box {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.gen-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.pct-text { font-weight: 700; color: #4f46e5; font-size: 20px; }

.progress-bar-wrap {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 4px;
  transition: width 0.3s;
}

.intent-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 8px;
}

.intent-progress-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
  flex-shrink: 0;
}

.intent-progress-dot.running { background: #f59e0b; animation: pulse 1s infinite; }
.intent-progress-dot.done { background: #16a34a; }
.intent-progress-dot.error { background: #ef4444; }

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

.intent-progress-info { flex: 1; }
.intent-progress-name { font-weight: 500; font-size: 13px; }
.intent-progress-msg { color: #999; font-size: 12px; }
.intent-progress-score { font-weight: 700; color: #4f46e5; }

/* Tracking preview */
.tracking-preview {
  background: #f0effe;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
}
.preview-label { font-size: 12px; color: #666; margin-bottom: 4px; }
.tracking-preview code { font-family: monospace; color: #4f46e5; word-break: break-all; }

/* Meta bar */
.meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: #555;
}

/* Offer slug link */
.offer-slug-link { color: #4f46e5; text-decoration: none; font-weight: 500; }
.offer-slug-link:hover { text-decoration: underline; }

/* Quality score */
.q-score { font-weight: 700; }
.q-high { color: #16a34a; }
.q-mid { color: #d97706; }
.q-low { color: #ef4444; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  max-width: 360px;
  transition: opacity 0.3s;
}
.toast.success { background: #16a34a; color: #fff; }
.toast.error { background: #ef4444; color: #fff; }
.toast.info { background: #4f46e5; color: #fff; }

/* Offer brand info */
.offer-brand { font-weight: 600; }
.offer-brand-url { color: #999; font-size: 12px; }

/* Offer info card in publish modal */
.offer-info-card { margin-bottom: 16px; }

/* OAuth auth info card */
.auth-info-card { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.auth-info-card.auth-expired { background: #fef2f2; border-color: #fca5a5; }
.auth-info-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.auth-info-label { color: #666; width: 70px; flex-shrink: 0; }
.auth-info-value { font-weight: 600; color: #111; }
.text-green { color: #16a34a !important; }
.text-red { color: #dc2626 !important; }

/* ===== 向导步骤指示器 ===== */
.wizard-steps {
  display: flex;
  align-items: center;
  padding: 16px 24px 0;
  gap: 0;
}
.pub-wizard-steps { padding: 16px 24px 0; }
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #999;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.wizard-step.active .wizard-step-num {
  background: #4f46e5;
  color: #fff;
}
.wizard-step-label {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}
.wizard-step.active .wizard-step-label { color: #4f46e5; font-weight: 600; }
.wizard-step-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin: 0 8px;
  margin-bottom: 16px;
}

/* ===== Offer 抓取进度 ===== */
.scrape-progress-box {
  padding: 8px 0;
}
.scrape-progress-title {
  font-size: 15px;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 16px;
}
.scrape-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.scrape-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1.5px solid transparent;
  transition: all .2s;
}
.scrape-step-item.active {
  border-color: #a5b4fc;
  background: #f0effe;
}
.scrape-step-item.completed {
  border-color: #86efac;
  background: #f0fdf4;
}
.scrape-step-icon { font-size: 18px; width: 24px; text-align: center; }
.scrape-step-label { flex: 1; font-weight: 500; }
.scrape-step-status {
  font-size: 12px;
  color: #999;
  min-width: 60px;
  text-align: right;
}
.scrape-step-status.running { color: #4f46e5; }
.scrape-step-status.done { color: #16a34a; font-weight: 600; }
.scrape-result-title {
  font-weight: 600;
  color: #16a34a;
  margin-bottom: 12px;
}
.scrape-info-grid { display: flex; flex-direction: column; gap: 8px; }
.scrape-info-row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  background: #f9fafb;
  border-radius: 6px;
  padding: 8px 12px;
}
.scrape-info-label { color: #666; width: 80px; flex-shrink: 0; }
.scrape-info-val { color: #111; flex: 1; }
.scrape-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  color: #dc2626;
  font-size: 13px;
}

/* ===== 发布向导创意选择卡片 ===== */
.creative-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.creative-select-card {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.creative-select-card:hover { border-color: #a5b4fc; background: #f5f3ff; }
.creative-select-card.selected { border-color: #4f46e5; background: #f0effe; }
.creative-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.badge-recommend {
  background: #fef9c3;
  color: #92400e;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}
.creative-card-headlines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.creative-headline-chip {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: #555;
}
.pub-no-creative-tip {
  text-align: center;
  padding: 32px 20px;
  color: #d97706;
  font-size: 15px;
  background: #fefce8;
  border-radius: 10px;
  border: 1.5px dashed #fcd34d;
}
.pub-step-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

/* ===== 发布向导账号选择 ===== */
.account-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.account-select-card {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.account-select-card:hover { border-color: #a5b4fc; background: #f5f3ff; }
.account-select-card.selected { border-color: #4f46e5; background: #f0effe; }
.account-card-name { font-weight: 600; color: #111; margin-bottom: 2px; }
.account-card-id { color: #4f46e5; font-size: 12px; }
.account-card-meta { color: #999; font-size: 11px; margin-top: 2px; }

/* ===== 发布摘要 ===== */
.pub-summary-box {
  background: #f9fafb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 16px;
  border: 1px solid #e5e7eb;
}
.pub-summary-title { font-weight: 600; color: #333; margin-bottom: 10px; }
.pub-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}
.pub-summary-row:last-child { border-bottom: none; }
.pub-summary-row span:first-child { color: #666; }
.pub-summary-row span:last-child { font-weight: 600; }

/* ===== 广告配置区块 (Step 3) ===== */
.cfg-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.cfg-section-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.cfg-section-num {
  width: 22px;
  height: 22px;
  background: #4f46e5;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.cfg-section-title {
  font-weight: 600;
  color: #111;
  font-size: 13px;
}

.cfg-section-sub {
  color: #999;
  font-size: 12px;
  margin-left: auto;
}

.cfg-section > .form-row,
.cfg-section > .form-group {
  padding: 14px 16px 0;
}

.cfg-section > .form-row:last-child,
.cfg-section > .form-group:last-child {
  padding-bottom: 14px;
}

/* input prefix wrapper (for $ prefix) */
.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.input-prefix-wrap:focus-within { border-color: #4f46e5; }

.input-prefix {
  padding: 0 10px;
  background: #f3f4f6;
  color: #666;
  font-size: 13px;
  border-right: 1px solid #d1d5db;
  height: 36px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.input-prefix-wrap input {
  border: none;
  outline: none;
  flex: 1;
  padding: 0 10px;
  height: 36px;
  font-size: 13px;
  background: transparent;
}

/* tag 自动提取标签 */
.tag-auto {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  background: #ecfdf5;
  color: #16a34a;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
}

/* headline count badge */
.hl-count {
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  color: #d97706;
}

/* ===== 标题/描述可编辑行 ===== */
.headlines-edit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.hl-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hl-edit-num {
  width: 20px;
  flex-shrink: 0;
  font-size: 12px;
  color: #999;
  text-align: right;
}

.hl-edit-input {
  flex: 1;
  font-size: 13px;
}

.hl-char-count {
  width: 36px;
  font-size: 11px;
  color: #999;
  text-align: right;
  flex-shrink: 0;
}

/* ===== 关键词编辑 ===== */
.kw-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.kw-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px;
  background: #fafafa;
}

.kw-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 8px;
}

.kw-text-input {
  flex: 1;
  font-size: 13px;
  height: 30px;
}

.kw-match-sel {
  width: 80px;
  font-size: 12px;
  height: 30px;
  flex-shrink: 0;
}

/* ===== 发布结果 ===== */
.pub-result-box {
  text-align: center;
  padding: 32px 20px;
}
.pub-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

