:root{color-scheme:light;--ink:#122033;--muted:#64748b;--line:#afc0d4;--paper:#f4f7fb;--panel:#fff;--primary:#1f5eff;--primary-dark:#123f8f;--teal:#0f8b7e;--warn:#a8550d;--danger:#b91c1c;--success:#21784b;--shadow: none;font-family:"Microsoft YaHei UI","Noto Sans CJK SC",sans-serif}*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;color:var(--ink);background:linear-gradient(rgba(31,94,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(31,94,255,.035) 1px,transparent 1px),var(--paper);background-size:30px 30px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.58}.sales-shell{width:min(1900px,calc(100% - 28px));min-height:100vh;margin:0 auto;padding:14px 0 22px;display:grid;grid-template-rows:auto auto auto auto minmax(660px,1fr);gap:10px}.panel{border:1px solid var(--line);background:var(--panel);box-shadow:var(--shadow)}.sales-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 20px;border-top:5px solid var(--primary)}.sales-header h1{margin:2px 0 4px;font-family:Georgia,"Microsoft YaHei UI",serif;font-size:clamp(24px,2.3vw,36px)}.eyebrow{margin:0;color:var(--primary-dark);font-size:12px;font-weight:800;letter-spacing:.18em}.subtle{margin:0;color:var(--muted)}.header-actions,.toolbar,.action-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.header-actions{justify-content:flex-end}.version-chip{padding:7px 10px;color:#fff;background:var(--primary-dark);border-radius:4px;font-weight:800}.button{min-height:34px;padding:6px 13px;border:1px solid var(--line);border-radius:5px;color:var(--ink);background:#eef4fc;font-weight:700}.button:hover:not(:disabled){border-color:var(--primary);color:var(--primary-dark)}.button.primary{color:#fff;border-color:var(--primary);background:var(--primary)}.button.teal{color:#fff;border-color:var(--teal);background:var(--teal)}.button.warn{color:#fff;border-color:var(--warn);background:var(--warn)}.summary-grid{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:10px}.metric-card{padding:13px 15px;border-left:5px solid var(--primary);background:var(--panel);box-shadow:var(--shadow)}.metric-label{color:var(--muted);font-size:13px;font-weight:700}.metric-value{margin-top:4px;font-family:Georgia,serif;font-size:28px;font-weight:800}.metric-card.risk{border-left-color:var(--warn)}.desktop-tabs{display:flex;overflow-x:auto}.tab-button{flex:0 0 auto;min-height:42px;padding:9px 14px;border:0;border-right:1px solid var(--line);border-bottom:3px solid transparent;color:#28405e;background:#f3f7fc;font-weight:800}.tab-button.active{color:#fff;border-bottom-color:#79dcca;background:var(--primary-dark)}.status-bar{display:block;min-height:38px;padding:9px 13px;border-left:5px solid var(--primary);color:#173f82;background:#e8efff;font-size:13px}.status-bar.error{border-left-color:var(--danger);color:#78231c;background:#fde8e6}.status-bar.success{border-left-color:var(--success);color:#175637;background:#e5f4eb}.page-root{min-height:660px;height:100%}.work-page{min-height:660px;height:100%;display:grid;gap:10px;align-content:stretch}.work-grid{min-height:0;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);gap:10px}.work-grid.equal{grid-template-columns:repeat(2,minmax(0,1fr))}.work-grid.three{grid-template-columns:repeat(3,minmax(300px,1fr))}.stack{min-width:0;display:grid;gap:10px;align-content:start}.content-panel{min-width:0;padding:15px}.fill-panel{min-height:500px;display:grid;grid-template-rows:auto auto minmax(300px,1fr) auto}.section-title{margin:0 0 10px;font-family:Georgia,"Microsoft YaHei UI",serif;font-size:19px}.section-title.small{font-size:16px}.hint{color:var(--muted);font-size:12px;line-height:1.65}.toolbar{margin-bottom:10px}.toolbar .grow{flex:1 1 260px}.action-row{margin-top:12px}.field-grid{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:10px}.field-grid.three{grid-template-columns:repeat(3,minmax(150px,1fr))}.field-grid.two{grid-template-columns:repeat(2,minmax(180px,1fr))}.field{min-width:0;display:grid;gap:4px}.field.wide{grid-column:1/-1}.field label,.field span{color:#435166;font-size:12px;font-weight:800}.input{width:100%;min-height:36px;padding:7px 9px;border:1px solid var(--line);border-radius:4px;color:var(--ink);background:#fff}.input[readonly]{background:#f1f4f8}textarea.input{min-height:88px;resize:vertical;line-height:1.55}.table-wrap{min-width:0;min-height:220px;overflow:auto;border:1px solid var(--line);background:#fff}.table-wrap.tall{min-height:390px}table{width:100%;border-collapse:collapse;font-size:13px}th,td{padding:8px 9px;border-bottom:1px solid #e1e8f1;text-align:left;vertical-align:top;white-space:nowrap}th{position:sticky;top:0;z-index:1;color:#fff;background:#284c7a;font-size:12px}tbody tr:nth-child(even){background:#f8fafd}tbody tr[data-row-type]:hover{background:#eaf0ff}tbody tr.selected{background:#d9e5ff}.empty-row td{height:92px;color:var(--muted);text-align:center;vertical-align:middle}.blocked-note{padding:10px;border:1px solid #e5b77d;color:#743f0f;background:#fff6e9;line-height:1.6}.line-editor{min-width:1000px}.line-editor input,.line-editor select{width:100%;min-width:82px}.shortage{background:#fee4e2!important;color:#b91c1c}.detail-dialog{width:min(1080px,calc(100% - 32px));max-height:calc(100vh - 40px);padding:0;border:1px solid var(--line)}.detail-dialog::backdrop{background:rgba(12,27,47,.58)}.detail-dialog form{padding:16px}.dialog-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.dialog-header h2{margin:0}@media(max-width:1250px){.work-grid,.work-grid.equal,.work-grid.three{grid-template-columns:1fr}.field-grid{grid-template-columns:repeat(2,minmax(150px,1fr))}}@media(max-width:760px){.sales-shell{width:calc(100% - 16px)}.sales-header{align-items:flex-start;flex-direction:column}.summary-grid,.field-grid,.field-grid.three,.field-grid.two{grid-template-columns:1fr}.button{min-height:42px}}

/* === 桌面版DataGrid对齐 === */
thead tr { background: #f3f7fc; }
th { color: #435166; font-weight: 600; text-align: left; padding: 0 8px; height: 34px; border-bottom: 1px solid #afc0d4; }
td { padding: 0 8px; height: 25px; border-bottom: 1px solid #e8eef5; }
tbody tr:nth-child(even) { background: #fafcff; }
tbody tr:hover { background: #f4f8ff; }
