:root{font-family:Inter,"Microsoft YaHei",Arial,sans-serif;color:#172033;background:#eef3f9}
*{box-sizing:border-box}html,body,#app{height:100%;margin:0}body{overflow:hidden}
.top{height:64px;background:#12223f;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 24px}
.brand{font-size:17px;font-weight:700}.brand small{display:block;margin-top:2px;color:#b9c6da;font-size:12px;font-weight:400}
.btn{border:0;border-radius:8px;padding:9px 14px;background:#e9eff9;color:#194780;cursor:pointer;white-space:nowrap}.btn:hover{filter:brightness(.98)}.btn:disabled{opacity:.5;cursor:not-allowed}.primary{background:#2d6cdf;color:#fff}
.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(140deg,#eaf2ff,#fafcff)}.card{width:min(430px,92vw);background:#fff;border-radius:16px;padding:34px;box-shadow:0 22px 60px #1b355b24}
.field{display:grid;gap:7px;margin:15px 0}.field input,.field select{padding:11px;border:1px solid #ccd8e8;border-radius:8px}.error{background:#fff0f0;color:#9e2929;padding:10px;border-radius:8px;margin:10px 0}
.app-shell{height:100%}.main{height:calc(100dvh - 64px);padding:14px 20px}.tabs{display:flex;gap:6px;height:38px;margin-bottom:10px}.tab{border:0;background:transparent;padding:9px 14px;border-radius:8px;color:#172033;text-decoration:none;cursor:pointer}.tab.on{background:#fff;color:#1d4f91;box-shadow:0 1px 3px #23395b14}
.panel{background:#fff;border:1px solid #dbe3ef;border-radius:12px;overflow:hidden}.sheetnav{height:48px;display:flex;align-items:center;gap:7px;padding:7px 10px;background:#eaf2ff;border:1px solid #ccdced;border-bottom:0;border-radius:12px 12px 0 0;overflow-x:auto;white-space:nowrap}.sheetnav-label{font-size:13px;font-weight:700;color:#50627b;margin-right:2px}.sheetbtn{border:1px solid #c1d2e8;border-radius:7px;background:#fff;color:#24466f;padding:7px 12px;cursor:pointer;flex:0 0 auto}.sheetbtn:hover,.sheetbtn.on{background:#2d6cdf;border-color:#2d6cdf;color:#fff}
.system-editor{height:calc(100% - 96px);min-height:0;border-radius:0 0 12px 12px;display:flex;flex-direction:column}.module-status{height:42px;flex:0 0 42px;display:flex;align-items:center;gap:18px;padding:6px 12px;background:#f8fbff;border-bottom:1px solid #e3eaf3;color:#4f6077;font-size:12px}.module-status b{font-size:14px;color:#203d62}.module-status .spacer{flex:1}
.zoom-controls{display:flex;align-items:center;border:1px solid #cbd8e8;border-radius:7px;overflow:hidden;background:#fff}.zoom-controls button{height:30px;min-width:34px;border:0;border-right:1px solid #d7e0ec;background:#fff;color:#285487;cursor:pointer}.zoom-controls button:nth-child(2){min-width:56px}.zoom-controls button:last-child{border-right:0}.zoom-controls button:hover{background:#edf4ff}
.formula-bar{height:48px;flex:0 0 48px;display:flex;gap:8px;align-items:center;padding:7px 12px;background:#f5f8fc;border-bottom:1px solid #dfe6f0}.formula-bar input{height:34px;min-width:180px;flex:1;border:1px solid #cbd6e5;border-radius:6px;padding:0 10px;font-family:Consolas,"Microsoft YaHei",monospace;background:#fff}.formula-bar input:read-only{background:#eef2f7;color:#5d6877}.mode{font-size:13px;color:#526176;white-space:nowrap}.address{width:72px;padding:7px;background:#fff;border:1px solid #d4deeb;border-radius:6px;text-align:center;font-family:Consolas,monospace}.jump{display:flex;gap:5px}.jump input{width:78px;min-width:78px;flex:0 0 78px}.sync{font-size:12px;color:#477159;white-space:nowrap}.sync.pending,.sync.running{color:#a36500}.sync.failed{color:#b42318}.protect{color:#8a5d00;font-size:12px;white-space:nowrap}
.formula-picker{height:34px;max-width:165px;border:1px solid #9fb7d6;border-radius:6px;padding:0 8px;background:#fff;color:#194780;font-weight:600}
.reference-bar{min-height:38px;max-height:76px;flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:5px 12px;overflow:auto;background:#fffbea;border-bottom:1px solid #ecdca8;font-size:12px;white-space:nowrap}.reference-bar>b{color:#273750;margin-right:5px}.reference-bar>span{color:#6b5b2d}.reference-chip{display:flex;align-items:center;gap:6px;max-width:270px;padding:5px 9px;border:2px solid;border-radius:7px;background:#fff;cursor:pointer}.reference-chip strong{font-family:Consolas,"Microsoft YaHei",monospace}.reference-chip em{overflow:hidden;color:#48566b;font-style:normal;text-overflow:ellipsis}.reference-chip:hover{background:#f8fbff}
.virtual-grid{position:relative;flex:1;overflow:auto;background:#fff;contain:strict}.grid-stage{position:relative;background:#fff}.col-head-row{position:sticky;top:0;height:28px;background:#eef2f7;border-bottom:1px solid #bfc9d7;z-index:12}.col-head{position:absolute;top:0;height:28px;padding:6px 4px;text-align:center;color:#536175;background:#eef2f7;border-right:1px solid #cbd3df;font:11px Consolas,monospace}.corner-head{position:absolute;left:0;top:0;width:46px;height:28px;background:#e5ebf3;border-right:1px solid #bfc9d7;z-index:14}.vcell{position:absolute;overflow:hidden;padding:3px 4px;border-width:0 1px 1px 0;border-style:solid;line-height:17px;text-overflow:ellipsis;cursor:cell}.vcell:hover{outline:1px solid #77a6ef;z-index:3}.vcell.selected{outline:2px solid #2d6cdf;z-index:5}.vcell.formula:after{content:'';position:absolute;right:0;top:0;border-top:6px solid #8ab3ef;border-left:6px solid transparent}.row-head{position:absolute;left:0;width:46px;padding:4px 6px;text-align:right;color:#637083;background:#f3f5f8;border-right:1px solid #cbd3df;border-bottom:1px solid #d9dee7;font-size:11px;z-index:4}
.grid{width:100%;border-collapse:collapse}.grid th,.grid td{text-align:left;padding:12px 14px;border-bottom:1px solid #edf1f6}.grid th{background:#f8fafc;color:#6e7d92}.head{display:flex;justify-content:space-between;gap:16px;padding:16px}.modalbg{position:fixed;inset:0;background:#111b2b88;display:grid;place-items:center;z-index:50}.modal{width:min(460px,92vw);background:#fff;border-radius:14px;padding:24px}.versions{list-style:none;margin:0;padding:0}.versions li{display:flex;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #edf1f6}.muted{color:#6f7d91;font-size:13px}
.import-layout{height:calc(100% - 48px);overflow:auto;display:grid;gap:12px;align-content:start}.import-card,.import-history{overflow:visible}.import-card .head{padding-bottom:8px}.upload-row{display:flex;align-items:center;gap:12px;padding:10px 16px 16px}.upload-row input[type=file]{flex:1;border:1px dashed #aebfd6;background:#f8fbff;border-radius:9px;padding:12px}.notice{margin:0 16px 14px;padding:10px 12px;background:#edf6ff;color:#24568e;border-radius:8px}.order-summary{display:flex;flex-wrap:wrap;gap:10px 20px;padding:12px 16px;background:#f7faff;border-top:1px solid #e2eaf4;border-bottom:1px solid #e2eaf4;font-size:13px}.order-summary b{color:#194780}.warn{color:#b45309!important}.preview-scroll{overflow:auto;max-height:310px}.preview-table{min-width:1050px}.preview-table td{white-space:nowrap}.commit-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px}.import-history{overflow:auto}.import-history .grid{min-width:880px}.status-pill{display:inline-block;border-radius:999px;padding:3px 8px;font-size:12px;background:#eef2f7;color:#536175}.status-pill.ready{background:#e7f7ed;color:#1d6a3c}.status-pill.calculating,.status-pill.pending{background:#fff5d9;color:#8a5a00}.status-pill.failed{background:#ffe9e7;color:#a42920}.vcell.frozen{z-index:9;box-shadow:0 1px 0 #8fa3bd}.row-head.frozen{z-index:10;box-shadow:0 1px 0 #8fa3bd}
@media(max-width:900px){.module-status span:nth-of-type(n+3){display:none}.sync,.protect{display:none}.formula-bar .btn{padding:8px}.address{width:58px}.main{padding:8px}.top{padding:0 12px}.upload-row,.commit-row{align-items:stretch;flex-direction:column}}
@media(max-height:560px){.top{height:52px}.brand small{display:none}.main{height:calc(100dvh - 52px);padding:7px 10px}.tabs{height:34px;margin-bottom:6px}.sheetnav{height:42px}.system-editor{height:calc(100% - 82px)}}
.vcell.selected{padding:0;overflow:visible}.vcell-input{position:absolute;inset:0;width:100%;height:100%;min-width:0;border:0;outline:0;padding:3px 4px;background:#fff!important;color:#111!important;font:inherit;text-align:inherit;caret-color:#111;opacity:1;-webkit-text-fill-color:#111}.vcell.formula:after{pointer-events:none}
.vcell.range{box-shadow:inset 0 0 0 1px rgba(45,108,223,.38)}.vcell.range.selected{outline:2px solid #2d6cdf}.add-sheet{border-style:dashed!important;font-weight:700}.mini-action{border:1px solid #c4d3e8;background:#fff;color:#244f86;border-radius:6px;padding:5px 8px;cursor:pointer;white-space:nowrap}.mini-action:hover{background:#eaf2ff}.formula-main-input{font-family:Consolas,"Microsoft YaHei",sans-serif}
.delete-sheet{color:#b42318!important;border-color:#f1b7b2!important}.delete-sheet:hover{background:#fff0ef!important}.format-bar{overflow-x:auto;overflow-y:hidden}.format-bar button{white-space:nowrap}
.fill-handle{position:absolute;right:-4px;bottom:-4px;width:9px;height:9px;background:#2d6cdf;border:1px solid #fff;box-shadow:0 0 0 1px #2d6cdf;z-index:30;cursor:crosshair}.vcell.selected:has(.fill-handle){overflow:visible}
.format-bar{height:44px;flex:0 0 44px;display:flex;align-items:center;gap:5px;padding:5px 12px;background:#fff;border-bottom:1px solid #dfe6f0}.format-bar select,.format-bar button{height:32px;border:1px solid #cbd6e5;border-radius:6px;background:#fff;color:#263c58}.format-bar select{padding:0 7px}.format-bar select:first-child{width:132px}.format-bar select:nth-child(2){width:62px}.format-bar button{min-width:34px;padding:0 9px;cursor:pointer}.format-bar button.on{background:#dbeaff;border-color:#6b9ee8;color:#174f9c}.format-bar button:disabled,.format-bar select:disabled,.color-tool input:disabled{opacity:.45;cursor:not-allowed}.format-sep{height:25px;border-left:1px solid #d8e0eb;margin:0 3px}.color-tool{position:relative;width:36px;height:32px;display:grid;place-items:center;border:1px solid #cbd6e5;border-radius:6px;background:#fff;font-weight:700;cursor:pointer;overflow:hidden}.color-tool input{position:absolute;left:0;bottom:0;width:100%;height:7px;border:0;padding:0}.fill-tool span{color:#d89a00}.col-head.frozen{z-index:13;box-shadow:1px 0 0 #9babc0}.corner-head{position:sticky;left:0}.vcell.frozenCol{box-shadow:1px 0 0 #8296b1}.vcell.freezeCorner{z-index:11}.row-head{box-shadow:1px 0 0 #a7b4c5}
