:root {
  --navy: #0b213d;
  --navy-2: #15395f;
  --red: #b21f35;
  --teal: #087d82;
  --gold: #d4a72c;
  --ink: #1c2938;
  --muted: #647181;
  --line: #dce3e9;
  --light: #f4f7f9;
  --paper: #fff;
  --ok: #16754a;
  --warn: #9a5d00;
  --bad: #a41f34;
  --shadow: 0 12px 32px rgba(16, 38, 63, .09);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: #f1f4f6;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.hero { background: var(--navy); color: white; border-bottom: 6px solid var(--red); }
.hero-inner { max-width: 1240px; margin: 0 auto; padding: 34px 28px 30px; display: flex; justify-content: space-between; gap: 32px; align-items: center; }
.eyebrow { color: #bdcce0; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; margin: 0 0 10px; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.14; margin: 0; letter-spacing: -.03em; }
.subtitle { color: #e9c86f; font-weight: 650; margin: 15px 0 0; letter-spacing: .04em; }
.service-panel { min-width: 230px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); padding: 15px 18px; border-radius: 10px; }
.language-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #dbe5ef; font-size: 12px; margin-bottom: 13px; }
.language-control select { min-width: 128px; color: white; background: var(--navy-2); border: 1px solid rgba(255,255,255,.28); border-radius: 5px; padding: 5px 7px; }
.language-control option { color: var(--ink); background: white; }
.status { display: flex; gap: 9px; align-items: center; font-size: 13px; font-weight: 700; }
.status > span:first-child { display: block; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #b8c1cb; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.status > .status-text { display: block; width: auto; height: auto; flex: 1 1 auto; }
.status.online > span:first-child { background: #53d48a; }
.status.offline > span:first-child { background: #ff6e78; }
.link-button { color: #e8c75f; background: none; border: 0; padding: 2px 0 0 18px; font-size: 12px; }

main { max-width: 1240px; margin: 0 auto; padding: 28px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 26px; }
.tab { border: 0; border-right: 1px solid var(--line); background: white; color: var(--navy); font-weight: 750; padding: 16px 12px; }
.tab:last-child { border-right: 0; }
.tab.active { background: var(--navy); color: white; box-shadow: inset 0 -4px var(--red); }
.tab.has-result:not(.active)::after { content: attr(data-result-label); color: var(--teal); font-size: 11px; }
.auto-fusion { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #eef5f5; border: 1px solid #c9dddd; border-left: 4px solid var(--teal); border-radius: 7px; padding: 13px 16px; margin: -10px 0 24px; }
.auto-fusion-option { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.auto-fusion-option input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--teal); }
.auto-fusion-option span { display: flex; flex-direction: column; gap: 3px; }
.auto-fusion-option strong { color: var(--navy); font-size: 13px; }
.auto-fusion-option small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.auto-fusion-status { flex: 0 0 auto; color: var(--muted); background: white; border: 1px solid #d7e3e3; border-radius: 99px; padding: 6px 11px; font-size: 11px; font-weight: 700; }
.auto-fusion-status.running { color: var(--warn); border-color: #e8d7ac; background: #fffaf0; }
.auto-fusion-status.ready { color: var(--ok); border-color: #bfe0cf; background: #f2fbf6; }
.auto-fusion-status.error { color: var(--bad); border-color: #ebc6cc; background: #fff5f6; }
.module { display: none; }
.module.active { display: block; }
.module-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 28px 2px 16px; }
.module-heading > div { display: flex; align-items: center; gap: 13px; }
.module-heading h2 { margin: 0; color: var(--navy); font-size: 25px; }
.module-heading p { margin: 0; color: var(--muted); text-align: right; font-size: 13px; }
.number { color: var(--red); font-weight: 850; font-size: 14px; border-right: 2px solid var(--red); padding-right: 10px; }

.card { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--navy); padding: 24px; border-radius: 8px; box-shadow: var(--shadow); }
.card h3 { color: var(--navy); margin: 3px 0 16px; font-size: 16px; }
.card h3:not(:first-child) { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.form-grid.compact { margin-top: 20px; }
.field label { display: block; color: var(--navy); font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.field label span { color: var(--muted); font-weight: 500; }
.field label > span[data-i18n]:first-child { color: var(--navy); font-weight: 700; }
.field input, .field select { width: 100%; height: 43px; border: 1px solid #c8d1d9; border-radius: 5px; padding: 8px 10px; color: var(--ink); background: white; }
.field input:focus, .field select:focus { outline: 2px solid rgba(8,125,130,.25); border-color: var(--teal); }
.split-field > div { display: grid; grid-template-columns: 1fr 110px; }
.split-field input { border-radius: 5px 0 0 5px; }
.split-field select { border-left: 0; border-radius: 0 5px 5px 0; }
.lead-order { grid-column: span 2; }
.check { align-self: end; min-height: 43px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.check input { width: 17px; height: 17px; accent-color: var(--teal); }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 19px; margin-top: 4px; }
.form-actions span { color: var(--muted); font-size: 12px; }
.primary, .secondary { border-radius: 5px; font-weight: 750; padding: 11px 22px; }
.primary { border: 0; color: white; background: var(--red); box-shadow: 0 5px 12px rgba(178,31,53,.18); }
.primary:hover { background: #95192c; }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { border: 1px solid var(--navy); color: var(--navy); background: white; }

.upload-zone { border: 1px dashed #9fadb9; background: var(--light); border-radius: 7px; padding: 21px; text-align: center; }
.upload-zone.small { padding: 14px 20px; }
.upload-zone label { display: block; color: var(--navy); font-size: 16px; font-weight: 750; margin-bottom: 11px; }
.upload-zone input { max-width: 100%; }
.upload-zone p { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.output { margin-top: 22px; }
.loading, .error-box, .blocked-box { background: white; border: 1px solid var(--line); min-height: 100px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 13px; padding: 22px; }
.loading span { width: 22px; height: 22px; border: 3px solid #d7e0e7; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { display: block; border-left: 5px solid var(--bad); color: var(--bad); }
.error-box strong { display: block; margin-bottom: 7px; }
.error-box p { margin: 4px 0; color: var(--ink); }
.blocked-box { display: block; border-left: 5px solid var(--warn); }
.blocked-box h3 { color: var(--warn); margin: 0 0 8px; }

.result-header { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 12px; }
.result-header h3 { color: var(--navy); margin: 0; font-size: 18px; }
.result-header p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.download-button { border: 1px solid var(--line); color: var(--navy); background: white; border-radius: 4px; padding: 7px 11px; font-size: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.risk-card { background: white; border: 1px solid var(--line); border-top: 4px solid var(--teal); padding: 18px; border-radius: 7px; box-shadow: var(--shadow); }
.risk-card.positive { border-top-color: var(--red); }
.risk-label { color: var(--navy); font-weight: 750; font-size: 14px; }
.probability { color: var(--navy); font-size: 36px; line-height: 1; font-weight: 850; margin: 15px 0 8px; letter-spacing: -.04em; }
.probability span { font-size: 17px; color: var(--muted); margin-left: 2px; }
.risk-state { font-size: 12px; color: var(--ok); font-weight: 700; }
.positive .risk-state { color: var(--red); }
.bar { height: 8px; background: #e9eef2; border-radius: 4px; overflow: hidden; margin: 14px 0 7px; }
.bar span { display: block; height: 100%; background: var(--teal); }
.positive .bar span { background: var(--red); }
.threshold { color: var(--muted); font-size: 11px; }
.components { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; color: var(--muted); font-size: 11px; }
.components b { display: block; color: var(--ink); font-size: 13px; }

.chart-card, .qc-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-top: 17px; box-shadow: var(--shadow); }
.chart-card h3, .qc-card h3 { color: var(--navy); font-size: 15px; margin: 0 0 13px; }
.chart-wrap { overflow-x: auto; }
canvas { display: block; max-width: 100%; background: white; }
.probability-chart { width: 100%; height: 230px; }
.ecg-chart { width: 100%; min-width: 820px; height: 620px; }
.qc-summary { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.badge { border-radius: 99px; padding: 6px 11px; font-size: 12px; font-weight: 750; background: #edf2f5; color: var(--muted); }
.badge.pass { background: #e5f5ec; color: var(--ok); }
.badge.fail { background: #fbe8ea; color: var(--bad); }
.qc-details { color: var(--muted); font-size: 12px; margin: 11px 0 0; line-height: 1.65; }
.result-note { background: #eef5f5; color: #365b5e; border-left: 4px solid var(--teal); padding: 12px 14px; font-size: 12px; margin-top: 16px; }


@media (max-width: 850px) {
  .hero-inner, .module-heading { align-items: flex-start; flex-direction: column; }
  .service-panel { width: 100%; }
  main { padding: 18px; }
  .form-grid, .result-grid { grid-template-columns: 1fr; }
  .lead-order { grid-column: auto; }
  .module-heading p { text-align: left; }
  .tabs { position: sticky; top: 0; z-index: 4; }
  .tab { padding: 13px 5px; font-size: 13px; }
  .auto-fusion { align-items: flex-start; flex-direction: column; gap: 10px; margin-top: -12px; }
  .auto-fusion-status { margin-left: 29px; }
}

/* 2026-11-28：论文最终模型 */
.disclaimer { margin: 0 0 18px; padding: 10px 14px; background: #fff7e6; border-left: 4px solid #d4a72c; color: #6b4e00; font-size: 13px; border-radius: 4px; }
.field-group { grid-column: 1 / -1; margin: 6px 0 -6px; color: var(--navy); font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.clinical-fields .field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.used-by { margin-left: auto; display: inline-flex; gap: 4px; }
.used-by .tag { font-size: 10px; font-weight: 600; line-height: 1; padding: 3px 5px; border-radius: 3px; color: #fff; }
.used-by .tag-ef { background: #087d82; }
.used-by .tag-mort { background: #5b4b8a; }
.risk-card.no-threshold { border-top-color: #8a9aa8; }
.form-grid.clinical-fields { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .form-grid.clinical-fields { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .form-grid.clinical-fields { grid-template-columns: 1fr; } }
