:root{font-family:'Microsoft YaHei UI','Microsoft YaHei',system-ui,sans-serif;color-scheme:light;--bg:#f7f7f7;--panel:#fff;--side:#fff;--text:#262626;--muted:#7b7b7b;--line:#dedede;--hover:#eee;--selected:#ddd;--primary:#303030;--primary-text:#fff;--warn:#bb3232;font-size:14px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}body.dark{color-scheme:dark;--bg:#181818;--panel:#242424;--side:#222;--text:#eee;--muted:#b0b0b0;--line:#414141;--hover:#303030;--selected:#3a3a3a;--primary:#e8e8e8;--primary-text:#141414;--warn:#f08080}button,input,select,textarea{font:inherit;color:inherit}button,input,select,textarea{border:1px solid var(--line);border-radius:7px;background:var(--panel);padding:10px 14px;min-height:40px}button{font-weight:600;cursor:pointer;white-space:nowrap}button:hover{background:var(--hover)}button:disabled{opacity:.4;cursor:default}button.primary{background:var(--primary);color:var(--primary-text);border-color:var(--primary)}button.danger{color:var(--warn)}input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible{outline:2px solid var(--text);outline-offset:2px}input[type=checkbox]{accent-color:var(--primary);width:19px;height:19px;min-height:0;cursor:pointer}input,select,textarea{min-width:0}textarea{resize:vertical;min-height:110px}a{color:inherit}h1,h2,h3,p{margin:0}h1{font-size:29px}h2{font-size:23px}h3{font-size:17px}p{line-height:1.7}.muted{color:var(--muted);font-size:13px}.row{display:flex;gap:10px;align-items:center;min-width:0}.wrap{flex-wrap:wrap}.grow{flex:1;min-width:0}.spacer{flex:1}.stack{display:flex;flex-direction:column;gap:18px;min-width:0}.sidebar{position:fixed;inset:0 auto 0 0;width:226px;background:var(--side);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:32px 24px 24px;gap:12px;z-index:5}.brand{display:flex;flex-direction:column;align-items:center;gap:14px;margin-bottom:18px}.chip-icon{width:66px;height:66px;flex-shrink:0}.brand-name{font-family:KaiTi,STKaiti,serif;font-size:31px;font-weight:bold;letter-spacing:4px}.brand b{letter-spacing:3px;font-size:19px}.sidebar nav{display:flex;flex-direction:column;gap:8px}.sidebar nav button{background:none;text-align:left;border:0;padding:12px 10px;color:var(--muted)}.sidebar nav button.active{color:var(--text);background:var(--selected);border-left:3px solid var(--text)}.account{margin-top:auto}.account button{width:100%;text-align:left;background:none;border:0}.main{margin-left:226px;height:100dvh;padding:40px 36px 24px;display:flex;flex-direction:column;gap:24px;min-width:0;position:relative;overflow:hidden}.page-header{display:flex;align-items:center;gap:18px;min-height:80px}.page-header p{margin-top:8px}.page-body{display:flex;flex-direction:column;gap:20px;min-height:0;flex:1;position:relative}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.stat{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:20px;text-align:left;display:flex;flex-direction:column;gap:12px;white-space:normal}.stat strong{font-size:32px}.stat small{font-weight:400;color:var(--muted)}.toolbar{display:flex;gap:8px;align-items:center;min-width:0}.toolbar input{flex:1}.footer{display:flex;gap:8px;align-items:center;flex-shrink:0;flex-wrap:wrap}.footer.right{justify-content:flex-end}.results{flex:1;min-height:0;display:flex;flex-direction:column;gap:18px}.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;min-height:0;flex:1}.split>section{display:flex;flex-direction:column;min-width:0;min-height:0;gap:10px}.table-wrap{overflow:auto;border:1px solid var(--line);background:var(--panel);min-height:0;flex:1;position:relative;scrollbar-color:var(--muted) var(--panel);scrollbar-width:auto}.table-wrap table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:100%;min-width:700px}th{position:sticky;top:0;background:var(--hover);z-index:1;cursor:pointer;user-select:none;text-align:left;height:49px;font-size:13px;color:var(--muted)}th,td{padding:12px 14px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);vertical-align:middle;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}td{height:50px;font-size:13px}td.wrap-text{white-space:normal;line-height:1.6}tr:nth-child(even) td{background:color-mix(in srgb,var(--panel),var(--bg) 45%)}tr.selected td{background:var(--selected)}tr:hover td{background:var(--hover)}.resize{position:absolute;right:-1px;top:0;bottom:0;width:12px;cursor:col-resize;z-index:2}.resize:after{content:'Ⅱ';position:absolute;right:3px;top:16px;font-size:10px;color:var(--muted)}.check-col{text-align:center}.empty{text-align:center;padding:50px;color:var(--muted)}dialog{color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:0;width:min(1060px,94vw);max-height:92dvh;box-shadow:0 20px 80px #0006}dialog::backdrop{background:#0007}.modal-head{padding:24px 24px 18px;display:flex;align-items:center;gap:15px}.modal-head button{border:0;background:none;font-size:24px;min-height:32px;padding:0 6px}.modal-body{padding:0 24px 18px;max-height:calc(90dvh - 175px);overflow:auto;display:flex;flex-direction:column;gap:18px}.modal-foot{padding:18px 24px;display:flex;gap:10px;justify-content:flex-end;border-top:1px solid var(--line);flex-wrap:wrap}.form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px 20px}.field{display:flex;flex-direction:column;gap:8px;min-width:0}.field.wide{grid-column:1/-1}.field label{color:var(--muted);font-size:13px}.field>*{width:100%}.tabs{display:flex;gap:6px;border-bottom:1px solid var(--line)}.tabs button{border-bottom-left-radius:0;border-bottom-right-radius:0;background:transparent}.tabs button.active{background:var(--selected)}.menu{position:fixed;z-index:1000;display:flex;flex-direction:column;min-width:220px;max-width:90vw;max-height:70vh;overflow:auto;padding:7px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 10px 35px #0005}.menu button{border:0;text-align:left;background:none;font-weight:400}.menu button:hover{background:var(--hover)}.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:8px 22px}.setting-row{display:flex;align-items:center;gap:24px;padding:17px 0;min-height:66px}.setting-row+.setting-row{border-top:1px solid var(--line)}.setting-row>.setting-label{flex:1}.setting-label p{color:var(--muted);font-size:13px;margin-top:5px}.setting-row input:not([type=checkbox]),.setting-row select{max-width:340px}.setting-title{font-weight:600}.settings-layout{display:flex;gap:22px;min-height:0;flex:1}.settings-nav{width:190px;flex-shrink:0;background:var(--hover);border-radius:12px;padding:14px;overflow:auto;display:flex;flex-direction:column;gap:6px}.settings-nav button{border:0;background:none;text-align:left;font-weight:400}.settings-nav button.active{background:var(--selected);font-weight:600}.settings-nav button.group{font-weight:600;margin-top:10px}.settings-content{flex:1;overflow:auto;min-width:0;padding:16px 12px}.settings-content>.stack{max-width:960px;margin:auto}.theme-choices{display:flex;gap:9px}.theme-choices button{width:95px;height:80px;padding:6px;white-space:normal;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}.theme-choices button.active{outline:2px solid var(--text)}.theme-choices svg{width:25px;height:25px}.login{max-width:430px;margin:12vh auto;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:35px;display:flex;flex-direction:column;gap:20px}.login .brand{margin-bottom:10px}#toast{position:fixed;right:24px;top:18px;z-index:2000;background:var(--panel);border:1px solid var(--line);padding:12px 18px;border-radius:9px;box-shadow:0 8px 28px #0003;max-width:600px;display:none}#toast.error{color:var(--warn)}#busy{position:fixed;bottom:12px;right:20px;z-index:1500;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:8px 14px;color:var(--muted)}.chip-background{position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.22}.above{position:relative;z-index:1}.drop-active:after{content:'松开以导入 BOM / 网表';position:fixed;inset:30px 30px 30px 250px;background:var(--panel);border:3px dashed var(--text);border-radius:16px;display:grid;place-items:center;font-size:26px;z-index:200}.badge{font-size:12px;border:1px solid var(--line);padding:3px 8px;border-radius:6px;color:var(--muted)}.alert-title{color:var(--warn)}.video{width:100%;max-height:45vh;background:#111}.permission-note{padding:12px;border:1px solid var(--line);border-radius:8px;color:var(--muted)}::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-thumb{background:var(--muted);border:3px solid var(--panel);border-radius:7px}::-webkit-scrollbar-track{background:var(--panel)}@media(max-width:1100px){.main{padding:26px 22px;gap:18px}.sidebar{width:195px;padding:26px 16px}.main{margin-left:195px}.brand-name{font-size:26px}.page-header{flex-wrap:wrap}.page-header h1{font-size:25px}.settings-nav{width:165px}.setting-row{gap:12px}.theme-choices button{width:79px}.footer button{padding:10px}.stats{gap:8px}.stat{padding:15px}.split{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}@media(max-width:760px){.sidebar{position:relative;width:100%;padding:12px}.brand{flex-direction:row;justify-content:center;margin:0;gap:9px}.brand .chip-icon{width:40px;height:40px}.brand-name{font-size:23px}.brand b,.brand .muted{display:none}.sidebar nav{flex-direction:row;overflow:auto}.sidebar nav button{flex-shrink:0}.account{display:none}.main{margin:0;padding:20px 14px;height:calc(100dvh - 130px);overflow:auto}.stats{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.page-header .chip-icon{display:none}.toolbar{flex-wrap:wrap}.toolbar input{flex-basis:100%}.split{display:flex;flex-direction:column}.split>section{min-height:260px}.form{grid-template-columns:1fr}.settings-layout{display:block;overflow:auto}.settings-nav{width:100%;flex-direction:row;overflow:auto;margin-bottom:15px}.settings-nav button{flex-shrink:0}.settings-content{overflow:visible}.setting-row{align-items:flex-start;flex-wrap:wrap}.setting-row>.setting-label{flex-basis:100%}.modal-body{max-height:calc(90dvh - 210px)}.drop-active:after{inset:15px}.page-body{min-height:450px}}

.chip-icon{color:var(--text);background:transparent}

th.check-col{padding:8px;overflow:visible}th.check-col input{vertical-align:middle;margin:0 0 0 4px;padding:0}

.login-title{font-size:22px;text-align:center;line-height:1.5}.login-edition{display:inline-block;margin-left:6px;font-size:14px;font-weight:400;color:var(--muted);white-space:nowrap}

.pool-classify{padding:10px 12px}

[hidden]{display:none!important}.home-body{isolation:isolate;overflow:hidden}.chip-background{width:100%;height:100%;display:block;max-width:100%;max-height:100%;contain:strict}.page-actions:empty{display:none}

/* Desktop proportions follow the client, without scaling browser coordinates. */
:root{--sidebar-width:clamp(226px,13.5vw,280px);font-size:16px}
.sidebar{width:var(--sidebar-width)}.main{margin-left:var(--sidebar-width)}
button,input,select,textarea{min-height:46px}h1{font-size:32px}.muted,.field label,.setting-label p{font-size:14px}
.sidebar nav button{font-size:16px}.brand-name{font-size:clamp(26px,1.75vw,34px);letter-spacing:3px;white-space:nowrap}.brand b{font-size:20px}
.stats{grid-template-columns:repeat(var(--stat-count,4),minmax(0,1fr))}.stat{min-height:148px}.stat strong{font-size:36px}
.stat small{font-size:14px}th,td{font-size:14px}
.home-main{isolation:isolate}.home-main>.page-header{position:relative;z-index:1;background:var(--bg)}.home-main>.home-body{z-index:1}
.home-main>.chip-background,.dark .home-main>.chip-background{opacity:1}
.settings-nav{width:210px}.settings-content{padding:16px 24px}.settings-content>.stack{max-width:none;margin:0}
@media(max-width:1100px){.sidebar{width:210px}.main{margin-left:210px}.settings-nav{width:165px}.settings-content{padding:16px 12px}.page-header h1{font-size:28px}}

.item-properties td{vertical-align:top;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75;text-overflow:clip}.item-properties table{min-width:0}.item-properties .wrap-text{white-space:pre-wrap}.property-row p{white-space:pre-wrap;overflow-wrap:anywhere}.form textarea{line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;min-height:132px}

.table-fit-tools{display:flex;justify-content:flex-end;padding:6px 8px;background:var(--panel);position:sticky;left:0}.table-fit-tools button{font-size:12px;padding:6px 10px;min-height:30px}.mobile .table-fit-tools{display:none}

/* Inventory severity is semantic, including selected rows and mobile cards. */
body{--stock-low-bg:#fff4ce;--stock-low-fg:#795300;--stock-out-bg:#ffe7e7;--stock-out-fg:#b00020}
body.dark{--stock-low-bg:#3d351e;--stock-low-fg:#ffdb77;--stock-out-bg:#3e2428;--stock-out-fg:#ff9aa4}
.stat.stock-low,.table-wrap tr.stock-low td,.mobile-card.stock-low,.mobile-card.stock-low.selected{background:var(--stock-low-bg);color:var(--stock-low-fg)}
.stat.stock-out,.table-wrap tr.stock-out td,.mobile-card.stock-out,.mobile-card.stock-out.selected{background:var(--stock-out-bg);color:var(--stock-out-fg)}
.stat.stock-low small,.stat.stock-low .muted,.stock-low dt{color:var(--stock-low-fg)}
.stat.stock-out small,.stat.stock-out .muted,.stock-out dt{color:var(--stock-out-fg)}
.stock-badge{margin-left:auto;font-size:11px;font-weight:600;border:1px solid currentColor;border-radius:5px;padding:3px 6px}
.table-wrap tr.stock-low.selected td,.table-wrap tr.stock-out.selected td{box-shadow:inset 0 -2px 0 currentColor}

.container-actions{gap:10px}.container-actions>button{width:140px;min-height:44px;border-radius:7px;padding:8px 14px}
.scan-preview{position:relative;overflow:hidden;background:#111;min-height:220px}
.scan-preview video{display:block;width:100%;height:55vh;max-height:520px;object-fit:contain}
.scan-target{position:absolute;left:50%;top:50%;width:72%;aspect-ratio:1;transform:translate(-50%,-50%);border:2px solid white;border-radius:10px;box-shadow:0 0 0 9999px #0008;pointer-events:none;overflow:hidden}
.scan-target::after{content:"";position:absolute;left:8px;right:8px;top:4%;height:2px;background:#eee;animation:scan-sweep 1.8s linear infinite}
@keyframes scan-sweep{to{top:96%}}
.danger-notice{border:1px solid #c84955;border-radius:10px;padding:14px 16px;background:#c8495510;color:#ad2735;line-height:1.7;overflow-wrap:anywhere}
.dark .danger-notice{color:#ff9aa3}.danger-dialog .modal-head h2,.danger-status{color:#cf3b4b}.danger-progress{display:flex;gap:12px;margin:4px 0 8px}.danger-progress span{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:50%;color:var(--muted)}.danger-progress span.current{background:#b83040;border-color:#b83040;color:white}.danger-dialog .modal-body{gap:18px}.danger-dialog .modal-body h3{margin:0}.danger-dialog button.danger,.renumber-dialog button.danger{background:#b83040;border-color:#b83040;color:white}.danger-dialog button.danger:hover,.renumber-dialog button.danger:hover{background:#9f2333}.danger-dialog .modal-foot>button{min-width:130px}.danger-status{min-height:1.5em;overflow-wrap:anywhere}.renumber-preview{min-width:0}.renumber-preview .table-wrap{max-height:42vh}.renumber-dialog .form{gap:14px 24px}
.renumber-options{border:1px solid var(--line);border-radius:10px;padding:12px 16px}.renumber-options summary{cursor:pointer;font-weight:600;line-height:1.7}.renumber-options[open] summary{margin-bottom:14px}
.bom-policy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.bom-policy-field{min-width:0;border:1px solid var(--line);border-radius:10px;padding:14px}.bom-policy-field>.row{align-items:flex-start;line-height:1.6;margin-bottom:10px}.bom-range{display:grid;grid-template-columns:80px minmax(70px,1fr) 76px;align-items:center;gap:8px;margin-top:10px}.bom-range input{min-width:0;width:100%}.bom-policy-field p{margin:0;line-height:1.6}.bom-result-options{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.bom-result-options>label{flex:1;min-width:0;line-height:1.6}.bom-result-options input[type=checkbox]{flex-shrink:0}
.separation-dialog{width:min(1380px,95vw)}.separation-layout{display:grid;grid-template-columns:minmax(0,1fr) 150px minmax(0,1fr);gap:14px;align-items:stretch}.separation-pane{min-width:0;border:1px solid var(--line);border-radius:12px;padding:15px;display:flex;flex-direction:column;gap:12px}.separation-pane h3{margin:0}.separation-pane>select,.separation-pane>input{width:100%;min-width:0}.separation-pane>p{white-space:pre-line;overflow-wrap:anywhere;max-height:100px;overflow:auto;margin:0;line-height:1.7}.separation-arrows{display:flex;flex-direction:column;justify-content:center;gap:14px;text-align:center}.separation-arrows button{padding:12px 7px;background:#b83040;color:white;border-color:#b83040;white-space:normal;min-height:48px}.separation-arrows button:disabled{opacity:.45}.separation-groups{max-height:350px;overflow:auto}.separation-items{max-height:280px;overflow:auto}.separation-pane .table-wrap{min-height:130px}.separation-pane .table-fit-tools{padding:5px}.separation-preview-dialog .table-wrap{max-height:330px}.separation-preview-dialog .modal-foot button.danger{background:#b83040;border-color:#b83040;color:white}

.eda-source-control{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:8px 0 12px;grid-column:1/-1}.eda-source-control label{display:flex;align-items:center;gap:8px;font-size:14px}.eda-source-control input[type=checkbox]{width:20px;min-height:20px}.eda-source-control button{font-size:13px;padding:7px 10px;min-height:36px}
