:root{color-scheme:dark;--bg:#090b0f;--surface:#14171d;--surface-2:#1b1f26;--line:#2b3039;--text:#f4f6f8;--muted:#9299a5;--blue:#2797ff;--amber:#d1a579;--soft-blue:#142b42}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:radial-gradient(circle at 85% 0%,#16202b 0,transparent 32%),var(--bg);color:var(--text);font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
button,input,select{font:inherit}
button{cursor:pointer}
a{color:#62b5ff}
.topbar{max-width:1280px;margin:auto;height:78px;padding:0 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ffffff0d}
.brand{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:760;letter-spacing:-.03em}
.brand small{display:block;color:var(--muted);font-size:9px;font-weight:700;letter-spacing:.21em;line-height:1}
.brand-icon{display:grid;place-items:center;background:#153d5d;color:#58b9ff;width:37px;height:37px;border-radius:12px;font-size:25px;font-weight:300}
.top-note{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:9px}
.live-dot{width:7px;height:7px;background:#62bd8a;border-radius:50%;box-shadow:0 0 0 4px #62bd8a22;animation:breathe 2.8s ease-in-out infinite}
.layout{max-width:1280px;margin:auto;padding:46px 32px 70px}
.intro{max-width:850px;animation:rise .6s ease-out both}
.eyebrow{color:var(--blue);font-size:10px;font-weight:800;letter-spacing:.2em;display:flex;align-items:center;gap:12px;text-transform:uppercase}
.eyebrow span{color:#87919f;font-weight:600;letter-spacing:.06em;text-transform:none}
.intro h1{font-size:clamp(36px,4.5vw,60px);line-height:1.2;letter-spacing:-.045em;margin:18px 0 13px;font-weight:800}
.intro h1 em{font-style:normal;color:#53adff}
.intro p{color:#abb1bb;font-size:15px;max-width:680px;margin:0 0 28px}
.notice{display:flex;gap:13px;align-items:flex-start;background:#16212d;border:1px solid #264158;border-radius:13px;padding:14px 17px;margin-bottom:23px;color:#b5c6d6;animation:rise .65s .07s ease-out both}
.notice-symbol{display:grid;place-items:center;flex:none;background:#235b88;color:#c7e8ff;width:22px;height:22px;border-radius:50%;font-size:13px;font-weight:800;font-style:italic}
.notice strong,.notice div span{display:block}
.notice strong{font-size:13px;color:#e8f4ff;margin-bottom:2px}
.notice div span{font-size:12px}
.workspace{display:grid;grid-template-columns:340px minmax(0,1fr);align-items:start;gap:20px}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:17px;box-shadow:0 12px 40px #00000017}
.controls{padding:22px;animation:rise .7s .1s ease-out both}
.results{display:grid;gap:15px;animation:rise .7s .17s ease-out both}
.section-head{display:flex;align-items:center;gap:10px;margin-bottom:17px}
.section-head span{display:grid;place-items:center;min-width:28px;height:28px;padding:0 6px;border-radius:8px;background:#173755;color:#77bcff;font-size:10px;font-weight:800}
.section-head h2{margin:0;font-size:17px;letter-spacing:-.02em}
.spaced{margin-top:26px;padding-top:24px;border-top:1px solid var(--line)}
.field-label{display:flex;justify-content:space-between;align-items:center;gap:8px;color:#bec5cf;font-size:12px;font-weight:700;margin:13px 0 8px}
.field-label span{color:var(--muted);font-size:11px;font-weight:400}
input:not([type=range]),select{width:100%;height:44px;background:#20242b;border:1px solid #3a414b;border-radius:9px;color:var(--text);padding:0 12px;outline:none}
input:focus,select:focus,button:focus-visible{outline:2px solid #4caaff;outline-offset:2px}
input::placeholder{color:#777f8c}
input[type=datetime-local]::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.66}
.drug-info{margin-top:14px;background:#1b2027;border:1px solid #303741;border-radius:12px;padding:15px}
.drug-info .kind{color:var(--amber);font-size:11px;font-weight:700}
.drug-info h3{font-size:17px;line-height:1.2;margin:5px 0}
.drug-info p{color:#a4abb5;font-size:11px;line-height:1.5;margin:6px 0}
.drug-info .numbers{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:13px 0}
.drug-info .numbers span{background:#242a32;border-radius:8px;padding:8px;color:#9ea8b4;font-size:10px}
.drug-info .numbers b{display:block;color:#f3f6f8;font-size:15px}
.text-button{background:transparent;border:0;color:#55afff;font-weight:700;font-size:12px;padding:2px 4px}
.text-button:hover{text-decoration:underline}
.dose-input-row{display:grid;grid-template-columns:minmax(0,1fr) 78px;gap:7px}
.dose-input-row input{min-width:0}
.dose-input-row select{font-weight:700}
.hint{color:#8e97a3;font-size:11px;line-height:1.5;margin:8px 0 0}
.primary{width:100%;height:48px;border:0;border-radius:11px;margin-top:17px;background:var(--blue);color:#fff;font-size:14px;font-weight:760;box-shadow:0 7px 20px #1784ef36;transition:transform .2s,box-shadow .2s,background .2s}
.primary span{font-size:19px;vertical-align:-1px;margin-right:5px}
.primary:hover{background:#4bacff;transform:translateY(-2px);box-shadow:0 10px 24px #1784ef55}
.primary:active{transform:translateY(0) scale(.99)}
.list-head{display:flex;justify-content:space-between;align-items:center;margin-top:23px;padding-top:18px;border-top:1px solid var(--line);font-size:13px;font-weight:760}
.list-head small{color:var(--muted);font-size:10px;font-weight:500}
.record-list{margin-top:7px}
.record{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 0 10px 11px;border-bottom:1px solid var(--line);border-left:3px solid var(--amber);animation:rise .3s ease-out both}
.record strong{font-size:13px}
.record small{display:block;color:var(--muted);font-size:11px}
.record .badge{display:inline-block;margin-left:5px;color:#9ccfff;font-size:10px}
.record button{background:#222831;border:0;border-radius:50%;width:27px;height:27px;color:#a6b0bd;font-size:18px;line-height:1}
.record button:hover{background:#5f3035;color:#fff}
.chart-panel{padding:23px 25px 18px;overflow:hidden}
.chart-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.chart-head h2{font-size:22px;letter-spacing:-.035em;margin:7px 0 0}
.muted{color:#8899a9}
.chart-unit{color:#8d9aa6;border:1px solid var(--line);border-radius:6px;padding:3px 7px;font-size:11px}
.chart-tools{display:flex;align-items:center;gap:12px;margin-top:12px;color:var(--muted);font-size:11px}
.chart-tools label{display:flex;align-items:center;gap:7px;white-space:nowrap}
.chart-tools select{width:auto;min-height:30px;padding:4px 25px 4px 9px;font-size:11px}
.chart-tools span{flex:1}
.chart-tools button{padding:5px 9px;font-size:11px;white-space:nowrap}
.chart-wrap{height:340px;min-width:0;margin-top:10px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;background:linear-gradient(180deg,#1b1c20 0%,#181a1f 100%);border-radius:12px;scrollbar-color:#52606c #20252c;scrollbar-width:thin}
.chart-wrap svg{display:block;height:340px;max-width:none;overflow:visible;touch-action:pan-x;cursor:crosshair}
.chart-line{stroke-dasharray:1000;stroke-dashoffset:1000;animation:trace 1.25s cubic-bezier(.2,.7,.2,1) forwards}
.probe{padding:14px 0 8px}
.probe-copy{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.probe-copy span{color:var(--muted);font-size:11px}
.probe-copy strong{font-size:12px;color:#f6d6b5;font-weight:650;text-align:right}
input[type=range]{width:100%;height:24px;margin:6px 0 0;accent-color:var(--amber);cursor:pointer}
input[type=range]:disabled{opacity:.35;cursor:default}
.legend{display:flex;gap:18px;color:#a4acb7;font-size:11px;margin:1px 0 11px}
.legend i{display:inline-block;width:18px;border-top:3px solid var(--amber);vertical-align:middle;margin-right:5px}
.legend i.dashed{border-top:2px dashed var(--blue)}
.chart-caption{padding-top:11px;border-top:1px solid var(--line);color:var(--muted);font-size:11px}
.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.metric{background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:15px 16px}
.metric span,.metric small{display:block;color:var(--muted);font-size:11px}
.metric strong{display:block;font-size:22px;line-height:1.15;margin:6px 0;color:#fff}
.threshold-panel,.plan-panel,.reading{padding:22px 24px}
.threshold-panel>p,.plan-panel>p{font-size:12px;color:#a8b0ba;margin:0 0 17px}
.threshold-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;font-weight:700}
.threshold-row>div{display:flex;align-items:center;gap:8px;max-width:190px}
.threshold-row input{max-width:125px}
.threshold-row span{color:var(--muted);font-size:11px;white-space:nowrap}
.crossing-result,.plan-result{background:#202833;border:1px solid #2e4356;border-radius:10px;margin-top:16px;padding:12px 14px;color:#bfe0ff;font-size:12px;line-height:1.55}
.plan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.plan-grid label{display:grid;gap:6px;color:#cbd1d9;font-size:11px;font-weight:700}
.plan-grid label small{color:var(--muted);font-size:10px;font-weight:400}
.reading .section-head{margin-bottom:10px}
.reading #insight{background:#20242b;border-radius:9px;padding:12px 14px;color:#c5ccd4;font-size:12px}
.reading-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px;margin-top:17px}
.reading-grid b{font-size:12px}
.reading-grid p{font-size:11px;color:var(--muted);margin:5px 0 0}
.sources{background:var(--surface);border:1px solid var(--line);border-radius:17px;margin-top:20px;padding:24px}
.sources>p{color:var(--muted);font-size:12px;max-width:920px}
.source-row{display:flex;align-items:start;gap:14px;padding:13px 0;border-top:1px solid var(--line);font-size:11px}
.source-row strong{flex:none;min-width:85px}
.source-row span{color:var(--muted)}
.source-row a{margin-left:auto;white-space:nowrap}
.footnote{border-top:1px solid var(--line);padding-top:15px;margin-top:19px}
.quick-add{display:none;position:fixed;right:20px;bottom:22px;z-index:5;width:56px;height:56px;background:var(--blue);border:0;border-radius:50%;box-shadow:0 8px 26px #0d7aeb78;color:white;font-size:30px;line-height:1;transition:transform .2s}
.quick-add:hover{transform:scale(1.07)}
footer{max-width:1280px;margin:auto;padding:0 32px 26px;color:var(--muted);display:flex;justify-content:space-between;font-size:11px;letter-spacing:.05em}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@keyframes trace{to{stroke-dashoffset:0}}
@keyframes breathe{50%{box-shadow:0 0 0 7px #62bd8a0a}}
@media(max-width:950px){.workspace{grid-template-columns:1fr}.controls{max-width:none}.layout{padding:34px 22px 55px}.topbar,footer{padding-left:22px;padding-right:22px}}
@media(max-width:600px){.topbar{height:64px}.top-note{display:none}.layout{padding:27px 15px 74px}.intro h1{font-size:36px}.intro p{font-size:13px}.notice{margin-bottom:15px}.panel{border-radius:15px}.controls{padding:17px}.results{gap:11px}.chart-panel{padding:18px 15px 14px}.chart-wrap{height:245px}.chart-head h2{font-size:19px}.metrics{gap:7px}.metric{padding:12px 10px}.metric strong{font-size:17px}.metric span,.metric small{font-size:9px}.threshold-panel,.plan-panel,.reading{padding:18px}.plan-grid{gap:11px}.reading-grid{grid-template-columns:1fr}.sources{padding:18px}.source-row{display:block}.source-row strong,.source-row a{display:block}.source-row a{margin:4px 0 0}.quick-add{display:block}footer span{display:none}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.group-intro{margin:-3px 0 12px}
.course-select-row{display:grid;grid-template-columns:minmax(0,1fr) 74px;gap:7px}
.course-select-row select{min-width:0}
.course-form{margin-top:13px;padding:14px;background:#1b2027;border:1px solid #303741;border-radius:11px}
.course-form .field-label:first-child{margin-top:0}
.course-grid{display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:8px}
.course-grid input{min-width:0}
.form-actions{display:flex;gap:8px;margin-top:12px}
.secondary,.ghost{border-radius:8px;min-height:39px;padding:0 11px;font-size:11px;font-weight:700}
.secondary{border:1px solid #367abd;background:#173e60;color:#d6ecff;flex:1}
.secondary:hover{background:#245780}
.ghost{border:1px solid #3a414b;background:#252b34;color:#b8c5d3}
.ghost:hover{background:#303a46}
.cancel-edit{width:100%;margin-top:8px}
.primary:disabled,.secondary:disabled,.ghost:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none}
.record-actions{display:flex;align-items:center;gap:5px}
.record-actions button:first-child{width:auto;height:27px;padding:0 8px;border-radius:6px;font-size:11px}
.scenario-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}
.inverse-block{border-top:1px solid var(--line);margin-top:18px;padding-top:17px}
.inverse-title{color:#f2d3b2;font-size:13px;font-weight:750}
.inverse-block>.hint{margin:8px 0 0;line-height:1.55}
.inverse-block .scenario-fields{margin-top:13px}
.scenario-fields>label{display:grid;gap:7px;color:#cbd1d9;font-size:11px;font-weight:700;min-width:0}
.scenario-fields input{min-width:0}
.scenario-fields .dose-input-row{grid-template-columns:minmax(0,1fr) 68px}
.legend i.preview{border-top:2px dashed #69b8ff}
.history-panel{padding:24px;margin-top:20px}
.history-panel>p{color:var(--muted);font-size:12px;margin:-3px 0 16px}
.history-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.history-card{display:grid;gap:5px;text-align:left;background:#1d222a;border:1px solid #343b46;border-radius:11px;padding:13px;color:var(--text);transition:border-color .2s,transform .2s}
.history-card:hover{border-color:#4a9add;transform:translateY(-2px)}
.history-card strong{font-size:13px}
.history-card small{font-size:10px;color:var(--muted)}
.history-card span{font-size:11px;color:#acd5f6}
@media(max-width:950px){.history-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.scenario-fields{grid-template-columns:1fr}.history-panel{padding:18px}.history-list{grid-template-columns:1fr}.legend{gap:10px;font-size:10px}}
@media(max-width:600px){.chart-wrap{height:260px}.chart-wrap svg{height:260px}.chart-tools{gap:7px}.chart-tools span{display:none}}
