/* 盘古舆情 Demo — 设计 token 与 design/ 保持一致 */
:root {
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --surface-warm: #fafafa;
  --fg:    rgba(0, 0, 0, 0.8);
  --fg-2:  rgba(0, 0, 0, 0.62);
  --muted: rgba(0, 0, 0, 0.45);
  --meta:  rgba(0, 0, 0, 0.27);
  --border:      rgba(0, 0, 0, 0.08);
  --border-soft: rgba(0, 0, 0, 0.05);
  --accent:        #ff2442;
  --accent-on:     #ffffff;
  --accent-hover:  #ff2e4d;
  --accent-active: #e6203a;
  --success: #02b940;
  --warn:    #ff7d03;
  --danger:  #ff2442;
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body:    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-pill: 9999px;
  --elev-raised: 0 4px 12px rgba(0, 0, 0, 0.08);
  --elev-modal:  0 8px 32px rgba(0, 0, 0, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== 步骤容器 ===== */
.step { display: none; max-width: 1080px; margin: 0 auto; padding: 32px 24px; }
.step.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 顶部导航条 ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 18px; color: var(--accent); }
.topbar .step-indicator { display: flex; gap: 8px; align-items: center; }
.topbar .step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all .3s;
}
.topbar .step-dot.done { background: var(--accent); }
.topbar .step-dot.current {
  background: var(--accent); box-shadow: 0 0 0 4px rgba(255,36,66,0.15);
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px; border: 1px solid var(--border-soft);
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.card-title .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500;
  padding: 10px 24px; transition: all .15s ease;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border);
}
.btn:hover { background: var(--surface-warm); }
.btn.primary { background: var(--accent); color: var(--accent-on); border: none; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { background: var(--accent-active); }
.btn.lg { padding: 14px 36px; font-size: 16px; }
.btn.sm { padding: 6px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 开场屏 ===== */
#step-hero {
  min-height: 100vh;
  align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  max-width: none; padding: 48px 24px;
}
#step-hero.active { display: flex; flex-direction: column; }
#step-hero .logo {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; margin-bottom: 24px;
}
#step-hero h1 { font-size: 40px; font-weight: 700; letter-spacing: 2px; }
#step-hero h1 .brand-red { color: var(--accent); }
#step-hero .tagline { font-size: 18px; color: var(--fg-2); margin-top: 12px; }
#step-hero .features { display: flex; gap: 12px; margin: 32px 0; flex-wrap: wrap; justify-content: center; }
#step-hero .feature-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 8px 20px; font-size: 13px; color: var(--fg-2);
}
#step-hero .hint { color: var(--meta); font-size: 12px; margin-top: 20px; }

/* ===== 新建分析 ===== */
.form-row { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--fg-2); }
.input {
  width: 100%; padding: 12px 16px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  outline: none; transition: border .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,36,66,0.12); }
.input.prefilled { border-color: var(--accent); }
.blink-cursor { display: inline-block; width: 2px; height: 18px; background: var(--accent); animation: blink 1s infinite; vertical-align: -3px; }
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px;
  border: 1px solid var(--border); cursor: pointer; background: var(--surface);
  transition: all .15s; user-select: none;
}
.chip.selected { background: rgba(255,36,66,0.08); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.cost-estimate {
  background: var(--surface-warm); border-radius: var(--radius-md);
  padding: 16px; display: flex; justify-content: space-between; align-items: center;
}
.cost-estimate .price { font-size: 22px; font-weight: 700; color: var(--accent); }
.cost-estimate .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== 分析进度 ===== */
.state-machine { display: flex; align-items: center; gap: 0; margin: 32px 0; flex-wrap: wrap; }
.state-node { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 110px; }
.state-node .dot {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all .4s; background: var(--surface);
}
.state-node .label { font-size: 12px; color: var(--muted); transition: color .3s; }
.state-node.active .dot { border-color: var(--accent); background: rgba(255,36,66,0.08); animation: pulse 1.2s infinite; }
.state-node.active .label { color: var(--accent); font-weight: 600; }
.state-node.done .dot { border-color: var(--success); background: var(--success); color: #fff; }
.state-node.done .label { color: var(--success); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,36,66,0.35); } 70% { box-shadow: 0 0 0 10px rgba(255,36,66,0); } 100% { box-shadow: 0 0 0 0 rgba(255,36,66,0); } }
.state-arrow { width: 28px; height: 2px; background: var(--border); margin: 0 4px; }
.state-arrow.done { background: var(--success); }

.crawl-log { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; background: #1a1a1e; color: #d4d4d8; border-radius: var(--radius-md); padding: 16px 20px; min-height: 200px; overflow: hidden; }
.crawl-log .line { opacity: 0; animation: logIn .3s forwards; margin: 2px 0; }
.crawl-log .line .time { color: #6b7280; margin-right: 8px; }
.crawl-log .line .ok { color: #4ade80; }
.crawl-log .line .info { color: #93c5fd; }
.crawl-log .line .warn { color: #fbbf24; }
@keyframes logIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.progress-bar { height: 6px; background: var(--border-soft); border-radius: 999px; overflow: hidden; margin-top: 16px; }
.progress-bar .fill { height: 100%; background: var(--accent); border-radius: 999px; width: 0; transition: width .5s ease; }

/* ===== 结果总览 ===== */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card { background: var(--surface); border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--border-soft); }
.metric-card .value { font-size: 26px; font-weight: 700; }
.metric-card .label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.metric-card .delta { font-size: 12px; margin-top: 4px; }
.metric-card .delta.up { color: var(--danger); }
.metric-card .delta.down { color: var(--success); }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .chart-row { grid-template-columns: 1fr; } .metric-grid { grid-template-columns: repeat(2, 1fr); } }
.chart-box { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border-soft); padding: 16px; }
.chart-box .chart-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }

.topic-list { display: flex; flex-direction: column; gap: 12px; }
.topic-item { display: flex; align-items: center; gap: 12px; }
.topic-item .rank { width: 24px; height: 24px; border-radius: 8px; background: var(--surface-warm); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.topic-item .name { flex: 1; font-size: 14px; }
.topic-item .count { font-size: 13px; color: var(--muted); }
.topic-item .bar { width: 120px; height: 8px; background: var(--border-soft); border-radius: 999px; overflow: hidden; }
.topic-item .bar .fill { height: 100%; border-radius: 999px; }

.hot-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.hot-item:last-child { border-bottom: none; }
.hot-item .platform-tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-warm); color: var(--muted); white-space: nowrap; }
.hot-item .title { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-item .interactions { font-size: 12px; color: var(--meta); white-space: nowrap; }

/* ===== 辩论回放 ===== */
.debate-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.agent-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 15px; flex-shrink: 0; }
.agent-name { font-weight: 600; font-size: 14px; }
.agent-role { font-size: 12px; color: var(--muted); }
.debate-round-label { text-align: center; font-size: 12px; color: var(--muted); margin: 24px 0 12px; letter-spacing: 1px; }
.speech {
  display: flex; gap: 12px; margin-bottom: 16px;
  opacity: 0; transform: translateY(6px);
  animation: speechIn .4s forwards;
}
@keyframes speechIn { to { opacity: 1; transform: none; } }
.speech .bubble {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px; padding: 14px 18px;
  font-size: 14px; flex: 1; position: relative;
}
.speech .bubble .evidence { font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.verdict-box {
  background: linear-gradient(135deg, rgba(255,36,66,0.04), rgba(255,36,66,0.01));
  border: 1px solid rgba(255,36,66,0.2); border-radius: var(--radius-md);
  padding: 20px; margin-top: 8px;
}
.verdict-box .label { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.verdict-box .text { font-size: 15px; }

/* ===== 报告预览 ===== */
.report-doc { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 32px; }
.report-doc h1 { font-size: 24px; margin-bottom: 4px; }
.report-doc .meta { font-size: 12px; color: var(--meta); margin-bottom: 24px; }
.report-doc h2 { font-size: 17px; margin: 24px 0 12px; padding-left: 10px; border-left: 3px solid var(--accent); }
.report-doc p { font-size: 14px; color: var(--fg-2); margin-bottom: 10px; }
.report-doc ul { padding-left: 20px; font-size: 14px; color: var(--fg-2); margin-bottom: 10px; }
.report-doc li { margin-bottom: 6px; }
.report-doc .key-data { display: flex; gap: 16px; margin: 16px 0; }
.report-doc .key-data .kd { flex: 1; text-align: center; background: var(--surface-warm); border-radius: var(--radius-md); padding: 16px; }
.report-doc .key-data .kd .num { font-size: 22px; font-weight: 700; color: var(--accent); }
.report-doc .key-data .kd .cap { font-size: 12px; color: var(--muted); margin-top: 2px; }
.report-doc .ai-tag { display: inline-block; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin-bottom: 16px; }

/* ===== 用量与套餐 ===== */
.meter-wrap { text-align: center; padding: 24px 0; }
.meter-ring { position: relative; width: 160px; height: 160px; margin: 0 auto 16px; }
.meter-ring svg { transform: rotate(-90deg); }
.meter-ring .center-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.meter-ring .center-num .big { font-size: 28px; font-weight: 700; }
.meter-ring .center-num .cap { font-size: 12px; color: var(--muted); }

.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 800px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
.plan-card { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 20px; text-align: center; position: relative; }
.plan-card.recommended { border-color: var(--accent); box-shadow: var(--elev-raised); }
.plan-card .rec-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; padding: 2px 12px; border-radius: 999px; }
.plan-card .plan-name { font-size: 16px; font-weight: 700; }
.plan-card .plan-price { font-size: 26px; font-weight: 700; color: var(--accent); margin: 8px 0; }
.plan-card .plan-price .unit { font-size: 13px; color: var(--muted); font-weight: 400; }
.plan-card .plan-feat { font-size: 12px; color: var(--fg-2); margin: 4px 0; }

.footer-nav { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
