:root {
  --bg: #f5f8ff;
  --bg-soft: #edf3ff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --line: rgba(37, 99, 235, 0.1);
  --line-strong: rgba(37, 99, 235, 0.18);
  --text: #1e293b;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 2px 16px rgba(37, 99, 235, 0.07);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --container: 1200px;
}

html[data-theme="dark"] {
  --bg: #09111f;
  --bg-soft: #111d31;
  --surface: rgba(18, 31, 52, 0.62);
  --surface-strong: rgba(14, 24, 39, 0.84);
  --line: rgba(150, 186, 255, 0.18);
  --line-strong: rgba(150, 186, 255, 0.28);
  --text: #eef5ff;
  --muted: #9db2cc;
  --brand: #2b8cff;
  --brand-2: #58d0ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  font-size: 14px;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% 15%, rgba(43, 140, 255, 0.2), transparent 22%),
    radial-gradient(circle at 85% 8%, rgba(88, 208, 255, 0.16), transparent 18%),
    radial-gradient(circle at 80% 78%, rgba(55, 103, 188, 0.26), transparent 24%),
    linear-gradient(180deg, #06101b 0%, #09111f 45%, #060b14 100%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.page-shell { min-height: 100vh; position: relative; overflow: hidden; }
.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: none;
}
html[data-theme="dark"] .page-shell::before {
  background:
    linear-gradient(120deg, rgba(255,255,255,0.06), transparent 20%, transparent 80%, rgba(255,255,255,0.04)),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.5));
}

.container { width: min(calc(100% - 32px), var(--container)); margin: 0 auto; }
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.glass-strong {
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 16px 0;
  transition: padding 0.25s ease, transform 0.25s ease;
}
.site-header.is-scrolled {
  padding: 10px 0;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 999px;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled .navbar {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(37, 99, 235, 0.1);
  box-shadow: 0 2px 16px rgba(37, 99, 235, 0.08);
}
html[data-theme="dark"] .site-header.is-scrolled .navbar {
  background: rgba(10, 18, 31, 0.86);
  border-color: rgba(150, 186, 255, 0.22);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.05) !important;
  padding: 6px !important;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  border: 1px solid var(--line) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.brand-mark img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}
.brand-copy strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0.01em;
}
.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.site-header .brand-mark {
  width: 44px;
  height: 44px;
}

.site-footer .brand-mark {
  width: 44px;
  height: 44px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.25s ease;
  font-size: 14px;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.07);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
}
.btn.secondary {
  background: var(--surface);
  border: 1px solid var(--line);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.mobile-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  padding: 18px;
}

.admin-sidebar {
  padding: 16px;
  border-radius: 16px;
  position: sticky;
  top: 16px;
  height: fit-content;
}

.sidebar-stack {
  display: grid;
  gap: 18px;
}

.sidebar-section-title {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-menu {
  display: grid;
  gap: 10px;
}

.side-menu button {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s ease;
}

.side-menu button.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--brand);
  font-weight: 500;
}

.store-picker {
  display: grid;
  gap: 0;
  padding: 0 2px;
}

.store-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-picker-head h3 {
  margin: 0;
  font-size: 16px;
}

.store-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.store-action-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
}

.store-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.store-manage-btn.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.store-manage-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.store-manage-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 128px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--surface-strong);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  z-index: 20;
}

.store-manage-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.store-manage-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

.store-manage-item.danger {
  color: var(--danger);
}

.store-manage-item.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.dashboard-main-wrap,
.super-main-wrap {
  display: grid;
  gap: 22px;
  align-items: start;
  align-content: start;
  position: relative;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.member-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.member-primary-action {
  margin-left: auto;
}

.schedule-rule-btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 20px;
  white-space: nowrap;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.schedule-rule-btn:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #115e59, #0f766e);
}

.schedule-rule-dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.schedule-rule-form {
  align-content: start;
}

.schedule-rule-top-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-builder {
  display: grid;
  gap: 12px;
}

.schedule-day-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.schedule-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-day-head strong {
  display: block;
  font-size: 14px;
}

.schedule-day-head span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-day-add {
  padding: 7px 12px;
  font-size: 12px;
}

.schedule-section-list {
  display: grid;
  gap: 10px;
}

.schedule-section-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.schedule-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-section-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-section-grid label span {
  padding-left: 2px;
}

.schedule-section-remove {
  justify-self: flex-end;
  padding: 6px 12px;
  font-size: 12px;
}

.schedule-section-empty {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.schedule-rule-sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
}

.schedule-rule-sidebar-head {
  display: grid;
  gap: 4px;
}

.schedule-rule-sidebar-head strong {
  font-size: 15px;
}

.schedule-rule-sidebar-head span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-rule-list {
  display: grid;
  gap: 12px;
  max-height: 500px;
  overflow: auto;
  padding-right: 4px;
}

.schedule-rule-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.schedule-rule-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.schedule-rule-item-head strong {
  display: block;
  font-size: 14px;
}

.schedule-rule-item-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.schedule-rule-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.schedule-rule-meta {
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.schedule-rule-empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(148, 163, 184, 0.06);
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-grid-compact {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.summary-card,
.status-card,
.chart-card,
.admin-section-card {
  padding: 18px;
  border-radius: 14px;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.summary-card strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.panel-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-grid-equal {
  align-items: stretch;
}

.overview-stack {
  display: grid;
  gap: 18px;
}

.empty-state {
  padding: 40px 26px;
  border-radius: 24px;
  text-align: center;
  color: var(--muted);
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.dashboard-view-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  display: grid;
  align-content: start;
  justify-items: center;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(246, 249, 252, 0.82), rgba(246, 249, 252, 0.7));
  backdrop-filter: blur(4px);
}

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

.dashboard-view-loader .section-loader-card {
  width: min(100%, 320px);
  margin: 0;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.logout-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.dashboard-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.dashboard-user-meta strong {
  font-size: 15px;
}

.dashboard-user-meta span {
  color: var(--muted);
  font-size: 12px;
}

.device-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.device-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
}

.device-pill-detail {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  min-width: 180px;
}

.device-pill-title {
  display: block;
  font-weight: 600;
}

.device-pill-sn {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.device-pill.online {
  border-color: rgba(34, 197, 94, 0.28);
  color: #15803d;
  background: rgba(34, 197, 94, 0.06);
}

.device-pill.offline {
  border-color: rgba(239, 68, 68, 0.24);
  color: #dc2626;
  background: rgba(239, 68, 68, 0.05);
}

.camera-placeholder {
  min-height: 200px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.chart-svg {
  width: 100%;
  height: 220px;
  display: block;
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-legend-stack {
  display: grid;
  gap: 10px;
  align-content: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chart-legend-value {
  margin-left: auto;
  white-space: nowrap;
}

.purchase-channel-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.purchase-channel-chart {
  width: min(100%, 240px);
  justify-self: center;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.theme-options {
  display: grid;
  gap: 12px;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: 0.2s ease;
}
.theme-option:hover {
  border-color: var(--brand);
}

.theme-swatch {
  display: inline-flex;
  gap: 8px;
}

.theme-swatch span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.modal-sheet {
  width: min(92vw, 460px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}
html[data-theme="dark"] .modal-sheet {
  background: rgba(14, 24, 39, 0.94);
}

.modal-sheet-wide {
  width: min(92vw, 760px);
}

.modal-sheet::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

.modal-body {
  padding: 20px;
}

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

.hero {
  padding: 38px 0 32px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
}
.hero-copy,
.hero-visual {
  border-radius: var(--radius-xl);
  padding: 34px;
}
.hero-copy {
  transform: translate3d(0, var(--parallax-y, 0), 0);
  transition: transform 0.18s linear;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}
.hero h1 {
  margin: 16px 0 14px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}
.stat-card {
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.stat-card strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}
.stat-card span { color: var(--muted); font-size: 12px; }

.hero-visual {
  position: relative;
  overflow: hidden;
  transform: translate3d(var(--tilt-x, 0), calc(var(--tilt-y, 0) + var(--parallax-scroll-y, 0)), 0);
  transition: transform 0.25s ease;
}
.hero-visual img {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
  transition: transform 0.35s ease;
  animation: floatY 7s ease-in-out infinite;
}
.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
}
.hero-visual::before {
  width: 220px;
  height: 220px;
  right: -70px;
  top: -60px;
  background: rgba(37, 99, 235, 0.14);
  animation: pulseGlow 7.5s ease-in-out infinite;
}
.hero-visual::after {
  width: 180px;
  height: 180px;
  left: -40px;
  bottom: -40px;
  background: rgba(59, 130, 246, 0.1);
  animation: pulseGlow 8.5s ease-in-out infinite reverse;
}

.visual-stack {
  position: relative;
  display: grid;
  gap: 18px;
}
.visual-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  animation: floatCard 8s ease-in-out infinite;
}
.visual-card:nth-child(2) {
  animation-delay: -2.2s;
}
.visual-card:nth-child(3) {
  animation-delay: -4.4s;
}
.visual-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.visual-card p { color: var(--muted); line-height: 1.7; margin: 0; font-size: 13px; }
.mesh {
  aspect-ratio: 16/10;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(88,208,255,0.7), transparent 38%),
    radial-gradient(circle at 72% 28%, rgba(43,140,255,0.55), transparent 30%),
    linear-gradient(135deg, rgba(43,140,255,0.2), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.55;
}

.section-block {
  padding: 26px 0 18px;
}
.section-head {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 28px);
}
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.8;
}

.grid {
  display: grid;
  gap: 18px;
}
.grid.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: -30% auto auto -20%;
  width: 160px;
  height: 260px;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0));
  transform: rotate(28deg);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}
.card:hover {
  transform: translate3d(var(--mx, 0), calc(var(--my, 0) - 4px), 0);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
}
.card:hover::after {
  opacity: 1;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px; }
.card .meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.14);
  font-size: 12px;
}

.feature-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.scene-card {
  border-radius: 14px;
  padding: 16px;
}
.scene-media {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
}
.scene-media img {
  width: 100%;
  display: block;
}
.scene-copy {
  margin-top: 16px;
}
.scene-copy h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.scene-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.breadcrumb {
  margin: 18px auto 6px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb a { color: var(--brand); }

.page-hero {
  padding: 18px 0 20px;
}
.page-banner {
  padding: 28px;
  border-radius: var(--radius-xl);
}
.page-banner h1 {
  margin: 8px 0 10px;
  font-size: clamp(22px, 4vw, 36px);
}
.page-banner p {
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
  max-width: 820px;
}

.two-col {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}
.detail-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.detail-item {
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.detail-item strong { display: block; margin-bottom: 8px; }

.news-list {
  display: grid;
  gap: 16px;
}
.news-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
}
.news-thumb {
  border-radius: 18px;
  min-height: 160px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.05)),
    var(--bg-soft);
  border: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}
.contact-card,
.form-card {
  padding: 24px;
  border-radius: 24px;
}
.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.textarea { min-height: 140px; resize: vertical; }

.site-footer {
  margin-top: 36px;
  padding: 26px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
  border-radius: 16px;
}
.footer-grid h4 { margin: 0 0 12px; }
.footer-grid p,
.footer-grid li,
.footer-grid a {
  color: var(--muted);
  line-height: 1.8;
}
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-bottom {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
  text-align: center;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.auth-panel,
.auth-form-wrap {
  padding: 32px;
  display: flex;
  align-items: center;
}
.auth-panel {
  background:
    radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.07), transparent 30%),
    radial-gradient(circle at 70% 60%, rgba(59, 130, 246, 0.05), transparent 30%),
    linear-gradient(180deg, #edf3ff, #f5f8ff);
  position: relative;
  overflow: hidden;
}
html[data-theme="dark"] .auth-panel {
  background:
    radial-gradient(circle at 25% 25%, rgba(88, 208, 255, 0.26), transparent 22%),
    radial-gradient(circle at 70% 60%, rgba(43, 140, 255, 0.22), transparent 26%),
    linear-gradient(180deg, #07101d, #0d1730);
}
.auth-form-wrap {
  position: relative;
  background: var(--bg);
}
.auth-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
}
html[data-theme="dark"] .auth-panel::after {
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.35;
}
.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}
.auth-copy .brand {
  gap: 18px;
}
.auth-copy .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}
.auth-copy .brand-copy strong {
  font-size: 18px;
}
.auth-copy .brand-copy span {
  font-size: 13px;
}
.auth-copy h1 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 4vw, 42px);
}
.auth-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}
.auth-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.auth-form {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 28px;
  border-radius: 28px;
}
.auth-form h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.auth-form p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.8;
}
.auth-helper {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.password-field {
  position: relative;
}
.password-field .input {
  padding-right: 84px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  min-width: 52px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  transition: 0.25s ease;
}
.password-toggle:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--brand);
}
.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: #58d0ff;
}

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.dashboard-sidebar {
  padding: 22px;
  border-right: 1px solid var(--line);
}
.dashboard-main {
  padding: 22px;
}
.store-card,
.nav-card,
.admin-card {
  border-radius: 14px;
  padding: 14px;
}
.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.side-nav button {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.side-nav button.active {
  color: var(--brand);
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.07);
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.dashboard-panels {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}
.table-wrap {
  overflow: auto;
  border-radius: 20px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.member-phone-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dispatch-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.value-tip {
  --tip-color: var(--brand);
  --tip-bg: rgba(37, 99, 235, 0.08);
  --tip-border: rgba(37, 99, 235, 0.18);
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--tip-border);
  background: var(--tip-bg);
  color: var(--tip-color);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.copy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
}

.copy-icon-btn:hover {
  color: var(--brand);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

.copy-icon-btn.copied {
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.3);
  background: rgba(22, 163, 74, 0.08);
}

.detail-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.detail-icon-btn:hover {
  color: var(--brand);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

.camera-capture-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.camera-capture-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
}

.camera-capture-head strong {
  color: var(--text);
}

.camera-capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 18px;
}

.camera-stage {
  position: relative;
  min-height: 300px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}

.camera-stage video,
.camera-stage canvas,
.camera-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-stage video {
  transform: scaleX(-1);
}

.camera-open-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.18s;
}
.camera-open-overlay:hover {
  background: rgba(0, 0, 0, 0.75);
}

@keyframes capture-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65); }
  55%       { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}
.capture-ready {
  animation: capture-pulse 1s ease-in-out infinite;
  background: #15803d !important;
  color: #fff !important;
  border-color: #15803d !important;
}

.camera-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.camera-guide-target {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(56%, 260px);
  aspect-ratio: 0.8;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(88,208,255,0.72);
  border-radius: 48% 48% 44% 44% / 38% 38% 58% 58%;
  box-shadow: 0 0 0 999px rgba(4, 10, 18, 0.38);
}

.camera-guide-face {
  position: absolute;
  left: var(--face-box-left, 0px);
  top: var(--face-box-top, 0px);
  width: var(--face-box-width, min(56%, 220px));
  height: var(--face-box-height, min(68%, 280px));
  border: 2px solid rgba(88,208,255,0.94);
  border-radius: 28px;
  box-shadow: 0 0 24px rgba(88,208,255,0.24);
  opacity: 0;
  transition:
    left 0.18s ease,
    top 0.18s ease,
    width 0.18s ease,
    height 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.camera-guide-face.is-visible {
  opacity: 1;
}

.camera-guide-face.is-adjusting {
  border-color: rgba(245, 158, 11, 0.94);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.24);
}

.camera-guide-face.is-locking {
  border-color: rgba(59, 130, 246, 0.98);
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.28);
}

.camera-guide-face.is-ready {
  border-color: rgba(34, 197, 94, 0.98);
  box-shadow: 0 0 32px rgba(34, 197, 94, 0.3);
}

.camera-controls {
  display: grid;
  gap: 14px;
  align-content: start;
}

.member-dialog-compact .modal-body {
  padding: 16px 18px;
}

.member-dialog-compact .camera-capture-card {
  padding: 14px;
}

.member-dialog-compact .camera-capture-grid {
  grid-template-columns: minmax(0, 1.04fr) minmax(236px, 0.82fr);
  gap: 14px;
}

.member-dialog-compact .camera-stage {
  min-height: 258px;
}

.member-dialog-compact .camera-controls {
  gap: 10px;
}

.member-dialog-compact .modal-actions {
  margin-top: 14px;
}

.member-dialog-inline-notice {
  justify-self: end;
  width: min(100%, 280px);
  margin-top: 2px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mijia-login-box {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.mijia-login-box img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.mijia-login-copy {
  display: grid;
  gap: 10px;
}

.mijia-quick-panel {
  display: grid;
  gap: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
th { color: var(--muted); font-size: 12px; font-weight: 500; }
.panel-stack { display: grid; gap: 18px; }
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}
.alert.ok { color: #15803d; border-color: rgba(34, 197, 94, 0.2); background: rgba(34, 197, 94, 0.06); }
.alert.error { color: #dc2626; border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.06); }

.svg-illustration {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
}
.product-media {
  padding: 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.06), transparent 26%),
    radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.04), transparent 28%),
    var(--surface);
}
.product-media:hover {
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.18);
}
.product-media img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: floatY 8.5s ease-in-out infinite;
}
.product-media:hover img {
  transform: translateY(-6px) scale(1.012);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.12);
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 36px, 0) scale(0.98);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.hero-stats strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

@keyframes floatY {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes floatCard {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -6px, 0);
  }
}

@media (max-width: 1080px) {
  .admin-layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .admin-sidebar {
    position: static;
    top: auto;
  }
  .dashboard-main-wrap,
  .super-main-wrap {
    gap: 18px;
  }
  .hero-grid,
  .feature-panel,
  .two-col,
  .contact-grid,
  .dashboard-panels,
  .panel-grid-2,
  .summary-grid,
  .auth-layout,
  .dashboard-shell,
  .footer-grid,
  .news-item {
    grid-template-columns: 1fr;
  }

  .dashboard-shell { display: block; }
}

@media (max-width: 900px) {
  .site-header {
    padding: 12px 0;
  }
  .navbar {
    padding: 14px 14px;
    gap: 12px;
  }
  .nav-links {
    display: none;
    width: 100%;
    padding-top: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .nav-links.open {
    display: flex;
  }
  .navbar {
    border-radius: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .nav-links a {
    width: 100%;
    text-align: center;
  }
  .nav-actions {
    width: 100%;
  }
  .nav-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .brand {
    gap: 10px;
    min-width: 0;
  }
  .brand-copy strong {
    font-size: 13px;
  }
  .brand-copy span {
    font-size: 10px;
  }
  .site-header .brand-mark,
  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .hero-copy,
  .hero-visual,
  .page-banner {
    padding: 24px;
  }
  .hero-stats,
  .kpi-strip,
  .scene-grid,
  .grid.cards-3,
  .grid.cards-2,
  .mijia-login-box,
  .camera-capture-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }
  .dashboard-toolbar,
  .panel-header,
  .dashboard-topbar,
  .camera-capture-head,
  .schedule-day-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .schedule-rule-dialog-layout,
  .schedule-rule-top-fields,
  .schedule-section-grid {
    grid-template-columns: 1fr;
  }
  .member-panel-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .logout-row {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .summary-card,
  .status-card,
  .chart-card,
  .admin-section-card {
    padding: 14px;
  }
  .table-wrap {
    margin: 0 -4px;
  }
  .modal-sheet,
  .modal-sheet-wide {
    width: min(96vw, 760px);
  }
  .purchase-channel-layout {
    grid-template-columns: 1fr;
  }
  .modal-body {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .site-header { padding-top: 12px; }
  .container { width: min(calc(100% - 20px), var(--container)); }
  .page-shell {
    overflow-x: hidden;
  }
  .auth-panel,
  .auth-form-wrap,
  .dashboard-main,
  .dashboard-sidebar {
    padding: 18px;
  }
  .admin-layout {
    padding: 12px;
    gap: 14px;
  }
  .admin-sidebar {
    padding: 16px;
    border-radius: 22px;
  }
  .store-card,
  .nav-card,
  .admin-card,
  .store-picker {
    padding: 16px;
  }
  .dashboard-main-wrap,
  .super-main-wrap {
    gap: 14px;
  }
  .btn {
    min-height: 44px;
    padding: 12px 16px;
  }
  .hero {
    padding: 18px 0 28px;
  }
  .hero-copy h1 {
    font-size: clamp(22px, 7vw, 32px);
  }
  .section-block {
    padding: 40px 0;
  }
  .section-head {
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  .summary-grid,
  .summary-grid-compact {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .panel-grid-2,
  .overview-stack,
  .camera-capture-grid {
    gap: 12px;
  }
  .device-tags {
    gap: 8px;
  }
  .device-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .device-pill-detail {
    justify-items: center;
  }
  .camera-stage {
    min-height: 220px;
  }
  .camera-guide-face {
    min-width: 84px;
    min-height: 108px;
  }
  .camera-guide-target {
    width: min(56%, 180px);
  }
  .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .button-group .btn {
    width: 100%;
  }
  .table-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .table-actions .btn {
    width: 100%;
    justify-content: center;
  }
  table {
    min-width: 560px;
  }
  .auth-copy .brand-mark {
    width: 48px;
    height: 48px;
  }
  .auth-copy .brand-copy strong {
    font-size: 16px;
  }
  .auth-copy h1 {
    font-size: 24px;
  }
  .footer-grid {
    gap: 14px;
  }
}

/* ===== Sidebar components ===== */
.sidebar-brand {
  padding: 4px 0 6px;
}

.sidebar-user {
  padding: 14px;
  border-radius: 12px;
  display: grid;
  gap: 10px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-user-info strong {
  font-size: 14px;
}

.sidebar-user-info span {
  font-size: 12px;
  color: var(--muted);
}

.sidebar-logout-btn {
  width: 100%;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: var(--danger);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.32);
}

.nav-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.side-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-menu button.active .nav-svg {
  opacity: 1;
}

/* ===== Card grid (售卡管理) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.card-tile {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.1);
}

.card-tile-cover {
  height: 96px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.07));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-tile-name-bg {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  opacity: 0.5;
  letter-spacing: 0.04em;
}

.card-tile-body {
  padding: 14px;
  display: grid;
  gap: 3px;
}

.card-tile-body strong {
  font-size: 15px;
  color: var(--text);
}

.card-tile-price {
  font-size: 17px;
  font-weight: 600;
  color: var(--brand);
  margin-top: 2px;
}

.card-tile-days {
  font-size: 12px;
  color: var(--muted);
}

.card-tile-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.card-tile-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.card-tile-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 5px 8px;
  min-height: 30px;
}

.card-tile-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px dashed var(--line);
  font-size: 14px;
}

/* Card cover image picker */
.card-cover-picker {
  display: grid;
  gap: 8px;
}

.card-cover-preview {
  height: 110px;
  border-radius: 12px;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-soft);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.card-cover-preview:hover {
  border-color: var(--brand);
}

.card-cover-placeholder {
  font-size: 13px;
  color: var(--muted);
}

/* ===== Face quality indicator ===== */
.face-quality-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.face-quality-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease, background 0.3s ease;
  background: var(--brand);
}

.face-quality-tip {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
  min-height: 18px;
  line-height: 1.5;
}

/* Camera idle hint overlay */
.camera-idle-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 14px;
}

/* Camera facing selector */
.camera-selector {
  display: flex;
  gap: 4px;
}

.camera-selector .tx-tab {
  font-size: 12px;
  padding: 4px 10px;
}

/* ===== Transaction tabs ===== */
.tx-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-soft);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.tx-tab {
  padding: 5px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: 0.18s ease;
  font-family: inherit;
}

.tx-tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
  font-weight: 500;
}

.transaction-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.transaction-view-all-btn {
  white-space: nowrap;
}

.transaction-detail-dialog {
  width: min(94vw, 920px);
}

.transaction-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.transaction-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.transaction-detail-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.transaction-filter-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.transaction-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.transaction-summary-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.transaction-summary-card span {
  font-size: 12px;
  color: var(--muted);
}

.transaction-summary-card strong {
  font-size: 18px;
  color: var(--text);
}

.transaction-detail-table-wrap {
  max-height: min(58vh, 520px);
  overflow: auto;
}

@media (max-width: 900px) {
  .transaction-detail-head {
    flex-direction: column;
    align-items: stretch;
  }

  .transaction-detail-head-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .transaction-detail-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .transaction-head-actions,
  .transaction-detail-head-actions {
    width: 100%;
  }

  .transaction-head-actions .btn,
  .transaction-detail-head-actions .btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .transaction-detail-filters,
  .transaction-detail-summary {
    grid-template-columns: 1fr;
  }
}

/* ===== Dialog border fix for light theme ===== */
/* ===== Admin topbar ===== */
.admin-topbar {
  display: none;
}

.admin-topbar-title {
  font-size: 14px;
  color: var(--muted);
}

.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.admin-topbar-user [data-user-name-topbar] {
  font-weight: 600;
  color: var(--text);
}

/* ===== Member management toolbar ===== */
.member-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.member-search-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 260px;
}

.member-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.member-search-input {
  padding-left: 32px !important;
  height: 36px;
}

.member-sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.member-sort-btn,
.member-filter-btn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 20px;
  white-space: nowrap;
}

.member-sort-btn.active,
.member-filter-btn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--brand);
  font-weight: 500;
}

@media (max-width: 640px) {
  .member-primary-action {
    margin-left: 0;
  }

  .member-dialog-compact .camera-stage {
    min-height: 220px;
  }

  .member-dialog-inline-notice {
    width: 100%;
    justify-self: stretch;
  }
}

/* ===== Member face thumbnail in table ===== */
.member-face-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 2px solid var(--line);
  background: var(--bg-soft);
}

.member-face-empty {
  display: inline-flex;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 2px dashed var(--line);
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

/* ===== Page loader overlay ===== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.loader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 80px;
  height: 80px;
  border: 7px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: loader-spin 0.85s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.loader-ring svg {
  animation: loader-ping 1.1s cubic-bezier(0, 0, 0.2, 1) infinite;
  width: 26px;
  height: 26px;
}

.loader-ring.loader-ring-inline {
  width: 64px;
  height: 64px;
  border-width: 6px;
}

.loader-ring.loader-ring-inline svg {
  width: 22px;
  height: 22px;
}

.section-loader-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 42px 18px;
  margin-bottom: 18px;
  text-align: center;
}

.section-loader-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes loader-ping {
  0% { transform: scale(1); opacity: 0.9; }
  75%, 100% { transform: scale(1.7); opacity: 0; }
}

dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: 0 8px 40px rgba(37, 99, 235, 0.1);
}

dialog::backdrop {
  background: rgba(30, 41, 59, 0.22);
  backdrop-filter: blur(3px);
}

/* ===== Responsive: card grid collapses to 2 cols on mobile ===== */
@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-tile-cover {
    height: 72px;
  }
}

/* ===== Mobile admin: sidebar → sticky horizontal top nav ===== */
@media (max-width: 767px) {
  .admin-layout {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
    min-height: 0;
  }
  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    border-radius: 0 0 16px 16px;
    padding: 10px 14px 0;
    /* keep glass-strong styles but flatten bottom */
    border-left: none;
    border-right: none;
    border-top: none;
  }
  .sidebar-stack {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  /* Logo: icon only */
  .sidebar-brand {
    order: 0;
    flex-shrink: 0;
    padding: 0;
  }
  .sidebar-brand .brand-copy {
    display: none;
  }
  .sidebar-brand .brand-mark img {
    width: 32px;
    height: 32px;
  }
  /* Store picker: inline row (select + add btn) */
  .store-picker {
    order: 1;
    flex: 1;
    min-width: 120px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    padding: 0 !important;
  }
  .store-picker-head {
    order: 2;
    flex-shrink: 0;
  }
  .store-action-row {
    gap: 4px;
  }
  .store-picker-head .sidebar-section-title {
    display: none;
  }
  .store-picker .select {
    flex: 1;
    margin-top: 0 !important;
    order: 1;
    font-size: 13px;
    height: 34px;
    padding: 0 10px;
  }
  .store-manage-menu {
    right: 0;
    left: auto;
  }
  /* User card stays visible on mobile */
  .sidebar-user {
    order: 3;
    width: 100%;
    padding: 10px 0 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  .sidebar-user-info {
    display: flex;
  }
  /* Nav card: full-width, no glass box */
  .nav-card {
    order: 4;
    width: 100%;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  .nav-card .sidebar-section-title {
    display: none;
  }
  /* Nav buttons: horizontal scrollable pills */
  .side-menu {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    gap: 6px;
    padding: 8px 0 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .side-menu::-webkit-scrollbar {
    display: none;
  }
  .side-menu button {
    flex-shrink: 0;
    width: auto !important;
    white-space: nowrap;
    padding: 7px 14px !important;
    font-size: 13px !important;
    border-radius: 20px !important;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  /* Main content padding */
  .dashboard-main-wrap,
  .super-main-wrap {
    padding: 12px;
    gap: 14px;
  }
  /* Topbar: hide title, keep logout compact */
  .admin-topbar-title {
    display: none;
  }
  .admin-topbar-user [data-user-name-topbar] {
    display: none;
  }
  .admin-topbar {
    padding: 6px 12px;
    justify-content: flex-end;
  }
}
