/* ================= 工地云 · 装饰工程 ERP ================= */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f2f4f7;
  --border: #e6e8ee;
  --border-strong: #d5d9e2;
  --text: #171a21;
  --text-2: #5a6271;
  --text-3: #8d94a3;
  --primary: #2f5cf6;
  --primary-soft: #eef2ff;
  --primary-deep: #1e42c4;
  --green: #0f9d58;
  --green-soft: #e7f6ee;
  --orange: #d97a06;
  --orange-soft: #fdf2e2;
  --red: #d63a3a;
  --red-soft: #fdeceb;
  --purple: #7145cf;
  --purple-soft: #f1ecfd;
  --cyan: #0d8f9c;
  --cyan-soft: #e4f6f8;
  --gray-soft: #eff1f5;
  --shadow-sm: 0 1px 2px rgba(19, 26, 45, .05);
  --shadow: 0 2px 10px rgba(19, 26, 45, .07);
  --shadow-lg: 0 18px 50px rgba(16, 22, 40, .16);
  --r: 10px;
  --r-lg: 14px;
}
[data-theme="dark"] {
  --bg: #0e1117;
  --surface: #161b23;
  --surface-2: #1b212b;
  --surface-3: #222a35;
  --border: #2a3240;
  --border-strong: #3a4454;
  --text: #e9edf4;
  --text-2: #a3adbd;
  --text-3: #78829a;
  --primary: #6b8bff;
  --primary-soft: #1e2942;
  --primary-deep: #93a9ff;
  --green: #38c98a;
  --green-soft: #16302a;
  --orange: #f0a33e;
  --orange-soft: #33260f;
  --red: #ff6f6f;
  --red-soft: #351a1c;
  --purple: #a887f5;
  --purple-soft: #271f3c;
  --cyan: #45c3d1;
  --cyan-soft: #102c31;
  --gray-soft: #1f262f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #7a5cff);
  color: #fff; font-weight: 700; font-size: 16px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(47, 92, 246, .3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; }
.brand-text span { font-size: 11px; color: var(--text-3); letter-spacing: .6px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-group-title {
  font-size: 10.5px; color: var(--text-3); letter-spacing: 1.2px;
  padding: 0 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px; margin-bottom: 2px;
  border: 0; background: transparent; border-radius: 8px;
  color: var(--text-2); font-size: 13px; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 16px; text-align: center; font-size: 13px; opacity: .9; }
.nav-item .badge-count {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: var(--red); color: #fff; border-radius: 9px;
  min-width: 17px; height: 17px; padding: 0 5px;
  display: grid; place-items: center;
}
.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }
.data-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 11px 12px; }
.data-card-title { font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.data-card p { margin: 0 0 8px; font-size: 11px; color: var(--text-3); line-height: 1.5; }
.side-btns { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.link-btn {
  border: 0; background: transparent; padding: 0; font-size: 11.5px;
  color: var(--primary); cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: 0 0 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 13px; color: var(--text-2); font-weight: 500; }
.crumb b { color: var(--text); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-box { position: relative; }
.search-box input {
  width: 236px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 0 10px 0 30px; outline: none; color: var(--text);
}
.search-box input:focus { border-color: var(--primary); background: var(--surface); }
.search-icon { position: absolute; left: 10px; top: 6px; color: var(--text-3); font-size: 14px; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: .8; }
.view { padding: 20px 22px 40px; max-width: 1560px; width: 100%; }

/* ---------- buttons ---------- */
.btn {
  height: 32px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; }
.btn-ghost { border-color: transparent; background: var(--surface-3); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 6px; }
.btn-icon { width: 32px; padding: 0; justify-content: center; font-size: 14px; }
.btn-danger { color: var(--red); border-color: var(--border-strong); }
.btn-danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-title { font-size: 19px; font-weight: 650; letter-spacing: -.2px; margin: 0 0 3px; }
.page-sub { font-size: 12px; color: var(--text-3); margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- kpi ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpi-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat-strip { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); }
.cat-chip { display: flex; align-items: center; gap: 7px; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; font-size: 11.5px; color: var(--text-2); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 13px 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.kpi-value { font-size: 21px; font-weight: 650; letter-spacing: -.6px; line-height: 1.15; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.kpi-foot { font-size: 11px; color: var(--text-3); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border); gap: 10px;
}
.panel-title { font-size: 13.5px; font-weight: 600; }
.panel-title span { font-weight: 400; color: var(--text-3); font-size: 11.5px; margin-left: 7px; }
.panel-body { padding: 14px 16px; }
.panel-body.tight { padding: 0; }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-weight: 500; color: var(--text-3); font-size: 11.5px;
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 600; }
.table .muted { color: var(--text-3); }
.table-wrap { overflow: auto; max-height: 620px; }
.row-link { cursor: pointer; }

/* ---------- tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 500;
  white-space: nowrap; line-height: 1.7;
}
.tag-blue { background: var(--primary-soft); color: var(--primary); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-orange { background: var(--orange-soft); color: var(--orange); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-purple { background: var(--purple-soft); color: var(--purple); }
.tag-cyan { background: var(--cyan-soft); color: var(--cyan); }
.tag-gray { background: var(--gray-soft); color: var(--text-2); }

/* ---------- progress / bars ---------- */
.progress { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.progress.sm { height: 4px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 132px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 4px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; font-size: 11.5px; }

/* ---------- charts ---------- */
.chart-svg { display: block; }
.chart-wide { width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-center { font-size: 11px; fill: var(--text-3); }
.donut-main { font-size: 17px; font-weight: 650; fill: var(--text); }

/* ---------- funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 62px; gap: 10px; align-items: center; font-size: 12px; }
.funnel-bar { height: 26px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: hidden; }
.funnel-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, var(--primary), #7a5cff); opacity: .85; }
.funnel-bar > span { position: absolute; left: 9px; top: 0; line-height: 26px; font-size: 11.5px; color: #fff; font-weight: 600; }

/* ---------- alerts ---------- */
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  display: flex; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--border);
  align-items: flex-start; cursor: pointer;
}
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: var(--surface-2); }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex: 0 0 6px; }
.alert-text { font-size: 12px; line-height: 1.5; }
.alert-text b { font-weight: 600; }
.alert-text small { display: block; color: var(--text-3); font-size: 11px; margin-top: 1px; }

/* ---------- site cards ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.site-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: var(--shadow-sm); position: relative;
}
.site-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.site-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 2px; }
.site-card .progress { height: 6px; margin-top: 2px; }
.site-name { font-size: 13.5px; font-weight: 600; margin: 0; line-height: 1.4; }
.site-meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 11px; }
.site-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 11px 0 9px; }
.site-fig span { display: block; font-size: 10.5px; color: var(--text-3); }
.site-fig strong { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.site-card-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 7px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); padding: 0 16px; background: var(--surface); }
.tab {
  border: 0; background: transparent; padding: 11px 12px 10px; font-size: 12.5px;
  color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- detail header ---------- */
.detail-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 14px; }
.detail-top { padding: 16px 18px 14px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.detail-title { font-size: 18px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.2px; }
.detail-sub { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.detail-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.dstat span { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.dstat strong { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- gantt ---------- */
.gantt { font-size: 11.5px; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 76px 88px; gap: 10px; align-items: center; }
.gantt-head { padding: 7px 14px; color: var(--text-3); font-size: 10.5px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.gantt-row { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-row:hover { background: var(--surface-2); }
.gantt-track { position: relative; height: 16px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.gantt-bar { position: absolute; top: 3px; height: 10px; border-radius: 3px; background: var(--primary); opacity: .9; }
.gantt-bar.done { background: var(--green); }
.gantt-bar.late { background: var(--red); }
.gantt-bar.plan { background: var(--primary); opacity: .15; top: 3px; height: 10px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 9px; min-height: 160px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 0 2px; }
.kcol-title { font-size: 12px; font-weight: 600; }
.kcol-count { font-size: 10.5px; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; margin-bottom: 7px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s;
}
.kcard:hover { border-color: var(--primary); }
.kcard-name { font-size: 12.5px; font-weight: 600; margin-bottom: 1px; }
.kcard-meta { font-size: 11px; color: var(--text-3); }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.form-item input, .form-item select, .form-item textarea {
  height: 32px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface); padding: 0 9px; outline: none; width: 100%; color: var(--text);
}
.form-item textarea { height: 64px; padding: 7px 9px; resize: vertical; line-height: 1.5; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-hint { font-size: 11px; color: var(--text-3); }
.budget-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.budget-preview b { color: var(--text); font-weight: 600; font-size: 14px; }
.budget-preview .arrow { color: var(--text-3); font-size: 15px; }
.budget-preview .delta { margin-left: auto; font-weight: 600; color: var(--primary); }
.link-check { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.link-check input { width: auto; margin-top: 2px; }
.link-check .form-hint { flex-basis: 100%; padding-left: 22px; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 20, 32, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px; z-index: 100; overflow-y: auto;
  animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: var(--r-lg); width: 520px; max-width: 100%;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: pop .14s ease-out;
}
.modal.wide { width: 860px; }
@keyframes pop { from { transform: translateY(-6px) scale(.99); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 14px; font-weight: 600; }
.modal-close { border: 0; background: transparent; font-size: 18px; color: var(--text-3); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- sum bar ---------- */
.sum-bar { display: flex; gap: 28px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); }
.sum-item span { display: block; font-size: 11px; color: var(--text-3); }
.sum-item strong { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sum-item.hl strong { color: var(--primary); }
.sum-item.warn strong { color: var(--red); }

/* ---------- misc ---------- */
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input {
  height: 30px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface); padding: 0 8px; outline: none; font-size: 12px; color: var(--text);
}
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 12px; font-size: 12px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -15px; top: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--primary); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.tl-date { font-size: 10.5px; color: var(--text-3); }
.kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--text-3); font-size: 12px; }
.kv dd { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.photo-card { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.photo-card img, .photo-card svg { display: block; width: 100%; height: 112px; object-fit: cover; }
.photo-meta { padding: 6px 9px; font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; }
.checkline { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(10px);
  background: #1d2330; color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 300;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .g-3, .g-4, .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .main, .view, .page-head, .panel, .panel-body { min-width: 0; max-width: 100%; }
  .sidebar {
    display: block; position: sticky; top: 0; z-index: 40; height: auto;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { display: none; }
  .nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group { display: contents; }
  .nav-group-title { display: none; }
  .nav-item {
    width: auto; white-space: nowrap; margin: 0; padding: 7px 12px;
    border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px;
  }
  .nav-item .badge-count { margin-left: 4px; }
  .sidebar-foot { display: none; }
  .topbar { position: static; height: auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .top-actions { flex: 1; min-width: 0; gap: 6px; justify-content: flex-end; }
  .sync-state { display: none; }
  .search-box { flex: 1 1 auto; min-width: 0; }
  .search-box input { width: 100%; }
  .user-chip { padding: 0 8px; }
  .user-chip .user-name { display: none; }
  .crumb { font-size: 13px; }
  .view { padding: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { font-size: 18px; }
  .search-box input { width: 120px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal { max-width: calc(100vw - 24px); }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 移动端：KPI 强制双列，避免被行内样式覆盖成单列 */
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .kpi { padding: 12px 13px !important; }
  .kpi-value { font-size: 20px !important; }
  .kpi-value small { font-size: 11px !important; }
  .kpi-foot { font-size: 10.5px !important; }
  html, body { overflow-x: hidden; }
  .chart-svg, .chart-wide { width: 100% !important; max-width: 100%; }
  .bar-row { grid-template-columns: 74px minmax(0, 1fr) 100px !important; font-size: 11.5px; }
  .panel-body { overflow-x: auto; }
  .detail-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .detail-stats { width: 100%; justify-content: space-between; }
  .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .page-actions { flex-wrap: wrap; gap: 6px; }
}

/* ================= 登录 ================= */
.login-mask {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #22305c 0%, #0d1220 58%, #090d17 100%);
}
.login-card {
  width: 100%; max-width: 368px; background: var(--surface);
  border-radius: 18px; padding: 26px 24px 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  border: 1px solid var(--border);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.login-mark {
  width: 40px; height: 40px; border-radius: 11px; color: #fff; font-weight: 700; font-size: 19px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #7a5cff);
  box-shadow: 0 6px 18px rgba(47, 92, 246, .35);
}
.login-brand strong { display: block; font-size: 16px; letter-spacing: .3px; }
.login-brand span { font-size: 11px; color: var(--text-3); letter-spacing: .8px; }
.login-sub { font-size: 12.5px; color: var(--text-3); margin-bottom: 16px; }
.login-item { margin-bottom: 12px; }
.login-item label { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 5px; }
.login-item input {
  width: 100%; height: 42px; padding: 0 12px; font-size: 14px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface-2); color: var(--text); outline: none;
}
.login-item input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-btn { width: 100%; height: 44px; font-size: 14.5px; margin-top: 6px; justify-content: center; }
.login-err {
  background: var(--red-soft); color: var(--red); font-size: 12.5px;
  padding: 9px 11px; border-radius: 8px; margin-bottom: 12px; line-height: 1.5;
}
.login-foot { margin-top: 14px; font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.6; }

/* ================= 顶栏用户与同步状态 ================= */
.user-chip { gap: 7px; padding-left: 6px; height: 32px; }
.user-chip .avatar {
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 600;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), #7a5cff);
}
.user-chip .user-name { font-size: 12.5px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-state { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.sync-state.bad { color: var(--red); }
.um-list { display: grid; gap: 6px; }
.um-item {
  text-align: left; padding: 11px 13px; border-radius: 9px; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.um-item:hover { border-color: var(--primary); color: var(--primary); }
.um-item.danger { color: var(--red); }
.um-item.danger:hover { border-color: var(--red); color: var(--red); }

/* ================= 照片 ================= */
.photo-img { display: block; width: 100%; height: 150px; object-fit: cover; }
.file-input {
  width: 100%; padding: 9px; font-size: 12.5px; border-radius: 9px;
  border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2);
}

/* ================= 打印报价单 ================= */
@media print {
  .sidebar, .topbar, .toast, .modal-mask, #loginRoot, .page-actions, .btn, .link-btn { display: none !important; }
  .app { display: block !important; }
  body { background: #fff !important; }
  .view { padding: 0 !important; }
  .panel { border: 0 !important; box-shadow: none !important; }
  .panel-head { border-bottom: 1px solid #ddd !important; }
  table { font-size: 11px !important; }
  .table th, .table td { padding: 5px 6px !important; }
  @page { margin: 14mm 12mm; }
}

/* ================= ERP 对接设置 ================= */
.set-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.set-title { font-size: 16px; font-weight: 650; letter-spacing: -.3px; }
.set-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.set-switch { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 20px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  font-size: 12px; cursor: pointer; white-space: nowrap; user-select: none; }
.set-switch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.set-switch.on { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.set-switch.on .set-switch-dot { background: var(--green); }
.set-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.set-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.set-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.set-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.panel-actions { display: flex; gap: 8px; }
.set-note { font-size: 11.5px; color: var(--text-3); line-height: 1.6; margin-top: 12px; }
.cache-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cache-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 13px; text-align: center; }
.cache-name { font-size: 11.5px; color: var(--text-2); }
.cache-num { font-size: 24px; font-weight: 650; margin: 4px 0 2px; }
.cache-foot { font-size: 10.5px; color: var(--text-3); }
.map-panel { margin-bottom: 12px; }
.map-path { font-family: var(--font-mono); }
.map-row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border); }
.map-row:last-child { border-bottom: 0; }
.map-head { font-size: 11px; color: var(--text-3); font-weight: 500; }
.map-key { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }
.map-input { width: 100%; padding: 6px 9px; font-size: 12px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.cache-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cache-tab { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.cache-tab.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.cache-body { overflow-x: auto; }
@media (max-width: 900px) {
  .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cache-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-row { grid-template-columns: 130px 1fr; }
}

/* ================= 版本标识 ================= */
.tag-primary { background: var(--primary-soft); color: var(--primary); }
/* 侧边栏底部版本号 */
.ver-foot {
  display: flex; align-items: center; gap: 7px; width: 100%;
  margin-top: 9px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text-3);
  font-size: 11px; cursor: pointer; text-align: left;
  font-variant-numeric: tabular-nums; transition: border-color .15s, color .15s;
}
.ver-foot:hover { border-color: var(--primary); color: var(--primary); }
.ver-foot-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px var(--green-soft); }
/* 顶栏版本徽标 */
.ver-badge {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 600;
  cursor: pointer; font-variant-numeric: tabular-nums; letter-spacing: .2px; white-space: nowrap;
}
.ver-badge:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
/* 登录页版本号 */
.login-ver { margin-top: 16px; font-size: 10.5px; color: var(--text-3); text-align: center; letter-spacing: .2px; }
/* 版本弹窗 */
.ver-banner-wrap { margin-bottom: 16px; }
.ver-banner {
  display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%); color: #fff;
}
.ver-banner-mark {
  width: 44px; height: 44px; border-radius: 11px; flex: none;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.ver-banner-title { font-size: 15px; font-weight: 650; letter-spacing: .3px; }
.ver-banner-sub { font-size: 12px; margin-top: 4px; opacity: .92; }
.ver-banner-sub b { font-weight: 650; }
.ver-log-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
.ver-item { display: flex; gap: 14px; }
.ver-rail { position: relative; width: 14px; flex: none; display: flex; justify-content: center; }
.ver-rail::before { content: ''; position: absolute; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.ver-item:last-child .ver-rail::before { display: none; }
.ver-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); margin-top: 6px; z-index: 1; flex: none; }
.ver-item.current .ver-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ver-content { flex: 1; min-width: 0; padding-bottom: 18px; }
.ver-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ver-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ver-date { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-left: auto; }
.ver-title { font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 6px; }
.ver-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 3px; }
@media (max-width: 720px) {
  .ver-badge { display: none; }
  .ver-banner { padding: 13px 14px; }
  .ver-date { margin-left: 0; }
}

/* 售后质保跟踪卡 */
.warranty-card { background: var(--purple-soft); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.warranty-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin-bottom: 12px; }
.warranty-icon { font-size: 16px; }
.warranty-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.warranty-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.warranty-grid span { font-size: 11px; color: var(--text-2); }
.warranty-grid strong { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .warranty-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .warranty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 审批单详情 */
.detail-list { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: 0; }
.detail-k { width: 96px; flex: none; color: var(--text-3); font-size: 12px; }
.detail-v { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
