/* ============ 主题变量 ============ */
:root[data-theme="light"] {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --border: #e3e9f2;
  --border-strong: #cfd8e6;
  --text: #14213d;
  --text-2: #5e6c85;
  --text-3: #95a1b5;
  --primary: #3659d9;
  --primary-soft: #e8edff;
  --primary-text: #2846b8;
  --cyan: #0e8fa8;
  --cyan-soft: #e0f5f8;
  --green: #0f9d6e;
  --green-soft: #e0f6ee;
  --amber: #d98214;
  --amber-soft: #fdf0dc;
  --red: #d64b4b;
  --red-soft: #fdeaea;
  --gray-soft: #eef1f6;
  --shadow: 0 1px 2px rgba(20,33,61,.04), 0 8px 24px rgba(20,33,61,.06);
  --shadow-lg: 0 18px 50px rgba(15,23,42,.18);
}
:root[data-theme="dark"] {
  --bg: #0c1220;
  --surface: #151e30;
  --surface-2: #1b263c;
  --surface-3: #233149;
  --border: #26334b;
  --border-strong: #354563;
  --text: #eaf0fb;
  --text-2: #9aa9c2;
  --text-3: #6c7c96;
  --primary: #7896ff;
  --primary-soft: #24325a;
  --primary-text: #a8baff;
  --cyan: #48c6dd;
  --cyan-soft: #163b46;
  --green: #3fcf9b;
  --green-soft: #143c32;
  --amber: #f0ad4e;
  --amber-soft: #40301a;
  --red: #f47979;
  --red-soft: #412327;
  --gray-soft: #232f46;
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.24);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

/* ============ 布局 ============ */
.app-shell { display: flex; min-height: 100%; }
.sidebar {
  width: 236px; flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(170deg, #14213d 0%, #0d172b 100%);
  color: #cbd5e8; display: flex; flex-direction: column; padding: 22px 14px 16px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, #4a73ff, #22b8d4);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 18px rgba(74,115,255,.4);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.brand-text span { display: block; font-size: 11px; color: #8092b3; margin-top: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  color: #9fb0cd; border: 0; background: transparent; text-align: left; width: 100%;
  font-size: 13.5px; font-weight: 500; transition: .18s;
}
.nav-item svg { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(100deg, rgba(74,115,255,.28), rgba(34,184,212,.14)); color: #fff; box-shadow: inset 2px 0 0 #6d91ff; }
.nav-item.active svg { opacity: 1; color: #8fb0ff; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.side-stat { font-size: 11.5px; color: #7d90b1; padding: 0 10px 10px; line-height: 1.7; }
.side-stat b { color: #cfe0ff; font-weight: 600; }
.theme-toggle {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,.05); border: 0; border-radius: 9px; color: #9fb0cd; font-size: 12.5px;
}
.theme-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.theme-toggle svg { width: 16px; height: 16px; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
  padding: 14px 26px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar-left { min-width: 0; }
.page-title { font-size: 19px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; }
.page-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.date-chip {
  font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); padding: 6px 11px; border-radius: 8px; white-space: nowrap;
}
.date-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.sync-chip { white-space: nowrap; font-size: 11px; cursor: help; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; color: var(--text-2);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.mobile-brand, .mobile-theme { display: none; }
.view { padding: 22px 26px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }

/* ============ 通用组件 ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-body { padding: 18px; }
.section-title { font-size: 13px; font-weight: 650; color: var(--text-2); margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 0; }
.section-title::before { content: ""; width: 3px; height: 14px; border-radius: 3px; background: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 550;
  transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0c1220; }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { color: #0c1220; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }
.btn-soft:hover { background: var(--primary-soft); color: var(--primary-text); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gray { background: var(--gray-soft); color: var(--text-3); }
.badge-blue { background: var(--primary-soft); color: var(--primary-text); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge-red { background: var(--red-soft); color: var(--red); }

.notice {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 15px; border-radius: 11px;
  background: var(--amber-soft); color: var(--amber); font-size: 12.5px; margin-bottom: 18px; line-height: 1.6;
}
.notice svg { width: 17px; height: 17px; margin-top: 1px; }
.notice.info { background: var(--primary-soft); color: var(--primary-text); }
.notice b { font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); outline: none; transition: .16s; font-size: 13px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { resize: vertical; min-height: 70px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--text-3); }
.search-wrap .input { padding-left: 38px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row .search-wrap { flex: 1; min-width: 210px; }
.filter-row .select { width: auto; min-width: 130px; }

.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg { width: 38px; height: 38px; opacity: .5; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -.2px; }
.muted { color: var(--text-2); }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }

/* ============ 总览 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 13px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 16px 17px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -16px; top: -16px; width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); opacity: .55; }
.stat-card .label { font-size: 12px; color: var(--text-2); position: relative; z-index: 1; }
.stat-card .value { font-size: 27px; font-weight: 720; letter-spacing: -1px; margin-top: 5px; line-height: 1.15; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.stat-card .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; position: relative; z-index: 1; }
.stat-card .stat-icon { position: absolute; right: 14px; bottom: 14px; width: 19px; height: 19px; color: var(--accent); opacity: .8; z-index: 1; }
.c-blue { --accent: var(--primary); --accent-soft: var(--primary-soft); }
.c-green { --accent: var(--green); --accent-soft: var(--green-soft); }
.c-amber { --accent: var(--amber); --accent-soft: var(--amber-soft); }
.c-cyan { --accent: var(--cyan); --accent-soft: var(--cyan-soft); }
.c-red { --accent: var(--red); --accent-soft: var(--red-soft); }

.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 20px; }
.loc-row { display: grid; grid-template-columns: 132px 1fr 62px; gap: 12px; align-items: center; padding: 8px 0; }
.loc-name { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), #34b3c9); }
.loc-val { text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.loc-val b { color: var(--text); }
.hist-item { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.hist-item:last-child { border-bottom: 0; }
.hist-date { font-size: 12px; font-weight: 650; min-width: 92px; }
.hist-meta { font-size: 11.5px; color: var(--text-3); flex: 1; }

/* ============ 查询页 ============ */
.query-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.result-list { max-height: 620px; overflow: auto; padding: 8px; }
.result-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 11px; border-radius: 9px; transition: .15s;
}
.result-item:hover { background: var(--surface-2); }
.result-item.active { background: var(--primary-soft); }
.result-item .r-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-item .r-code { font-size: 13px; font-weight: 650; }
.result-item .r-name { font-size: 11.5px; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.detail-title { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.detail-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; max-width: 620px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.kv { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.kv .k { font-size: 11px; color: var(--text-3); }
.kv .v { font-size: 14px; font-weight: 650; margin-top: 3px; word-break: break-all; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data-table th { text-align: left; font-size: 11px; color: var(--text-3); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tbody tr:hover { background: var(--surface-2); }
table.data-table .row-link { color: var(--primary); font-weight: 600; cursor: pointer; }
table.data-table .row-link:hover { text-decoration: underline; }

.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.machine-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 15px; box-shadow: var(--shadow); text-align: left; transition: .18s; width: 100%; }
.machine-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 12px 28px rgba(54,89,217,.13); }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-no { font-size: 15px; font-weight: 700; }
.mc-loc { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.mc-body { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--border); display: grid; gap: 6px; }
.mc-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.mc-line span:first-child { color: var(--text-3); flex: none; }
.mc-line span:last-child { color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }

/* ============ 每日更新 ============ */
.daily-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.daily-group { margin-top: 18px; }
.daily-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.daily-group-head .name { font-size: 13px; font-weight: 650; }
.daily-group-head .count { font-size: 11px; color: var(--text-3); background: var(--surface-3); padding: 2px 8px; border-radius: 20px; }
.daily-row { display: grid; grid-template-columns: 118px 82px 82px minmax(120px,1fr) minmax(130px,1.3fr) minmax(100px,1fr); gap: 9px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.daily-row:last-child { border-bottom: 0; }
.daily-row.head { font-size: 11px; color: var(--text-3); font-weight: 650; padding-top: 4px; padding-bottom: 4px; background: var(--surface-2); border-radius: 8px; border-bottom: 0; }
.daily-row .input, .daily-row .select { padding: 7px 9px; font-size: 12px; border-radius: 7px; }
.daily-mno { font-size: 12.5px; font-weight: 650; }
.daily-loc { font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 19px; border-radius: 20px; background: var(--border-strong); position: relative; transition: .18s; flex: none; }
.switch .track::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch .lbl { font-size: 11.5px; color: var(--text-2); }
.switch input:checked ~ .lbl { color: var(--green); font-weight: 600; }
.daily-card { border: 1px solid var(--border); border-radius: 11px; padding: 12px; margin-bottom: 9px; background: var(--surface); }
.daily-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.daily-card-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.daily-card-fields .field-full { grid-column: 1 / -1; }
.daily-switches { display: flex; gap: 18px; padding: 4px 0 10px; }

/* ============ 弹窗 / Toast ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(8,15,30,.55); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { width: min(760px, 100%); }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 680; }
.modal-body { padding: 20px; overflow: auto; }
.modal-body .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-body .field-full { grid-column: 1 / -1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; }
.close-x { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.close-x:hover { background: var(--red-soft); color: var(--red); }
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #14213d; color: #fff; padding: 10px 17px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .22s ease; max-width: 88vw; }
.toast.ok { background: #0f9d6e; }
.toast.err { background: #d64b4b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 重点关注产品 ============ */
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; margin-top: 16px; }
.focus-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.fc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fc-code { font-size: 14px; font-weight: 700; }
.fc-name { font-size: 11.5px; color: var(--text-2); margin-top: 3px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-head .icon-btn { width: 26px; height: 26px; font-size: 12px; flex: none; }
.fc-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 12px; }
.fc-num { font-size: 24px; font-weight: 720; letter-spacing: -.6px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-num small { display: block; font-size: 10.5px; font-weight: 400; color: var(--text-3); letter-spacing: 0; margin-top: 4px; }
.spark { width: 128px; height: 44px; color: var(--primary); flex: none; }
.spark-last { fill: var(--amber); }
.fc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 11px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.fc-metrics > div { text-align: center; min-width: 0; }
.fc-metrics span { display: block; font-size: 10px; color: var(--text-3); white-space: nowrap; }
.fc-metrics b { display: block; font-size: 12.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.fc-metrics b.up { color: var(--green); }
.fc-metrics b.down { color: var(--red); }
.fc-alerts { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 0; min-height: 40px; align-content: flex-start; }
.fc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pick-list { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.pick-item:last-child { border-bottom: 0; }
.pick-item > div:first-child { flex: 1; }
.pick-item .btn { flex: none; }

/* ============ 登录遮罩 ============ */
.login-mask { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(380px, 100%); padding: 26px 24px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand svg { width: 34px; height: 34px; color: var(--primary); background: var(--primary-soft); padding: 6px; border-radius: 10px; }
.login-brand strong { display: block; font-size: 16px; color: var(--text); }
.login-brand span { font-size: 11.5px; color: var(--text-3); }
.login-title { font-size: 14px; font-weight: 650; color: var(--text); margin-bottom: 14px; }
.login-err { color: var(--red); font-size: 12px; min-height: 16px; margin-bottom: 8px; }
.login-card .input { width: 100%; margin-bottom: 12px; }
.login-card .btn-block { width: 100%; justify-content: center; margin-bottom: 10px; }

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .query-layout { grid-template-columns: 290px 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .daily-row { grid-template-columns: 108px 74px 74px minmax(105px,1fr) minmax(120px,1.2fr) minmax(85px,1fr); }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { padding: 11px 15px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
  .mobile-brand .mb-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(140deg,#4a73ff,#22b8d4); display: grid; place-items: center; color: #fff; }
  .mobile-brand .mb-mark svg { width: 13px; height: 13px; }
  .mobile-brand span { font-size: 11px; color: var(--text-3); }
  .mobile-theme { display: grid; }
  .page-title { font-size: 17px; }
  .page-sub { font-size: 11px; }
  .date-chip { display: none; }
  .view { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .query-layout { grid-template-columns: 1fr; }
  .result-list { max-height: 260px; }
  .machine-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(15,23,42,.06);
  }
  .tab-item { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--text-3); font-size: 10.5px; border-radius: 9px; }
  .tab-item svg { width: 20px; height: 20px; }
  .tab-item.active { color: var(--primary); font-weight: 650; }
  .tab-item.active svg { stroke-width: 2.2; }
  .daily-row { display: none; }
  .daily-card { display: block; }
}
@media (min-width: 901px) { .daily-card { display: none; } }
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .value { font-size: 23px; }
  .stat-card .stat-icon { display: none; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }
  .machine-grid { grid-template-columns: 1fr; }
  .two-col { gap: 12px; margin-top: 14px; }
  .loc-row { grid-template-columns: 105px 1fr 54px; gap: 8px; }
  .modal-body .form-grid { grid-template-columns: 1fr; }
  .modal-body .field-full { grid-column: auto; }
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
  .daily-toolbar { padding: 12px; }
  .filter-row .select { flex: 1; min-width: 110px; }
  .focus-grid { grid-template-columns: 1fr; gap: 11px; }
  .focus-card { padding: 14px; }
  .fc-metrics { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .spark { width: 105px; height: 40px; }
  .fc-num { font-size: 21px; }
  .tab-item { font-size: 9.5px; padding: 5px 1px; }
  .tab-item svg { width: 19px; height: 19px; }
  .sync-chip { font-size: 0; padding: 5px 8px; }
  .sync-chip .dot { width: 7px; height: 7px; }
}
