:root {
  --background: #f3f6f8;
  --surface: #ffffff;
  --ink: #19313e;
  --muted: #607682;
  --border: #dbe5e9;
  --primary: #006d77;
  --primary-dark: #00535b;
  --primary-pale: #e9f4f4;
  --temperature: #b86424;
  --danger: #aa3434;
  --danger-pale: #fff1f0;
  --radius: 10px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, input { -webkit-tap-highlight-color: transparent; }
input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #bdcdd5; background: var(--surface); border-radius: 6px; padding: 10px 12px; color: var(--ink); }
input::placeholder { color: #748894; opacity: 1; }
input:focus, button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #8bcbd0; outline-offset: 3px; }
label { display: block; font-weight: 600; margin-bottom: 7px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon, .empty-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 20; padding: 10px 16px; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; white-space: nowrap; transition: background-color .14s, border-color .14s; }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); }
.button-secondary { border-color: #c6d5dc; background: var(--surface); color: var(--ink); }
.button-secondary:hover:not(:disabled), .button-icon:hover:not(:disabled), .button-quiet:hover:not(:disabled) { background: #edf3f5; border-color: #adbec7; }
.button-quiet { color: var(--muted); background: transparent; padding-inline: 11px; }
.button-icon { width: 44px; padding: 10px; color: var(--muted); background: transparent; }
.button:disabled { opacity: .5; }
.rotate-180 { transform: rotate(180deg); }
.muted, .section-note { color: var(--muted); }
.section-note { font-size: 12px; }
.brand-symbol { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: white; }
.brand-symbol .icon { width: 25px; height: 25px; }
.topbar { height: 78px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 19px; letter-spacing: -.3px; }
.brand span:not(.brand-symbol) { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.account-actions { display: flex; align-items: center; gap: 8px; }
.account-name { padding-right: 8px; border-right: 1px solid var(--border); color: var(--muted); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace { max-width: 1780px; padding: 25px 32px 40px; margin: auto; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.workspace-heading h1 { font-size: 25px; letter-spacing: -.5px; font-weight: 650; }
.workspace-heading p { margin-top: 4px; color: var(--muted); }
.refresh-control { display: flex; align-items: center; gap: 14px; }
.refresh-control > div { text-align: right; color: var(--muted); font-size: 12px; }
.refresh-control small { display: block; font-size: 12px; margin-top: 3px; }
.monitor-layout { display: grid; grid-template-columns: minmax(540px, .95fr) minmax(470px, 1fr); gap: 22px; align-items: start; }
.panel { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 15px; gap: 16px; }
.panel-heading h2 { font-size: 16px; font-weight: 650; }
.count-badge { display: inline-block; margin-left: 6px; min-width: 26px; padding: 1px 7px; border-radius: 5px; color: var(--primary); background: var(--primary-pale); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.search-form { display: flex; gap: 8px; padding: 0 20px 17px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field .icon { position: absolute; left: 11px; top: 12px; width: 19px; height: 19px; color: #708694; pointer-events: none; }
.search-field input { padding-left: 38px; background: #fbfcfd; }
.table-scroll { min-height: 305px; max-height: 590px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #bdcbd2 transparent; }
.device-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.device-table th { position: sticky; top: 0; z-index: 1; background: #f4f7f9; color: #5e737f; font-size: 12px; font-weight: 600; text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); }
.device-table th:first-child { width: 29%; padding-left: 20px; }
.device-table th:nth-child(2) { width: 30%; }
.device-table th:nth-child(3) { width: 14%; text-align: right; }
.device-table th:last-child { width: 27%; padding-right: 20px; }
.device-table td { padding: 15px 10px; vertical-align: middle; border-bottom: 1px solid #edf1f3; }
.device-table td:first-child { padding-left: 20px; }
.device-table td:last-child { padding-right: 20px; }
.device-table tbody tr { cursor: pointer; }
.device-table tbody tr:hover { background: #f5fafb; }
.device-table tbody tr.is-selected { background: var(--primary-pale); }
.device-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.device-open { border: 0; background: none; text-align: left; font-weight: 600; color: var(--ink); padding: 4px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-open:hover { color: var(--primary); }
.device-imei, .device-iccid { display: block; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.device-iccid { color: #526a78; letter-spacing: -.2px; }
.device-temperature { text-align: right; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 650; }
.device-temperature small { font-size: 11px; margin-left: 2px; font-weight: 400; color: var(--muted); }
.device-last-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.device-elapsed { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 10px 20px; border-top: 1px solid var(--border); min-height: 64px; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; gap: 4px; }
.empty-state, .detail-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: var(--muted); padding: 54px 24px; }
.empty-state .empty-icon, .detail-empty .empty-icon { width: 42px; height: 42px; margin-bottom: 17px; stroke-width: 1.1; color: #809ca7; }
.empty-state strong { font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.empty-state p { font-size: 13px; max-width: 300px; }
.detail-empty { min-height: 620px; }
.detail-empty h2 { color: var(--ink); font-size: 18px; margin-bottom: 8px; }
.detail-empty p { max-width: 280px; }
.loading-note { padding: 45px 20px; text-align: center; color: var(--muted); }
.device-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 23px 24px 19px; }
.device-heading-name { min-width: 0; flex: 1; }
.device-title-row { display: flex; align-items: center; gap: 5px; margin: 2px 0 4px; }
.device-title-row h2 { font-size: 19px; overflow-wrap: anywhere; line-height: 1.35; }
.device-title-row .button-icon { width: 44px; min-width: 44px; padding: 11px; }
#detail-report-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.temperature-reading { white-space: nowrap; text-align: right; line-height: 1.1; padding-top: 3px; font-variant-numeric: tabular-nums; }
#detail-temperature { font-size: 43px; font-weight: 600; letter-spacing: -1.8px; }
.temperature-unit { font-size: 20px; padding-left: 5px; color: var(--muted); }
.temperature-reading small { display: block; color: var(--muted); font-size: 12px; margin-top: 10px; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 22px; padding: 17px 24px; margin: 0 24px; background: #f7fafb; border-radius: 6px; }
.identity-grid div { min-width: 0; }
.identity-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.identity-grid dd { margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.identifier { user-select: all; }
.history-section { padding: 23px 24px 19px; }
.history-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 15px; }
.history-heading h3 { font-size: 15px; font-weight: 650; }
.history-tools { display: flex; align-items: center; gap: 10px; }
.history-tools .button { padding-inline: 10px; font-size: 12px; }
.range-buttons { display: flex; border: 1px solid var(--border); border-radius: 6px; width: max-content; overflow: hidden; }
.range-buttons button { min-height: 44px; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 8px 17px; background: white; color: var(--muted); font-size: 12px; }
.range-buttons button:last-child { border-right: 0; }
.range-buttons button:hover { background: #f1f6f7; }
.range-buttons button[aria-pressed="true"] { background: var(--primary-pale); color: var(--primary); font-weight: 600; }
.range-buttons button:focus-visible { outline-offset: -3px; }
.custom-range { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding-top: 12px; }
.custom-range label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.custom-range input { font-size: 12px; min-height: 44px; padding: 7px; }
.custom-range .button { min-height: 44px; padding: 7px 11px; font-size: 12px; }
.chart-legend { display: flex; align-items: center; justify-content: flex-end; gap: 15px; font-size: 12px; color: var(--muted); margin-top: 17px; }
.chart-legend > span { display: flex; gap: 5px; align-items: center; }
.chart-legend i { display: inline-block; width: 17px; border-top: 2px solid; }
.legend-average { color: var(--temperature); }
.legend-extreme { color: #91acb7; border-top-style: dashed !important; }
.chart-frame { position: relative; height: 310px; }
.history-chart { width: 100%; height: 100%; }
.chart-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); font-size: 13px; background: rgb(255 255 255 / 94%); }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 14px; border-top: 1px solid var(--border); gap: 16px; }
.history-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; }
.history-summary span { color: var(--muted); font-size: 12px; }
.history-summary strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-caption { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.notice, .inline-notice { padding: 12px 15px; border-radius: 6px; background: var(--primary-pale); color: var(--primary-dark); font-size: 13px; }
.notice { margin-bottom: 18px; }
.inline-notice { margin: 0 20px 12px; }
.notice-error { background: var(--danger-pale); color: var(--danger); }
.form-error { font-size: 13px; color: var(--danger); line-height: 1.6; margin-top: 10px; }
.field-help { font-size: 12px; color: var(--muted); margin-top: 6px; }
.boot-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.auth-view { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-brand { display: flex; gap: 12px; align-items: center; font-size: 20px; font-weight: 650; margin-bottom: 28px; }
.auth-panel { width: min(100%, 410px); background: white; border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.auth-panel h1 { font-size: 23px; }
.auth-intro { margin: 8px 0 25px; color: var(--muted); font-size: 13px; }
.auth-panel label:not(:first-of-type) { margin-top: 18px; }
.auth-submit { width: 100%; margin-top: 24px; }
.auth-footnote { margin-top: 20px; font-size: 12px; color: var(--muted); }
.dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 12px; padding: 25px; color: var(--ink); box-shadow: 0 18px 70px rgb(12 36 48 / 20%); }
.dialog::backdrop { background: rgb(20 43 57 / 35%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -6px -8px 20px 0; }
.dialog-heading h2 { font-size: 19px; }
.dialog label:not(:first-of-type) { margin-top: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.chart-axis-actions { flex-wrap: wrap; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100% - 32px); background: #193b48; color: white; border-radius: 7px; padding: 11px 19px; box-shadow: 0 4px 20px rgb(20 43 57 / 13%); text-align: center; }
.is-refreshing .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .table-scroll { max-height: 650px; } .device-table th { font-size: 12px; } .device-imei, .device-iccid { font-size: 12px; } .device-table td { padding-block: 18px; } }
@media (max-width: 1150px) { .monitor-layout { grid-template-columns: 1fr; } .table-scroll { max-height: 430px; } .detail-empty { min-height: 260px; } .chart-frame { height: 350px; } .device-table th:first-child { width: 32%; } .device-table th:nth-child(2) { width: 29%; } .device-table th:nth-child(3) { width: 15%; } .device-table th:last-child { width: 24%; } .device-iccid, .device-imei { font-size: 12px; } }
@media (max-width: 650px) {
  .topbar { height: auto; min-height: 78px; padding: 15px 18px; flex-wrap: wrap; gap: 12px; }
  .brand strong { font-size: 17px; } .brand span:not(.brand-symbol) { font-size: 11px; }
  .account-actions { margin-left: auto; gap: 2px; width: 100%; } .account-name { display: block; flex: 1; min-width: 0; max-width: none; font-size: 12px; } .button-quiet { padding: 7px; font-size: 12px; flex-shrink: 0; }
  .workspace { padding: 20px 14px 28px; } .workspace-heading { align-items: flex-start; margin-bottom: 18px; }
  .workspace-heading h1 { font-size: 22px; } .workspace-heading p { font-size: 12px; max-width: 210px; }
  .refresh-control { gap: 0; } .refresh-control > div { display: none; } .refresh-control .button { padding: 8px 12px; }
  .monitor-layout { gap: 16px; } .panel-heading { padding: 17px 16px 13px; } .search-form { padding: 0 16px 14px; }
  .search-form .button { padding-inline: 12px; } .search-field input { font-size: 13px; }
  .table-scroll { max-height: 420px; min-height: 240px; } .device-table thead { display: none; }
  .device-table, .device-table tbody { display: block; } .device-table tbody tr { display: grid; grid-template-columns: 1fr auto; padding: 13px 16px; border-bottom: 1px solid var(--border); column-gap: 12px; row-gap: 8px; }
  .device-table td, .device-table td:first-child, .device-table td:last-child { padding: 0; border: 0; }
  .device-table tbody tr.is-selected { box-shadow: inset 3px 0 0 var(--primary); } .device-table tbody tr.is-selected td:first-child { box-shadow: none; }
  .device-table td:nth-child(1) { grid-column: 1; grid-row: 1; min-width: 0; } .device-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .device-table td:nth-child(3) { grid-column: 2; grid-row: 1; } .device-table td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
  .device-temperature { font-size: 22px; align-self: center; } .device-imei, .device-iccid { font-size: 12px; } .device-last-time { font-size: 12px; }
  .device-iccid::before { content: "ICCID "; font-size: 11px; color: var(--muted); } .device-elapsed { margin-top: 1px; font-size: 12px; }
  .pagination { padding-left: 16px; } .device-heading { padding: 19px 16px 16px; gap: 12px; } .device-title-row h2 { font-size: 17px; }
  #detail-temperature { font-size: 35px; } .temperature-unit { font-size: 17px; } .temperature-reading small { font-size: 12px; }
  .identity-grid { margin-inline: 16px; padding: 14px; column-gap: 14px; } .identity-grid dd { font-size: 12px; } .identity-grid dt { font-size: 12px; }
  .history-section { padding: 21px 16px 17px; } .chart-frame { height: 290px; } .range-buttons { width: 100%; } .range-buttons button { flex: 1; min-height: 44px; padding-inline: 10px; }
  .custom-range { grid-template-columns: 1fr 1fr; } .custom-range .button { grid-column: 1 / -1; min-height: 44px; } .custom-range input { min-height: 44px; }
  .chart-legend { font-size: 12px; gap: 10px; } .history-summary { gap: 10px; } .history-summary > div { flex-direction: column; gap: 4px; }
  .history-caption { font-size: 12px; } .auth-panel { padding: 26px; } .dialog { padding: 21px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.customer-page .admin-only, body:not(.customer-page) .customer-only { display: none !important; }
.monitor-navigation { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.monitor-navigation button[aria-pressed="true"] { background: var(--primary-pale); border-color: var(--primary); color: var(--primary-dark); }
@media (max-width: 650px) {
  .monitor-navigation { gap: 6px; }
  .monitor-navigation .button { padding-inline: 8px; font-size: 12px; }
}
.comparison-pick { display: flex; align-items: center; gap: 9px; min-height: 44px; margin: 0; cursor: pointer; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .monitor-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.comparison-pick input { flex: 0 0 18px; width: 18px; min-height: 0; height: 18px; margin: 0; accent-color: var(--primary); }
.comparison-pick:has(input:disabled) { cursor: not-allowed; }
.comparison-pick:has(input:disabled) span { color: var(--muted); }
.comparison-mode .device-table tbody tr { cursor: default; }
.comparison-mode .form-error { overflow-wrap: anywhere; }
.comparison-selection { padding: 12px 24px 16px; border-bottom: 1px solid var(--border); }
.comparison-selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comparison-selection-heading h2 { font-size: 15px; }
.comparison-selected { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.comparison-selected li { min-width: 0; max-width: 100%; }
.comparison-selected .button { min-height: 44px; max-width: 100%; justify-content: flex-start; padding: 4px 9px; font-size: 12px; white-space: normal; text-align: left; }
.comparison-name { min-width: 0; overflow-wrap: anywhere; }
.comparison-key { flex: 0 0 18px; width: 18px; border-top: 3px solid; }
.comparison-selected .simulation-badge { flex: 0 0 auto; }
.comparison-stats { border-top: 1px solid var(--border); }
.comparison-stats table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.comparison-stats :is(th, td) { padding: 8px 5px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.comparison-stats thead th { color: var(--muted); font-size: 12px; }
.comparison-stats tr > :first-child { width: 46%; padding-left: 0; text-align: left; overflow-wrap: anywhere; }
.comparison-stats tr > :last-child { padding-right: 0; }
.comparison-stats td[colspan] { color: var(--muted); text-align: left; }
@media (max-width: 650px) {
  .comparison-selection { padding-inline: 16px; }
  .comparison-stats table { font-size: 12px; }
  .comparison-stats tr > :first-child { width: 40%; }
}
.simulation-badge { display: inline-block; margin: 4px 0; padding: 2px 7px; font-size: 12px; font-weight: 500; border-radius: 4px; color: #84500e; background: #fff1d6; }
.admin-navigation { display: flex; gap: 10px; margin-bottom: 24px; }
.admin-navigation button[aria-pressed="true"] { background: var(--primary); color: white; }
.admin-navigation button[aria-pressed="false"] { background: white; color: var(--primary); border: 1px solid var(--border); }
.user-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(420px, 1.3fr); gap: 22px; align-items: start; }
.users-list { min-height: 200px; }
.user-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 16px 20px; background: white; text-align: left; border: 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.user-row strong { grid-column: 1; } .user-row span { grid-column: 1; color: var(--muted); } .user-row small { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.user-row:hover, .user-row[aria-pressed="true"] { background: var(--primary-pale); }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; border-bottom: 1px solid var(--border); }
.grant-list { padding: 0 20px 12px; }
.grant-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.grant-row > div { min-width: 0; overflow-wrap: anywhere; } .grant-row small { display: block; color: var(--muted); } .grant-row button { flex-shrink: 0; }
.customer-page .device-table th:first-child { width: 43%; }
.customer-page .device-table th:nth-child(3) { width: 22%; }
.customer-page .device-table th:last-child { width: 35%; }
@media (max-width: 800px) { .user-layout { grid-template-columns: 1fr; } .user-actions, .grant-list { padding-inline: 16px; } }
@media (max-width: 650px) { .customer-page .device-table td:nth-child(4) { grid-column: 1 / -1; text-align: left; } .customer-page .device-last-time, .customer-page .device-elapsed { display: inline; margin-right: 12px; } .customer-page .device-open { white-space: normal; overflow-wrap: anywhere; } }
