/* 客流飞轮系统 V0.1 — 全局样式 (手机优先) */

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #333;
  --text: #e0e0e0;
  --text2: #999;
  --primary: #00d4aa;
  --primary-dim: #009977;
  --danger: #ff4444;
  --warning: #ffa500;
  --success: #00d4aa;
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 768px;
  margin: 0 auto;
  padding: 16px 16px 80px;
  -webkit-text-size-adjust: 100%;
}

/* ─── Typography ─── */
h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }
h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; color: var(--text2); }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.card:active { border-color: var(--primary); }
.card-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: center;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 2px;
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  -webkit-appearance: none;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-hint {
  font-size: 0.72rem; color: var(--text2); margin-top: 2px;
}

/* ─── Checkbox Toggle ─── */
.check-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
}
.check-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
}
.check-row label { font-size: 0.9rem; margin: 0; color: var(--text); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font);
}
.btn:active { opacity: 0.75; }
.btn-primary { background: var(--primary); color: #000; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-icon {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius);
}

/* ─── Collapsible Sections ─── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.section-header h3 { margin: 0; flex: 1; }
.section-header .arrow {
  font-size: 0.8rem; transition: transform 0.2s;
  color: var(--text2);
}
.section.open .arrow { transform: rotate(180deg); }
.section-body {
  display: none;
  padding: 0 16px 16px;
}
.section.open .section-body { display: block; }

/* ─── Bottom Nav ─── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: 768px;
  margin: 0 auto;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.68rem;
  padding: 4px 8px;
}
.nav-item.active { color: var(--primary); }
.nav-item .nav-icon { font-size: 1.2rem; }

/* ─── Tags / Badges ─── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}
.tag-lead-gen { background: rgba(0,212,170,0.15); color: var(--primary); }
.tag-lead-capture { background: rgba(255,165,0,0.15); color: var(--warning); }
.tag-transaction { background: rgba(255,68,68,0.15); color: var(--danger); }
.tag-status { background: var(--surface2); color: var(--text2); }

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text2);
  cursor: pointer;
}
.filter-chip.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

/* ─── Status Indicators ─── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dot-draft { background: var(--text2); }
.dot-ready { background: var(--warning); }
.dot-published { background: var(--success); }
.dot-not-published { background: var(--danger); }

/* ─── Helpers ─── */
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--text2); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Toast ─── */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #000;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600;
  z-index: 999; opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); color: #fff; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text2);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ─── Pillar Chips ─── */
.pillar-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pillar-chip {
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text2);
}
.pillar-chip.selected {
  background: rgba(0,212,170,0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* ─── Demo Badge ─── */
.demo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: rgba(255, 165, 0, 0.12);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 12px;
  font-size: 0.68rem; font-weight: 700;
  color: var(--warning);
}
.demo-banner {
  background: rgba(255, 165, 0, 0.08);
  border: 1px solid rgba(255, 165, 0, 0.25);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.75rem; color: var(--warning);
  text-align: center;
  font-weight: 600;
}

/* ─── Account Strategy Banner ─── */
.strategy-banner {
  background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(0,212,170,0.02));
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  color: var(--text2);
}
.strategy-banner strong { color: var(--primary); }
