/* 「靠谱吗」消息查证助手 */
:root {
  --bg: #f2f4fb;
  --card: #ffffff;
  --ink: #1c2333;
  --muted: #6b7280;
  --line: #e5e8f2;
  --primary: #4f46e5;
  --primary-2: #06b6d4;
  --ok: #16a34a;
  --partial: #2563eb;
  --doubt: #d97706;
  --bad: #dc2626;
  --unknown: #64748b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(28, 35, 51, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

/* ── 顶部 ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 130%);
  color: #fff;
  border-radius: 20px;
  padding: 34px 30px 26px;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.28);
}
.logo {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 2px;
}
.logo .qmark { opacity: 0.85; }
.tagline { margin: 6px 0 16px; font-size: 15px; opacity: 0.95; }
.meta .chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 3px 12px;
  margin: 0 8px 6px 0;
  font-size: 12.5px;
  backdrop-filter: blur(4px);
}
.chip.on  { background: rgba(74, 222, 128, 0.25); border-color: rgba(134, 239, 172, 0.7); }
.chip.off { background: rgba(251, 191, 36, 0.25); border-color: rgba(253, 224, 71, 0.7); }

/* ── 通用卡片 ─────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-top: 18px;
  border: 1px solid var(--line);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 14px 0 8px;
}
.field-label:first-child { margin-top: 0; }

textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  background: #fafbff;
}
textarea:focus { outline: 2px solid rgba(79, 70, 229, 0.35); border-color: var(--primary); }

/* ── 上传区 ───────────────────────────── */
.dropzone {
  border: 1.5px dashed #c7cdec;
  border-radius: 12px;
  background: #fafbff;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: #f0f0ff; }
.dz-icon { font-size: 30px; margin-bottom: 4px; }
.dz-preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.dz-preview .ghost-btn { margin-top: 10px; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }

button.primary {
  border: none;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
  transition: transform 0.1s, box-shadow 0.15s;
}
button.primary:hover  { transform: translateY(-1px); }
button.primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  font: inherit;
}
.ghost-btn:hover { border-color: var(--primary); color: var(--primary); }
.ghost-btn.small { padding: 3px 12px; font-size: 12.5px; }

/* ── 演示横幅 / 错误 ──────────────────── */
.demo-banner {
  margin-top: 18px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #874d00;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13.5px;
}
.demo-banner code { background: #ffeccc; padding: 1px 6px; border-radius: 4px; }

.error-card { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.error-card h3 { margin: 0 0 6px; }

/* ── 步骤动画 ─────────────────────────── */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.steps li {
  flex: 1 1 150px;
  background: #f4f5fa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  text-align: center;
}
.steps li::before { content: "○ "; }
.steps li.doing {
  color: var(--primary);
  border-color: #c7cdec;
  background: #eef0ff;
  font-weight: 600;
  animation: pulse 1.2s ease-in-out infinite;
}
.steps li.doing::before { content: "◐ "; }
.steps li.done { color: var(--ok); background: #f0fdf4; border-color: #bbf7d0; }
.steps li.done::before { content: "✔ "; }
.steps li.fail { color: var(--bad); background: #fef2f2; border-color: #fecaca; font-weight: 600; }
.steps li.fail::before { content: "✖ "; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ── 结果 ─────────────────────────────── */
.verdict-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.verdict-badge {
  font-size: 22px;
  font-weight: 800;
  padding: 8px 22px;
  border-radius: 12px;
  color: #fff;
}
.v-ok      { background: var(--ok); }
.v-partial { background: var(--partial); }
.v-doubt   { background: var(--doubt); }
.v-bad     { background: var(--bad); }
.v-unknown { background: var(--unknown); }

.confidence-wrap { flex: 1 1 220px; min-width: 200px; }
.confidence-bar {
  height: 10px;
  background: #eef0f6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.confidence-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  transition: width 0.6s ease;
}

.result-question { font-size: 17px; font-weight: 700; margin: 16px 0 4px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.meta-pill {
  background: #f4f5fa;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}
.meta-pill.warn { background: #fff7e6; border-color: #ffd591; color: #874d00; }

.sec-title { font-size: 15px; font-weight: 700; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.sec-title .muted { font-weight: 400; }

.result-image { margin-top: 12px; }
.result-image img { max-width: min(100%, 420px); border-radius: 10px; border: 1px solid var(--line); }

.summary-text { font-size: 15px; background: #f8f9ff; border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; padding: 12px 16px; }

sup.ref {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0 1px;
}
sup.ref:hover { text-decoration: underline; }

.evidence-item, .source-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fdfdff;
}
.evidence-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.evidence-claim { font-weight: 600; flex: 1 1 300px; }

.stance {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.s-ok      { background: #dcfce7; color: #15803d; }
.s-bad     { background: #fee2e2; color: #b91c1c; }
.s-doubt   { background: #fef3c7; color: #b45309; }
.s-muted   { background: #eef0f6; color: #64748b; }

.evidence-detail { font-size: 14px; margin: 8px 0 0; color: #374151; }
.source-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.src-chip {
  font-size: 12px;
  border: 1px solid #c7cdec;
  color: var(--primary);
  background: #eef0ff;
  border-radius: 999px;
  padding: 2px 10px;
  text-decoration: none;
}
.src-chip:hover { background: #dfe2ff; }

.source-item { display: flex; gap: 12px; }
.src-no {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef0ff;
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.src-main { flex: 1; min-width: 0; }
.src-title { font-weight: 600; font-size: 14.5px; }
.src-title a { color: var(--ink); text-decoration: none; }
.src-title a:hover { color: var(--primary); text-decoration: underline; }
.src-info { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.src-passage { font-size: 13.5px; color: #4b5563; }
.badge-demo {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #874d00;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11.5px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.query-chip { background: #f4f5fa; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: #475569; }

.caveats-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; color: #92400e; }

.result-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ── 历史 ─────────────────────────────── */
.history-head { display: flex; justify-content: space-between; align-items: center; }
.history-head h2 { margin: 0; font-size: 17px; }
.history-list { margin-top: 10px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  border-radius: 8px;
}
.history-item:hover { background: #f7f8fd; }
.h-verdict {
  flex: 0 0 64px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 3px 0;
  color: #fff;
}
.h-question { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-meta { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

.foot { text-align: center; margin-top: 28px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--primary); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .logo { font-size: 32px; }
  .hero { padding: 26px 20px; }
  .card { padding: 16px; }
  .h-meta { display: none; }
}
