*{box-sizing:border-box}body{margin:0;background:#f3f6fa;color:#203047;font:15px/1.6 system-ui,-apple-system,Microsoft YaHei,sans-serif}button,input,select,textarea{font:inherit}button{border:1px solid #d4dce8;background:#fff;border-radius:7px;padding:8px 14px;cursor:pointer;color:#26405c}button:hover{background:#eaf1f9}button:disabled{opacity:.5;cursor:not-allowed}.primary{background:#1d5593;color:#fff;border-color:#1d5593}.primary:hover{background:#17467c}.danger,.error{color:#ad293d}.danger{border-color:#efc3c9}.error{white-space:pre-wrap;background:#fff0f1;padding:10px;border-radius:6px}.muted,small{color:#67788c}small{display:block;font-size:12px}h1,h2,h3,p{margin:0 0 12px}h1{font-size:23px}h2{font-size:21px}h3{font-size:17px}label{display:flex;flex-direction:column;gap:5px;margin-bottom:14px;min-width:0}input,select,textarea{border:1px solid #cbd6e2;border-radius:7px;padding:9px 11px;background:#fff;color:#203047;min-width:0;width:100%}input:focus,select:focus,textarea:focus{outline:2px solid #88b8e4;outline-offset:1px}input[type=checkbox],input[type=radio]{width:19px;height:19px;flex:0 0 19px;accent-color:#1d5593}textarea{resize:vertical;max-width:100%}.app-header{background:#153e6f;color:#fff;padding:20px max(24px,calc((100vw - 1400px)/2));display:flex;justify-content:space-between;align-items:center}.app-header small{color:#cadcf0}.app-header h1{margin:0}.workspace{max-width:1448px;margin:auto;padding:24px}.project-select{max-width:560px}nav{display:flex;gap:6px;overflow:auto;margin:0 0 25px;padding:4px 0 10px}nav button{white-space:nowrap;border:0;background:transparent;padding:10px 18px}nav .active{background:#1d5593;color:#fff}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:16px;flex-wrap:wrap}.section-heading h2,.section-heading h3{margin:0}.toolbar,.row-actions,.pagination{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar{margin:12px 0}.row-actions{min-width:175px}.row-actions button{padding:5px 10px;font-size:13px}.filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:18px 0}.filters>input{max-width:280px}.filters>select{width:auto;max-width:100%}.filters label{margin:0}.inline{flex-direction:row;align-items:center}.panel,.stats article{background:#fff;border:1px solid #e1e7ee;border-radius:10px;padding:22px;margin-bottom:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.stats strong{display:block;font-size:29px;margin-top:8px}.table-scroll{max-width:100%;overflow:auto;border:1px solid #e1e7ee;border-radius:8px;background:#fff}table{width:100%;border-collapse:collapse;text-align:left}th{background:#edf3f9;color:#516780;font-weight:600;font-size:13px}th,td{padding:12px 15px;border-bottom:1px solid #e7ecf2;vertical-align:top}td{font-size:14px}td small{max-width:300px;overflow-wrap:anywhere}td:first-child,th:first-child{position:sticky;left:0;background:#fff;z-index:1;min-width:140px;max-width:220px}th:first-child{background:#edf3f9}tr:hover td{background:#f6f9fd}.link{border:0;background:transparent;color:#1763a6;padding:0;text-align:left}.badge{display:inline-block;padding:2px 8px;background:#e9f1fb;color:#245a8f;border-radius:4px;font-size:12px}.warning{color:#ad6a16}.badge.warning{background:#fff1d9}.void{color:#7d8894}.pagination{justify-content:center;margin:20px 0}.empty{padding:35px;text-align:center;color:#718197}.notice{background:#eaf2ff;padding:12px 16px;border-radius:8px}.project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}.entry-row{border:1px solid #dce5ee;border-radius:9px;padding:15px;margin:15px 0;background:#f7f9fc}.picker{max-height:320px;overflow:auto;border:1px solid #e1e7ee;border-radius:7px;padding:10px;margin:14px 0}.picker>button{display:block;width:100%;text-align:left;margin-bottom:6px}.check-row{flex-direction:row;gap:12px;align-items:start;padding:10px 4px;border-bottom:1px solid #e6ebf2;margin:0}.check-row span{min-width:0;overflow-wrap:anywhere}.attachments>span{display:flex;gap:10px;align-items:center;flex-wrap:wrap}dialog{width:min(900px,calc(100vw - 28px));max-height:90dvh;padding:0;border:0;border-radius:12px;color:#203047;box-shadow:0 15px 70px #0f244b44}dialog::backdrop{background:#172c4b88}dialog>header{display:flex;justify-content:space-between;align-items:center;padding:17px 22px;border-bottom:1px solid #e1e7ee;position:sticky;top:0;background:#fff;z-index:3}dialog>header h2{margin:0;font-size:19px}.dialog-body{padding:22px}dialog footer{position:sticky;bottom:-22px;background:#fff;border-top:1px solid #e1e7ee;padding:14px 0;margin-top:15px}fieldset{border:0;margin:0;padding:0;min-width:0}.login-shell{min-height:100dvh;display:grid;place-items:center;padding:24px;background:linear-gradient(145deg,#e7f0fc,#f7f9fc)}.login-card{width:min(420px,100%);background:#fff;border:1px solid #dfe7f0;border-radius:15px;padding:34px;box-shadow:0 14px 55px #234b7b12}.login-card>.primary{width:100%}.brand-mark{width:48px;height:48px;background:#153e6f;border-radius:12px;color:#fff;display:grid;place-items:center;font-size:25px;margin-bottom:20px}.document-sheet{width:740px;table-layout:fixed;font-family:SimSun,serif}.document-sheet td,.document-sheet th{border:1px solid #333;background:#fff;padding:5px;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;position:static;min-width:0;max-width:none}.document-sheet .document-title{font-size:24px;text-align:center;padding:15px}summary{cursor:pointer;margin-bottom:12px}@media(max-width:700px){.workspace{padding:14px}.app-header{padding:15px}.app-header h1{font-size:19px}.stats{grid-template-columns:repeat(2,1fr);gap:10px}.stats article,.panel{padding:15px}.stats strong{font-size:25px}.project-grid{grid-template-columns:1fr;gap:0}.form-grid{grid-template-columns:1fr}.entry-row .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.entry-row .form-grid label:nth-child(1),.entry-row .form-grid label:nth-child(2){grid-column:1/-1}.filters>input{max-width:none}.filters>label{flex:1 1 130px}.filters>select{flex:1 1 130px}.table-scroll table:not(.document-sheet){min-width:650px}th,td{padding:10px}.dialog-body{padding:15px}dialog>header{padding:13px 15px}.login-card{padding:25px}.row-actions{min-width:160px}}.ai-chat-entry{margin-left:auto;color:#176557;background:#eef8f4;border-color:#b9dbcc}.ai-chat-panel{position:fixed;right:20px;top:80px;bottom:20px;width:440px;max-width:calc(100vw - 24px);z-index:90;background:#fff;border:1px solid #d5dedb;border-radius:12px;box-shadow:0 12px 50px #10282030;display:flex;flex-direction:column;padding:16px;gap:10px;color:#20352e}.ai-chat-panel header{display:flex;justify-content:space-between;align-items:center}.ai-chat-panel p{margin:4px 0}.ai-chat-panel label{margin:0}.chat-feed{overflow:auto;flex:1;min-height:60px}.chat-feed article{border-bottom:1px solid #e0e7e3;padding:14px 0}.chat-feed p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 14px}.ai-chat-panel textarea{width:100%;min-height:65px;resize:vertical;max-height:130px}.ai-chat-panel form{display:flex;align-items:flex-end;gap:8px}.ai-chat-panel .error{max-height:80px;overflow:auto}@media(min-width:800px){.stats{display:flex;border:1px solid #dce5df;border-radius:6px;background:#fff;gap:0}.stats article{flex:1;box-shadow:none;border:0;border-right:1px solid #e4ebe7;border-radius:0;padding:12px 18px}.stats article:last-child{border-right:0}.stats strong{font-size:23px}}@media(max-width:600px){.app-header{flex-wrap:wrap;gap:8px}.ai-chat-entry{order:3;width:100%;margin:0}.ai-chat-panel{right:8px;top:8px;bottom:8px;max-width:calc(100vw - 16px);padding:12px}}.ai-chat-panel form button{flex-shrink:0;white-space:nowrap;min-width:70px}.ai-chat-panel small{color:#657b88}.app-header>.ai-chat-entry{margin-right:12px}.resizable-dialog{width:min(1480px,calc(100vw - 32px));height:min(820px,92dvh);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:hidden}.resizable-dialog[open]{display:flex;flex-direction:column}.resizable-dialog>header{flex:none;position:static;gap:10px}.dialog-actions{display:flex;gap:8px;align-items:center}.dialog-actions button{white-space:nowrap}.resizable-dialog>.dialog-body{flex:1;min-height:0;overflow:auto;padding-bottom:30px}.dialog-resize-handle{position:absolute;bottom:0;right:0;padding:0;width:26px;height:26px;border:0;border-radius:0;background:#e5eef9;color:#315d89;cursor:nwse-resize;touch-action:none;z-index:5}.stock-metadata{grid-template-columns:repeat(3,minmax(0,1fr))}.resizable-field{width:160px;height:44px;min-width:84px;min-height:40px;resize:both;overflow:hidden;padding:1px 5px 5px 1px}.resizable-field>input{height:100%;width:100%;border-radius:5px;padding:6px 9px}.resizable-field:focus-within{outline:1px solid #88b8e4}.stock-metadata .resizable-field{width:100%;max-width:100%;height:48px}.stock-entry-scroll{margin:10px 0 18px;max-height:50dvh}.stock-entry-table{width:100%;min-width:1100px}.stock-entry-table th,.stock-entry-table td{padding:8px;vertical-align:middle;white-space:nowrap}.stock-entry-table thead th{position:sticky;top:0;z-index:2}.stock-entry-table th:first-child{min-width:48px;max-width:none;width:48px;left:0;z-index:3}.stock-entry-table tbody th{background:#f5f8fc;font-weight:400}.stock-entry-table td:first-child{position:static;min-width:0;max-width:none}.stock-entry-table button{padding:6px 10px}.field-name,.field-model{width:180px}.field-quantity{width:120px}.field-unit{width:100px}.field-type,.field-supplier{width:165px}.stock-notes{resize:both;min-width:180px;min-height:65px;max-width:100%}.stock-editor-help{font-size:13px}@media(max-width:700px){.resizable-dialog{width:calc(100vw - 16px);height:92dvh}.resizable-dialog>header{flex-wrap:wrap}.resizable-dialog>header h2{font-size:17px}.dialog-actions button{padding:5px 9px}.stock-metadata{grid-template-columns:1fr}.stock-entry-scroll{max-height:46dvh}.stock-entry-table th,.stock-entry-table td{padding:6px}.resizable-dialog footer{bottom:-30px}.stock-notes{width:100%}}.file-drop-zone{border:2px dashed #b8cbe0;border-radius:8px;padding:14px;margin:14px 0;background:#f7faff;transition:background .15s,border-color .15s;overflow-wrap:anywhere}.file-drop-zone label{margin-bottom:8px}.file-drop-zone input[type=file]{max-width:100%;background:#fff}.file-drop-zone p{margin:6px 0 0}.file-drop-zone.drag-active{border-color:#1d5593;background:#e3efff;box-shadow:inset 0 0 0 1px #1d5593}.file-drop-zone.drop-disabled{opacity:.65}.selected-file{display:flex;flex-wrap:wrap;align-items:center;gap:10px;overflow-wrap:anywhere}.file-drop-zone .error{font-size:13px}.stock-entry-table{min-width:1290px}.field-name,.field-model{width:160px}.field-quantity{width:110px}.field-unit{width:90px}.field-date{width:155px;min-width:145px}.field-type{width:145px}.field-supplier{width:150px}.record-table td:first-child:has(input[type=checkbox]),.record-table th:first-child:has(+th){min-width:55px}.record-table a,.batch-table a{display:block;overflow-wrap:anywhere;max-width:230px}.selection-toolbar{background:#edf4fc;padding:10px;border-radius:7px}.batch-table td.batch-expanded{position:static;max-width:none;min-width:0;background:#f4f7fb;padding:12px}.batch-expanded>.table-scroll{max-width:calc(100vw - 110px)}.batch-edit-table{min-width:1650px}.batch-edit-table td,.batch-edit-table th{padding:8px;vertical-align:middle;white-space:nowrap}.batch-edit-table th:first-child{min-width:48px;width:48px}.resizable-field>textarea{height:100%;width:100%;padding:6px 9px;resize:none}.batch-edit-table .resizable-field{width:160px}.batch-edit-table{min-width:1340px}.batch-edit-table .resizable-field{width:135px}.batch-edit-table .batch-field-quantity{width:100px}.batch-edit-table .batch-field-unit{width:84px}.batch-edit-table .batch-field-attribute{width:120px}.batch-edit-table .batch-field-record_time{width:155px}.batch-edit-table .batch-field-supplier{width:150px}.batch-edit-table .batch-field-operator{width:115px}.batch-edit-table .batch-field-notes{width:170px}.batch-edit-table thead th{position:sticky;top:0;z-index:2}.batch-edit-table td:nth-child(2),.batch-edit-table th:nth-child(2){position:sticky;left:48px;background:#fff;z-index:1}.batch-edit-table thead th:nth-child(-n+2){z-index:3;background:#edf3f9}.image-viewer{width:min(1200px,calc(100vw - 24px));height:min(900px,calc(100dvh - 24px));max-width:none;max-height:none;overflow:hidden;background:#111a25;color:#fff}.image-viewer[open]{display:flex;flex-direction:column}.image-viewer>header{position:static;flex:none;background:#17263a;color:#fff;border-color:#33465d;gap:16px;flex-wrap:wrap}.image-viewer>header small{color:#c8d5e4;max-width:520px;overflow-wrap:anywhere}.image-viewer-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.image-viewer-actions output{min-width:58px;text-align:center}.image-viewer-actions a{color:#d5eaff;padding:7px 10px}.image-viewer-stage{flex:1;min-height:0;overflow:auto;display:flex;align-items:flex-start;justify-content:center;padding:20px;background:repeating-conic-gradient(#192432 0 25%,#202d3d 0 50%) 50%/24px 24px}.image-viewer-stage img{display:block;max-width:none;height:auto;object-fit:contain;transform-origin:top center;box-shadow:0 3px 25px #0008}.image-viewer-help{flex:none;margin:0;padding:8px 18px;background:#17263a;color:#c8d5e4;font-size:13px}.attachment-image-link{cursor:zoom-in}@media(max-width:600px){.image-viewer{width:calc(100vw - 12px);height:calc(100dvh - 12px)}.image-viewer>header{padding:10px}.image-viewer-actions{width:100%}.image-viewer-actions button,.image-viewer-actions a{padding:5px 8px}.image-viewer-stage{padding:8px}.image-viewer-help{padding:6px 10px}}.image-viewer-stage{display:block;padding:0;cursor:grab;overscroll-behavior:contain;touch-action:none;-webkit-user-select:none;user-select:none}.image-viewer-stage.dragging{cursor:grabbing}.image-viewer-canvas{box-sizing:border-box;min-width:100%;min-height:100%;width:max-content;height:max-content;padding:20px;display:grid;place-items:center}.image-viewer-stage img{width:auto;max-width:none;height:auto;pointer-events:auto}.image-viewer-actions output{min-width:118px}.image-viewer-help{overflow-wrap:anywhere}@media(max-width:600px){.image-viewer-canvas{padding:8px}.image-viewer-actions output{min-width:105px}}.pdf-viewer-stage{flex:1;min-height:0;background:#384554;overflow:hidden}.pdf-viewer-stage iframe{display:block;width:100%;height:100%;border:0;background:#fff}@media(max-width:600px){.pdf-viewer-stage{min-height:0}}.supply-switch{display:flex;gap:6px;min-height:43px;align-items:center}.supply-switch button{flex:1;white-space:nowrap}.supply-selector{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}.supply-selector>small{color:#203047;font-size:15px}nav button,.supply-switch button{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .12s ease}nav button:hover,.supply-switch button:hover{transform:translateY(-1px)}nav button:active,.supply-switch button:active{transform:translateY(0) scale(.98)}nav .active,.supply-switch .primary{box-shadow:0 4px 12px #1d559326}.workspace>section,.workspace>.empty{animation:tab-content-enter .22s cubic-bezier(.2,.7,.3,1) both}@keyframes tab-content-enter{0%{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){nav button,.supply-switch button{transition:none}.workspace>section,.workspace>.empty{animation:none}}.workspace>section>section{animation:tab-content-enter .2s cubic-bezier(.2,.7,.3,1) both}@media(prefers-reduced-motion:reduce){.workspace>section>section{animation:none}}dialog[open]{animation:dialog-enter .2s cubic-bezier(.2,.75,.25,1) both}dialog[open]::backdrop{animation:dialog-backdrop-enter .2s ease-out both}@keyframes dialog-enter{0%{opacity:0;transform:translateY(12px) scale(.975)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes dialog-backdrop-enter{0%{background-color:transparent}to{background-color:#172c4b88}}@media(prefers-reduced-motion:reduce){dialog[open],dialog[open]::backdrop{animation:none}}
