:root{font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft Yahei',sans-serif;color:#24334d;background:#edf2f7;font-size:15px;--navy:#102039;--teal:#007d89;--orange:#cb7425;--purple:#8067c1}*{box-sizing:border-box}body{margin:0}button,select,input{font:inherit}button{cursor:pointer;background:#fff;border:1px solid #d4dee8;border-radius:7px;padding:8px 12px;color:#2c405c;transition:.15s}button:hover{border-color:#007d89;color:#007d89}button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #00b7c5;outline-offset:3px}header{height:78px;background:var(--navy);display:flex;align-items:center;justify-content:space-between;padding:0 28px;color:white;border-bottom:3px solid #54d9cd}.brand{display:flex;align-items:center;gap:12px;font-weight:650;font-size:19px}.brandmark{font-size:36px;color:#54d9cd}.brand small{display:block;color:#9faec5;font-size:12px;letter-spacing:.6px;margin-top:3px;font-weight:400}.headright{display:flex;align-items:center;gap:9px}.headright button{background:#20324c;border-color:#394c68;color:#e6f2ff}.chip{font-size:12px;border:1px solid #3c5876;padding:6px 10px;border-radius:20px;color:#9fc4d9;margin-right:8px}.workspace{display:grid;grid-template-columns:278px 1fr;max-width:1800px;margin:auto;min-height:calc(100vh - 78px)}aside{background:#fff;border-right:1px solid #d9e2eb;padding:22px 20px;overflow:auto;max-height:calc(100vh - 78px);position:sticky;top:0}.section-title{font-weight:650;font-size:15px;display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:15px}.section-title span{font-size:10px;letter-spacing:1px;color:#8a98aa}label{display:block;font-size:14px;color:#52647b}select{display:block;width:100%;margin-top:7px;background:#f7f9fc;border:1px solid #d6e0eb;border-radius:6px;padding:9px 7px;color:#21314b}.hint{font-size:12px;line-height:1.7;color:#78879a;margin:9px 0 15px}.subtle{font-size:12px;width:100%;background:#f4f8fa;color:#52707a;margin-bottom:15px}.control{margin:15px 0 18px}.control .top{display:flex;justify-content:space-between;align-items:center;gap:5px}.control input[type=number]{width:83px;text-align:right;border:1px solid #d9e4ed;border-radius:5px;padding:5px;color:#173f5c;background:#f8fbfc;font-size:13px}input[type=range]{width:100%;accent-color:var(--teal);height:4px;margin:13px 0 3px;cursor:pointer}.unit{font-size:11px;color:#95a2b2}.control small{font-size:11px;color:#8e9bad}.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.check{display:flex;align-items:center;gap:7px;font-size:12px;white-space:nowrap}.check input{accent-color:var(--teal)}aside .check{margin:14px 0}#periods{font:12px ui-monospace,monospace;line-height:2;color:#655589;padding:8px 10px;background:#f8f5ff;border-radius:6px}main{min-width:0;padding:22px 25px 32px}.stagehead{display:flex;align-items:center;justify-content:space-between;margin:0 0 18px}h1{font-size:23px;margin:0 0 5px;font-weight:650;color:#17314c}.sub{font-size:12px;color:#7890a7}.tabs{display:flex;background:#e2e9f1;border-radius:8px;padding:3px;gap:3px}.tabs button{border:0;background:transparent;font-size:13px}.tabs .active{background:white;color:#006c79;box-shadow:0 2px 5px #163d5920}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:15px}.metric{background:#fff;border:1px solid #dce5ee;border-radius:9px;padding:13px 15px;border-top:3px solid #7a9bae}.metric:first-child{border-top-color:#00a6b1}.metric span{display:block;font-size:12px;color:#71859a}.metric strong{font-size:23px;font-weight:600;display:block;margin:7px 0 3px;color:#19354f;letter-spacing:-.5px}.metric small{font-size:11px;color:#8c9aad}.stage{background:white;border:1px solid #d9e4ec;border-radius:11px;overflow:hidden;box-shadow:0 4px 20px #24466105}.stagebar{display:flex;justify-content:space-between;padding:13px 18px;border-bottom:1px solid #eef2f7}.legend{display:flex;gap:7px;align-items:center;font-size:12px;color:#6b7b91}.legend i{width:13px;height:5px;margin-left:10px;border-radius:1px}.legend .ray{background:#008a9b}.legend .lc{background:#df9a4d}.legend .pg{background:#9782ca}#optics{width:100%;display:block;min-height:330px;background:linear-gradient(#fcfdff,#f5f9fc)}#view3d{height:410px;position:relative}#three{height:100%}.threehint{position:absolute;bottom:15px;left:18px;color:#afc1d0;font-size:12px;pointer-events:none}.stagefoot{display:flex;justify-content:space-between;padding:10px 16px;font-size:11px;color:#8995a5;border-top:1px solid #edf2f5}.lower{display:grid;grid-template-columns:1.2fr 1fr;gap:16px;margin-top:16px}.card{background:white;border:1px solid #dde5ee;border-radius:10px;padding:17px 18px;min-width:0}.card .section-title span{font-size:9px}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px;white-space:nowrap}th{text-align:left;color:#8291a2;font-weight:400;border-bottom:1px solid #e2e9f0;padding:9px 7px}td{padding:9px 7px;border-bottom:1px solid #f0f3f7;color:#445775}tr.pg td{background:#faf8ff}tr.lc td:first-child{color:#ad6c25}.pol{font:12px ui-monospace,monospace;color:#007a87}#matrix{display:grid;gap:5px}#matrix button{font:12px ui-monospace,monospace;padding:8px 3px;border:1px solid #dce8ed;border-radius:5px;min-width:0}#matrix button.selected{outline:2px solid #007c8c;outline-offset:1px}#matrix .axis{font-size:11px;align-self:center;text-align:center;color:#8798aa}.scanTitle{margin-top:20px;margin-bottom:5px}.scanTitle button{font-size:11px;padding:6px 8px}#sweep{width:100%;display:block;background:#fafcfe;border-radius:6px}#warnings{font-size:12px;color:#9e5828;line-height:1.6;margin-top:9px}#warnings:empty{display:none}.notice{font-size:12px;line-height:1.8;color:#76899f;margin-top:17px;padding:12px 15px;background:#e5ecf3;border-radius:8px}.notice b{font-weight:550;color:#52657c}dialog{border:0;border-radius:14px;max-width:720px;width:calc(100% - 30px);padding:30px;box-shadow:0 20px 100px #001c4540;color:#3a4e68}dialog::backdrop{background:#0a193c88;backdrop-filter:blur(3px)}dialog p{line-height:1.85;font-size:15px}dialog h2{color:#183751}dialog h3{font-size:17px;margin-top:25px}dialog a{color:#007d89}.close{float:right}#codeControls[hidden],[hidden]{display:none!important}@media(min-width:1500px){#optics{height:440px}}@media(max-width:1050px){.workspace{grid-template-columns:238px 1fr}aside{padding:18px 14px}main{padding:18px 16px}.metrics{gap:7px}.metric{padding:10px}.metric strong{font-size:19px}.lower{grid-template-columns:1fr}.legend{gap:4px}.stagefoot{flex-wrap:wrap;gap:5px}}@media(max-width:700px){header{padding:0 14px;height:70px}.brand{font-size:16px}.brandmark{font-size:28px}.chip{display:none}.headright{gap:5px}.headright button{font-size:11px;padding:7px}.workspace{display:flex;flex-direction:column}aside{position:static;max-height:none;order:2;border-top:1px solid #ddd;padding:20px}main{padding:17px 12px}.metrics{grid-template-columns:repeat(2,1fr)}.stagehead{gap:8px}h1{font-size:20px}.tabs button{font-size:12px;padding:8px}#optics{min-height:240px}.stagebar{padding:12px 8px}.legend{font-size:10px}.check{font-size:11px}.stagefoot{font-size:10px}.card{padding:15px}aside #controls{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.section-title span{font-size:10px}#view3d{height:300px}}
/* v2: system scene first, component details always readable. */
:root{font-size:16px;background:#edf3f7}header{height:70px}.workspace{grid-template-columns:272px 1fr;max-width:1900px}aside{max-height:calc(100vh - 70px);padding:20px 18px}main{padding:22px 24px}.hint{font-size:13px;color:#546b80;line-height:1.65}.sub{font-size:14px;color:#5a748c}.stagehead{margin-bottom:18px}.stagehead h1{font-size:24px}.routingbar{display:grid;grid-template-columns:1.35fr 1fr 1fr auto;gap:12px;align-items:end;margin:12px 0}.routingbar select{margin-top:5px}.routingbar button{height:39px}.assignment{display:flex;gap:8px;flex-wrap:wrap}.assignment button{font-size:14px;padding:8px 10px;border-bottom:3px solid var(--route)}.assignment button.active{background:#e8f2f6;border-color:var(--route)}.assignment i{display:inline-block;width:8px;height:8px;background:var(--route);border-radius:50%;margin-right:6px}.compact{margin:8px 0 14px}.metrics{gap:10px}.metric{padding:11px 12px}.metric span{font-size:13px}.metric strong{font-size:22px}.metric strong small{display:inline;font-size:13px}.metric small{font-size:12px;color:#5f778c}.stagebar{align-items:center;gap:12px}.tabs button{font-size:14px}.stagefoot{font-size:12px;color:#536c80;align-items:center;gap:12px}#optics{height:auto;min-height:0;background:#fbfdff}.svgroute{cursor:pointer}.svgroute:focus{outline:none;filter:brightness(.8)}.detailhead{display:flex;align-items:baseline;gap:15px;margin-top:24px;margin-bottom:13px}.detailhead h2{font-size:20px;margin:0}.detailhead span{font-size:13px;color:#637b8e}.opticaldetails{display:grid;grid-template-columns:1fr 1fr;gap:14px}.stagecards{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px}.stagecard{text-align:left;padding:12px 10px;display:flex;flex-direction:column;gap:9px;background:#f8fbfd;min-width:0}.stagecard.selected{border:2px solid #e35136;padding:11px 9px}.stagecardtop{display:flex;justify-content:space-between;font-size:14px;gap:6px}.stagecardtop b{color:#695198}.lcstate{font-size:13px;color:#965e13}.pgstate{font-size:13px;color:#634695}.stagecard strong{font-size:17px;font-weight:600;color:#224a62;white-space:nowrap}.stagecard strong small{font-size:12px;display:block;color:#60788b;font-weight:400;margin-top:3px}.stagefine{font-size:12px;color:#5c7287}.bad{color:#b23820}.landingcard{display:grid;grid-template-columns:1.6fr 1fr;gap:20px;margin:14px 0;align-items:center}.landingcard p{font-size:14px;line-height:1.9;margin:0}#landing{width:100%;display:block}.lower{grid-template-columns:1fr 1fr}.lower .hint{font-size:13px}details{margin:15px 0}details.card{padding:16px 18px}summary{cursor:pointer;font-size:15px;font-weight:600;color:#29495e;line-height:1.6}details[open]>summary{margin-bottom:15px}.section-title span{font-size:12px}.paramnote{padding:13px;background:#edf3f7;font-size:13px;color:#546c81;line-height:1.8;border-radius:8px}.control input[type=number]{font-size:14px;width:83px}.control label{font-size:14px}.control{margin:14px 0 20px}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.fallback{padding:28px;color:#294a62;background:#eef4f8;height:100%}.fallback h3{font-size:20px}.fallback p{font-size:15px;line-height:1.8}.threehint{color:#60788d}.check{font-size:13px}#warnings{font-size:13px}#matrix button{font-size:13px}#matrix .axis{font-size:13px}table{font-size:14px}td,th{padding:10px}dialog{max-width:850px}dialog h3{font-size:18px}.notice{font-size:13px;color:#576f83}.reference{border-left:3px solid #8c73b6;padding-left:15px;margin:18px 0}.reference p{margin:6px 0;font-size:14px}#periods{font-size:13px}.stagecard:hover{background:#edf6f8}
@media(min-width:1500px){#optics{height:auto}}@media(max-width:1180px){.workspace{grid-template-columns:250px 1fr}main{padding:18px}.opticaldetails{grid-template-columns:1fr}.stagecards{grid-template-columns:repeat(auto-fit,minmax(135px,1fr))}.routingbar{grid-template-columns:1fr 1fr}.lower{grid-template-columns:1fr}.metric strong{font-size:19px}.metrics{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.workspace{display:flex}aside{order:2;max-height:none;position:static}main{padding:15px 10px}.stagehead{align-items:start}.stagehead h1{font-size:22px}.stagehead button{font-size:12px;padding:7px}.stagebar{flex-wrap:wrap;padding:9px}.tabs button{font-size:13px;padding:8px}.stage{overflow:visible}#view2d{overflow-x:auto}#optics{min-width:760px}.metrics{grid-template-columns:repeat(2,1fr)}.detailhead{flex-direction:column;gap:6px}.opticaldetails{grid-template-columns:1fr}.landingcard{grid-template-columns:1fr}.stagecards{grid-template-columns:repeat(auto-fit,minmax(128px,1fr))}.routingbar label{font-size:13px}.assignment button{font-size:13px}.stagefoot{flex-wrap:wrap}.brand small{font-size:11px}.headright button{font-size:12px}aside #controls{display:block}}
@media(min-width:1000px){.routingbar{grid-template-columns:1.15fr .8fr .8fr auto;gap:10px}.metrics{grid-template-columns:repeat(4,1fr)}.opticaldetails{grid-template-columns:1fr 1fr}.lower{grid-template-columns:1fr 1fr}.opticaldetails:has(.stagecard:nth-child(3)){grid-template-columns:1fr}}.svgcomponent{cursor:pointer}.stagecards .stagecard{transition:background .15s}#sweep{max-height:210px}.detailhead{scroll-margin-top:15px}
.ministage{display:block;width:100%;height:90px;background:#eff5f8;border-radius:5px}
#mobileParams{display:none}@media(max-width:700px){#mobileParams{display:block;position:fixed;right:16px;bottom:18px;z-index:40;background:#0c6874;color:white;box-shadow:0 4px 20px #173c5b30;padding:12px 18px}aside{display:none}.showparams aside{display:block;position:fixed;inset:70px 0 0;max-height:none;overflow:auto;z-index:30;padding-bottom:85px}.showparams main{visibility:hidden}.stagefoot:before{content:'左右滑动查看完整光路';display:block;width:100%;color:#007d89}}
.paperReference{margin-top:18px;border-top:4px solid #765aa8}.referenceControls{display:grid;grid-template-columns:1.6fr 1fr .8fr;gap:14px;margin-bottom:15px}.referenceCondition{font-size:14px;color:#455e76;background:#f2f5fa;padding:12px;line-height:1.8;border-radius:7px}#referenceChart{width:100%;display:block;margin:15px 0 2px;max-height:400px}.referenceLegend{font-size:13px;color:#587187;line-height:1.8}.referenceReadout{font-size:14px;line-height:1.8;color:#3e596f}.referenceBoundary{padding:12px 14px;background:#fff6e7;border-left:3px solid #c88a37;color:#7b5521;font-size:14px;line-height:1.8}.referenceGeometry{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 0;font-size:14px;line-height:1.8}.referenceGeometry button{white-space:nowrap;font-size:13px}#referenceSource{font-size:14px;color:#007d89}@media(max-width:700px){.referenceControls{grid-template-columns:1fr}.referenceGeometry{flex-direction:column;align-items:start}.paperReference>.section-title{flex-wrap:wrap}#referenceChart{min-width:0}.referenceCondition,.referenceReadout,.referenceBoundary{font-size:13px}}
.headActions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.headActions button{font-size:13px}.paperReference{scroll-margin-top:18px}@media(max-width:700px){.stagehead{flex-wrap:wrap}.headActions{justify-content:flex-start}.paperReference .section-title span{font-size:11px}}
.portFaces{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}.portFaces section{background:white;border:1px solid #d4e0e9;padding:12px;border-radius:9px;overflow:auto}.portFaces b{font-size:14px}.portFaces svg{width:100%;max-height:240px;display:block}.portFaces small{font-size:12px;color:#5c768d}.projectionControl{display:flex;align-items:center;gap:6px;font-size:12px}.projectionControl select{margin:0;padding:5px;width:125px;font-size:12px}.stagebar{flex-wrap:wrap}.stagecard strong{white-space:normal}.lower{display:block}#matrix{overflow:auto;padding:3px}.scanPanel{margin-top:16px}.scanSetup,.scanCriteria{display:grid;grid-template-columns:repeat(3,minmax(110px,1fr));gap:12px;align-items:end}.scanSetup{grid-template-columns:repeat(3,minmax(100px,1fr)) auto}.scanSetup input,.scanCriteria input{width:100%;margin-top:6px;padding:8px;border:1px solid #cbdbe6;border-radius:6px;font:inherit;color:#294e66;background:#f8fbfd}.scanSetup label,.scanCriteria label{font-size:13px}#scanChart{width:100%;display:block;max-height:330px}#scanChart circle{cursor:pointer}.scanSelect{display:flex;gap:10px;align-items:end;margin-bottom:14px}.scanSelect label{flex:1}.scanValues{background:#f0f6f9;border-radius:9px;padding:15px;line-height:1.7;font-size:14px}.scanValues:empty{display:none}.scanValueGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}.scanValueGrid span{font-size:12px;color:#536e84}.scanValueGrid b{display:block;font-size:16px;color:#214f66}.scanValues p{font-size:13px;margin-bottom:0}.applyScan{margin:13px 0;background:#0e7886;color:white;border-color:#0e7886}.applyScan:hover{color:white;background:#075c69}.scanPanel details{margin-bottom:6px}.scanPanel>label{max-width:350px}.portFaces[hidden]{display:none!important}@media(max-width:700px){.portFaces{grid-template-columns:1fr}.scanSetup,.scanCriteria{grid-template-columns:1fr 1fr}.scanValueGrid{grid-template-columns:1fr 1fr}.scanSelect{flex-wrap:wrap}.scanSelect label{min-width:180px}.projectionControl{order:3}.scanSetup button{align-self:end}.scanPanel{padding:13px}.scanValues{padding:12px}}

#assignment{max-height:160px;overflow:auto}#randomize{background:#0e7886;color:white}.portFaces svg{min-width:300px}.routingbar{flex-wrap:wrap}

.portFaces svg{max-height:none}#matrix{max-height:550px}

[hidden]{display:none!important}.physicalSummary{margin:10px 0 16px;padding:13px 16px;border-left:4px solid #158a9b;background:#eaf3f6;line-height:1.8;font-size:13px;color:#31556b}.beamcard{margin:16px 0;border-top:3px solid #188a9b}#beamEnvelope{width:100%;max-height:320px;display:block}.paramnote{line-height:1.8}#matchWaist{width:100%;margin:0 0 14px}
