:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #dbe2e8;
  --border-strong: #c3ced8;
  --text: #17212b;
  --text-muted: #5f6f7e;
  --text-faint: #8795a3;
  --primary: #334e9e;
  --primary-hover: #293f82;
  --primary-soft: #edf1ff;
  --success: #267a5b;
  --success-soft: #e9f6ef;
  --attention: #9a6700;
  --attention-soft: #fff6dd;
  --danger: #b42332;
  --danger-soft: #fff0f1;
  --info: #236a91;
  --info-soft: #eaf5fb;
  --neutral-soft: #eef2f5;
  --shadow: 0 1px 2px rgba(23, 33, 43, .06), 0 6px 20px rgba(23, 33, 43, .04);
  --radius: 10px;
  --sidebar: 264px;
  --topbar: 56px;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); font-size: 14px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid rgba(51, 78, 158, .28); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 10px; top: -60px; z-index: 100; padding: 8px 12px; color: white; background: var(--primary); border-radius: 6px; }
.skip-link:focus { top: 8px; }
.app-shell { display: grid; min-height: 100vh; grid-template: var(--topbar) 1fr / var(--sidebar) minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; height: var(--topbar); padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface); z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--primary); font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.topbar-context { min-width: 0; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.health-button, .icon-button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.health-button { padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
.health-button:hover { border-color: var(--primary); color: var(--primary); }
.icon-button { width: 36px; height: 36px; border-radius: 7px; font-size: 20px; }
.icon-button:hover { background: var(--surface-muted); color: var(--text); }
.nav-toggle { display: none; }

.primary-nav { grid-row: 2; overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px 28px; }
.nav-new { width: 100%; margin-bottom: 18px; }
.nav-section { margin: 16px 0; }
.nav-section-header { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 7px; color: var(--text-faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); text-align: left; text-decoration: none; cursor: pointer; }
.nav-link:hover, .nav-link.active { background: var(--primary-soft); color: var(--primary); }
.nav-link.active { font-weight: 650; }
.nav-link-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-label { padding: 7px 9px 3px; color: var(--text-faint); font-size: 11px; font-weight: 650; }
.nav-count { color: var(--text-faint); font-size: 11px; }

.main-content { grid-row: 2; min-width: 0; overflow: auto; padding: 30px 34px 60px; }
.route-outlet { width: min(100%, 1380px); margin: 0 auto; }
.page-narrow { width: min(100%, 900px); margin: 0 auto; }
.research-entry { padding-top: 6px; }
.research-hero { text-align: center; }
.research-hero .page-title { font-size: clamp(27px, 3vw, 36px); }
.research-hero .page-description { width: min(720px, 100%); margin: 6px auto 14px; font-size: 14px; }
.question-entry-card { padding: 14px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 36px rgba(23, 33, 43, .09); text-align: left; }
.question-entry-card .textarea { min-height: 116px; border: 0; background: transparent; font-size: 15px; }
.question-entry-card .textarea:focus { outline: none; }
.question-entry-actions { justify-content: flex-end; margin-top: 6px; }
.preset-showcase { margin-top: 20px; }
.preset-showcase > .section-title { text-align: center; color: var(--text-muted); font-size: 14px; letter-spacing: .08em; }
.preset-feature-card { padding: 16px 22px; border-color: rgba(51, 78, 158, .35); background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 100%); text-align: center; }
.preset-feature-card h3 { width: min(720px, 100%); margin: 2px auto 12px; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.55; }
.preset-kicker { color: var(--primary); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.preset-start { min-width: 170px; }
.page-title { margin: 0 0 6px; font-size: clamp(22px, 2vw, 30px); line-height: 1.3; letter-spacing: -.02em; }
.page-description { margin: 0 0 22px; color: var(--text-muted); }
.section-title { margin: 0 0 12px; font-size: 17px; }
.subtle { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.prose { max-width: 860px; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; }

.card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-flat { box-shadow: none; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.card-title { margin: 0; font-size: 15px; }
.card-description { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }
.notice { margin: 12px 0; padding: 11px 13px; border-left: 3px solid var(--info); border-radius: 6px; background: var(--info-soft); color: #184e6b; }
.notice.attention { border-left-color: var(--attention); background: var(--attention-soft); color: #6f4a00; }
.notice.danger { border-left-color: var(--danger); background: var(--danger-soft); color: #8f1b28; }
.notice.neutral { border-left-color: var(--border-strong); background: var(--neutral-soft); color: var(--text-muted); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 7px; font-weight: 650; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: var(--primary); color: var(--primary); }
.button.ghost { background: transparent; color: var(--primary); }
.button.danger { background: var(--danger); color: white; }
.button.small { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

.field-label { display: block; margin-bottom: 6px; font-weight: 650; }
.textarea, .input, .select { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.textarea { min-height: 132px; padding: 13px 14px; resize: vertical; line-height: 1.65; }
.input, .select { height: 40px; padding: 7px 11px; }
.textarea:focus, .input:focus, .select:focus { border-color: var(--primary); outline: 3px solid rgba(51, 78, 158, .13); }
.field-help { margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.examples { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.example-button { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); color: var(--text-muted); text-align: left; cursor: pointer; }
.example-button:hover { border-color: var(--primary); color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--text-muted); font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-running, .tone-information { background: var(--info-soft); color: var(--info); }
.tone-attention { background: var(--attention-soft); color: var(--attention); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-neutral { background: var(--neutral-soft); color: var(--text-muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-running .status-dot { animation: pulse 1.7s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.task-header { margin-bottom: 18px; }
.task-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.task-title { margin: 0 0 7px; font-size: clamp(20px, 2vw, 27px); line-height: 1.4; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-muted); }
.task-primary-action { flex: none; }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 19px 0 18px; border-bottom: 1px solid var(--border); }
.tab { flex: none; padding: 10px 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); font-weight: 700; }

.lifecycle { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 14px 0; }
.lifecycle-step { min-width: 0; padding: 8px 6px; border-top: 3px solid var(--border); color: var(--text-faint); text-align: center; font-size: 11px; }
.lifecycle-step.done { border-color: var(--success); color: var(--success); }
.lifecycle-step.current { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.lifecycle-step.problem { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.replay-lifecycle .lifecycle-step.done { animation: replay-step-fill .45s ease both; animation-delay: calc(var(--step-index) * 70ms); }
@keyframes replay-step-fill { from { border-color: var(--border); color: var(--text-faint); background: transparent; } to { border-color: var(--success); color: var(--success); } }
.replay-lifecycle.is-running .lifecycle-step.current { animation: replay-current-pulse 1s ease-in-out infinite; }
@keyframes replay-current-pulse { 50% { box-shadow: inset 0 0 0 999px rgba(35, 106, 145, .08); } }
.replay-run-button { min-width: 126px; box-shadow: 0 5px 16px rgba(51, 78, 158, .22); }
.replay-progress-card { border-left: 4px solid var(--primary); background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 100%); }
.replay-progress-card h2 { margin: 5px 0 8px; font-size: 21px; }
.replay-progress-card p { margin: 0; color: var(--text-muted); }
.replay-progress-kicker { color: var(--primary); font-size: 12px; font-weight: 750; letter-spacing: .06em; }
.replay-loading-card { border-left: 4px solid var(--info); background: linear-gradient(135deg, var(--surface) 0%, var(--info-soft) 100%); }
.replay-loading-card .loading { min-height: 92px; border: 0; background: transparent; box-shadow: none; }
.compact-spinner { width: 14px; height: 14px; margin: 0; }

.metrics { display: grid; grid-template-columns: 1fr; gap: 10px; }
.metric { padding: 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); }
.metric-value { font-size: 21px; font-weight: 750; line-height: 1.3; }
.metric-label { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.definition-grid { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 7px 16px; }
.definition-grid dt { color: var(--text-muted); }
.definition-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.timeline { position: relative; margin: 8px 0 0 8px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 0 0 17px; }
.timeline-item::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.timeline-title { font-weight: 650; }
.timeline-time { margin-left: 7px; color: var(--text-faint); font-size: 11px; }
.timeline-detail { margin-top: 3px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th, .data-table td { padding: 9px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table th { background: var(--surface-muted); color: var(--text-muted); font-size: 11px; letter-spacing: .03em; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td { font-size: 12px; }

.claim-card, .round-card, .step-card { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.claim-header, .round-header, .step-header { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.claim-header:hover, .round-header:hover, .step-header:hover { background: var(--surface-muted); }
.expand-label { flex: 1; min-width: 0; }
.expand-icon { color: var(--text-faint); transition: transform .15s; }
[aria-expanded="true"] .expand-icon { transform: rotate(90deg); }
.expand-body { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.challenge { margin: 8px 0; padding: 9px 11px; border-left: 3px solid var(--attention); background: var(--attention-soft); }
.challenge.high { border-left-color: var(--danger); background: var(--danger-soft); }
.response { margin: 8px 0; padding: 9px 11px; border-left: 3px solid var(--info); background: var(--info-soft); }

/* 跨轮次依赖桥接 */
.cross-round-bridge {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px dashed var(--primary);
  border-radius: 7px;
  background: var(--primary-soft);
}
.bridge-label {
  font-weight: 650;
  color: var(--primary);
  margin-bottom: 6px;
  font-size: 13px;
}
.bridge-questions {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}
.bridge-questions li {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 湿实验方案展示 - 卡片式布局 */
.wet-experiment-plan {
  margin: 16px 0;
}
.experiment-target-grid,
.experiment-section-grid,
.hypothesis-grid,
.evidence-overview-grid,
.figure-evidence-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.figure-evidence-grid { grid-template-columns: 1fr; }
.experiment-overview { margin-bottom: 16px; }
.experiment-target-card,
.experiment-section-card,
.hypothesis-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.experiment-target-card { border-left: 3px solid var(--attention); }
.experiment-target-card span,
.hypothesis-index {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
}
.experiment-target-card strong { display: block; font-size: 15px; }
.experiment-target-card p { margin: 7px 0 0; color: var(--text-muted); }
.experiment-section-card { margin-bottom: 16px; box-shadow: var(--shadow); }
.experiment-section-card.primary { border-top: 3px solid var(--primary); }
.experiment-section-card h3 { margin: 0 0 12px; font-size: 16px; }
.experiment-section-card h4 { margin: 14px 0 5px; color: var(--text-muted); font-size: 13px; }
.experiment-section-card h4:first-child { margin-top: 0; }
.experiment-list { margin: 0; padding-left: 20px; }
.experiment-list li { margin: 6px 0; line-height: 1.65; }
.experiment-section-card .decision-grid { grid-template-columns: 1fr; }
.hypothesis-card { background: var(--surface-muted); line-height: 1.7; }
.evidence-overview-grid > .card { height: auto; }
.evidence-summary-list { margin: 0; padding-left: 20px; }
.evidence-summary-list li { margin: 8px 0; }
.wet-targets-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.wet-target-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--attention);
  border-radius: 8px;
  background: var(--surface);
}
.wet-target-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.wet-target-number {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
  font-weight: 600;
}
.wet-edge {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.5;
}
.wet-reason {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.wet-section {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.wet-section-title {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 10px;
  color: var(--text);
}
.wet-detail-list, .wet-readout-list {
  margin: 8px 0;
  padding-left: 20px;
  list-style: disc;
}
.wet-numbered-list {
  margin: 8px 0;
  padding-left: 24px;
  list-style: decimal;
}
.wet-detail-list li, .wet-readout-list li, 
.wet-numbered-list li {
  margin: 6px 0;
  line-height: 1.6;
  font-size: 14px;
}
.wet-dose-time-card {
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: 6px;
}
.dose-time-item {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.6;
}
.decision-rules-section {
  background: var(--surface-muted);
}
.decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
.decision-rule-card {
  padding: 12px 14px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.decision-rule-card .rule-label {
  font-weight: 650;
  margin-bottom: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.decision-rule-card .rule-content {
  font-size: 13px;
  line-height: 1.5;
}
.decision-rule-card.support {
  background: var(--success-soft);
  border-color: var(--success);
}
.decision-rule-card.weaken {
  background: var(--attention-soft);
  border-color: var(--attention);
}
.decision-rule-card.refute {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.decision-rule-card.uninterpretable {
  background: var(--info-soft);
  border-color: var(--info);
}
.primary-readouts {
  border-left: 3px solid var(--primary);
}

/* 系统局限性列表 */
.system-limitations {
  background: var(--surface-muted);
  border-left: 3px solid var(--info);
}
.limitation-list {
  margin: 8px 0;
  padding-left: 20px;
  list-style: disc;
}
.limitation-list li {
  margin: 6px 0;
  line-height: 1.6;
  font-size: 14px;
}

.evidence-record { margin: 8px 0; padding: 12px; border: 1px solid var(--border); border-radius: 7px; }
.evidence-record.supports { border-left: 3px solid var(--success); }
.evidence-record.counters { border-left: 3px solid var(--danger); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.task-list-controls { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, auto)); gap: 10px; margin-bottom: 16px; }
.task-list { display: grid; gap: 9px; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-decoration: none; color: var(--text); }
.task-row:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.task-question { font-weight: 650; overflow-wrap: anywhere; }
.task-row-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }

.empty, .loading, .error-panel { padding: 42px 20px; border: 1px dashed var(--border-strong); border-radius: 9px; color: var(--text-muted); text-align: center; background: var(--surface); }
.spinner { display: inline-block; width: 20px; height: 20px; margin-bottom: 8px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.detail-drawer { position: fixed; top: 0; right: 0; z-index: 60; width: min(520px, 100vw); height: 100vh; transform: translateX(100%); transition: transform .2s ease; background: var(--surface); box-shadow: -10px 0 40px rgba(23, 33, 43, .15); }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.drawer-header h2 { margin: 0; font-size: 17px; }
.drawer-body { height: calc(100vh - 58px); overflow: auto; padding: 18px; }
.drawer-overlay, .nav-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(23, 33, 43, .35); }

.dialog-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(23, 33, 43, .4); }
.dialog { width: min(500px, 100%); padding: 21px; border-radius: 10px; background: var(--surface); box-shadow: 0 18px 60px rgba(23, 33, 43, .22); }
.dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.toast.error { border-color: #e7a8ae; color: var(--danger); }
.toast.success { border-color: #a8d4c2; color: var(--success); }

.classic-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.figure-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.figure-card { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.figure-card img { display: block; width: 100%; height: auto; }
.report-frame { width: 100%; min-height: 72vh; border: 1px solid var(--border); border-radius: 8px; background: white; }
.console { max-height: 320px; overflow: auto; padding: 12px; border-radius: 7px; background: #17212b; color: #dbe5ed; font: 12px/1.7 Consolas, monospace; white-space: pre-wrap; }

@media (max-width: 1100px) {
  :root { --sidebar: 230px; }
  .main-content { padding: 25px 24px 50px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .examples { grid-template-columns: 1fr; }
  .task-list-controls { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 12px; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .brand span { display: none; }
  .primary-nav { position: fixed; top: var(--topbar); left: 0; bottom: 0; z-index: 55; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s ease; }
  .primary-nav.open { transform: translateX(0); }
  .main-content { grid-column: 1; padding: 20px 14px 45px; }
  .task-title-row { display: block; }
  .task-primary-action { margin-top: 12px; }
  .lifecycle { grid-template-columns: 1fr; }
  .lifecycle-step { padding: 5px 8px; border-top: 0; border-left: 3px solid var(--border); text-align: left; }
  .definition-grid { grid-template-columns: 1fr; gap: 2px; }
  .definition-grid dd { margin-bottom: 7px; }
  .metrics, .classic-grid { grid-template-columns: 1fr; }
  .task-list-controls { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr; }
  .task-row-meta { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.modality-chart { display: grid; gap: 10px; }
.modality-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(80px, 2fr) 32px; gap: 10px; align-items: center; }
.modality-bar { height: 10px; border-radius: 999px; }
.mechanism-flow { display: flex; gap: 10px; align-items: center; overflow-x: auto; padding: 14px 0 20px; }
.mechanism-flow > span { min-width: 150px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; text-align: center; }
.mechanism-flow > b { color: #64748b; }

/* ===== 科学发现标签增强样式 ===== */

/* 主结论高亮卡片 */
.conclusion-highlight {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 100%);
}
.conclusion-highlight .conclusion-text {
  font-size: 15px;
  line-height: 1.8;
  margin-top: 10px;
}

/* 关键统计发现网格 */
.findings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}
.finding-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.finding-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.finding-number {
  position: absolute;
  top: -8px;
  left: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(51, 78, 158, 0.25);
}
.finding-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.stat-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--info-soft);
  color: var(--info);
  font-size: 11px;
  font-weight: 650;
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* 证据演化时间线 */
.evidence-timeline {
  position: relative;
  padding-left: 32px;
  margin: 16px 0;
}
.evidence-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--success));
  border-radius: 2px;
}
.timeline-node {
  position: relative;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.timeline-node > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.timeline-node > summary::-webkit-details-marker { display: none; }
.timeline-node > summary::after {
  content: "展开";
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.timeline-node[open] > summary::after { content: "收起"; }
.timeline-node[open] > summary { margin-bottom: 12px; }
.timeline-node::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 18px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-node.accepted::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-node.rejected::before { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.timeline-node.partial::before { background: var(--attention); box-shadow: 0 0 0 2px var(--attention); }
.timeline-round {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.timeline-content {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 候选机制网络 */
.mechanism-card .mechanism-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.mechanism-node {
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 13px;
}
.mechanism-node.causal {
  border-color: var(--success);
  background: var(--success-soft);
}
.mechanism-node.correlative {
  border-color: var(--info);
  background: var(--info-soft);
}

/* 批判性分析卡片 */
.critical-analysis {
  border-left: 3px solid var(--attention);
  background: var(--attention-soft);
}
.critical-analysis h3 {
  color: var(--attention);
  margin-bottom: 10px;
}
.limitation-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.limitation-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.limitation-list li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  color: var(--attention);
}

/* 下一步验证卡片 */
.next-steps-card {
  border-left: 3px solid var(--info);
  background: var(--info-soft);
}
.next-steps-card h3 {
  color: var(--info);
  margin-bottom: 10px;
}
.step-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.step-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.7;
}
.step-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--info);
  font-weight: 700;
}

/* ===== 证据图谱标签增强样式 ===== */

/* 图表-证据配对卡片 */
.figure-evidence-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-width: 0;
  align-items: start;
}
.figure-evidence-pair .card-header { grid-column: 1 / -1; margin-bottom: 0; }
.figure-evidence-pair .figure-container { display: block; grid-column: 1; grid-row: auto; min-height: 0; }
.figure-evidence-pair .evidence-links { grid-column: 1; grid-row: auto; }
.figure-evidence-pair .figure-container img { max-height: none; object-fit: contain; }
.figure-container img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.08);
}
.evidence-links {
  display: grid;
  gap: 10px;
}
.evidence-link-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: 8px;
  background: var(--surface-muted);
  transition: box-shadow 0.2s ease;
}
.evidence-link-card:hover {
  box-shadow: var(--shadow);
}
.evidence-link-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.evidence-link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* 数据来源能力矩阵 */
.capability-matrix th {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.capability-matrix td:nth-child(5) {
  color: var(--success);
  font-size: 12px;
}
.capability-matrix td:nth-child(6) {
  color: var(--danger);
  font-size: 12px;
}

/* 文献证据对照 */
.literature-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 3px solid var(--info);
}
.literature-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.literature-card summary { display: flex; flex-wrap: wrap; gap: 7px; cursor: pointer; }
.literature-valid-null-group { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.literature-valid-null-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; color: var(--text-muted); }
.evidence-collapsible > details { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.evidence-collapsible > details > summary { cursor: pointer; color: var(--primary); font-weight: 650; }
.folded-content { margin-top: 14px; }
.technical-audit > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.technical-audit .actions { margin-top: 14px; }
.pmid-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pmid-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* ===== 对抗迭代标签增强样式 ===== */

/* 对抗对话流 */
.debate-timeline {
  display: grid;
  gap: 18px;
}
.debate-stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.debate-stage-grid .debate-stage { height: auto; margin-bottom: 0; }
.debate-round {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(23, 33, 43, 0.06);
}
.debate-round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.debate-round-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}
.debate-stage {
  position: relative;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.debate-stage:last-child {
  margin-bottom: 0;
}
.generator-stage {
  background: var(--info-soft);
  border-left-color: var(--info);
}
.challenger-stage {
  background: var(--attention-soft);
  border-left-color: var(--attention);
}
.response-stage {
  background: var(--success-soft);
  border-left-color: var(--success);
}
.arbiter-stage {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}
.stage-label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}
.generator-stage .stage-label {
  background: var(--info);
  color: white;
}
.challenger-stage .stage-label {
  background: var(--attention);
  color: white;
}
.response-stage .stage-label {
  background: var(--success);
  color: white;
}
.arbiter-stage .stage-label {
  background: var(--primary);
  color: white;
}
.stage-content {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}

/* 证据增量柱状图 */
.evidence-delta-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}
.delta-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.delta-bar {
  width: 100%;
  max-width: 60px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(to top, var(--primary), var(--info));
  transition: height 0.3s ease;
}
.delta-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
}
.delta-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* 技术审计按钮区域 */
.audit-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ===== 对抗迭代标签 - 轮次卡片内部结构 ===== */

/* 轮次头部栏 */
.round-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.round-label {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}
.round-recipe {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* 挑战卡片 */
.challenge-card {
  margin: 8px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--attention);
  background: var(--attention-soft);
  border-radius: 6px;
}
.challenge-card.high {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.challenge-card .challenge-focus {
  font-weight: 700;
  margin-bottom: 4px;
}
.challenge-card .challenge-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* 回应卡片 */
.response-card {
  margin: 8px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--success);
  background: var(--success-soft);
  border-radius: 6px;
}
.response-action {
  margin-bottom: 4px;
}
.response-card .response-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

/* 修订假说 */
.revised-hypothesis {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 13px;
  line-height: 1.75;
}

/* Arbiter裁决区域 */
.arbiter-verdict {
  margin-bottom: 8px;
}
.arbiter-reason {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}

/* Assertion条目 */
.assertion-item {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.assertion-item:last-child {
  border-bottom: none;
}

/* 证据增量柱状图补充 */
.delta-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.delta-count {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* ===== 科学发现标签 - 补充样式 ===== */

/* 分析区块 */
.analysis-section {
  margin-bottom: 16px;
}
.analysis-section:last-child {
  margin-bottom: 0;
}

/* 替代解释列表 */
.alternative-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.alternative-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.alternative-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--attention);
  font-weight: 700;
}

/* 混杂因素列表 */
.confounder-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.confounder-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.confounder-list li::before {
  content: "◦";
  position: absolute;
  left: 0;
  color: var(--info);
  font-weight: 700;
}

/* 下一步主要验证 */
.next-step-primary {
  padding: 12px;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* 反馈策略 */
.feedback-strategies {
  margin-top: 14px;
}
.strategy-list {
  padding-left: 20px;
  margin: 10px 0;
}
.strategy-list li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* 机制边卡片 */
.mechanism-edge {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  min-width: 200px;
}
.mechanism-edge.supported {
  border-color: var(--success);
  background: var(--success-soft);
}
.mechanism-edge.unsupported {
  border-color: var(--attention);
  background: var(--attention-soft);
}
.edge-label {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.edge-support {
  margin-bottom: 6px;
}
.edge-interpretation {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 6px;
}
.edge-boundary small {
  font-size: 11px;
  color: var(--text-faint);
}

/* 时间线裁决徽章 */
.timeline-verdict {
  margin-top: 8px;
}

/* 发现内容区 */
.finding-content {
  margin-top: 8px;
}
.finding-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ===== 证据图谱标签 - 补充样式 ===== */

/* 证据链接头部 */
.evidence-link-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

/* 证据链接限制 */
.evidence-link-limit {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-faint);
}

/* 文献卡片头部 */
.literature-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

/* 文献文本 */
.literature-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* 文献关联Claim */
.literature-claim {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-faint);
}

/* 空结果文献 */
.literature-card.null-result {
  border-left-color: var(--border-strong);
  background: var(--neutral-soft);
}

/* 数据来源能力矩阵列 */
.can-do {
  color: var(--success);
  font-size: 12px;
}
.cannot-do {
  color: var(--danger);
  font-size: 12px;
}

/* 轮次摘要网格 */
.round-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
.round-summary-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}
.round-number {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 6px;
}
.round-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* 展开切换按钮 */
.expand-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 12px 14px;
}
.expand-toggle:hover {
  background: var(--surface-muted);
}

/* 响应式适配 */
@media (max-width: 1100px) {
  .findings-grid {
    grid-template-columns: 1fr;
  }
  .experiment-target-grid, .experiment-section-grid, .hypothesis-grid,
  .evidence-overview-grid, .figure-evidence-grid { grid-template-columns: 1fr; }
  .figure-evidence-pair { grid-template-columns: 1fr; }
  .figure-evidence-pair .card-header,
  .figure-evidence-pair .figure-container,
  .figure-evidence-pair .evidence-links { grid-column: 1; grid-row: auto; }
  .literature-grid { grid-template-columns: 1fr; }
  .round-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .findings-grid {
    grid-template-columns: 1fr;
  }
  .evidence-delta-chart {
    height: 140px;
  }
  .debate-stage {
    padding: 12px;
  }
  .debate-stage-grid,
  .experiment-section-card .decision-grid { grid-template-columns: 1fr; }
  .round-summary-grid {
    grid-template-columns: 1fr;
  }
  .mechanism-flow {
    flex-direction: column;
    align-items: stretch;
  }
  .mechanism-edge {
    min-width: auto;
  }
}
