:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --navy: #073d72;
  --blue: #087fc4;
  --gold: #f2c978;
  --orange-gold: #e89e30;
  --red: #d91f37;
  --red-light: #f24b53;
  --green: #16865d;
  --ink: #172f47;
  --muted: #708294;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 4%, rgba(28, 149, 221, 0.2), transparent 32%),
    linear-gradient(150deg, #eaf3f9 0%, #f7fafc 55%, #e8f1f7 100%);
}

.page-shell {
  width: min(100%, 880px);
  margin: 0 auto;
  padding-bottom: 24px;
}

.brand-header {
  position: relative;
  min-height: 118px;
  padding: 22px 24px 34px;
  color: white;
  background:
    radial-gradient(circle at 110% -20%, rgba(67, 180, 240, 0.42), transparent 45%),
    linear-gradient(120deg, #073d72, #087fc4);
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-en {
  color: var(--gold);
  font: 800 30px/1 "Segoe UI", sans-serif;
  letter-spacing: 1px;
}

.brand-cn {
  color: var(--orange-gold);
  font-size: 15px;
  font-weight: 800;
}

.brand-header p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.report-card {
  position: relative;
  width: calc(100% - 28px);
  margin: -22px auto 0;
  padding: 24px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(7, 61, 114, 0.08);
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(12, 55, 91, 0.14);
}

.site-badge {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--red-light), var(--red));
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(217, 31, 55, 0.28);
  font-size: 22px;
  font-weight: 800;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
}

h1 {
  margin: 6px 0 8px;
  color: var(--navy);
  font-size: 26px;
  text-align: center;
}

.intro {
  margin: 0 auto 18px;
  max-width: 640px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  box-shadow: 0 8px 20px rgba(18, 90, 161, 0.18);
}

.secondary-button {
  color: var(--navy);
  background: #eef6fb;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.site-search-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.site-search-wrap label {
  color: var(--navy);
  font-weight: 800;
}

.site-search-wrap input {
  width: 100%;
  padding: 13px 16px;
  color: var(--ink);
  background: #f8fbfe;
  border: 1px solid #cdddea;
  border-radius: 14px;
  font: inherit;
}

.site-search-wrap input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(16, 111, 168, 0.14);
}

.search-hint {
  min-height: 20px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

body:not(.site-view) .site-detail-only {
  display: none;
}

.header-config-button {
  position: absolute;
  top: 20px;
  right: 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(8px);
}

.header-config-button:hover {
  background: rgba(255, 255, 255, 0.23);
}

body.site-view .management-only,
body.site-view #qr-canvas {
  display: none;
}

body.site-view .site-badge,
body.site-view .detail-body,
body.site-view footer,
body.site-view .brand-header > p,
body.site-view .site-pill {
  display: none;
}

body.site-view {
  min-height: 100vh;
  background: #f3f7fa;
}

body.site-view .page-shell {
  width: min(100%, 760px);
  padding: 20px;
}

body.site-view .brand-header {
  min-height: auto;
  padding: 18px 22px;
  border-radius: 18px 18px 0 0;
}

body.site-view .report-card {
  width: 100%;
  max-width: 760px;
  margin-top: 0;
  margin-inline: auto;
  padding: 22px;
  border-radius: 0 0 18px 18px;
}

body.site-view .detail-card {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

body.site-view .detail-body {
  grid-template-columns: 1fr;
}

body.site-view .qr-panel {
  justify-content: flex-start;
}

body.site-view .detail-header {
  padding-bottom: 18px;
  border-bottom: 1px solid #dce8f1;
}

body.site-view .detail-header h2 {
  font-size: clamp(28px, 7vw, 42px);
}

body.site-view .rs-dashboard {
  margin-top: 22px;
}

.site-card {
  padding: 14px;
  border: 1px solid #dce8f2;
  border-radius: 16px;
  background: #fbfdff;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
}

.site-card.active {
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(8, 127, 196, 0.12);
}

.site-card-code {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
}

.site-card-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.site-card-title {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 14px;
}

.detail-card,
.scanner-card {
  margin-top: 14px;
  padding: 18px;
  background: #f8fbfe;
  border: 1px solid #e0edf6;
  border-radius: 20px;
}

.detail-header,
.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-kicker,
.camera-status {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h2,
h3 {
  margin: 0;
  color: var(--navy);
}

.site-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  color: var(--green);
  background: #e7f6ee;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.detail-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 16px;
  margin-top: 16px;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: white;
  border: 1px solid #e3eef7;
  border-radius: 16px;
}

#qr-canvas {
  width: 220px;
  height: 220px;
  padding: 10px;
  border-radius: 16px;
  background: white;
}

.qr-meta {
  width: 100%;
  text-align: center;
}

.qr-meta p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#action-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.8;
}

.status-panel,
.scanner-message {
  padding: 12px 14px;
  color: var(--navy);
  background: #eef7fb;
  border: 1px dashed #c8e4f2;
  border-radius: 12px;
  font-size: 14px;
}

.scanner-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  margin-top: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #0c3458, #103f6d);
  border-radius: 18px;
}

#video {
  width: 100%;
  max-width: 520px;
  min-height: 280px;
  object-fit: cover;
  background: #000;
}

.scanner-placeholder {
  position: absolute;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  text-align: center;
}

footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.dataview-alert-dashboard {
  margin-top: 22px;
  padding: 18px;
  background: #f5f9fc;
  border: 1px solid #dce9f2;
  border-radius: 18px;
}

.dataview-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dataview-alert-refresh {
  width: auto;
  min-width: 76px;
  padding: 9px 14px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #bad3e3;
  border-radius: 999px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

.dataview-alert-refresh:disabled {
  cursor: wait;
  opacity: 0.65;
}

.dataview-alert-meta {
  margin: 7px 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.dataview-alert-list {
  display: grid;
  gap: 10px;
}

.dataview-alert-card {
  padding: 14px;
  background: #fff;
  border-left: 5px solid #e28a00;
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(7, 61, 114, 0.07);
}

.dataview-alert-card.red {
  border-left-color: #b3261e;
}

.dataview-alert-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dataview-alert-main h3 {
  font-size: 17px;
}

.dataview-alert-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #8a4b00;
  background: #fff0d6;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.dataview-alert-status.red {
  color: #8f1813;
  background: #fde7e5;
}

.dataview-alert-values {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 13px;
}

.dataview-alert-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dataview-alert-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dataview-alert-link {
  width: auto;
  padding: 7px 13px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
}

.dataview-alert-empty {
  padding: 20px;
  color: #2e7d32;
  background: #fff;
  border-radius: 13px;
  font-weight: 900;
  text-align: center;
}

.dataview-alert-empty.error {
  color: #b3261e;
}

.rs-dashboard {
  margin-top: 18px;
  padding: 20px;
  background: linear-gradient(145deg, #073d72, #0b6197);
  border-radius: 18px;
}

.rs-dashboard[hidden] {
  display: none;
}

.shelf-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.shelf-station-card {
  padding: 18px;
  color: var(--navy);
  background: #fff;
  border-radius: 15px;
}

.shelf-station-card:only-child {
  grid-column: 1 / -1;
}

.shelf-station-card h4 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  color: var(--blue);
  border-bottom: 2px solid #e3eef7;
  font-size: clamp(24px, 5vw, 38px);
}

.shelf-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 6px;
  padding: 11px 0;
  border-bottom: 1px solid #edf2f6;
}

.shelf-metric-row:last-child {
  border-bottom: 0;
}

.shelf-metric-row span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.shelf-metric-row strong {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1;
}

.shelf-metric-row small {
  color: var(--muted);
  font-weight: 800;
}

.shelf-loading,
.shelf-unavailable {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--navy);
  background: #fff;
  border-radius: 15px;
  font-weight: 800;
  text-align: center;
}

.shelf-load-error {
  color: #b3261e;
}

.rs-dashboard h3 {
  color: #fff;
}

.shelf-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.refresh-shelf-cache-button {
  width: auto;
  min-width: 76px;
  padding: 8px 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

.refresh-shelf-cache-button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.refresh-shelf-cache-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.rs-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.metric-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 18px;
  color: var(--navy);
  background: #fff;
  border-radius: 15px;
}

.metric-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.metric-value {
  margin-top: 6px;
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1;
}

.metric-unit {
  color: var(--muted);
  font-weight: 800;
}

.rs-data-status {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.container-info-button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 15px 20px;
  color: var(--navy);
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 32, 70, 0.16);
  font-size: 17px;
  font-weight: 900;
}

.container-info-button:hover {
  background: #eef8ff;
  transform: translateY(-1px);
}

.container-info-button:active {
  transform: translateY(0);
}

.container-info-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.container-info-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.quick-zone-lock-button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 15px 20px;
  color: #fff;
  background: #d06000;
  border: 2px solid #ffad42;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 32, 70, 0.2);
  font-size: 17px;
  font-weight: 900;
}

.vehicle-cache-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  color: var(--navy);
  background: #fff;
  border: 2px solid #cfe3ef;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  text-align: left;
}

.vehicle-cache-button[hidden] {
  display: none;
}

.vehicle-cache-button.has-alert {
  color: #8a3c00;
  background: #fff7e8;
  border-color: #f0a343;
}

.vehicle-cache-button-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.vehicle-cache-alerts {
  display: grid;
  gap: 4px;
}

.vehicle-cache-alerts[hidden] {
  display: none;
}

.vehicle-cache-alert-line {
  padding-left: 10px;
  color: #9a5600;
  border-left: 3px solid #e28a00;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.vehicle-cache-alert-line.blocked {
  color: #a2211b;
  border-left-color: #b3261e;
}

.vehicle-cache-chevron {
  font-size: 28px;
  line-height: 1;
}

.vehicle-cache-backdrop {
  align-items: end;
  padding: 0;
}

.vehicle-cache-drawer {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  padding: 12px 20px 24px;
  overflow-y: auto;
  background: #f5f9fc;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 35px rgba(0, 34, 66, 0.22);
}

.vehicle-cache-drawer-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 14px;
  background: #c2d1dc;
  border-radius: 999px;
}

.vehicle-cache-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vehicle-cache-close {
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--navy);
  background: #e5eef4;
  border: 0;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.vehicle-cache-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vehicle-cache-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vehicle-shelf-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px;
  background: #e5eef4;
  border-radius: 13px;
}

.vehicle-shelf-switch[hidden] {
  display: none;
}

.vehicle-shelf-switch-button {
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 900;
}

.vehicle-shelf-switch-button.selected {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 3px 9px rgba(7, 61, 114, 0.12);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-dot.normal { background: #2e7d32; }
.status-dot.warning { background: #e28a00; }
.status-dot.blocked { background: #b3261e; }

.vehicle-cache-list {
  display: grid;
  gap: 20px;
}

.vehicle-shelf-group {
  display: grid;
  gap: 10px;
}

.vehicle-shelf-group + .vehicle-shelf-group {
  padding-top: 18px;
  border-top: 2px solid #dbe7ef;
}

.vehicle-shelf-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px;
}

.vehicle-shelf-group-header h3 {
  color: var(--blue);
  font-size: 22px;
}

.vehicle-shelf-group-header span {
  padding: 5px 9px;
  color: var(--muted);
  background: #e5eef4;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.vehicle-shelf-group-list {
  display: grid;
  gap: 12px;
}

.vehicle-cache-card {
  padding: 16px;
  background: #fff;
  border-left: 5px solid #2e7d32;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(7, 61, 114, 0.08);
}

.vehicle-cache-card.warning { border-left-color: #e28a00; }
.vehicle-cache-card.blocked { border-left-color: #b3261e; }

.vehicle-cache-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vehicle-cache-card-header h3 {
  font-size: 20px;
}

.vehicle-status-badge {
  padding: 5px 9px;
  color: #1d6a29;
  background: #e5f5e8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.vehicle-status-badge.warning {
  color: #8a4b00;
  background: #fff0d6;
}

.vehicle-status-badge.blocked {
  color: #8f1813;
  background: #fde7e5;
}

.vehicle-channel {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.vehicle-cache-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vehicle-cache-metrics > div {
  padding: 10px;
  background: #f3f7fa;
  border-radius: 10px;
}

.vehicle-cache-metrics span,
.vehicle-cache-metrics strong {
  display: block;
}

.vehicle-cache-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.vehicle-cache-metrics strong {
  margin-top: 4px;
  color: var(--navy);
  font-size: 20px;
}

.vehicle-cache-rule {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.quick-zone-lock-button:hover {
  background: #e16a00;
  transform: translateY(-1px);
}

.zone-modal-card {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.zone-modal-site {
  margin: 8px 0 14px;
  color: var(--muted);
  font-weight: 800;
}

.zone-option-list {
  display: grid;
  gap: 9px;
}

.zone-option-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  color: var(--navy);
  background: #f5f9fc;
  border: 2px solid #dce9f2;
  border-radius: 12px;
  text-align: left;
}

.zone-option-button span {
  color: var(--muted);
  font-size: 12px;
}

.zone-option-button.selected {
  background: #fff5e8;
  border-color: #f09a35;
}

.zone-action-modal-backdrop {
  z-index: 930;
  background: rgba(3, 24, 43, 0.68);
  backdrop-filter: blur(4px);
}

.zone-action-panel {
  width: min(620px, calc(100vw - 32px));
  padding: 24px;
  background: #fff;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(3, 24, 43, 0.32);
}

.zone-selected-detail {
  margin: 7px 0 16px;
  padding: 11px 13px;
  color: #496276;
  background: #f1f6f9;
  border-radius: 10px;
  font-weight: 900;
}

.zone-action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.zone-action-button {
  padding: 12px 8px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
}

.zone-action-button.warning { background: #d06000; }
.zone-action-button.danger { background: #b3261e; }
.zone-action-button.success { background: #2e7d32; }
.zone-action-button:disabled { cursor: wait; opacity: 0.55; }
.zone-action-status {
  min-height: 0;
  margin: 11px 0 0;
  padding: 0;
  color: var(--muted);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.zone-action-status:empty {
  display: none;
}

.zone-action-status.loading,
.zone-action-status.info {
  padding: 10px 12px;
  color: #71501c;
  background: #fff7e8;
  border: 1px solid #f0d29b;
}

.zone-action-status.success {
  padding: 11px 12px;
  color: #176b2c;
  background: #eaf7ed;
  border: 2px solid #4d9b5f;
}

.zone-action-status.error {
  padding: 13px 14px;
  color: #8f1813;
  background: #fde7e5;
  border: 3px solid #b3261e;
  box-shadow: 0 5px 14px rgba(179, 38, 30, 0.18);
  font-size: 15px;
}

@media (max-width: 520px) {
  body.site-view {
    background: #edf4f8;
  }

  body.site-view .page-shell {
    padding: 8px;
  }

  body.site-view .brand-header {
    padding: 14px 16px;
    border-radius: 15px 15px 0 0;
  }

  body.site-view .brand-en {
    font-size: 25px;
  }

  body.site-view .brand-cn {
    font-size: 13px;
  }

  body.site-view .report-card {
    padding: 14px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 26px rgba(12, 55, 91, 0.1);
  }

  body.site-view .detail-header {
    padding: 2px 2px 11px;
  }

  body.site-view .detail-header .detail-kicker {
    margin-bottom: 1px;
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  body.site-view .detail-header h2 {
    font-size: 30px;
  }

  body.site-view .rs-dashboard {
    margin-top: 12px;
  }

  .zone-action-buttons { grid-template-columns: 1fr; }
  .shelf-dashboard {
    padding: 13px;
    border-radius: 15px;
    background: linear-gradient(150deg, #084b7d, #086c9b);
  }

  .shelf-dashboard-header h3 {
    font-size: 18px;
  }

  .refresh-shelf-cache-button {
    min-width: 62px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .shelf-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .shelf-station-card {
    min-width: 0;
    padding: 10px;
    border-radius: 11px;
  }

  .shelf-station-card h4 {
    margin-bottom: 5px;
    padding-bottom: 6px;
    font-size: 20px;
  }

  .shelf-metric-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px;
    padding: 7px 0;
  }

  .shelf-metric-row span {
    font-size: 10px;
  }

  .shelf-metric-row strong {
    font-size: 17px;
  }

  .shelf-metric-row small {
    display: none;
  }

  .vehicle-cache-button,
  .quick-zone-lock-button {
    margin-top: 10px;
    padding: 11px 12px;
    border-radius: 11px;
    font-size: 13px;
  }

  .quick-zone-lock-button {
    color: #9a4a00;
    background: #fff7ec;
    border-color: #efa64f;
    box-shadow: none;
  }

  .quick-zone-lock-button:hover {
    background: #ffefd8;
  }

  .rs-data-status {
    margin-top: 8px;
    font-size: 10px;
    text-align: center;
  }

  .vehicle-cache-alert-line {
    font-size: 10px;
  }

  .vehicle-cache-drawer {
    max-height: 88vh;
    padding: 8px 12px 14px;
    border-radius: 17px 17px 0 0;
  }

  .vehicle-cache-drawer-handle {
    margin-bottom: 8px;
  }

  .vehicle-cache-header .detail-kicker {
    font-size: 9px;
  }

  .vehicle-cache-header h2 {
    font-size: 22px;
  }

  .vehicle-cache-close {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }

  .vehicle-cache-legend {
    gap: 9px;
    margin: 8px 0;
    font-size: 10px;
  }

  .vehicle-shelf-switch {
    gap: 5px;
    margin-bottom: 10px;
    padding: 4px;
  }

  .vehicle-shelf-switch-button {
    padding: 7px 8px;
    font-size: 11px;
  }

  .vehicle-cache-list {
    gap: 12px;
  }

  .vehicle-shelf-group {
    gap: 6px;
  }

  .vehicle-shelf-group + .vehicle-shelf-group {
    padding-top: 10px;
  }

  .vehicle-shelf-group-header h3 {
    font-size: 17px;
  }

  .vehicle-shelf-group-header span {
    padding: 4px 7px;
    font-size: 9px;
  }

  .vehicle-shelf-group-list {
    gap: 7px;
  }

  .vehicle-cache-card {
    padding: 10px;
    border-left-width: 4px;
    border-radius: 10px;
  }

  .vehicle-cache-card-header h3 {
    font-size: 16px;
  }

  .vehicle-status-badge {
    padding: 4px 7px;
    font-size: 9px;
  }

  .vehicle-channel {
    margin: 2px 0 7px;
    font-size: 9px;
  }

  .vehicle-cache-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .vehicle-cache-metrics > div {
    padding: 7px 6px;
    border-radius: 7px;
  }

  .vehicle-cache-metrics span {
    font-size: 9px;
  }

  .vehicle-cache-metrics strong {
    margin-top: 2px;
    font-size: 16px;
  }

  .vehicle-cache-rule {
    margin-top: 8px;
    font-size: 9px;
  }
}

/* Mobile station experience */
@media (max-width: 520px) {
  body.site-view {
    background:
      radial-gradient(circle at 92% 0, rgba(20, 145, 211, 0.14), transparent 28%),
      #edf3f7;
  }

  body.site-view .page-shell {
    width: 100%;
    padding: 0 8px calc(12px + env(safe-area-inset-bottom));
  }

  body.site-view .brand-header {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
    background: linear-gradient(120deg, #073d72 0%, #086da5 72%, #0b8bca 100%);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 22px rgba(7, 61, 114, 0.18);
  }

  body.site-view .brand-row {
    gap: 8px;
  }

  body.site-view .brand-en {
    font-size: 24px;
    letter-spacing: 0.06em;
  }

  body.site-view .brand-cn {
    font-size: 12px;
  }

  body.site-view .report-card {
    margin-top: 8px;
    padding: 12px;
    overflow: visible;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(12, 55, 91, 0.08);
  }

  body.site-view .detail-header {
    min-height: 58px;
    padding: 5px 4px 11px;
    border-bottom: 1px solid #dbe7ef;
  }

  body.site-view .detail-header .detail-kicker {
    margin-bottom: 2px;
    color: #5f7487;
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  body.site-view .detail-header h2 {
    color: #073d72;
    font-size: 29px;
    line-height: 1.05;
    letter-spacing: 0.01em;
  }

  body.site-view .rs-dashboard {
    margin-top: 11px;
  }

  .shelf-dashboard {
    padding: 12px;
    color: var(--ink);
    background: #f1f6f9;
    border: 1px solid #d8e6ee;
    border-radius: 14px;
    box-shadow: none;
  }

  .shelf-dashboard-header {
    min-height: 42px;
    padding: 0 1px 9px;
    border-bottom: 1px solid #d7e4ec;
  }

  .shelf-dashboard-header h3 {
    color: #073d72;
    font-size: 17px;
    letter-spacing: 0.01em;
  }

  .refresh-shelf-cache-button {
    min-width: 66px;
    min-height: 36px;
    padding: 7px 13px;
    color: #086da5;
    background: #fff;
    border: 1px solid #b9d2e1;
    border-radius: 999px;
    box-shadow: 0 3px 9px rgba(7, 61, 114, 0.06);
    font-size: 12px;
  }

  .refresh-shelf-cache-button:active {
    transform: scale(0.97);
  }

  .shelf-comparison {
    gap: 7px;
    margin-top: 9px;
  }

  .shelf-station-card {
    padding: 10px 9px;
    border: 1px solid #dde8ef;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(7, 61, 114, 0.05);
  }

  .shelf-station-card h4 {
    margin: 0 0 3px;
    padding: 0 0 7px;
    color: #087fc4;
    border-bottom: 1px solid #dce7ee;
    font-size: 19px;
    line-height: 1.15;
  }

  .shelf-metric-row {
    min-height: 37px;
    padding: 7px 0;
    border-bottom-color: #e5edf2;
  }

  .shelf-metric-row span {
    color: #667b8d;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
  }

  .shelf-metric-row strong {
    color: #073d72;
    font-size: 18px;
    line-height: 1;
  }

  .vehicle-cache-button,
  .quick-zone-lock-button {
    position: relative;
    min-height: 48px;
    margin-top: 9px;
    padding: 11px 38px 11px 13px;
    border-radius: 12px;
    font-size: 13px;
    text-align: left;
    transition: transform 120ms ease, filter 120ms ease;
  }

  .vehicle-cache-button:active,
  .quick-zone-lock-button:active {
    transform: scale(0.985);
  }

  .vehicle-cache-button {
    color: #704000;
    background: #fff9ed;
    border: 1px solid #edb863;
    box-shadow: none;
  }

  .quick-zone-lock-button {
    color: #fff;
    background: linear-gradient(135deg, #d85d00, #ed7b13);
    border: 0;
    box-shadow: 0 6px 15px rgba(205, 87, 0, 0.2);
    font-weight: 900;
    text-align: center;
  }

  .quick-zone-lock-button::after {
    content: "›";
    position: absolute;
    top: 50%;
    right: 15px;
    font-size: 24px;
    font-weight: 400;
    transform: translateY(-52%);
  }

  .rs-data-status {
    margin: 8px 2px 0;
    color: #7a8c9b;
    font-size: 9px;
    line-height: 1.45;
  }

  .zone-modal-backdrop {
    align-items: end;
    padding: 0;
    background: rgba(4, 25, 45, 0.58);
    backdrop-filter: blur(3px);
  }

  .zone-modal-card {
    width: 100%;
    max-height: min(88dvh, 760px);
    margin: 0;
    padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 50px rgba(4, 32, 57, 0.25);
  }

  .zone-modal-card::before {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    margin: -8px auto 13px;
    background: #c8d7e2;
    border-radius: 999px;
  }

  .zone-modal-card .detail-kicker {
    font-size: 9px;
  }

  .zone-modal-card h2 {
    padding-right: 42px;
    font-size: 24px;
  }

  .zone-modal-card .modal-close {
    top: 16px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #073d72;
    background: #edf4f8;
    font-size: 26px;
  }

  .zone-modal-site {
    margin: 5px 0 12px;
    font-size: 12px;
  }

  .zone-option-list {
    gap: 8px;
  }

  .zone-option-button {
    min-height: 58px;
    padding: 10px 12px;
    background: #f4f8fb;
    border: 1px solid #d6e3ec;
    border-radius: 12px;
    box-shadow: none;
  }

  .zone-option-button strong {
    font-size: 15px;
  }

  .zone-option-button span {
    font-size: 10px;
    line-height: 1.4;
  }

  .zone-option-button.selected {
    background: #fff7eb;
    border: 2px solid #ec8b25;
    border-radius: 12px;
  }

  .zone-action-modal-backdrop {
    display: grid;
    place-items: center;
    padding: 18px;
  }

  .zone-action-panel {
    width: 100%;
    margin: 0;
    padding: 20px 14px 15px;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(3, 24, 43, 0.35);
  }

  .zone-action-panel h2 {
    padding-right: 36px;
    font-size: 21px;
  }

  .zone-action-panel .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #073d72;
    background: #edf4f8;
    font-size: 24px;
  }

  .zone-selected-detail {
    margin: 7px 0 13px;
    padding: 10px 11px;
    font-size: 12px;
  }

  .zone-action-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .zone-action-button {
    min-height: 44px;
    padding: 9px 3px;
    border-radius: 9px;
    font-size: 12px;
  }

  .zone-action-status.error {
    padding: 11px 12px;
    border-width: 2px;
    font-size: 13px;
  }

  .zone-action-status.success,
  .zone-action-status.loading,
  .zone-action-status.info {
    padding: 9px 10px;
    font-size: 11px;
  }
}

.container-results {
  margin-top: 16px;
  padding: 16px;
  color: var(--navy);
  background: #fff;
  border-radius: 14px;
}

.container-results[hidden] {
  display: none;
}

.container-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.container-code-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.container-code {
  padding: 10px 12px;
  color: var(--navy);
  background: #eef7fb;
  border: 1px solid #c8e4f2;
  border-radius: 10px;
  font-weight: 800;
  text-align: center;
}

.container-code:hover,
.container-code:focus-visible {
  color: #fff;
  background: var(--blue);
}

.rcs-task-results {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dce8f1;
}

.rcs-task-results[hidden] {
  display: none;
}

.rcs-task-card {
  margin: 12px 0 0;
  padding: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #e9f6ff;
  background: #092f53;
  border-radius: 12px;
  font: 14px/1.75 "Microsoft YaHei UI", sans-serif;
}

body:not(.authenticated),
body.modal-open {
  overflow: hidden;
}

body:not(.authenticated) > .page-shell {
  visibility: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(145deg, #052f59, #0b588b);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  gap: 12px;
  width: min(100%, 390px);
  padding: 30px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 20, 45, 0.32);
}

.auth-logo {
  color: var(--blue);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card p,
.settings-note {
  color: var(--muted);
}

.auth-card label,
.settings-form label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.auth-card input,
.settings-form input {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cdddea;
  border-radius: 10px;
  font: inherit;
}

.auth-card input:focus,
.settings-form input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(16, 111, 168, 0.14);
}

.form-message {
  min-height: 20px;
  color: #b42318;
  font-size: 13px;
}

.settings-form {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.settings-form .form-message,
.settings-form .modal-actions {
  grid-column: 2;
}

.settings-note {
  margin: 12px 0 0;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 31, 58, 0.62);
  backdrop-filter: blur(5px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(100%, 560px);
  padding: 28px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 20, 45, 0.35);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: #eef6fb;
  font-size: 25px;
  line-height: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .report-card {
    width: calc(100% - 16px);
    padding: 16px;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  #qr-canvas {
    width: 100%;
    max-width: 220px;
    height: auto;
  }

  .site-search-wrap {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .rs-metrics {
    grid-template-columns: 1fr;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .settings-form .form-message,
  .settings-form .modal-actions {
    grid-column: 1;
  }

  .header-config-button {
    top: 16px;
    right: 14px;
    padding: 8px 11px;
    font-size: 12px;
  }
}
