:root {
  color-scheme: dark;
  --bg: #06070d;
  --panel: rgba(13, 19, 31, 0.72);
  --panel-strong: rgba(18, 26, 44, 0.9);
  --text: #eef7ff;
  --muted: #8fa3b7;
  --line: rgba(118, 221, 255, 0.22);
  --cyan: #39d9ff;
  --mint: #35f5b3;
  --pink: #ff4fc4;
  --gold: #ffd45a;
  --danger: #ff526b;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(57, 217, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(255, 79, 196, 0.14), transparent 26rem),
    linear-gradient(135deg, #05060c 0%, #0a1020 48%, #06070d 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(57, 217, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 217, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 86%);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.control-strip,
.grid-wrap {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(12, 20, 35, 0.76), rgba(11, 12, 19, 0.58));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 128px;
  padding: 26px 28px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(57, 217, 255, 0.45);
}

.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(53, 245, 179, 0.24);
  border-radius: 999px;
  color: #c8fff0;
  background: rgba(53, 245, 179, 0.08);
  white-space: nowrap;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 14px var(--mint);
}

.sync-dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 14px var(--danger);
}

.control-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
}

.metric {
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
  letter-spacing: 0;
}

.icon-button,
.close-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(57, 217, 255, 0.28);
  border-radius: 8px;
  color: var(--text);
  background: rgba(57, 217, 255, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-button {
  width: 72px;
  min-height: 72px;
}

.icon-button svg,
.close-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover,
.close-button:hover {
  transform: translateY(-1px);
  border-color: rgba(57, 217, 255, 0.68);
  background: rgba(57, 217, 255, 0.16);
}

.grid-wrap {
  position: relative;
  min-height: 360px;
  margin-top: 14px;
  padding: 18px;
  border-radius: 8px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 16px;
}

.account-card {
  position: relative;
  display: flex;
  min-height: 112px;
  padding: 14px 14px 38px;
  border: 1.4px solid var(--mint);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(9, 15, 25, 0.84);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.account-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.13) 42%, transparent 68%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

.account-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34), 0 0 24px rgba(57, 217, 255, 0.13);
}

.account-card:hover::before {
  transform: translateX(120%);
}

.account-card.is-busy {
  border-color: var(--danger);
}

.account-card.is-plus {
  border-color: var(--gold);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.32), 0 0 24px rgba(255, 212, 90, 0.22);
}

.account-card.is-disabled {
  cursor: default;
  opacity: 0.48;
  pointer-events: none;
}

.card-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.card-id {
  color: #f4fbff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

.card-name {
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.card-chip {
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cfeaff;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.status-img {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  width: 115px;
  height: 20px;
  object-fit: contain;
  opacity: 0.86;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
  text-align: center;
}

.scanner {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border: 1px solid rgba(57, 217, 255, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, transparent, rgba(57, 217, 255, 0.24), transparent);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.62;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.login-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 1px solid rgba(57, 217, 255, 0.36);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.58);
}

.login-dialog::backdrop {
  background: rgba(2, 5, 12, 0.76);
  backdrop-filter: blur(8px);
}

.login-dialog form {
  padding: 20px;
}

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

.dialog-badge {
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid rgba(53, 245, 179, 0.24);
  border-radius: 999px;
  color: #c8fff0;
  background: rgba(53, 245, 179, 0.08);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.close-button {
  width: 36px;
  height: 36px;
}

.login-dialog h2 {
  margin: 18px 0 14px;
  font-size: 22px;
  letter-spacing: 0;
}

.login-dialog input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(3, 7, 14, 0.58);
  outline: none;
}

.login-dialog input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(57, 217, 255, 0.14);
}

.dialog-error {
  margin: 10px 0 0;
  color: #ff9aaa;
  font-size: 13px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.ghost-button,
.primary-button {
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button {
  border: 1px solid rgba(57, 217, 255, 0.48);
  color: #031018;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 22px;
  }

  .control-strip {
    grid-template-columns: 1fr 1fr;
  }

  .icon-button {
    width: 100%;
    min-height: 56px;
  }

  .account-grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 10px;
  }

  .account-card {
    min-height: 106px;
  }
}
