:root{font-family:system-ui,-apple-system,"Noto Sans TC","Microsoft JhengHei",sans-serif;color:#193039;background:#f4f6f3;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}a{color:#1f6470}h1,h2,h3,p{margin:0}small{font-size:.78rem}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #64ada9;outline-offset:2px}.boot{height:100vh;display:grid;place-content:center;text-align:center;font-size:2rem;color:#153c48;line-height:2}.boot small{font-size:1rem;color:#6a7c81}.auth-page{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.auth-brand{background:#102f3b;color:#fff;padding:7vw;display:flex;flex-direction:column;justify-content:space-between;gap:4rem}.auth-brand h1{font-size:clamp(2rem,4vw,4.2rem);line-height:1.2;letter-spacing:.04em}.auth-brand p{color:#c7e1d8;max-width:30rem;line-height:1.9}.eyebrow{color:#397985;font-weight:700;font-size:.73rem;letter-spacing:.16em;text-transform:uppercase}.auth-brand .eyebrow{color:#99cdbb}.auth-form-wrap{padding:3rem;display:grid;align-content:center;justify-content:center}.auth-panel{width:min(440px,100%)}.auth-panel h2{font-size:2rem;margin:.7rem 0}.auth-panel p{color:#677880;line-height:1.75}.auth-panel form{margin-top:2rem;display:grid;gap:1rem}.app-shell{display:grid;grid-template-columns:244px minmax(0,1fr);min-height:100vh}.sidebar{background:#102f3b;color:white;padding:2rem 1rem;display:flex;flex-direction:column;gap:1.25rem;min-height:100vh}.brand-lockup{padding:.3rem 1rem 1.4rem;border-bottom:1px solid #35515c}.brand-lockup h2{font-size:1.2rem;letter-spacing:.12em}.brand-lockup small{color:#aac1ca;display:block;margin-top:.45rem}.side-nav{display:grid;gap:.4rem}.nav-btn{padding:1rem;text-align:left;background:transparent;color:#c7d6db;border:0;border-radius:11px;font-weight:600}.nav-btn:hover,.nav-btn.active{background:#245263;color:#fff}.sidebar-footer{margin-top:auto;display:grid;gap:1rem;padding:.7rem}.sidebar-footer small{color:#b9c9ca}.main{min-width:0;padding:2.2rem clamp(1rem,3.3vw,3.4rem);max-width:1500px;width:100%;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;gap:1.2rem;margin-bottom:2rem}.topbar h1{font-size:clamp(1.5rem,2.5vw,2.2rem);margin-top:.5rem;letter-spacing:-.03em}.top-actions{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap}.pill{border-radius:100px;padding:.42rem .8rem;font-size:.75rem;font-weight:700;background:#e6f0ec;color:#266150}.pill.warn{background:#fff0dd;color:#8b5d20}.card{background:#fff;border:1px solid #e3e9e4;border-radius:17px;padding:1.4rem;box-shadow:0 6px 26px rgba(17,53,60,.035)}.grid{display:grid;gap:1.1rem}.two{grid-template-columns:repeat(2,minmax(0,1fr))}.three{grid-template-columns:repeat(3,minmax(0,1fr))}.four{grid-template-columns:repeat(4,minmax(0,1fr))}.stat{padding:1.4rem}.stat strong{font-size:2rem;color:#123f4b;display:block;margin:.7rem 0}.muted{color:#6b7d83}.lead{line-height:1.75;color:#61747b}.section-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.1rem}.section-head h2{font-size:1.18rem}.field{display:grid;gap:.45rem}.field label,.label{font-size:.8rem;font-weight:700;color:#435a62}.field input,.field select,.field textarea,.searchbox{border:1px solid #d1dcd9;border-radius:9px;background:#fff;width:100%;padding:.77rem .86rem;min-width:0;color:#1b3540}.field textarea{min-height:95px;resize:vertical}.field input:disabled{background:#f2f4f2}.field .hint{font-size:.72rem;color:#7c8a8c;line-height:1.5}.check{display:flex;align-items:flex-start;gap:.55rem;line-height:1.55;padding:.3rem 0;font-size:.91rem}.check input{width:1.15rem;height:1.15rem;flex:0 0 auto;accent-color:#266879;margin-top:.1rem}.btn{border:1px solid #cbd9d8;background:#fff;color:#24454f;border-radius:10px;padding:.74rem 1.05rem;font-weight:700;display:inline-flex;justify-content:center;align-items:center;gap:.3rem;text-decoration:none}.btn:hover{filter:brightness(.96)}.btn.primary{background:#155568;color:white;border-color:#155568}.btn.warn{border-color:#b75a51;color:#9f483b}.btn.full{width:100%}.btn:disabled{opacity:.5;cursor:not-allowed}.stack{display:grid;gap:1rem}.case-row{border:1px solid #e4eae6;border-radius:12px;padding:1.05rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}.case-row strong{display:block;margin-bottom:.4rem}.case-actions{display:flex;gap:.5rem;flex-wrap:wrap}.empty{padding:3rem 1rem;text-align:center;color:#7a8989}.empty strong{display:block;color:#284a50;font-size:1.14rem;margin-bottom:.7rem}.steps{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1.1rem}.step{border:1px solid #d9e5e2;border-radius:9px;background:#fff;color:#4f6a6f;padding:.65rem 1rem}.step.active{background:#dfeee8;border-color:#aecfc5;color:#125060;font-weight:800}.group-title{border-bottom:1px solid #e9eeec;padding-bottom:.7rem;margin-bottom:1.2rem;font-size:1.08rem;color:#274d59}.form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.form-grid .wide{grid-column:span 2}.form-grid .full{grid-column:1/-1}.form-actions{display:flex;gap:.75rem;justify-content:space-between;align-items:center;flex-wrap:wrap;margin-top:1.2rem}.alert{border-radius:11px;padding:1rem 1.1rem;line-height:1.6;font-size:.89rem}.alert.notice{background:#edf5f3;border:1px solid #cce4dd;color:#265968}.alert.danger{background:#fff0ed;border:1px solid #f5b8ad;color:#8a3226}.alert.warning{background:#fff5e6;border:1px solid #eed8b7;color:#7e5a20}.alert ul{margin:.5rem 0 0;padding-left:1.4rem}.report{background:white;border:1px solid #dae3df;border-radius:16px;padding:2rem;max-width:1000px;margin:auto}.report-header{border-bottom:3px solid #174a57;padding-bottom:1.1rem;margin-bottom:1.2rem;display:flex;justify-content:space-between;gap:1rem}.report-header h2{font-size:1.4rem}.report-sub{font-size:.74rem;color:#6e8387}.report h3{font-size:1rem;color:#1c5260;border-bottom:1px solid #d9e5e2;padding-bottom:.5rem;margin:1.4rem 0 .8rem}.report table{border-collapse:collapse;width:100%;font-size:.83rem}.report th,.report td{border-bottom:1px solid #e6ece9;text-align:left;padding:.55rem;vertical-align:top}.report th{color:#536d72;background:#f7f9f8}.finding{border:1px solid #e3e8e6;border-left:4px solid #7fadb0;border-radius:9px;padding:.9rem;margin-bottom:.7rem;line-height:1.65}.finding.urgent{border-left-color:#c94e43;background:#fff4f2}.finding.referral{border-left-color:#d18f35;background:#fff9ef}.finding.review{border-left-color:#407ea1}.finding h4{margin:0 0 .35rem;font-size:.92rem}.finding p{font-size:.82rem;margin:.3rem 0}.tag{display:inline-block;background:#eff3f2;color:#496871;padding:.17rem .5rem;border-radius:6px;font-size:.69rem;margin-left:.4rem}.sources{font-size:.76rem;line-height:1.8;overflow-wrap:anywhere}.report-note{font-size:.75rem;color:#617278;line-height:1.8}.signature{border-top:1px solid #cbd8d3;margin-top:1.5rem;padding-top:1rem;font-size:.83rem;line-height:2}.toast{position:fixed;right:1.2rem;bottom:1.2rem;background:#204a58;color:#fff;border-radius:10px;padding:.95rem 1.3rem;max-width:420px;box-shadow:0 8px 28px #233f4550;z-index:50}.banner{margin-bottom:1.1rem}.auth-note{font-size:.75rem;line-height:1.7;color:#77868d}.divider{border-top:1px solid #e4ebe6;margin:1rem 0}.data-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:.7rem}.metric{padding:.95rem;border-radius:10px;background:#f0f6f3}.metric small{color:#668185;display:block}.metric strong{display:block;font-size:1.24rem;margin-top:.4rem}.footer-help{font-size:.8rem;line-height:1.7;color:#72848b;margin:1.3rem 0}.hidden{display:none!important}@media(max-width:1080px){.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.four{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){.auth-page{grid-template-columns:1fr}.auth-brand{padding:2.5rem;gap:1rem}.auth-brand h1{font-size:2rem}.auth-form-wrap{padding:2rem 1rem}.app-shell{grid-template-columns:1fr}.sidebar{min-height:auto;gap:.8rem;padding:1rem}.brand-lockup{padding:.2rem .5rem .8rem}.side-nav{display:flex;overflow-x:auto}.nav-btn{white-space:nowrap;padding:.7rem}.sidebar-footer{display:none}.main{padding:1.15rem}.topbar{align-items:flex-start;flex-direction:column;margin-bottom:1.2rem}.two,.three,.four{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:span 1}.case-row{align-items:flex-start;flex-direction:column}.report{padding:1rem}.report-header{flex-direction:column}.data-summary{grid-template-columns:1fr}.report table{font-size:.74rem}}@media print{@page{margin:14mm;size:A4}.sidebar,.topbar,.not-print,.steps,.form-actions,.toast,.banner{display:none!important}.app-shell{display:block}.main{padding:0;max-width:none}.report{border:0;box-shadow:none;max-width:none;padding:0;font-size:10pt}.finding{break-inside:avoid}.report table{font-size:9pt}.report h3{break-after:avoid}.report-header{padding:0 0 8px}.report-note{color:#555}.report a{color:black;text-decoration:none}}

/* V1.2 即時臨床狀態及病史提示 */
.value-status{display:flex;flex-direction:column;gap:3px;margin-top:7px;padding:7px 10px;border-radius:8px;border:1px solid #e1e9e7;background:#f7faf9;font-size:.72rem;line-height:1.45}
.value-status b{font-size:.73rem}.value-status small{font-size:.68rem;color:#4b6670;font-weight:400}.value-status.missing{background:#f7f8fa;color:#6a7780}.value-status.reference{background:#edf8f1;border-color:#c9e7d5;color:#146849}.value-status.abnormal,.value-status.error{background:#fff1ef;border-color:#f0c9c4;color:#a1392e}.value-status.review{background:#f2f6fa;color:#315b78}.field:has(.value-status.abnormal) input,.field:has(.value-status.error) input{border-color:#c44c40}
.live-assessment{margin:1rem 0;padding:1rem 1.25rem;border:1px solid #cfdeda;background:#f7fbfa;border-radius:12px;font-size:.84rem}.live-assessment.critical{border-color:#d56c5a;background:#fff4f0}.live-assessment ul{margin:.6rem 0 0;padding-left:1.2rem;line-height:1.7}
.prompt-stack{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.clinical-prompt{background:#f4f8f7;border-left:3px solid #427b7b;padding:.8rem;border-radius:7px;font-size:.8rem}.clinical-prompt p{margin:.25rem 0 0;line-height:1.7;color:#4c6269}
.narrative-section{padding:.75rem 0;border-bottom:1px solid #e5efeb;break-inside:avoid}.narrative-section h4{margin:.15rem 0 .4rem;font-size:.98rem;color:#214952}.narrative-section p{font-size:.86rem;line-height:1.9;margin:0;white-space:pre-wrap}
@media(max-width:760px){.prompt-stack{grid-template-columns:1fr}.value-status{font-size:.72rem}}
@media print{.live-assessment,.value-status{display:none!important}.narrative-section{break-inside:auto}.narrative-section h4{break-after:avoid}}

/* V1.3 — 五個獨立驗光工作頁面與最後完整報告。 */
.module-steps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.55rem;overflow:visible;margin-bottom:1.1rem}
.module-steps .step{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:.3rem;text-align:left;min-height:76px;padding:.85rem .9rem;white-space:normal;line-height:1.35}
.module-steps .step small{font-size:.65rem;letter-spacing:.1em;opacity:.7}
.module-steps .step span{font-size:.87rem;font-weight:650}
.module-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1.15rem 1.3rem;border-radius:13px;background:#eff6f4;margin-bottom:1rem}
.module-heading .eyebrow{font-size:.65rem;letter-spacing:.13em;color:#4b7471}
.module-heading h2{margin:.15rem 0 0;font-size:1.25rem;color:#183b43}
.section-summary{margin-top:1.15rem;border-left:4px solid #3a7a72}
.section-summary p{line-height:1.7;color:#37535a}
#draft-report{margin-top:.75rem}
@media(max-width:1080px){.module-steps{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.module-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.module-steps .step{min-height:64px}.module-heading{padding:.85rem 1rem}}
@media print{.app-shell[data-view="edit"]{display:none!important}.module-steps,.module-heading,.section-summary{display:none!important}}

/* V1.7 屈光與眼位：iPhone 需可顯式切換正負號，避免手機數字鍵盤不提供符號鍵。 */
.signed-entry{display:flex;gap:.4rem;align-items:stretch;min-width:0}
.signed-entry input{flex:1;min-width:0;font-variant-numeric:tabular-nums}
.sign-actions{display:flex;gap:.28rem;flex:0 0 auto}
.sign-key{min-width:2.35rem;min-height:2.75rem;padding:.35rem .6rem;border-radius:.6rem;border:1px solid #b5cbc7;background:#e9f3ef;color:#165866;font-size:1.15rem;font-weight:800;line-height:1}
.sign-key:hover,.sign-key:focus-visible{background:#d9ece8}
@media(max-width:760px){.sign-key{min-width:2.65rem;min-height:2.9rem}.signed-entry{gap:.3rem}}

/* V1.9 輕量化綜合評估，保留完整原始數據供查核。 */
.concise-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.8rem}.concise-head h3{border:0!important;margin:0!important}
.concise-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1rem 0}.concise-grid section{border:1px solid #deebe5;border-radius:11px;padding:1rem}.concise-grid h4{font-size:.94rem;margin:0 0 .5rem;color:#254b57}
.concise-list{padding-left:1.2rem;margin:.3rem 0;line-height:1.65;font-size:.88rem}.concise-list li{margin:.25rem 0 .65rem}.concise-list small{display:block;color:#667b82;margin-top:.2rem}
.concise-missing{border-top:1px solid #e6edeb;padding-top:.75rem;margin-top:.55rem;font-size:.86rem}.concise-missing p{margin:.25rem 0}.tiny-note{font-size:.77rem;margin-top:.4rem}
.detail-preview{border:1px solid #cfddd7;border-radius:12px;background:white;padding:.85rem 1rem}.detail-preview summary{cursor:pointer;font-weight:700;color:#235462;padding:.4rem}.detail-preview[open]{padding-bottom:1.4rem}
@media(max-width:760px){.concise-grid{grid-template-columns:1fr}.concise-head{align-items:flex-start}}
@media print{.detail-preview summary{display:none}.detail-preview .report{display:block}}
