/* ═══════════════════════════════════════
   剧本式营销 · 5分钟直播诊断系统
   Design: Cinematic / Dark / Gold
   ═══════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-card-hover: #22222f;
  --gold: #c9a96e;
  --gold-light: #e8d5a3;
  --gold-dark: #a08040;
  --gold-glow: rgba(201, 169, 110, 0.15);
  --text-primary: #f0f0f0;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --border: #2a2a3a;
  --border-gold: rgba(201, 169, 110, 0.3);
  --danger: #e74c3c;
  --success: #27ae60;
  --grade-s: #ffd700;
  --grade-a: #27ae60;
  --grade-b: #f39c12;
  --grade-c: #e67e22;
  --grade-d: #e74c3c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  padding-bottom: 40px;
}

.page { display: none; }
.page.active { display: block; }

/* ── Header ── */
.header {
  text-align: center;
  padding: 36px 20px 24px;
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.brand {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon { font-size: 18px; }

/* ── Form ── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--gold);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.form-divider::before,
.form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--border);
}

.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

.form-divider span {
  background: var(--bg-card);
  padding: 0 12px;
  position: relative;
}

/* ── Textarea ── */
.textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.3s;
}

.textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.textarea::placeholder { color: var(--text-muted); }

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 14px;
}

/* ── File Upload ── */
.file-upload {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.file-upload:hover,
.file-upload.active {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.05);
}

.file-upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.file-upload-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--gold);
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.file-remove:hover {
  color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  border: none;
  font-family: inherit;
}

.btn-block { display: block; width: 100%; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a0f;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-sm { padding: 10px 20px; font-size: 13px; }

.btn-group {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.btn-group .btn { flex: 1; }

/* ── Grade Display ── */
.grade-display {
  text-align: center;
  padding: 30px 20px;
  margin-bottom: 16px;
}

.grade-letter {
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 0 40px currentColor;
}

.grade-letter.grade-S { color: var(--grade-s); }
.grade-letter.grade-A { color: var(--grade-a); }
.grade-letter.grade-B { color: var(--grade-b); }
.grade-letter.grade-C { color: var(--grade-c); }
.grade-letter.grade-D { color: var(--grade-d); }

.grade-label {
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* ── Score Grid ── */
.score-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.score-item {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.score-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.score-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.score-pass {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

.score-pass.pass {
  background: rgba(39, 174, 96, 0.15);
  color: var(--success);
}

.score-pass.fail {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

.score-total {
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.score-total span {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

/* ── Upgrade Card ── */
.upgrade-card {
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(201, 169, 110, 0.05), var(--bg-card));
}

.upgrade-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.upgrade-icon { font-size: 32px; }

.upgrade-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upgrade-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Pricing Options ── */
.pricing-options {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pricing-option {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.pricing-option:hover,
.pricing-option.selected {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.08);
}

.pricing-option.popular {
  border-color: var(--gold-dark);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #0a0a0f;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
}

.pricing-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pricing-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.pricing-features {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Optimize Features ── */
.optimize-features {
  margin-bottom: 16px;
}

.feature-item {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.feature-item:last-child { border-bottom: none; }

.optimize-price-row {
  text-align: center;
  margin-bottom: 16px;
}

.optimize-price {
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
}

.optimize-price-note {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Report Content ── */
.report-content {
  font-size: 14px;
  line-height: 2;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 30px 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 2;
}

.brand-line {
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  color: var(--text-primary);
  z-index: 1000;
  transition: transform 0.3s;
  box-shadow: var(--shadow);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }

/* ── Loading ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease; }

/* ── Responsive ── */
@media (max-width: 360px) {
  .title { font-size: 22px; }
  .pricing-options { flex-direction: column; }
  .container { padding: 0 16px; }
}
