:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #17363a;
  background: #f3f6f7;
  --primary: #087d83;
  --primary-dark: #075c62;
  --ink: #17363a;
  --muted: #6c8083;
  --line: #dce6e7;
  --surface: #ffffff;
  --soft: #edf5f5;
  --warning: #b66b08;
  --danger: #b42318;
  --success: #14785c;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 980px; background: #f3f6f7; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #cad8da; border-radius: 9px; padding: 9px 14px; background: #fff; color: #214448; transition: border-color .15s, background .15s, transform .15s; }
button:hover { border-color: var(--primary); }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .55; }
.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.danger-button { color: var(--danger); border-color: #efc8c4; }
.link-button { border: 0; padding: 4px; color: var(--primary); background: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow, .breadcrumb { margin: 0 0 7px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 25px; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 18px; }
h3 { margin-bottom: 0; font-size: 15px; }

.brand-mark { display: grid; width: 46px; height: 46px; margin-bottom: 24px; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg,#0d949b,#075d64); font-size: 15px; font-weight: 900; box-shadow: 0 9px 24px #0d7a8040; }
.brand-mark.small { width: 38px; height: 38px; margin: 0; border-radius: 11px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 25% 20%,#dceeee 0,transparent 36%),linear-gradient(135deg,#eef6f6,#f9fbfb); }
.login-panel { width: min(440px,100%); padding: 40px; border: 1px solid #e5eded; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px #24494b20; }
.login-panel > .muted { margin: 12px 0 26px; line-height: 1.65; }
label { display: grid; gap: 7px; margin: 15px 0; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd9da; border-radius: 9px; padding: 10px 12px; outline: 0; background: #fbfdfd; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #0b84891c; }
textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
.login-button { width: 100%; margin-top: 10px; padding: 11px; }
.wecom-login-button { display: grid; width: 100%; min-height: 44px; place-items: center; border-radius: 9px; color: #fff; background: #087d83; font-weight: 700; text-decoration: none; }
.wecom-login-button:hover { background: #075c62; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 4px; color: #849497; font-size: 12px; }
.login-divider::before, .login-divider::after { height: 1px; flex: 1; background: #dce6e7; content: ""; }
.form-error { min-height: 21px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.login-note { margin: 14px 0 0; color: #849497; font-size: 12px; line-height: 1.55; }

.workspace { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 4; display: flex; width: 228px; flex-direction: column; padding: 22px 15px 17px; color: #d8e8e8; background: #0c3034; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 24px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { color: #fff; font-size: 15px; }
.sidebar-brand span { margin-top: 3px; color: #8fabad; font-size: 11px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button { position: relative; display: flex; align-items: center; gap: 11px; border: 0; padding: 11px 13px; color: #bcd0d2; background: transparent; text-align: left; }
.sidebar nav button > span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px; color: #89b4b7; font-size: 16px; }
.sidebar nav button:hover, .sidebar nav .nav-active { color: #fff; background: #17464b; }
.sidebar nav .nav-active > span { color: #fff; background: var(--primary); }
.sidebar nav i { min-width: 19px; margin-left: auto; border-radius: 12px; padding: 2px 6px; color: #fff; background: #c66c18; font-size: 11px; font-style: normal; text-align: center; }
.sidebar-foot { display: grid; margin-top: auto; padding: 15px 9px 0; border-top: 1px solid #ffffff18; }
.sidebar-foot span { color: #fff; font-weight: 700; }
.sidebar-foot small { margin: 3px 0 12px; color: #8fabad; }
.sidebar-foot button { border-color: #ffffff24; color: #c6d7d8; background: transparent; text-align: left; }

.content-shell { min-width: 0; margin-left: 228px; }
.topbar { position: sticky; top: 0; z-index: 3; display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 28px; border-bottom: 1px solid var(--line); background: #ffffffec; backdrop-filter: blur(12px); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search { display: flex; width: 290px; align-items: center; gap: 7px; margin: 0; border: 1px solid #cedbdd; border-radius: 9px; padding: 0 10px; background: #f7fafa; }
.search input { border: 0; padding: 9px 0; box-shadow: none; background: transparent; }
main { max-width: 1480px; margin: auto; padding: 25px 28px 60px; }

.summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; margin-bottom: 18px; }
.summary-card { position: relative; overflow: hidden; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px #2143460a; }
.summary-card::after { position: absolute; top: -18px; right: -15px; width: 75px; height: 75px; border-radius: 50%; background: var(--soft); content: ""; }
.summary-card span { position: relative; z-index: 1; color: var(--muted); font-size: 12px; }
.summary-card strong { position: relative; z-index: 1; display: block; margin: 8px 0 3px; font-size: 27px; }
.summary-card small { position: relative; z-index: 1; color: #8a9a9d; }
.summary-card.warning strong { color: var(--warning); }
.summary-card.danger strong { color: var(--danger); }
.dashboard-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 17px; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 16px #2143460a; }
.panel.span-two { grid-column: span 2; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.inline-form { display: flex; min-width: 420px; align-items: center; gap: 8px; margin: 0; }
.inline-form input { min-width: 280px; }
.trace-card + .trace-card { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.overview-row { display: grid; grid-template-columns: minmax(140px,1.4fr) 70px minmax(160px,1fr) 56px; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #eef2f3; }
.overview-row:first-child { border-top: 0; }
.overview-row small { color: var(--muted); }
.progress { height: 8px; overflow: hidden; border-radius: 20px; background: #e3ebec; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#0e8d94,#3bb59e); }
.progress.large { height: 10px; }
.mini-list { display: grid; gap: 10px; }
.mini-item { padding: 11px; border-radius: 9px; background: #f5f8f8; }
.mini-item strong, .mini-item span { display: block; }
.mini-item span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.risk-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid #eef2f3; }
.risk-item:first-child { border-top: 0; }
.risk-item strong { font-size: 20px; }
.risk-item.warning strong { color: var(--warning); }
.risk-item.danger strong { color: var(--danger); }

.section-tools { display: flex; min-height: 45px; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.section-tools p { margin: 0; }
.section-tools > select { width: 330px; }
.section-actions { display: flex; align-items: center; gap: 8px; }
.filter-tabs { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: #e8eeee; }
.filter-tabs button { border: 0; padding: 7px 13px; background: transparent; }
.filter-tabs .active { color: var(--primary-dark); background: #fff; box-shadow: 0 2px 8px #17393b14; font-weight: 700; }
.project-layout { display: grid; grid-template-columns: 310px minmax(0,1fr); align-items: start; gap: 17px; }
.customer-list { display: grid; gap: 8px; }
.customer-row { width: 100%; padding: 15px; border-color: var(--line); background: #fff; text-align: left; }
.customer-row.active { border-color: var(--primary); box-shadow: 0 0 0 2px #0d818617; }
.customer-row-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.customer-row p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.customer-row .progress { margin-top: 10px; }
.project-panel { min-height: 420px; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.empty-state { display: grid; place-content: center; color: #839497; text-align: center; }
.empty-state strong { color: #516b6e; font-size: 17px; }
.empty-state p { margin: 7px 0 0; }
.customer-title { display: flex; align-items: start; justify-content: space-between; gap: 15px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.customer-title p { margin: 6px 0 0; color: var(--muted); }
.order-card { margin-top: 15px; border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #fbfcfc; }
.order-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.order-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.order-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 11px; margin-top: 13px; }
.order-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.order-facts strong { color: var(--ink); font-weight: 700; }
.progress-detail { border: 0; padding: 1px 4px; color: var(--primary); background: transparent; font-size: 12px; }
.status { display: inline-block; border-radius: 16px; padding: 4px 9px; color: #0c6c61; background: #ddf1eb; font-size: 11px; white-space: nowrap; }
.status.warning { color: #945a09; background: #fff0d6; }
.status.danger { color: #9d241c; background: #fee9e7; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(205px,1fr)); gap: 9px; margin-top: 14px; }
.device-card { padding: 12px; border: 1px solid #dfe8e9; border-radius: 9px; background: #fff; }
.device-card-head { display: flex; justify-content: space-between; gap: 8px; }
.device-card p { margin: 7px 0; color: var(--muted); font-size: 12px; }
.device-card button { width: 100%; margin-top: 5px; padding: 7px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }

.stack-list { display: grid; gap: 10px; }
.list-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #21434608; }
.list-card.overdue, .list-card.blocking { border-left: 4px solid #d07816; }
.list-card h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.list-card p { margin: 6px 0 0; line-height: 1.5; }
.list-card .meta { color: var(--muted); font-size: 12px; }
.list-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.file-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.file-group { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.file-group-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.file-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #eef2f3; }
.file-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--muted); }

dialog { width: min(820px,calc(100% - 36px)); max-height: 88vh; overflow: auto; border: 0; border-radius: 17px; padding: 27px; color: var(--ink); background: #fff; box-shadow: 0 25px 90px #0005; }
dialog::backdrop { background: #102d3185; backdrop-filter: blur(2px); }
.dialog-close { position: sticky; top: 0; z-index: 2; float: right; width: 34px; height: 34px; border: 0; border-radius: 50%; padding: 0; color: #607679; background: #edf2f2; font-size: 22px; }
.dialog-intro { margin: 7px 45px 20px 0; color: var(--muted); line-height: 1.55; }
.dialog-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 14px; }
.form-grid .wide { grid-column: 1/-1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.field-hint { margin: -8px 0 12px; color: var(--muted); font-size: 11px; }
.progress-breakdown { display: grid; gap: 13px; margin-top: 19px; }
.progress-stage { display: grid; grid-template-columns: 105px 1fr 45px; align-items: center; gap: 12px; }
.issue-body { padding: 13px; border-radius: 9px; background: #f5f8f8; }
.issue-body p:last-child { margin-bottom: 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 420px; border-radius: 10px; padding: 12px 17px; color: #fff; background: #153f43; box-shadow: 0 12px 35px #0003; }
.toast.error { background: #a9342b; }
.loading { padding: 50px 20px; color: var(--muted); text-align: center; }
.system-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; margin-bottom: 18px; }
.system-grid .summary-card strong { font-size: 23px; }
.system-sections { display: grid; grid-template-columns: 1fr 1.4fr; gap: 17px; }
.usage-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #eef2f3; }
.usage-row:first-child { border-top: 0; }
.visitor-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.visitor-table th, .visitor-table td { padding: 11px 9px; border-bottom: 1px solid #e7eeee; text-align: left; }
.visitor-table th { color: var(--muted); font-size: 11px; font-weight: 700; }
.health-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: #23a36f; box-shadow: 0 0 0 4px #23a36f1c; }
.material-tabs { width: max-content; margin-bottom: 16px; }
.material-summary { margin-bottom: 16px; }
.material-summary .summary-card strong { font-size: 23px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.table-toolbar p { margin: 5px 0 0; font-size: 12px; }
.table-toolbar select { width: 220px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid #e6eeee; text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: #f6f9f9; font-size: 11px; font-weight: 800; white-space: nowrap; }
.data-table td { font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfb; }
.data-table .code-cell { color: var(--primary-dark); font-family: Consolas, monospace; font-weight: 700; white-space: nowrap; }
.data-table .number-cell { text-align: right; white-space: nowrap; }
.data-table .action-cell { text-align: right; white-space: nowrap; }
.bom-version-list { display: grid; gap: 11px; }
.bom-card { display: grid; grid-template-columns: minmax(210px,1.4fr) minmax(150px,.7fr) minmax(170px,.8fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfd; }
.bom-card h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bom-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.bom-card-stat strong, .bom-card-stat span { display: block; }
.bom-card-stat span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.bom-card-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.bom-scope { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--soft); color: #496568; font-size: 12px; }
.bom-lines { margin-top: 14px; }
.bom-level { display: inline-grid; min-width: 24px; height: 24px; place-items: center; border-radius: 7px; color: var(--primary-dark); background: var(--soft); font-size: 11px; font-weight: 800; }
.bom-difference { padding: 12px; border-bottom: 1px solid #e6eeee; }
.bom-difference:last-child { border-bottom: 0; }
.bom-difference strong { display: inline-block; min-width: 44px; margin-right: 8px; }
.bom-difference.added strong { color: var(--success); }
.bom-difference.removed strong { color: var(--danger); }
.bom-difference.changed strong { color: var(--warning); }
.file-drop { padding: 19px; border: 1px dashed #9ebbbd; border-radius: 10px; background: #f6fafa; }
.file-drop input { background: #fff; }
.button-link { display: inline-block; margin-bottom: 10px; border: 1px solid var(--primary); border-radius: 8px; padding: 8px 12px; color: var(--primary-dark); background: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }
.button-link:hover { background: var(--soft); }
.template-hint { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 8px; margin-top: 9px; }
.inline-check { display: flex; align-items: center; gap: 8px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fbfdfd; font-weight: 500; }
.inline-check input { width: auto; margin: 0; }
.negative-stock { color: var(--danger); font-weight: 800; }
#purchase-pane .panel + .panel, #inventory-pane .panel + .panel, #installation-pane .panel + .panel { margin-top: 16px; }
#reservation-list { margin-top: 16px; }

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: repeat(2,1fr); }
  .panel.span-two { grid-column: span 2; }
  .search { width: 230px; }
  .system-grid { grid-template-columns: repeat(2,1fr); }
  .bom-card { grid-template-columns: minmax(220px,1fr) minmax(140px,.6fr) auto; }
  .bom-card-stat.scope-stat { display: none; }
}
