/* Scientific Data 知识库全站样式。使用说明：无需构建工具，由 Django staticfiles 直接发布。 */
:root {
  --ink: #13231f;
  --muted: #68746f;
  --paper: #f5f3ed;
  --surface: #fffefa;
  --line: #dcded8;
  --green: #0d6b55;
  --green-dark: #07503f;
  --mint: #dff0e9;
  --lime: #d6eb75;
  --amber: #b67526;
  --red: #a33c36;
  --shadow: 0 12px 30px rgba(21, 42, 35, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 5%, rgba(214, 235, 117, .18), transparent 24rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.62;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 76px; display: flex; align-items: center; gap: 34px;
  padding: 0 max(28px, calc((100vw - 1440px) / 2));
  background: rgba(255, 254, 250, .92); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(19, 35, 31, .09);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark, .login-emblem {
  display: grid; place-items: center; background: var(--green); color: white; font-family: Georgia, serif;
  font-weight: 700; letter-spacing: -.06em;
}
.brand-mark { width: 39px; height: 39px; border-radius: 11px 11px 11px 3px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.12; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .12em; margin-top: 3px; }
.topbar nav { display: flex; height: 100%; align-items: center; gap: 6px; }
.topbar nav a { color: #4c5a55; padding: 9px 13px; border-radius: 10px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { color: var(--green); background: var(--mint); }
.logout-form { margin: 0; }
.link-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; }

.page-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 50px 0 80px; }
.auth-shell { width: 100%; min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 4vw, 54px); line-height: 1.12; margin: 5px 0 8px; letter-spacing: -.025em; }
.page-heading > p:last-child { color: var(--muted); margin: 0; max-width: 720px; }
.heading-with-action { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em; margin: 0 0 4px; text-transform: uppercase; }
.muted, .english-title { color: var(--muted); }
.english-title { font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.45; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px;
  border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: transform .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 7px 16px rgba(13, 107, 85, .18); }
.button.primary:hover { background: var(--green-dark); }
.button.ghost { color: var(--green); border-color: #b8c9c2; background: transparent; }
.button.wide { width: 100%; }

.messages { margin-bottom: 20px; }
.message { padding: 12px 15px; border-radius: 10px; background: var(--mint); border: 1px solid #b5d5c9; }
.message.error { color: #772b27; background: #fbe8e6; border-color: #efc2be; }

.login-card {
  width: min(460px, 100%); padding: 48px; border: 1px solid var(--line); border-radius: 26px;
  background: rgba(255, 254, 250, .95); box-shadow: 0 24px 80px rgba(18, 51, 41, .12);
}
.login-emblem { width: 58px; height: 58px; border-radius: 16px 16px 16px 4px; font-size: 22px; margin-bottom: 28px; }
.login-card h1 { font-family: Georgia, "Songti SC", serif; font-size: 38px; line-height: 1.1; margin: 8px 0 14px; }
.stack-form { display: grid; gap: 8px; margin-top: 28px; }
.stack-form label { font-size: 13px; font-weight: 700; margin-top: 7px; }
.stack-form input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; background: white; }
.stack-form .button { margin-top: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { min-height: 150px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { font-family: Georgia, serif; font-size: 40px; line-height: 1.1; margin: auto 0 3px; }
.stat-card small { color: #8a938f; font-size: 11px; letter-spacing: .04em; }
.stat-card.accent { color: white; background: var(--green); border-color: var(--green); }
.stat-card.accent span, .stat-card.accent small { color: rgba(255,255,255,.72); }
.stat-card.warning strong { color: var(--amber); }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
.lower-grid { grid-template-columns: 1fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 18px; }
.panel h2, .content-section h2 { font-family: Georgia, "Songti SC", serif; margin: 0; font-size: 24px; }
.panel-heading a { font-size: 13px; }
.chart-panel { min-height: 390px; }
.bar-chart { display: grid; gap: 9px; }
.scroll-chart { max-height: 315px; overflow: auto; padding-right: 7px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 46px; gap: 12px; align-items: center; font-size: 12px; }
.bar-row > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #53605b; }
.bar-row > div { height: 9px; border-radius: 5px; background: #e9ece8; overflow: hidden; }
.bar-row i { display: block; height: 100%; width: var(--bar); border-radius: inherit; background: linear-gradient(90deg, var(--green), #4ca083); }
.bar-row b { text-align: right; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #e8e9e4; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li b { font-family: Georgia, serif; }

.filter-panel { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; min-width: 0; height: 48px; padding: 0 15px; border: 1px solid #cfd5d1; border-radius: 11px; background: #fff; }
.search-row input:focus, select:focus, textarea:focus, input:focus { outline: 3px solid rgba(13, 107, 85, .14); border-color: var(--green); }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 12px; margin-top: 15px; align-items: end; }
.filter-grid label { color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-grid select { display: block; width: 100%; height: 39px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 0 8px; color: var(--ink); }
.filter-grid .check-label { display: flex; align-items: center; gap: 6px; height: 39px; color: var(--ink); }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 28px 2px 14px; color: var(--muted); }
.results-toolbar p { margin: 0; }
.results-toolbar div { display: flex; gap: 16px; font-size: 13px; }
.paper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.paper-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-height: 320px; display: flex; flex-direction: column; box-shadow: 0 5px 18px rgba(22, 45, 37, .035); transition: transform .18s, box-shadow .18s; }
.paper-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.paper-card h2 { font-family: Georgia, "Songti SC", serif; font-size: 21px; line-height: 1.3; margin: 16px 0 8px; }
.paper-card h2 a { color: var(--ink); }
.paper-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.abstract-preview { color: #46534e; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 15px; }
.chips span, .status { background: #edf1ee; color: #50605a; border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 700; }
.chips .domain-primary { background: #214f42; color: #fff; }
.chips .domain-related { background: #fff; color: #356658; border: 1px solid #8db6aa; }
.chips .method-tag { background: #ece6f5; color: #59437a; }
.status.approved { color: var(--green-dark); background: var(--mint); }
.status.needs_review { color: #7b4a12; background: #f7e7c9; }
.status.high_risk { color: #8b241c; background: #f8d7d2; }
.status.auto_passed { color: var(--green-dark); background: var(--mint); }
.status.manually_verified { color: #244f77; background: #dceaf7; }
.status.unchecked { color: #5c6064; background: #e9ecef; }
.status.awaiting_source { color: #62521d; background: #f4edc9; }
.repository-line { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 12px; color: var(--green); }
.pagination { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 25px; font-size: 14px; }

.detail-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.detail-actions > div { display: flex; gap: 8px; }
.inline-form { display: inline; }
.detail-hero { padding: 42px; color: white; background: linear-gradient(130deg, #074c3e, #10735b 70%, #3b826d); border-radius: 24px; box-shadow: 0 22px 50px rgba(4, 65, 50, .18); }
.detail-hero h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 4vw, 52px); line-height: 1.16; margin: 18px 0 12px; max-width: 1050px; }
.detail-en-title { color: rgba(255,255,255,.75); font-family: Georgia, serif; font-size: 19px; max-width: 1000px; }
.authors { color: rgba(255,255,255,.83); }
.hero-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.hero-links a { color: var(--lime); font-size: 13px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 25px; align-items: start; }
.domain-summary { margin-top: 24px; }
.detail-main { display: grid; gap: 18px; }
.content-section { padding: 31px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.content-section > p:last-child { color: #34423d; }
.content-section.secondary { background: #eef2ee; }
.content-section.source-section p:last-child { font-size: 14px; color: #53605c; }
.dataset-card { margin-top: 20px; padding: 24px; border: 1px solid #cfdad5; border-radius: 15px; background: #fbfcf8; }
.dataset-head { display: flex; justify-content: space-between; gap: 15px; }
.dataset-head > div > span { font-size: 10px; color: var(--green); font-weight: 800; letter-spacing: .14em; }
.dataset-card h3 { font-family: Georgia, "Songti SC", serif; font-size: 23px; line-height: 1.25; margin: 5px 0; }
.confidence { color: var(--muted); font-size: 11px; white-space: nowrap; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.field-grid > div { padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.field-grid dt, .detail-sidebar dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.field-grid dd { margin: 3px 0 0; font-size: 13px; }
.repo-stack h4 { margin: 0 0 8px; font-size: 13px; }
.repo-stack a { display: grid; grid-template-columns: 130px minmax(0, 1fr) 20px; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--mint); margin: 6px 0; font-size: 12px; }
.repo-stack a span { color: #50605a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-stack a i { font-style: normal; text-align: right; }
details { margin-top: 18px; }
summary { color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.evidence-list div { margin: 10px 0; }.evidence-list dt { font-weight: 700; }.evidence-list dd { margin: 2px 0; color: var(--muted); font-size: 12px; }
.detail-sidebar { position: sticky; top: 96px; display: grid; gap: 16px; }
.detail-sidebar section { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.detail-sidebar h3 { font-family: Georgia, "Songti SC", serif; margin: 0 0 13px; }
.detail-sidebar dl { display: grid; grid-template-columns: 90px 1fr; gap: 9px; margin: 0; }
.detail-sidebar dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }

.edit-form { display: grid; gap: 20px; max-width: 1050px; }
.form-section h2 { margin-bottom: 17px; }
.form-section form { display: block; }
.form-section > div, .dataset-form > div { display: grid; gap: 5px; margin-bottom: 14px; }
.form-section label { font-size: 12px; font-weight: 800; color: #4f5c57; }
.form-section input:not([type="checkbox"]), .form-section select, .form-section textarea { width: 100%; border: 1px solid #cbd2ce; border-radius: 9px; padding: 9px 11px; background: white; }
.form-section input[type="checkbox"] { width: 18px; height: 18px; }
.form-section .errorlist { color: var(--red); margin: 0; font-size: 12px; }
.dataset-form { margin-top: 13px; }
.dataset-form h3 { font-family: Georgia, serif; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sticky-actions { position: sticky; bottom: 15px; display: flex; justify-content: flex-end; gap: 9px; padding: 12px; background: rgba(255,254,250,.92); border: 1px solid var(--line); border-radius: 13px; backdrop-filter: blur(14px); }

.quality-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.quality-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); display: flex; flex-direction: column; }
.quality-card:hover, .quality-card.active { border-color: var(--green); box-shadow: 0 0 0 2px rgba(13,107,85,.08); }
.quality-card span { color: var(--muted); font-size: 12px; }
.quality-card strong { font-family: Georgia, serif; font-size: 32px; margin-top: 10px; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: .08em; color: var(--muted); background: #eef1ed; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e5e7e2; vertical-align: top; }
td:first-child { min-width: 360px; }td:first-child a { color: var(--ink); font-weight: 700; }td:first-child small { display: block; color: var(--muted); margin-top: 4px; }
.empty { color: var(--muted); text-align: center; padding: 25px; }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; text-align: center; border: 1px dashed #bbc5c0; border-radius: 16px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 20px; }

/* 研究构想实验室 */
.idea-heading { max-width: 940px; }
.idea-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.idea-form { padding: 34px; }
.idea-form-section { display: flex; gap: 15px; align-items: start; margin: 6px 0 17px; padding-top: 25px; border-top: 1px solid var(--line); }
.idea-form-section:first-of-type { border-top: 0; padding-top: 0; }
.idea-form-section h2 { margin-bottom: 2px; }
.idea-form-section p { margin: 0; font-size: 13px; }
.section-number { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 11px; background: var(--mint); color: var(--green); font: 700 14px Georgia, serif; }
.domain-picker ul { list-style: none; padding: 0; margin: 0 0 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.domain-picker label { display: flex; gap: 8px; align-items: center; min-height: 45px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf9; font-size: 12px; cursor: pointer; }
.domain-picker label:has(input:checked) { border-color: var(--green); color: var(--green-dark); background: var(--mint); box-shadow: inset 0 0 0 1px var(--green); }
.domain-picker input { accent-color: var(--green); }
.idea-form textarea { width: 100%; resize: vertical; border: 1px solid #cbd2ce; border-radius: 11px; padding: 12px 14px; background: white; }
.model-select-grid { display: grid; grid-template-columns: 1fr 38px 1fr; gap: 12px; align-items: end; }
.model-select-grid label { color: var(--muted); font-size: 12px; font-weight: 700; }
.model-select-grid select { display: block; width: 100%; height: 48px; margin-top: 6px; border: 1px solid #cbd2ce; border-radius: 10px; padding: 0 10px; background: white; color: var(--ink); }
.model-arrow { display: grid; place-items: center; height: 48px; color: var(--green); font-size: 23px; }
.thinking-options { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 14px; border-radius: 10px; background: #f1f3ef; }
.thinking-options label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.thinking-options input { accent-color: var(--green); }
.thinking-options small { width: 100%; color: var(--muted); }
.cost-estimate { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr 1.15fr; border: 1px solid #bdd2c9; border-radius: 13px; overflow: hidden; background: #f8fbf8; }
.cost-estimate > div { display: flex; flex-direction: column; padding: 14px 17px; border-right: 1px solid #d5e2dc; }
.cost-estimate > div:last-of-type { border: 0; }
.cost-estimate span { color: var(--muted); font-size: 11px; }
.cost-estimate strong { font: 700 24px Georgia, serif; }
.cost-estimate .cost-total { background: var(--green); color: white; }
.cost-estimate .cost-total span { color: rgba(255,255,255,.7); }
.cost-estimate p { grid-column: 1 / -1; margin: 0; padding: 7px 14px; color: #8b3c31; background: #fae9e6; font-size: 11px; }
.cost-estimate p.ready { color: var(--green-dark); background: var(--mint); }
.idea-submit { width: 100%; min-height: 50px; margin-top: 18px; }
.submit-note, .tiny-note { color: var(--muted); font-size: 11px; }
.submit-note { text-align: center; margin: 9px 0 0; }
.form-errors, .errorlist { color: var(--red); font-size: 12px; }
.idea-sidebar { display: grid; gap: 18px; position: sticky; top: 96px; }
.model-status-list { display: grid; gap: 3px; }
.model-status-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e7e9e4; }
.model-status-list span { display: flex; flex-direction: column; }
.model-status-list b { font-size: 12px; }
.model-status-list small { color: var(--muted); font-size: 10px; }
.model-status-list i { align-self: center; color: #8b514b; font-size: 10px; font-style: normal; white-space: nowrap; }
.model-status-list i.configured { color: var(--green); }
.method-note { background: #123f35; color: white; }
.method-note .eyebrow { color: var(--lime); }
.method-note ol { list-style: none; counter-reset: steps; padding: 0; margin: 15px 0 0; display: grid; gap: 15px; }
.method-note li { display: grid; grid-template-columns: 24px 1fr; gap: 2px 8px; counter-increment: steps; }
.method-note li::before { content: counter(steps); grid-row: 1 / 3; color: var(--lime); font: 700 17px Georgia, serif; }
.method-note li b { font-size: 13px; }
.method-note li span { color: rgba(255,255,255,.68); font-size: 11px; }
.idea-history { margin-top: 22px; }
.history-list { display: grid; }
.history-list > a { display: grid; grid-template-columns: 1fr auto 65px; align-items: center; gap: 15px; padding: 13px 5px; border-bottom: 1px solid var(--line); color: var(--ink); }
.history-list > a:last-child { border-bottom: 0; }
.history-list span:first-child { display: flex; flex-direction: column; }
.history-list small { color: var(--muted); }
.history-list > a > strong { text-align: right; font-family: Georgia, serif; }
.status.queued { color: #65521a; background: #f4eabd; }
.status.running { color: #245078; background: #dceaf7; }
.status.complete { color: var(--green-dark); background: var(--mint); }
.status.partial { color: #76520b; background: #fff0bf; }
.status.failed { color: #8b241c; background: #f8d7d2; }

.idea-run-hero { display: flex; justify-content: space-between; gap: 30px; align-items: center; padding: 34px; border-radius: 22px; background: linear-gradient(130deg, #093f34, #0d6b55); color: white; }
.idea-run-hero h1 { margin: 4px 0; font: 700 clamp(28px, 4vw, 46px)/1.2 Georgia, "Songti SC", serif; }
.idea-run-hero > div > p:last-child { max-width: 800px; color: rgba(255,255,255,.75); }
.run-status-box { flex: 0 0 190px; display: flex; flex-direction: column; align-items: end; gap: 8px; }
.run-status-box > span, .run-status-box small { color: rgba(255,255,255,.65); font-size: 11px; }
.run-status-box .status { font-size: 13px; }
.run-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.run-metrics > div { min-height: 105px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; flex-direction: column; }
.run-metrics span, .run-metrics small { color: var(--muted); font-size: 10px; }
.run-metrics strong { margin: auto 0 3px; font: 700 17px Georgia, "Songti SC", serif; }
.idea-progress-panel { padding: 26px 30px; }
.idea-progress-panel > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.idea-progress-panel > header .eyebrow { margin: 0 0 3px; color: var(--green); }
.idea-progress-panel > header h2 { margin: 0; font: 700 24px/1.3 Georgia, "Songti SC", serif; }
.progress-elapsed { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.progress-elapsed b { color: var(--ink); font: 700 15px Georgia, serif; }
.idea-progress-timeline { list-style: none; margin: 22px 0 0; padding: 0; }
.progress-step { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 72px; gap: 3px 14px; min-height: 74px; padding-bottom: 16px; }
.progress-step:last-child { min-height: 40px; padding-bottom: 0; }
.progress-step:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 28px; bottom: -1px; width: 2px; background: #dce3df; }
.progress-step.completed:not(:last-child)::before { background: var(--green); }
.progress-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #ccd5d1; border-radius: 50%; background: var(--surface); color: white; font-size: 14px; font-weight: 900; }
.progress-step.completed .progress-marker { border-color: var(--green); background: var(--green); }
.progress-step.active .progress-marker { border: 7px solid #d9eee5; background: var(--green); box-shadow: 0 0 0 0 rgba(13,107,85,.35); animation: progress-pulse 1.8s infinite; }
.progress-step.failed .progress-marker { border-color: #d66b61; background: #b83b31; }
.progress-step h3 { margin: 2px 0 4px; font-size: 14px; }
.progress-step p { margin: 0; color: var(--muted); font-size: 11px; }
.progress-step > strong { align-self: start; justify-self: end; margin-top: 4px; color: #9ba39f; font-size: 11px; }
.progress-step.completed > strong { color: var(--green); }
.progress-step.active > strong { color: #245078; }
.progress-step.failed > strong { color: var(--red); }
.progress-step.pending h3, .progress-step.pending p { color: #9ba39f; }
.progress-note { margin: 20px 0 0 44px; padding: 11px 13px; border-radius: 9px; background: #f2f6f3; color: var(--muted); font-size: 11px; }
@keyframes progress-pulse { 70% { box-shadow: 0 0 0 10px rgba(13,107,85,0); } 100% { box-shadow: 0 0 0 0 rgba(13,107,85,0); } }
.waiting-panel { display: flex; align-items: center; gap: 20px; min-height: 150px; }
.waiting-panel h2 { margin-bottom: 4px; }
.waiting-panel p { color: var(--muted); margin: 0; }
.waiting-pulse { flex: 0 0 42px; height: 42px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(13,107,85,.5); animation: waiting-pulse 1.8s infinite; }
@keyframes waiting-pulse { 70% { box-shadow: 0 0 0 18px rgba(13,107,85,0); } 100% { box-shadow: 0 0 0 0 rgba(13,107,85,0); } }
.failure-panel { border-color: #e5b9b5; background: #fff8f7; }
.failure-panel h2 { color: var(--red); }
.partial-panel { border-color: #e6c66a; background: #fffaf0; }
.partial-panel h2 { color: #76520b; }
.validation-warning { color: #76520b; background: #fff5d6; border-radius: 8px; padding: 8px 10px; }
.idea-portfolio-intro { max-width: 800px; padding: 34px 5px 20px; }
.idea-portfolio-intro h2 { margin: 3px 0 7px; font: 700 34px Georgia, "Songti SC", serif; }
.idea-portfolio-intro > p:last-child { color: var(--muted); }
.final-idea-stack { display: grid; gap: 24px; }
.final-idea-card { padding: 32px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); }
.final-idea-card > header { display: grid; grid-template-columns: 56px 1fr 85px; gap: 17px; align-items: start; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.idea-rank { font: 700 34px Georgia, serif; color: var(--green); }
.final-idea-card h2 { margin: 3px 0 8px; font: 700 30px/1.25 Georgia, "Songti SC", serif; }
.final-idea-card header p:last-child { color: var(--muted); margin: 0; }
.overall-score { display: flex; align-items: baseline; justify-content: end; color: var(--green); }
.overall-score strong { font: 700 32px Georgia, serif; }
.overall-score span { font-size: 11px; }
.idea-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
.idea-body-grid section { padding: 16px; border-radius: 11px; background: #f3f5f1; }
.final-idea-card h3 { margin: 0 0 7px; font-size: 13px; color: var(--green-dark); }
.idea-body-grid p { margin: 0; font-size: 13px; }
.source-use-section { margin: 25px 0; }
.source-use-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.source-use-grid a { display: flex; flex-direction: column; min-height: 155px; padding: 14px; border: 1px solid #bed2c9; border-radius: 12px; background: var(--mint); color: var(--ink); }
.source-use-grid span { font-weight: 800; font-size: 13px; }
.source-use-grid b { margin-top: 4px; color: var(--green); font-size: 11px; }
.source-use-grid small { color: var(--muted); overflow-wrap: anywhere; }
.source-use-grid p { margin: auto 0 0; font-size: 11px; }
.idea-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.idea-plan-grid section { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; }
.idea-plan-grid ol, .idea-plan-grid ul { margin: 0; padding-left: 20px; font-size: 12px; }
.idea-plan-grid li + li { margin-top: 5px; }
.idea-plan-grid .risk-section { border-color: #e4c1bd; background: #fff8f6; }
.minimum-study, .novelty-boundary { margin-top: 15px; padding: 16px; border-left: 3px solid var(--green); background: #f0f4f0; }
.novelty-boundary { border-left-color: var(--amber); }
.minimum-study span, .novelty-boundary span { font-size: 11px; font-weight: 800; color: var(--green); }
.novelty-boundary span { color: var(--amber); }
.minimum-study p, .novelty-boundary p { margin: 3px 0 0; font-size: 13px; }
.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.score-grid div { padding: 10px; border-radius: 9px; text-align: center; background: #e9efeb; }
.score-grid span { display: block; color: var(--muted); font-size: 10px; }
.score-grid b { font: 700 21px Georgia, serif; }
.final-idea-card blockquote { margin: 18px 0 0; padding: 14px 18px; border-left: 3px solid var(--lime); background: #143f35; color: rgba(255,255,255,.85); font-size: 13px; }
.source-evidence-panel { margin-top: 22px; }
.source-paper-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; }
.source-paper-list a { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.source-paper-list span { font-size: 12px; font-weight: 700; }
.source-paper-list small { color: var(--muted); }
.audit-panel { margin-top: 18px; }
.audit-panel details + details { border-top: 1px solid var(--line); padding-top: 15px; }
.audit-panel pre { max-height: 420px; overflow: auto; padding: 14px; border-radius: 9px; white-space: pre-wrap; background: #17221f; color: #dbe7e1; font-size: 10px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .paper-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .quality-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar nav a { padding-inline: 8px; }
  .idea-layout { grid-template-columns: 1fr; }
  .idea-sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .source-use-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 18px; flex-wrap: wrap; gap: 8px; }
  .brand { width: calc(100% - 55px); }.topbar nav { order: 3; width: 100%; overflow-x: auto; }.topbar nav a { white-space: nowrap; }
  .page-shell { width: min(100% - 28px, 1380px); padding-top: 30px; }
  .heading-with-action { align-items: start; flex-direction: column; }
  .stat-grid, .dashboard-grid, .lower-grid, .paper-grid, .quality-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 120px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .search-row { flex-wrap: wrap; }.search-row input { flex-basis: 100%; }
  .detail-hero { padding: 28px 22px; }.detail-layout { grid-template-columns: 1fr; }.detail-sidebar { position: static; }
  .field-grid { grid-template-columns: 1fr; }.repo-stack a { grid-template-columns: 100px minmax(0,1fr) 18px; }
  .detail-actions { align-items: start; gap: 12px; }.detail-actions > div { flex-wrap: wrap; justify-content: end; }
  .login-card { padding: 30px 24px; }
  .bar-row { grid-template-columns: 80px 1fr 38px; }
  .idea-form { padding: 22px 17px; }
  .domain-picker ul { grid-template-columns: 1fr 1fr; }
  .model-select-grid { grid-template-columns: 1fr; }
  .model-arrow { height: 20px; transform: rotate(90deg); }
  .cost-estimate, .run-metrics, .idea-body-grid, .idea-plan-grid, .score-grid, .source-paper-list { grid-template-columns: 1fr; }
  .cost-estimate > div { border-right: 0; border-bottom: 1px solid #d5e2dc; }
  .idea-sidebar { grid-template-columns: 1fr; }
  .idea-run-hero { align-items: start; flex-direction: column; }
  .run-status-box { align-items: start; flex-basis: auto; }
  .idea-progress-panel { padding: 22px 18px; }
  .idea-progress-panel > header { align-items: start; flex-direction: column; gap: 8px; }
  .progress-step { grid-template-columns: 30px minmax(0, 1fr); }
  .progress-step > strong { grid-column: 2; justify-self: start; margin-top: 0; }
  .progress-note { margin-left: 0; }
  .final-idea-card { padding: 22px 16px; }
  .final-idea-card > header { grid-template-columns: 42px 1fr; }
  .overall-score { grid-column: 2; justify-content: start; }
  .source-use-grid { grid-template-columns: 1fr; }
}
