:root {
  --ink: #15222e;
  --muted: #6a7780;
  --soft: #f4f6f3;
  --paper: #fbfcfa;
  --line: #dfe5df;
  --navy: #183a4a;
  --teal: #1c7c79;
  --mint: #d8eee5;
  --coral: #df755f;
  --sand: #ead9b8;
  --shadow: 0 18px 50px rgba(26, 51, 64, .08);
  --radius: 2px;
}

* { box-sizing: border-box; }
html { background: var(--soft); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--soft); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.55; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { display: grid; grid-template-columns: 254px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 32px 24px 26px; background: var(--navy); color: #eaf2ef; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--navy); background: var(--mint); font-weight: 800; letter-spacing: -.08em; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.brand-caption { margin-top: 1px; color: #9ab5b7; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.side-rule { height: 1px; margin: 38px 0 26px; background: rgba(232, 242, 239, .18); }
.primary-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border: 0; color: #b4cdcc; background: transparent; text-align: left; transition: background .2s, color .2s; }
.nav-item:hover, .nav-item.active { color: #f8fcf8; background: rgba(216, 238, 229, .11); }
.nav-item.active { box-shadow: inset 3px 0 var(--coral); }
.nav-index { color: #6f9b9d; font-size: 11px; letter-spacing: .1em; }
.nav-item.active .nav-index { color: var(--coral); }
.sidebar-footer { margin-top: auto; }
.status-dot { display: flex; align-items: center; gap: 8px; color: #b4cdcc; font-size: 12px; }
.status-dot span { width: 7px; height: 7px; border-radius: 50%; background: #71d0a4; box-shadow: 0 0 0 4px rgba(113, 208, 164, .12); }
.sidebar-note { margin-top: 20px; color: #7f9a9c; font-size: 11px; line-height: 1.6; letter-spacing: .04em; }

.main-content { min-width: 0; padding: 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--muted); font-size: 11px; letter-spacing: .09em; }
.breadcrumb strong { color: var(--ink); }
.crumb-sep { padding: 0 8px; color: #b0bbb8; }
.topbar-actions { display: flex; align-items: center; gap: 24px; }
.model-chip { padding: 5px 9px; color: var(--teal); border: 1px solid #a8d3ca; background: #eff8f4; font-size: 10px; letter-spacing: .08em; }
.text-link { color: var(--teal); font-size: 12px; text-decoration: none; border-bottom: 1px solid #b2d2cb; }
.text-link:hover { color: var(--coral); border-color: var(--coral); }
.section-view { display: none; max-width: 1340px; margin: 0 auto; padding: 72px 0 40px; animation: enter .35s ease both; }
.section-view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .16em; line-height: 1.2; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 22px; font-size: clamp(38px, 5vw, 68px); line-height: 1.04; letter-spacing: -.06em; font-weight: 650; }
h1 em { color: var(--teal); font-style: normal; }
h2 { margin-bottom: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.04em; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .75fr); gap: 70px; align-items: end; padding-bottom: 96px; }
.hero-copy { max-width: 610px; margin-bottom: 30px; color: var(--muted); font-size: 16px; }
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 43px; padding: 10px 17px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; font-weight: 650; transition: transform .2s, background .2s, border-color .2s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #f9fcfa; background: var(--teal); }
.button-primary:hover { background: #146360; }
.button-secondary { color: var(--navy); background: var(--mint); border-color: #b9dcd0; }
.button-secondary:hover { background: #c7e7db; }
.button-quiet { color: var(--ink); background: transparent; border-color: var(--line); }
.button-quiet:hover { border-color: #9fb3ad; background: #fff; }
.hero-stat-panel { padding: 25px 25px 21px; border-top: 3px solid var(--coral); background: #eef3ef; box-shadow: var(--shadow); }
.panel-kicker { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.hero-stat-value { margin: 17px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 68px; line-height: .95; letter-spacing: -.08em; }
.hero-stat-label { margin-top: 8px; color: var(--muted); font-size: 12px; }
.stat-rule { height: 1px; margin: 23px 0 11px; background: #d0dcd5; }
.mini-stat-row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--muted); font-size: 12px; }
.mini-stat-row strong { color: var(--ink); font-size: 13px; }
.section-heading, .result-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin: 0 0 27px; }
.section-lead { max-width: 370px; margin: 0; color: var(--muted); font-size: 13px; }
.method-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.3fr); gap: 28px; margin-bottom: 92px; }
.method-flow { padding: 6px 0; }
.flow-node { width: 100%; display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px; border: 1px solid transparent; color: var(--muted); background: transparent; text-align: left; }
.flow-node:hover { color: var(--ink); background: #f8faf7; }
.flow-node.selected { color: var(--ink); border-color: var(--line); background: #fff; box-shadow: 0 6px 18px rgba(26, 51, 64, .05); }
.node-number { color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.flow-node strong { display: block; font-size: 14px; }
.flow-node small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.flow-connector { height: 18px; margin-left: 21px; border-left: 1px solid #b8cbc4; }
.detail-panel { min-height: 312px; padding: 30px 33px; border-left: 3px solid var(--teal); background: #fff; box-shadow: var(--shadow); }
.detail-panel h3 { margin: 0 0 12px; font-size: 24px; letter-spacing: -.04em; }
.detail-panel p { color: var(--muted); font-size: 14px; }
.detail-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--line); }
.detail-meta span { display: block; color: var(--muted); font-size: 11px; }
.detail-meta strong { display: block; margin-top: 5px; color: var(--ink); font-size: 14px; }
.detail-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.detail-list li { position: relative; padding-left: 16px; color: var(--muted); font-size: 13px; }
.detail-list li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 2px; background: var(--coral); }
.evidence-grid { display: grid; grid-template-columns: 1.25fr .75fr .75fr; gap: 16px; }
.evidence-card { min-width: 0; margin: 0; border: 1px solid var(--line); background: #fff; }
.evidence-card img { display: block; width: 100%; height: 184px; object-fit: contain; background: #fff; }
.evidence-card-wide img { height: 220px; }
.evidence-card figcaption { display: grid; gap: 3px; padding: 12px 14px 14px; }
.evidence-card figcaption span { color: var(--teal); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.evidence-card figcaption strong { font-size: 13px; }

.compact-intro { max-width: 800px; margin-bottom: 38px; }
.compact-intro h1 { font-size: clamp(36px, 4.5vw, 58px); }
.compact-intro > p:last-child { max-width: 650px; color: var(--muted); font-size: 15px; }
.model-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 15px 17px; margin-bottom: 15px; border: 1px solid var(--line); background: #eef3ef; }
.active-model-summary { display: grid; gap: 3px; }
.toolbar-label { color: var(--muted); font-size: 11px; }
.active-model-summary strong { font-size: 14px; }
.active-model-summary small { color: var(--muted); font-size: 11px; }
.custom-model-actions { display: flex; align-items: center; gap: 9px; }
.model-file-label { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 11px; border: 1px dashed #aec4bb; color: var(--muted); background: #fff; cursor: pointer; font-size: 11px; }
.model-file-label:hover { border-color: var(--teal); color: var(--ink); }
.model-toolbar select { min-width: 285px; padding: 7px 9px; border: 1px solid #bdcdc5; border-radius: 0; color: var(--ink); background: #fff; font-size: 13px; }
.model-toolbar > span { color: var(--muted); font-size: 12px; }
.predict-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 16px; }
.input-panel, .prediction-result, .batch-panel, .train-input-panel, .training-status-panel { border: 1px solid var(--line); background: #fff; }
.input-panel { padding: 27px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 23px; }
.panel-heading h2 { font-size: 20px; }
.required-note { color: var(--muted); font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 5px; }
.field label { color: var(--ink); font-size: 12px; font-weight: 650; }
.field label span { color: var(--muted); font-weight: 400; }
.field input, .target-field input { width: 100%; padding: 10px 11px; border: 1px solid #cad6d0; border-radius: 0; color: var(--ink); background: var(--paper); outline: 0; }
.field input:focus, .target-field input:focus, .model-toolbar select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(28, 124, 121, .1); }
.field small { min-height: 16px; color: var(--muted); font-size: 10px; }
.form-actions { margin-top: 25px; }
.form-error { min-height: 18px; margin-top: 12px; color: #a43d34; font-size: 12px; white-space: pre-wrap; }
.prediction-result { position: relative; min-height: 480px; padding: 30px; overflow: hidden; background: var(--navy); color: #eef7f2; }
.prediction-result::after { content: ""; position: absolute; right: -100px; bottom: -130px; width: 310px; height: 310px; border: 1px solid rgba(216, 238, 229, .17); border-radius: 50%; box-shadow: 0 0 0 35px rgba(216, 238, 229, .04), 0 0 0 70px rgba(216, 238, 229, .03); }
.prediction-result .eyebrow { color: #9ed4c3; }
.result-empty { position: relative; z-index: 1; margin-top: 78px; }
.result-orbit { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 25px; border: 1px solid rgba(216, 238, 229, .35); color: var(--mint); font-size: 15px; font-weight: 800; letter-spacing: -.08em; }
.result-empty h2 { max-width: 260px; margin-bottom: 12px; color: #f6fbf8; font-size: 26px; }
.result-empty p:last-child { max-width: 260px; color: #a8c2be; font-size: 13px; }
.result-filled { position: relative; z-index: 1; }
.result-filled h2 { margin-bottom: 8px; color: #f6fbf8; font-size: 27px; }
.score-block { display: flex; align-items: end; gap: 9px; margin: 27px 0 14px; }
.score-number { color: var(--mint); font-family: Georgia, serif; font-size: 76px; line-height: .85; letter-spacing: -.08em; }
.score-unit { color: #9ab5b7; font-size: 13px; }
.risk-pill { display: inline-flex; align-items: center; padding: 6px 10px; color: #153a3b; background: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.risk-pill.high { color: #fff4ed; background: var(--coral); }
.score-track { height: 7px; margin: 22px 0 10px; background: rgba(216, 238, 229, .18); }
.score-track span { display: block; height: 100%; background: var(--mint); }
.result-meta { display: grid; gap: 0; margin-top: 26px; border-top: 1px solid rgba(216, 238, 229, .18); }
.result-meta-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(216, 238, 229, .12); color: #9ab5b7; font-size: 12px; }
.result-meta-row strong { color: #eef7f2; font-weight: 600; }
.result-footnote { margin-top: 17px; color: #9ab5b7; font-size: 11px; }
.batch-panel { margin-top: 16px; padding: 25px 27px; }
.upload-row { display: flex; align-items: center; gap: 12px; }
input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.file-drop, .large-drop { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 12px 14px; border: 1px dashed #aec4bb; background: #f7faf7; cursor: pointer; }
.file-drop { flex: 1; }
.file-drop:hover, .large-drop:hover { border-color: var(--teal); background: #f0f8f3; }
.file-drop strong, .large-drop strong { display: block; font-size: 13px; }
.file-drop small, .large-drop small { display: block; color: var(--muted); font-size: 10px; }
.upload-icon, .drop-mark { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; color: var(--teal); border: 1px solid #b9d9ce; font-size: 17px; }
.batch-table-wrap { overflow-x: auto; margin-top: 18px; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.batch-table th, .batch-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.batch-table th { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.batch-table td strong { color: var(--teal); }
.batch-risk-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.batch-risk-badge.low { color: #17645a; background: #d9f2e8; }
.batch-risk-badge.high { color: #9d3f2c; background: #ffe0d4; }
.batch-risk-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.training-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 16px; }
.train-input-panel, .training-status-panel { padding: 27px; }
.large-drop { flex-direction: column; align-items: flex-start; justify-content: center; min-height: 150px; margin-bottom: 18px; }
.drop-mark { width: 42px; height: 42px; font-size: 11px; letter-spacing: .08em; }
.target-field { display: grid; gap: 7px; margin-bottom: 21px; color: var(--ink); font-size: 12px; font-weight: 650; }
.target-field small { color: var(--muted); font-size: 10px; font-weight: 400; }
.full-button { width: 100%; }
.status-line { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; }
.status-line strong { font-size: 17px; }
.status-bullet { width: 9px; height: 9px; border-radius: 50%; background: #bbc8c2; }
.status-bullet.running { background: var(--coral); box-shadow: 0 0 0 5px rgba(223, 117, 95, .13); animation: pulse 1.3s ease-in-out infinite; }
.status-bullet.done { background: #55ae82; }
.status-bullet.error { background: #bd453d; }
@keyframes pulse { 50% { opacity: .35; } }
.status-message { max-width: 430px; color: var(--muted); font-size: 13px; }
.stage-list { display: grid; gap: 10px; margin-top: 25px; }
.stage-list > div { display: flex; align-items: center; gap: 12px; color: #a7b3ad; font-size: 12px; }
.stage-list > div span { color: #b7c7bf; font-size: 10px; }
.stage-list > div.current { color: var(--ink); }
.stage-list > div.current span { color: var(--coral); }
.stage-list > div.done { color: var(--teal); }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }
.metric-strip span { display: block; color: var(--muted); font-size: 10px; }
.metric-strip strong { display: block; margin-top: 3px; color: var(--ink); font-family: Georgia, serif; font-size: 25px; }
.training-download-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.training-note { display: flex; gap: 18px; align-items: start; padding: 18px 0; margin-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.training-note > span { flex: 0 0 auto; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.training-note p { max-width: 700px; margin: 0; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 30px 0 35px; color: #89958f; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 25px 13px; }
  .brand-lockup { justify-content: center; }
  .brand-lockup > div:last-child, .sidebar-note, .status-dot, .nav-item span:last-child { display: none; }
  .side-rule { margin: 28px 0 20px; }
  .nav-item { justify-content: center; padding: 13px 8px; }
  .nav-item.active { box-shadow: inset 3px 0 var(--coral); }
  .main-content { padding: 0 30px; }
  .hero-grid { gap: 35px; }
  .evidence-grid { grid-template-columns: 1fr 1fr; }
  .evidence-card-wide { grid-column: 1 / -1; }
  .predict-layout, .training-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 14px 18px; }
  .brand-lockup { justify-content: flex-start; }
  .brand-lockup > div:last-child, .status-dot { display: block; }
  .side-rule, .sidebar-footer { display: none; }
  .primary-nav { display: flex; gap: 4px; margin-top: 15px; }
  .nav-item { flex: 1; justify-content: center; padding: 9px 5px; }
  .nav-item span:last-child { display: block; font-size: 12px; }
  .nav-index { display: none; }
  .main-content { padding: 0 17px; }
  .topbar { min-height: 60px; }
  .breadcrumb { font-size: 9px; }
  .topbar-actions .text-link { display: none; }
  .section-view { padding-top: 43px; }
  h1 { font-size: 42px; }
  .hero-grid { grid-template-columns: 1fr; padding-bottom: 65px; }
  .hero-stat-panel { max-width: 420px; }
  .section-heading, .result-heading, .panel-heading { display: block; }
  .section-lead { margin-top: 12px; }
  .method-layout { grid-template-columns: 1fr; margin-bottom: 65px; }
  .detail-panel { min-height: 0; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .evidence-grid { grid-template-columns: 1fr; }
  .evidence-card-wide { grid-column: auto; }
  .model-toolbar { display: block; }
  .custom-model-actions { flex-wrap: wrap; margin-top: 14px; }
  .field-grid { grid-template-columns: 1fr; }
  .input-panel, .prediction-result, .batch-panel, .train-input-panel, .training-status-panel { padding: 21px; }
  .upload-row { display: grid; grid-template-columns: 1fr; }
  .file-drop { width: 100%; }
  .training-layout { gap: 12px; }
  .site-footer { display: block; line-height: 1.8; }
  .site-footer span { display: block; }
}
