/* style.css — AI 幻觉检测器 Demo 样式（浅色主题，投影友好） */

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

:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --muted: #64748b;
  --brand: #4338ca;
  --brand-soft: #eef2ff;
  --green: #16a34a;
  --red: #dc2626;
  --gray: #64748b;
  --blue: #2563eb;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 26px; color: var(--brand); }
.title-wrap h1 { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #3730a3; }
.top-right { display: flex; align-items: center; gap: 14px; }
.server-status { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.server-status.on { background: #ecfdf5; color: #15803d; }
.server-status.off { background: #fef2f2; color: #b91c1c; }
.mode-tag { font-size: 11px; color: #94a3b8; margin-left: 4px; }

/* 左右布局 */
.layout {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px 22px;
  min-height: 0;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel.left { flex: 0 0 58%; }
.panel.right { flex: 1; }

.panel-head {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
  flex-shrink: 0;
}
.panel-head .hint { font-weight: 400; color: var(--muted); font-size: 12px; }

/* 编辑器 */
.editor {
  flex: 1;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.9;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}
.editor:empty::before {
  content: "在这里粘贴一段 AI 回答或文章……\A\A然后按住鼠标划选其中一句含数据的表述，右侧会弹出证据核查结果。";
  white-space: pre-wrap;
  color: #9aa4b2;
}
.editor:focus { background: #fdfdfe; }

/* 证据面板 */
.evidence-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.placeholder {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  padding: 24px 8px;
  text-align: center;
}
.placeholder .em { color: var(--brand); font-weight: 600; }

.verdict-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.verdict-badge.support { background: var(--green); }
.verdict-badge.contradict { background: var(--red); }
.verdict-badge.no-evidence { background: var(--gray); }
.verdict-badge.calc { background: var(--blue); }

.verdict-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

.quote-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.q-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.q-text { font-size: 13.5px; line-height: 1.7; color: #334155; }

.source-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fff;
}
.source-card.no-src {
  border-left-color: var(--gray);
  background: #fafafa;
  color: var(--muted);
  font-size: 13px;
}
.sc-head { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; margin-bottom: 6px; }
.sc-source { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.sc-quote { font-size: 13px; color: #475569; line-height: 1.7; margin-bottom: 8px; }
.sc-link { font-size: 12px; color: var(--brand); text-decoration: none; word-break: break-all; }
.sc-link:hover { text-decoration: underline; }

.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.score-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.score-bar {
  flex: 1;
  height: 10px;
  background: #eef1f6;
  border-radius: 999px;
  overflow: hidden;
}
.score-fill { height: 100%; border-radius: 999px; transition: width 0.25s; }
.score-num { font-size: 15px; font-weight: 700; white-space: nowrap; }

.reason {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.calc-note {
  background: var(--brand-soft);
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #3730a3;
}

/* 底部追问条 */
.askbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ask-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.askbar input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.askbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1); }
.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--brand-soft); }
