:root {
  --ink: #17313b;
  --muted: #6d7e86;
  --line: #dfe7e9;
  --surface: #ffffff;
  --canvas: #f2f5f5;
  --nav: #092f42;
  --nav-soft: #0d4156;
  --teal: #0b7189;
  --teal-dark: #075a70;
  --teal-soft: #e8f4f5;
  --gold: #e5aa3d;
  --green: #23866b;
  --red: #bd4a46;
  --shadow: 0 18px 42px rgba(20, 55, 66, 0.08);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1160px; min-height: 100vh; background: var(--canvas); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.analytics-filter { display: flex; align-items: end; gap: 16px; margin-bottom: 18px; padding: 18px 22px; }
.analytics-filter .toolbar-copy { flex: 1; }
.compact-field { display: grid; gap: 6px; color: #6b7785; font-size: 12px; }
.compact-field input, .compact-field select { min-width: 150px; height: 38px; padding: 0 10px; border: 1px solid #dbe4e7; border-radius: 8px; color: #1d2c33; background: #fff; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.echart { width: 100%; height: 320px; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1.1fr) minmax(420px, 0.9fr);
  min-height: 100vh;
  background: #f4f7f7;
}

.login-panel {
  width: min(520px, calc(100% - 80px));
  margin: auto;
  padding: 56px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  color: white;
  background: linear-gradient(145deg, var(--teal-dark), #12929d);
  border-radius: 22px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand-mark.small { width: 48px; height: 48px; border-radius: 15px; font-size: 17px; }
.login-eyebrow, .page-eyebrow { margin-top: 28px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.login-panel h1 { margin: 10px 0 12px; font-size: 34px; letter-spacing: -0.8px; }
.login-panel > p { margin: 0 0 38px; color: var(--muted); line-height: 1.7; }
.login-panel label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.login-panel input { width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; outline: none; }
.login-panel input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(11, 113, 137, 0.1); }
.login-panel .button { margin-top: 16px; }
.login-note { margin-top: 22px; color: #8a969c; font-size: 12px; line-height: 1.6; }
.login-aside { display: flex; flex-direction: column; justify-content: flex-end; padding: 80px; color: #fff; background: radial-gradient(circle at 75% 20%, rgba(47, 168, 172, 0.34), transparent 34%), linear-gradient(145deg, #062d40, #0b586b 60%, #0a7582); }
.aside-number { font-size: 116px; font-weight: 800; line-height: 0.9; letter-spacing: -8px; }
.aside-title { margin-top: 28px; font-size: 28px; font-weight: 800; }
.aside-text { width: 420px; max-width: 100%; margin-top: 14px; color: rgba(255,255,255,.72); line-height: 1.8; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 26px 20px; color: white; background: var(--nav); }
.brand-block { display: flex; align-items: center; gap: 14px; padding: 4px 8px 28px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-title { font-size: 16px; font-weight: 800; }
.brand-subtitle { margin-top: 4px; color: rgba(255,255,255,.55); font-size: 11px; }
.nav-list { display: grid; gap: 8px; margin-top: 28px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 14px 15px; color: rgba(255,255,255,.67); text-align: left; background: transparent; border: 0; border-radius: 12px; cursor: pointer; transition: .18s ease; }
.nav-item span { color: rgba(255,255,255,.34); font-size: 11px; font-weight: 800; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: var(--nav-soft); box-shadow: inset 3px 0 0 #39afba; }
.sidebar-footer { margin-top: auto; padding: 20px 12px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.scope-label { color: rgba(255,255,255,.38); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.scope-value { margin-top: 10px; font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: #47c39f; border-radius: 50%; box-shadow: 0 0 0 4px rgba(71,195,159,.12); }
.logout-button { margin-top: 18px; padding: 0; color: rgba(255,255,255,.5); background: none; border: 0; cursor: pointer; }
.logout-button:hover { color: white; }

.main-content { min-width: 0; padding: 0 34px 42px; }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 112px; padding: 18px 0; background: rgba(242,245,245,.93); backdrop-filter: blur(16px); }
.topbar .page-eyebrow { margin: 0; }
.topbar h2 { margin: 6px 0 0; font-size: 28px; letter-spacing: -.4px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-control { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 13px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.date-control span { color: var(--muted); font-size: 12px; }
.date-control input { color: var(--ink); background: none; border: 0; outline: none; }
.icon-button { width: 42px; height: 42px; color: var(--teal); background: #fff; border: 1px solid var(--line); border-radius: 11px; font-size: 21px; cursor: pointer; }
.page-panel { display: none; }
.page-panel.active { display: block; }

.panel, .kpi-card, .overview-strip, .rule-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 26px rgba(21,57,68,.045); }
.overview-strip { display: flex; align-items: flex-end; justify-content: space-between; min-height: 178px; padding: 30px 34px; color: #fff; background: radial-gradient(circle at 80% 10%, rgba(55, 174, 176, .32), transparent 32%), linear-gradient(125deg, #093f59, #0b7189); border: 0; }
.overview-label { color: rgba(255,255,255,.65); font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.overview-title { margin-top: 4px; font-size: 64px; font-weight: 800; line-height: 1; }
.overview-title small { margin-left: 4px; font-size: 24px; }
.overview-copy { margin-top: 10px; color: rgba(255,255,255,.7); font-size: 13px; }
.overview-meter { width: min(42%, 480px); height: 12px; margin-bottom: 11px; overflow: hidden; background: rgba(255,255,255,.16); border-radius: 999px; }
.overview-meter-fill { width: 0; height: 100%; background: #f3c35f; border-radius: inherit; transition: width .35s ease; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.kpi-card { position: relative; padding: 22px 24px; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -22px; bottom: -28px; width: 88px; height: 88px; background: var(--teal-soft); border-radius: 50%; }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { position: relative; z-index: 1; margin-top: 10px; font-size: 36px; font-weight: 800; }
.kpi-value.accent { color: var(--green); }
.kpi-value.warning { color: #ad771f; }
.kpi-value.danger { color: var(--red); }
.kpi-unit { position: absolute; z-index: 1; right: 22px; top: 24px; color: #97a4aa; font-size: 11px; }
.content-grid { display: grid; gap: 16px; margin-top: 16px; }
.content-grid > * { min-width: 0; }
.dashboard-grid { grid-template-columns: minmax(0, 1.9fr) minmax(280px, .7fr); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 16px; }
.panel-heading h3, .toolbar h3 { margin: 0; font-size: 16px; }
.panel-heading p, .toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.legend .done { background: var(--green); }
.legend .todo { background: #d8e1e4; }
.table-wrap { max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; color: #71828a; text-align: left; background: #f8fafa; border-top: 1px solid #edf1f2; border-bottom: 1px solid #edf1f2; font-size: 11px; font-weight: 800; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #edf1f2; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfc; }
.point-name-cell strong { display: block; font-size: 13px; }
.point-name-cell small { display: block; margin-top: 4px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tag.success { color: #207258; background: #e5f4ed; }
.tag.warning { color: #916516; background: #fff3d8; }
.tag.danger { color: #a33c38; background: #fdecea; }
.tag.neutral { color: #55707c; background: #edf2f4; }
.progress-cell { min-width: 136px; }
.mini-progress { width: 92px; height: 6px; margin-top: 6px; overflow: hidden; background: #e8edef; border-radius: 999px; }
.mini-progress span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.inspector-list { padding: 0 22px 22px; }
.inspector-item { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid #edf1f2; }
.inspector-item:last-child { border-bottom: 0; }
.inspector-avatar { display: grid; place-items: center; width: 36px; height: 36px; color: var(--teal); background: var(--teal-soft); border-radius: 11px; font-weight: 800; }
.inspector-copy { min-width: 0; flex: 1; }
.inspector-copy strong { display: block; font-size: 12px; }
.inspector-copy small { color: var(--muted); font-size: 10px; }
.inspector-count { color: var(--teal); font-size: 16px; font-weight: 800; }
.empty-list { padding: 38px 10px; color: var(--muted); text-align: center; font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.search-input { width: 250px; height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.search-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,113,137,.08); }
.button { min-height: 40px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 800; cursor: pointer; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--teal); background: var(--teal-soft); border-color: #cce5e8; }
.button.ghost { color: var(--muted); background: #fff; border-color: var(--line); }
.button.danger { color: var(--red); background: #fff0ef; border-color: #f1d1cf; }
.button.full { width: 100%; }
.table-panel { margin-top: 16px; overflow: hidden; }
.assignment-summary { margin: 20px 22px 0; padding: 14px 16px; color: #365866; background: #eef6f7; border: 1px solid #d6e8ea; border-radius: 12px; font-size: 12px; line-height: 1.6; }
.inline-input, .inline-select { width: 100%; min-width: 150px; height: 38px; padding: 0 10px; color: var(--ink); background: #fbfcfc; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.inline-input:focus, .inline-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,113,137,.08); }
.assignment-points { min-width: 360px; }
.point-check-group { margin-bottom: 10px; padding: 10px; background: #f7fafb; border: 1px solid #edf1f2; border-radius: 10px; }
.point-check-group:last-child { margin-bottom: 0; }
.point-check-title { margin-bottom: 7px; color: var(--teal); font-size: 11px; font-weight: 800; }
.point-check { display: inline-flex; align-items: center; gap: 5px; width: 50%; margin: 4px 0; color: #405862; font-size: 11px; line-height: 1.4; }
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); padding: 20px 22px; border-bottom: 1px solid var(--line); }
.summary-row > div { padding-left: 18px; border-left: 2px solid #e3e9eb; }
.summary-row strong { display: block; font-size: 23px; }
.summary-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.coordinates { font-variant-numeric: tabular-nums; line-height: 1.5; }
.action-group { display: flex; gap: 7px; }
.action-link { padding: 0; color: var(--teal); background: none; border: 0; font-size: 11px; font-weight: 800; cursor: pointer; }
.action-link.danger { color: var(--red); }
.switch-indicator { display: inline-block; width: 31px; height: 17px; padding: 2px; background: #c7d1d5; border-radius: 999px; vertical-align: middle; }
.switch-indicator::after { content: ""; display: block; width: 13px; height: 13px; background: #fff; border-radius: 50%; transition: .2s; }
.switch-indicator.on { background: var(--green); }
.switch-indicator.on::after { transform: translateX(14px); }

.settings-layout { display: grid; grid-template-columns: minmax(560px, 1.4fr) minmax(320px, .7fr); gap: 18px; }
.settings-form { padding-bottom: 25px; }
.settings-form .form-field { margin: 0 24px 20px; }
.settings-form > .button { margin-left: 24px; }
.inline-message { display: inline-block; margin-left: 13px; color: var(--green); font-size: 12px; }
.settings-side { display: grid; gap: 12px; }
.rule-card { display: flex; align-items: center; gap: 16px; padding: 20px; }
.rule-card strong { font-size: 13px; }
.rule-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.rule-number { min-width: 74px; color: var(--teal); font-size: 48px; font-weight: 800; letter-spacing: -3px; }
.rule-index { display: grid; place-items: center; flex: none; width: 38px; height: 38px; color: #fff; background: var(--teal); border-radius: 12px; font-size: 13px; font-weight: 800; }
.geofence-rule { color: #fff; background: linear-gradient(135deg, #0b566c, #0b7e8e); border: 0; }
.geofence-rule .rule-number { color: #f5c767; }
.geofence-rule p { color: rgba(255,255,255,.7); }

.image-thumb { width: 58px; height: 42px; object-fit: cover; background: #e9eef0; border-radius: 7px; cursor: pointer; }
.records-table td { max-width: 250px; }
.description-cell { color: #5f6f77; line-height: 1.5; }
.description-cell small { display: block; margin-top: 4px; color: var(--muted); }
.description-cell pre { max-width: 260px; margin: 6px 0 0; white-space: pre-wrap; color: #5f6f77; font: inherit; font-size: 11px; }
.admin-create-form { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) auto; gap: 14px; align-items: end; margin-top: 16px; padding: 20px 22px; }
.admin-create-form .form-field > span { margin-bottom: 7px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(3,24,33,.58); backdrop-filter: blur(5px); }
.modal-card { width: min(860px, 94vw); max-height: 92vh; padding: 28px; overflow: auto; background: #fff; border-radius: 22px; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.modal-heading .page-eyebrow { margin: 0 0 5px; }
.modal-heading h3 { margin: 0; font-size: 23px; }
.modal-close { width: 36px; height: 36px; color: #61737b; background: #f1f4f5; border: 0; border-radius: 10px; font-size: 24px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: block; }
.form-field.full-span { grid-column: 1 / -1; }
.form-field > span { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.form-field input, .form-field textarea, .form-field select { width: 100%; padding: 11px 13px; color: var(--ink); background: #fbfcfc; border: 1px solid var(--line); border-radius: 10px; outline: none; resize: vertical; }
.form-field input, .form-field select { height: 42px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,113,137,.08); }
.form-field small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.map-picker { position: relative; width: 100%; height: 300px; overflow: hidden; background: linear-gradient(135deg, #eef3f4, #dfeaec); border: 1px solid var(--line); border-radius: 14px; }
.map-picker::before { position: absolute; z-index: 0; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; content: "请先在巡查频次页面配置腾讯地图Key"; }
.map-picker.is-ready::before { display: none; }
.coordinate-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 14px; background: #f4f8f8; border-radius: 12px; }
.text-link { color: var(--teal); font-size: 12px; font-weight: 800; text-decoration: none; }
.switch-row { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 12px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.form-error { min-height: 18px; margin-top: 10px; color: var(--red); font-size: 12px; }
.toast { position: fixed; z-index: 80; right: 28px; bottom: 28px; max-width: 380px; padding: 14px 18px; color: #fff; background: #17313b; border-radius: 12px; box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
  .analytics-filter { flex-wrap: wrap; }
  .analytics-filter .toolbar-copy { flex-basis: 100%; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { min-width: 0; }
  .login-shell { display: block; min-height: 100vh; padding: 18px; }
  .login-panel { width: 100%; padding: 30px 22px; border-radius: 18px; }
  .login-aside { display: none; }
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 16px; }
  .brand-block { padding-bottom: 14px; }
  .nav-list { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
  .nav-item { padding: 12px; border-radius: 10px; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 14px 8px 0; }
  .main-content { padding: 0 14px 28px; }
  .topbar { position: relative; display: block; min-height: auto; padding: 20px 0; }
  .topbar-actions { margin-top: 12px; justify-content: space-between; }
  .overview-strip { display: block; min-height: 0; padding: 24px; }
  .overview-meter { width: 100%; margin-top: 22px; }
  .kpi-grid, .summary-row, .settings-side, .admin-create-form { grid-template-columns: 1fr; }
  .toolbar { display: block; }
  .analytics-filter { display: grid; }
  .compact-field input, .compact-field select { width: 100%; }
  .toolbar-actions { margin-top: 14px; }
  .search-input { width: 100%; }
  .modal-backdrop { padding: 12px; }
  .modal-card { width: 100%; max-height: 96vh; padding: 20px; border-radius: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .coordinate-tools { display: block; }
  .coordinate-tools .text-link { display: block; margin-top: 12px; }
  .point-check { width: 100%; }
}
