:root {
  color-scheme: light;
  --blue: #2f9bff;
  --blue-deep: #1687f1;
  --text: #1f2937;
  --muted: #a3adba;
  --line: #d9dde5;
  --page: #f7f7f8;
  --danger: #ef4444;
  --green: #18a06b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}
.page { position: relative; min-height: 100vh; overflow: hidden; padding: 0 30px 34px; }
.hero {
  position: absolute; inset: 0 0 auto; height: 330px;
  background: linear-gradient(135deg, #78a7ff 0%, var(--blue) 62%, var(--blue-deep) 100%);
  overflow: hidden;
}
.hero::before, .hero::after, .wave-bottom, .bubble, .line-a, .line-b {
  content: ""; position: absolute; pointer-events: none;
}
.hero::before {
  width: 310px; height: 178px; right: -90px; top: -20px;
  border-radius: 42% 0 48% 52%; background: rgba(218, 238, 255, 0.45); transform: rotate(18deg);
}
.hero::after {
  width: 184px; height: 184px; right: -38px; top: -38px;
  border-radius: 50%; background: rgba(198, 225, 255, 0.45);
}
.wave-bottom {
  left: -82px; right: -82px; bottom: -76px; height: 132px;
  background: #f8f8f9; border-radius: 0 0 50% 50%; transform: rotate(5deg);
}
.bubble.one { width: 102px; height: 102px; right: 134px; top: 52px; border-radius: 50%; background: rgba(229, 244, 255, 0.76); }
.bubble.two { width: 36px; height: 36px; right: 168px; top: 176px; border-radius: 50%; background: rgba(229, 244, 255, 0.78); }
.bubble.three { width: 13px; height: 13px; right: 240px; top: 92px; border-radius: 50%; background: rgba(229, 244, 255, 0.76); }
.line-a, .line-b { width: 118px; height: 3px; background: rgba(221, 239, 255, 0.62); transform: rotate(-47deg); }
.line-a { left: 236px; top: 64px; }
.line-b { left: 258px; top: 132px; }
.bottom-art {
  position: fixed; left: -56px; bottom: -130px; width: 470px; height: 286px;
  border-radius: 50%; background: rgba(91, 155, 255, 0.5); transform: rotate(13deg); pointer-events: none;
}
.bottom-art::after {
  content: ""; position: absolute; left: 74px; top: 22px; width: 386px; height: 164px;
  border-radius: 50%; background: var(--page);
}
main { position: relative; z-index: 1; width: min(680px, 100%); margin: 0 auto; padding-top: 80px; }
.logout-row { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.logout-row a, .logout-row button {
  border: 0; border-radius: 999px; background: rgba(255,255,255,0.22); color: #fff; padding: 8px 14px; cursor: pointer;
  text-decoration: none;
}
.welcome { color: #fff; margin: 0 0 54px 12px; line-height: 1.55; }
.welcome h1 { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: 0; }
.welcome p { margin: 8px 0 0; font-size: 30px; font-weight: 600; }
.card {
  background: #fff; border-radius: 30px; box-shadow: 0 14px 24px rgba(29, 68, 108, 0.14);
  padding: 20px 18px 16px;
}
.field {
  display: grid; grid-template-columns: 16px 88px minmax(0, 1fr);
  align-items: center; min-height: 56px; border-bottom: 1px solid var(--line);
}
.field .star { color: var(--danger); font-size: 14px; }
.field label { color: #111827; font-size: 16px; white-space: nowrap; }
.select-wrap { position: relative; }
select, input {
  width: 100%; border: 0; outline: 0; background: transparent; color: #111827;
  font: inherit; min-height: 42px; padding: 0 30px 0 0;
}
select { appearance: none; color: var(--muted); }
select.selected, input:not(:placeholder-shown) { color: #111827; }
.select-wrap::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px;
  border-right: 1.8px solid #5b6472; border-bottom: 1.8px solid #5b6472;
  transform: translateY(-70%) rotate(45deg);
}
.type-value { min-height: 42px; display: flex; align-items: center; font-size: 16px; }
.refresh { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; color: #6b7280; font-size: 15px; }
.refresh button { border: 0; background: transparent; color: #2e74ff; padding: 0; font: inherit; cursor: pointer; }
.primary {
  display: block; width: min(470px, calc(100% - 28px)); min-height: 76px; margin: 48px auto 0;
  border: 0; border-radius: 12px; color: #fff;
  background: linear-gradient(90deg, #bdd7ff 0%, #319cff 100%);
  box-shadow: 0 7px 14px rgba(49, 156, 255, 0.22); font-size: 28px; font-weight: 700; cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: 0.62; }
.status { margin-top: 14px; min-height: 22px; color: #5b6472; line-height: 1.5; white-space: pre-wrap; }
.status.error { color: var(--danger); }
details { margin-top: 16px; color: #6b7280; }
summary { cursor: pointer; font-size: 14px; }
.admin { display: grid; gap: 10px; margin-top: 10px; }
.admin input, .admin select, .admin textarea {
  border: 1px solid var(--line); border-radius: 8px; min-height: 42px; padding: 8px 10px; background: #fff;
}
.admin textarea { min-height: 98px; resize: vertical; font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.modal.hidden { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
  background: rgba(15, 23, 42, 0.42); padding: 20px;
}
.result {
  width: min(520px, calc(100% - 40px)); background: #fff; border-radius: 18px;
  box-shadow: 0 12px 22px rgba(29, 68, 108, 0.12); padding: 18px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.close-btn {
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f5f9; color: #334155;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.result-head { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.room-title { font-size: 18px; font-weight: 700; }
.room-sub { margin-top: 5px; color: #6b7280; font-size: 14px; }
.balance { text-align: right; white-space: nowrap; }
.balance span { display: block; color: #6b7280; font-size: 13px; }
.balance strong { display: block; margin-top: 4px; color: var(--green); font-size: 24px; }
.charge-form { display: grid; gap: 14px; margin-top: 16px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.amount-option {
  min-height: 42px; border: 1px solid #cfd7e3; border-radius: 8px; background: #fff; color: #1f2937;
  font-size: 16px; cursor: pointer;
}
.amount-option.active { border-color: var(--blue); color: var(--blue); background: #eff7ff; font-weight: 700; }
.amount-input { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; }
.pay-btn { min-height: 48px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-size: 17px; cursor: pointer; }
.qrcode-panel {
  display: none; gap: 10px; justify-items: center; margin-top: 4px; padding: 14px; border-radius: 12px;
  background: #f8fafc; border: 1px solid #e2e8f0; text-align: center;
}
.qrcode-panel.show { display: grid; }
.qrcode-panel img {
  width: 210px; height: 210px; border: 8px solid #fff; border-radius: 8px; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.order-no { color: #64748b; font-size: 13px; word-break: break-all; }
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(135deg, #78a7ff, #2196f3);
}
.login-card {
  width: min(390px, 100%); background: #fff; border-radius: 16px; padding: 30px 24px; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  display: grid; gap: 14px; text-align: center;
}
.login-logo { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto; color: #fff; background: var(--blue); font-weight: 700; font-size: 24px; }
.login-card h1 { margin: 4px 0 0; font-size: 22px; }
.login-card p { margin: 0; color: #64748b; }
.login-card input { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; text-align: left; }
.login-card button { min-height: 44px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font: inherit; cursor: pointer; }
.login-msg { min-height: 20px; color: var(--danger); }
.admin-page {
  background: #f4f7fb;
}
.admin-main {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.admin-header h1 {
  margin: 0;
  font-size: 24px;
}
.admin-header p {
  margin: 6px 0 0;
  color: #64748b;
}
.admin-actions {
  display: flex;
  gap: 10px;
}
.admin-actions a,
.admin-actions button,
.admin-panel-head button {
  min-height: 38px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.admin-panel {
  background: #fff;
  border: 1px solid #dfe6f1;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.admin-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.pager-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pager-actions select {
  min-height: 38px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
}
.config-list {
  display: grid;
  gap: 8px;
  color: #475569;
}
.order-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.summary-card {
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.summary-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: #0f172a;
}
.summary-card.good { background: #eefdf6; border-color: #b7e4c7; }
.summary-card.warn { background: #fff8e6; border-color: #f5d48a; }
.summary-card.bad { background: #fff1f1; border-color: #fecaca; }
.order-list {
  display: grid;
  gap: 12px;
}
.order-item {
  border: 1px solid #dfe6f1;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}
.order-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.order-title {
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}
.order-meta {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}
.order-amount {
  flex: 0 0 auto;
  color: #0f766e;
  font-size: 20px;
  font-weight: 800;
}
.order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.order-grid div {
  min-width: 0;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
}
.order-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.order-grid strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 13px;
  word-break: break-all;
}
.status-pill {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px !important;
}
.status-pill.ok { background: #dcfce7; color: #166534; }
.status-pill.bad { background: #fee2e2; color: #991b1b; }
.status-pill.warn { background: #fef3c7; color: #92400e; }
.status-pill.muted { background: #e2e8f0; color: #475569; }
.order-reason {
  margin-top: 10px;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
}
.order-reason.bad {
  background: #fff1f1;
  color: #991b1b;
}
.order-raw {
  margin-top: 10px;
}
.order-raw summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 13px;
}
.order-raw pre {
  margin-top: 8px;
}
.empty-state {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
  color: #64748b;
}
.jump-card .primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.jump-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.jump-preview div {
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}
.jump-preview span {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.jump-preview strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 14px;
  word-break: break-all;
}
.admin-panel pre {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 24px;
}
.pager button {
  min-height: 38px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  padding: 8px 14px;
  cursor: pointer;
}
.pager button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
@media (max-width: 560px) {
  .page { padding: 0 20px 28px; }
  main { padding-top: 72px; }
  .welcome { margin-bottom: 50px; }
  .welcome h1 { font-size: 29px; }
  .welcome p { font-size: 27px; }
  .card { border-radius: 28px; padding: 18px 16px 14px; }
  .field { grid-template-columns: 15px 86px minmax(0, 1fr); }
  .primary { min-height: 70px; margin-top: 48px; font-size: 27px; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .result-head { flex-direction: column; }
  .balance { text-align: left; }
  .admin-header,
  .admin-panel-head,
  .order-main {
    flex-direction: column;
  }
  .admin-actions,
  .pager-actions {
    flex-wrap: wrap;
  }
  .order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-grid {
    grid-template-columns: 1fr;
  }
  .order-amount {
    font-size: 18px;
  }
}

.qrcode-panel.recharge-ok {
  border-color: #b7e4c7;
  background: #f0fff6;
  color: #208a4b;
  font-weight: 700;
}
.qrcode-panel.recharge-fail {
  border-color: #ffd0d0;
  background: #fff5f5;
  color: #c03535;
  font-weight: 700;
}
.mobile-page .modal {
  padding: 0;
  background: rgba(0, 0, 0, 0.48);
}
.mobile-page .result {
  width: min(390px, calc(100vw - 58px));
  max-height: calc(100vh - 130px);
  overflow: auto;
  border-radius: 10px;
  padding: 14px 14px 0;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}
.mobile-page .modal-head {
  justify-content: center;
  margin-bottom: 10px;
  text-align: center;
}
.mobile-page .modal-head h2 {
  font-size: 18px;
  color: #555b66;
}
.mobile-page .close-btn {
  display: none;
}
.mobile-page .result-head {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  border: 1px solid #62b34d;
  border-bottom: 0;
  padding: 10px 8px;
}
.mobile-page .room-title {
  font-size: 17px;
  line-height: 1.25;
}
.mobile-page .room-sub,
.mobile-page .balance span {
  display: none;
}
.mobile-page .balance {
  text-align: center;
}
.mobile-page .balance strong {
  color: #1f2937;
  font-size: 18px;
}
.mobile-page .balance strong::before {
  content: "剩余电量：";
  color: #1f2937;
  font-size: 15px;
  font-weight: 400;
}
.mobile-page .balance strong::after {
  content: "度";
  color: #1f2937;
  font-size: 15px;
  font-weight: 400;
}
.mobile-page .charge-form {
  gap: 10px;
  margin-top: 0;
}
.mobile-page .amount-input {
  order: 0;
  min-height: 42px;
  border: 1px solid #62b34d;
  border-radius: 0;
  text-align: center;
}
.mobile-page .amounts {
  order: 1;
  gap: 8px;
  margin-top: 8px;
}
.mobile-page .amount-option {
  min-height: 40px;
  border-radius: 8px;
  font-size: 16px;
}
.mobile-page .qrcode-panel {
  order: 2;
  padding: 9px;
}
.mobile-page .qrcode-panel img:not([src]),
.mobile-page .qrcode-panel img[src=""] {
  display: none;
}
.mobile-page .pay-btn {
  order: 3;
  margin: 0 -14px;
  min-height: 54px;
  border-radius: 0;
  background: #fff;
  color: #4da050;
  border-top: 1px solid #e5e7eb;
  font-size: 19px;
}

.modal {
  background: rgba(0, 0, 0, 0.48);
}
.result {
  width: min(430px, calc(100vw - 56px));
  border-radius: 8px;
  padding: 18px 18px 0;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}
.modal-head {
  justify-content: center;
  text-align: center;
  margin-bottom: 14px;
}
.modal-head h2 {
  max-width: 100%;
  color: #565b66;
  font-size: clamp(19px, 4.6vw, 23px);
  line-height: 1.22;
  font-weight: 700;
}
.close-btn {
  display: none;
}
.hidden {
  display: none !important;
}
.power-info-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #62b34d;
  color: #1f2937;
}
.power-info-table th,
.power-info-table td {
  border: 1px solid #62b34d;
  height: clamp(54px, 11vw, 66px);
  text-align: center;
  vertical-align: middle;
  font-size: clamp(17px, 4.4vw, 21px);
}
.power-info-table th {
  font-weight: 700;
  font-size: clamp(18px, 4.8vw, 22px);
}
.power-info-table .amount-input {
  width: calc(100% - 28px);
  min-height: 40px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-align: center;
  font-size: inherit;
}
.power-info-table .amount-input::placeholder {
  color: #c8cdd5;
}
.amount-unit,
.balance-unit {
  margin-left: 4px;
}
.charge-form {
  gap: 0;
  margin-top: 0;
}
.charge-form > .amounts,
.charge-form > .pay-btn {
  display: none;
}
.qrcode-panel {
  margin-top: 10px;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 16px -18px 0;
  border-top: 1px solid #e5e7eb;
}
.dialog-actions button {
  min-height: clamp(54px, 12vw, 64px);
  border: 0;
  background: #fff;
  font: inherit;
  font-size: clamp(18px, 4.8vw, 22px);
  cursor: pointer;
}
.dialog-close {
  color: #bd5b5b;
  border-right: 1px solid #e5e7eb !important;
}
.dialog-pay {
  color: #4da050;
}
