:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #778196;
  --border: #e8edf4;
  --primary: #0fc0d9;
  --primary-dark: #009db8;
  --green: #13b98b;
  --green-soft: #ddf8ef;
  --amber: #f4a621;
  --amber-soft: #fff4d8;
  --red: #ec5454;
  --red-soft: #ffe7e7;
  --shadow: 0 14px 42px rgba(31, 45, 75, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0, rgba(15, 192, 217, 0.08), transparent 24rem),
    var(--bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(1480px, calc(100% - 56px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.title-row { display: flex; align-items: center; gap: 10px; }
.title-row h1 { margin: 0; font-size: 30px; letter-spacing: -0.04em; }
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #18ba37;
  box-shadow: 0 0 0 5px rgba(24, 186, 55, 0.11);
}
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-chip { color: var(--muted); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.user-chip-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 11px; border-radius: 9px; text-decoration: none; white-space: nowrap; transition: color .18s ease, background .18s ease; }
.user-chip-link:hover { color: var(--primary-dark); background: rgba(15, 192, 217, .09); }
.sync-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border-radius: 999px; color: #168a70; background: #e5f8f2; font-size: 12px; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(19,185,139,.1); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); border-color: #cfd8e7; box-shadow: 0 7px 20px rgba(35, 51, 80, .08); }
.btn-primary { color: white; border-color: transparent; background: linear-gradient(135deg, #11c4dd, #09acd2); box-shadow: 0 10px 24px rgba(9, 172, 210, .2); }
.btn-primary:hover { border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); background: var(--red-soft); border-color: transparent; }
.btn-wide { width: 100%; }
.btn-small { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.btn-icon { font-size: 21px; line-height: 1; font-weight: 300; }
.btn-app-download { color: #087f93; border-color: rgba(15, 192, 217, .25); background: rgba(255,255,255,.82); }
.btn-app-download:hover { border-color: rgba(15, 192, 217, .55); box-shadow: 0 8px 22px rgba(9, 172, 210, .11); }
.download-phone-icon { display: grid; place-items: center; width: 21px; height: 21px; border: 1.7px solid currentColor; border-radius: 6px; font-size: 14px; font-weight: 800; line-height: 1; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 54px;
}
.summary-card {
  min-height: 158px;
  padding: 30px 34px;
  border: 1px solid rgba(232, 237, 244, .82);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.summary-label { display: flex; align-items: center; justify-content: space-between; color: #70798a; font-size: 16px; }
.summary-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 800; font-size: 13px; }
.summary-icon.ok { color: white; background: var(--green); }
.summary-icon.warn { color: white; background: var(--red); }
.summary-value { margin-top: 22px; font-size: 38px; font-weight: 700; letter-spacing: -.04em; }

.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(330px, 1fr));
  gap: 28px;
}
.device-card {
  position: relative;
  padding: 25px;
  overflow: hidden;
  border: 1px solid rgba(232, 237, 244, .9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.device-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--green), #26d6b5);
}
.device-card.warning::before { background: linear-gradient(90deg, var(--amber), #ffc965); }
.device-card.danger::before, .device-card.offline::before { background: linear-gradient(90deg, var(--red), #ff8888); }
.device-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.device-head h2 { margin: 0 0 7px; font-size: 20px; letter-spacing: -.02em; }
.device-meta { color: var(--muted); font-size: 13px; }
.status-pill { flex: none; padding: 6px 14px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 13px; font-weight: 600; }
.status-pill.warning { color: #b87400; background: var(--amber-soft); }
.status-pill.danger, .status-pill.offline { color: var(--red); background: var(--red-soft); }
.device-main { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 24px; margin: 28px 0 25px; }
.gauge {
  --progress: 100;
  --gauge-color: var(--green);
  display: grid;
  place-items: center;
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color) calc(var(--progress) * 1%), #edf0f2 0);
}
.gauge::before { grid-area: 1/1; width: 104px; aspect-ratio: 1; border-radius: 50%; background: white; content: ""; }
.gauge-value { z-index: 1; grid-area: 1/1; color: var(--gauge-color); font-size: 26px; font-weight: 650; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 22px 16px; }
.metric-label { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.metric-value { font-size: 16px; font-weight: 700; white-space: nowrap; }
.metric-value.accent { color: var(--green); }
.device-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.replace-btn { color: #2f68b8; background: #f1f5ff; border-color: transparent; font-weight: 600; }
.empty-state { grid-column: 1 / -1; padding: 70px 24px; text-align: center; color: var(--muted); border: 1px dashed #cbd6e5; border-radius: var(--radius); background: rgba(255,255,255,.5); }
.empty-icon { margin-bottom: 12px; font-size: 42px; }

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 24, 42, .52);
  backdrop-filter: blur(7px);
}
.modal-backdrop.hidden, .hidden { display: none !important; }
.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(13, 24, 45, .24);
}
.modal-lg { width: min(620px, 100%); }
.modal-device-wizard { width: min(980px, 100%); padding: 0; overflow: hidden; }
.app-download-modal { width: min(900px, 100%); padding: 0; overflow: hidden; }
.app-download-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 30px 34px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, rgba(15,192,217,.08), rgba(19,185,139,.04) 60%, transparent); }
.app-download-brand { display: flex; align-items: center; gap: 15px; }
.app-download-mark { display: grid; flex: none; place-items: center; width: 48px; height: 48px; padding: 9px; border-radius: 15px; background: white; box-shadow: 0 10px 24px rgba(9,172,210,.18); }
.app-download-mark svg { display: block; width: 100%; height: 100%; }
.cellatopia-mark-dark { fill: #343434; }
.cellatopia-mark-cyan { fill: #08bde6; }
.app-download-head h2 { margin: 0 0 6px; font-size: 24px; }
.app-download-head p { margin: 0; color: var(--muted); line-height: 1.5; }
.app-platform-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(260px, .82fr); gap: 18px; padding: 24px 28px 18px; }
.app-platform-card { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.android-card { border-color: rgba(15,192,217,.23); box-shadow: 0 14px 34px rgba(23,62,83,.07); }
.ios-card { color: #687286; background: linear-gradient(145deg, #f8fafc, #f2f5f8); }
.platform-title-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.platform-title-row h3 { margin: 0 0 3px; color: var(--text); font-size: 18px; }
.platform-title-row p { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.platform-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-size: 17px; font-weight: 800; }
.android-icon { color: #087f67; background: #ddf8ef; }
.ios-icon { color: #657083; background: #e8edf3; }
.platform-ready, .platform-coming { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.platform-ready { color: #087f67; background: #ddf8ef; }
.platform-coming { color: #737d8f; background: #e8edf3; }
.android-download-body { display: grid; grid-template-columns: 164px minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 22px; }
.qr-frame { display: grid; place-items: center; width: 164px; height: 164px; padding: 10px; border: 1px solid #dce7ec; border-radius: 15px; background: white; box-shadow: inset 0 0 0 5px #f6fafb; }
.qr-frame img { display: block; width: 142px; height: 142px; object-fit: contain; }
.qr-frame img:not([src]) { visibility: hidden; }
.qr-frame.is-empty { background: repeating-linear-gradient(135deg, #f7f9fb, #f7f9fb 8px, #f1f4f7 8px, #f1f4f7 16px); }
.download-copy { min-width: 0; }
.download-copy strong { display: block; margin-bottom: 7px; font-size: 16px; }
.download-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.or-divider { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: #a0a8b6; font-size: 11px; }
.or-divider::before, .or-divider::after { height: 1px; flex: 1; content: ""; background: var(--border); }
.btn.disabled { cursor: not-allowed; pointer-events: none; opacity: .48; box-shadow: none; }
.download-status { margin: 15px 0 0; color: var(--red); font-size: 13px; text-align: center; }
.ios-coming-body { display: grid; justify-items: center; padding: 30px 10px 16px; text-align: center; }
.ios-orbit { display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 18px; border: 1px solid #dbe2ea; border-radius: 50%; background: rgba(255,255,255,.7); box-shadow: 0 0 0 10px rgba(229,234,241,.55); }
.ios-orbit span { color: #6a7485; font-size: 20px; font-weight: 750; }
.ios-coming-body strong { color: #4f596b; }
.ios-coming-body p { max-width: 250px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.official-download-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 0 28px 24px; color: var(--muted); font-size: 12px; text-align: center; }
.official-download-note > span:first-child { color: var(--green); font-weight: 800; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.modal h2 { margin: 0; font-size: 23px; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: #f3f5f8; font-size: 20px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 22px; border-radius: 10px; background: #f1f4f8; }
.tab { min-height: 38px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.tab.active { color: var(--text); background: white; box-shadow: 0 4px 12px rgba(32, 47, 72, .08); font-weight: 600; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #5f697a; font-size: 13px; font-weight: 600; }
.field input, .field select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  outline: none;
  border: 1px solid #dce3ed;
  border-radius: 9px;
  color: var(--text);
  background: white;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 192, 217, .12); }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.form-help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-error { min-height: 18px; margin: 2px 0 0; color: var(--red); font-size: 13px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.wizard-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px 42px 16px; border-bottom: 1px solid var(--border); }
.wizard-header h2 { margin: 0; font-size: 27px; }
.wizard-header p { margin: 8px 0 0; color: var(--muted); }
.wizard-header .modal-close { position: absolute; top: 14px; right: 16px; }
.wizard-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; max-height: calc(100vh - 156px); }
.wizard-body { padding: 16px 42px 28px; overflow-y: auto; }
.wizard-body h3 { margin: 0 0 26px; font-size: 20px; }
.wizard-notice { display: flex; align-items: flex-start; gap: 16px; padding: 24px 28px; margin-bottom: 16px; border-radius: 13px; color: #e18b00; background: #eef6ff; }
.wizard-notice.success { color: #168a70; background: #eaf9f4; }
.wizard-notice strong { display: block; margin-bottom: 7px; font-size: 15px; }
.wizard-notice p { margin: 0; line-height: 1.7; font-size: 14px; }
.notice-icon { display: grid; flex: none; place-items: center; width: 22px; height: 22px; margin-top: 2px; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 800; }
.wizard-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 62px; }
.wizard-fields .field { align-content: start; }
.wizard-fields .field input, .wizard-fields .field select { height: 44px; }
.wizard-fields .sn-field input { width: calc(50% - 31px); }
.label-with-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-with-option > span:last-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 400; white-space: nowrap; }
.label-with-option input { width: 17px !important; height: 17px !important; margin: 0; accent-color: #2378ff; }
.volume-row { display: grid; grid-template-columns: 1fr 116px; gap: 12px; }
.wizard-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 42px; border-top: 1px solid var(--border); background: #fafbfd; }
.wizard-footer > div { display: flex; gap: 10px; }
.wizard-footer .btn { min-width: 128px; }
.confirmation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; }
.confirmation-grid > div { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.confirmation-grid > div:nth-child(odd) { border-right: 1px solid var(--border); }
.confirmation-grid dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.confirmation-grid dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 18px;
  border-radius: 11px;
  color: white;
  background: #1f2b3f;
  box-shadow: 0 14px 38px rgba(19, 31, 51, .22);
  transform: translateY(0);
}
.toast.error { background: #c94343; }

.table-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
.data-table th { color: var(--muted); background: #fafbfd; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:last-child td { border-bottom: 0; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; }
.online-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 600; }
.online-badge::before { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(19,185,139,.11); content: ""; }
.offline-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--red); font-weight: 600; }
.offline-badge::before { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(236,84,84,.10); content: ""; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 18px; }
.section-head h2 { margin: 0; font-size: 19px; }
.admin-list-tools { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.device-search { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.device-search input { width: 240px; height: 40px; padding: 0 13px; outline: none; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: white; }
.device-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,192,217,.12); }
.refresh-note { color: var(--muted); font-size: 13px; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-top: 1px solid var(--border); background: #fafbfd; }
.pagination-summary, .pagination-page, .pagination-actions label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pagination-actions { display: flex; align-items: center; gap: 10px; }
.pagination-actions select { height: 38px; padding: 0 30px 0 11px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: white; }
.pagination-actions .btn { min-height: 38px; padding: 8px 14px; }
.pagination-actions .btn:disabled { cursor: default; opacity: .42; }
.access-state { padding: 80px 24px; text-align: center; color: var(--muted); }
.access-state h2 { margin: 0 0 10px; color: var(--text); }
.expiry-modal { width: min(500px, calc(100vw - 32px)); }
.expiry-device-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 10px; background: #f4f7fb; }
.expiry-device-summary span { color: var(--muted); font-size: 13px; }
.expiry-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.expiry-actions .btn { width: 100%; }

.account-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(480px, 1.25fr); gap: 28px; align-items: start; }
.account-summary, .account-card { border: 1px solid rgba(232, 237, 244, .9); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.account-summary { padding: 34px; text-align: center; }
.account-avatar { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; color: white; background: linear-gradient(135deg, #13c5d9, #16b98b); box-shadow: 0 12px 28px rgba(15, 192, 217, .2); font-size: 32px; font-weight: 700; }
.account-summary h2 { margin: 0 0 7px; font-size: 23px; overflow-wrap: anywhere; }
.account-email { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.account-meta { display: grid; gap: 14px; margin-top: 30px; text-align: left; }
.account-meta > div { display: flex; justify-content: space-between; gap: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.account-meta span { color: var(--muted); font-size: 13px; }
.account-meta strong { font-size: 13px; text-align: right; }
.account-card { padding: 32px 34px; }
.account-card-head { margin-bottom: 26px; }
.account-card-head h2 { margin: 0 0 8px; font-size: 22px; }
.account-card-head p { margin: 0; color: var(--muted); font-size: 14px; }
.account-card .form-error { grid-column: 1 / -1; }
.account-form-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; margin-top: 6px; }
.account-form-actions .btn { min-width: 128px; }
.field input[readonly] { color: #70798a; background: #f6f8fb; cursor: not-allowed; }
.account-management-card { grid-column: 1 / -1; }
.account-management-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-management-link {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 92px;
  padding: 17px 18px;
  border: 1px solid #e1e9f1;
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(145deg, #fff, #f7fbfd);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.account-management-link:hover { transform: translateY(-2px); border-color: rgba(10,174,201,.35); box-shadow: 0 12px 28px rgba(32,72,105,.1); }
.account-management-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: #078d99; background: #e4f8f7; font-size: 25px; font-weight: 700; }
.account-management-icon.usage-icon { color: #2876b5; background: #eaf3ff; }
.account-management-link strong, .account-management-link small { display: block; }
.account-management-link strong { margin-bottom: 5px; font-size: 17px; }
.account-management-link small { color: var(--muted); font-size: 13px; }
.account-management-arrow { color: #91a0b4; font-size: 28px; }

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: #f0f4f9;
}
.language-option {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #788399;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.language-option:hover { color: #0aaec9; }
.language-option.active {
  color: #0aaec9;
  background: #fff;
  box-shadow: 0 5px 16px rgba(30,75,112,.1);
  font-weight: 700;
}
.language-option:focus-visible { outline: 2px solid rgba(10,174,201,.35); outline-offset: 2px; }

@media (max-width: 1180px) {
  .device-grid { grid-template-columns: repeat(2, minmax(330px, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1480px); padding-top: 22px; }
  .topbar { align-items: stretch; flex-direction: column; margin-bottom: 24px; }
  .top-actions { justify-content: flex-start; }
  .btn-app-download, #add-device-btn { flex: 1 1 auto; }
  .summary-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 30px; }
  .summary-card { min-height: 108px; padding: 20px 22px; }
  .summary-value { margin-top: 10px; font-size: 30px; }
  .device-grid { grid-template-columns: 1fr; }
  .device-main { grid-template-columns: 122px 1fr; gap: 14px; }
  .gauge { width: 116px; }
  .gauge::before { width: 88px; }
  .gauge-value { font-size: 22px; }
  .metric-grid { gap: 18px 10px; }
  .metric-value { font-size: 14px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .account-layout { grid-template-columns: 1fr; }
  .account-summary, .account-card { padding: 24px 22px; }
  .account-management-links { grid-template-columns: 1fr; }
  .admin-list-tools { align-items: stretch; flex-direction: column; gap: 10px; }
  .device-search { align-items: stretch; flex-direction: column; }
  .device-search input { width: 100%; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-actions { justify-content: space-between; flex-wrap: wrap; }
  .wizard-header { align-items: flex-start; flex-direction: column; padding: 24px 22px 16px; }
  .wizard-form { max-height: calc(100vh - 130px); }
  .wizard-body { padding: 16px 22px 24px; }
  .wizard-fields { grid-template-columns: 1fr; gap: 18px; }
  .wizard-fields .sn-field input { width: 100%; }
  .wizard-footer { padding: 14px 22px; }
  .app-download-head { padding: 24px 22px 20px; }
  .app-platform-grid { grid-template-columns: 1fr; padding: 18px; }
  .confirmation-grid { grid-template-columns: 1fr; }
  .confirmation-grid > div:nth-child(odd) { border-right: 0; }
}

@media (max-width: 430px) {
  .app-download-brand { align-items: flex-start; }
  .app-download-mark { width: 42px; height: 42px; border-radius: 13px; }
  .app-download-head h2 { font-size: 20px; }
  .android-download-body { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .download-copy { width: 100%; }
  .device-card { padding: 20px; }
  .device-main { grid-template-columns: 1fr; justify-items: center; }
  .metric-grid { width: 100%; }
  .device-actions { grid-template-columns: 1fr; }
}

/* 设备管理 / 报警配置 / 每日用量 */
.management-shell { padding-bottom: 56px; }
.management-head h1 { margin: 0 0 8px; font-size: 34px; }
.management-tabs { display: flex; gap: 8px; margin: 10px 0 26px; padding: 6px; border-radius: 14px; background: #eaf0f7; }
.management-tabs button { min-width: 150px; padding: 13px 24px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.management-tabs button.active { color: #078fa8; background: white; box-shadow: 0 5px 16px rgba(30,75,112,.1); }
.management-panel { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.management-tools, .table-actions, .management-form-actions { display: flex; align-items: center; gap: 10px; }
.management-tools input { width: 310px; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; }
.management-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; }
.management-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 13px; }
.management-table th, .management-table td { padding: 14px 13px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.management-table th { color: #596477; background: #f7f9fc; font-weight: 700; }
.management-table tr:last-child td { border-bottom: 0; }
.table-actions button { padding: 6px 10px; border: 0; border-radius: 8px; color: #246bc5; background: #eef4ff; cursor: pointer; }
.table-actions button.danger { color: #d94141; background: #ffeaea; }
.management-status { display: inline-block; padding: 5px 9px; border-radius: 999px; }
.management-status.ok { color: #078c75; background: #ddf8ef; }.management-status.bad { color: #d94141; background: #ffe8e8; }
.management-modal { width: min(820px, calc(100vw - 28px)); }.management-contact-modal { width: min(500px, calc(100vw - 28px)); }
.management-contact-modal .form-grid { padding: 24px; }.management-form-actions { justify-content: flex-end; grid-column: 1 / -1; }
.check-field { justify-content: end; }.check-field label { margin-top: 28px; }
.usage-filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 14px; align-items: end; margin-bottom: 22px; }
.usage-filters label { display: grid; gap: 7px; color: #5f697a; font-size: 13px; font-weight: 650; }
.usage-filters select, .usage-filters input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.usage-chart-card { margin-bottom: 22px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: #fbfcfe; }
#usage-chart { display: block; width: 100%; min-height: 250px; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 12px; }
.usage-legend span { display: inline-flex; align-items: center; gap: 6px; }.usage-legend i { width: 9px; height: 9px; border-radius: 50%; }

@media (max-width: 760px) {
  .management-tabs { overflow-x: auto; }.management-tabs button { min-width: 120px; padding: 11px 14px; }
  .management-panel { padding: 18px 14px; }.management-tools { align-items: stretch; width: 100%; }.management-tools input { width: 100%; }
  .usage-filters { grid-template-columns: 1fr 1fr; }.usage-filters label:first-child, .usage-filters .btn { grid-column: 1 / -1; }
}
