:root {
  --ink: #28352f;
  --ink-strong: #1f2c26;
  --muted: #9aa7a2;
  --muted-dark: #5f6d68;
  --line: #e9efed;
  --card: #fdfefe;
  --card-border: #dfe8e5;
  --card-radius: 11px;
  --red: #b34a4a;
  --red-soft: #fff0f0;
  --red-text: #b95858;
  --red-line: #c76060;
  --orange: #a8492a;
  --orange-soft: #fff0e8;
  --orange-text: #bd4f24;
  --orange-line: #e0703f;
  --green: #2e8b45;
  --green-teal: #26836a;
  --green-soft: #e7f7f1;
  --green-line: #3da086;
  --button-green: #3b9d83;
  --button-green-dark: #318e76;
  --shadow-soft: 0 1px 2px rgba(31, 72, 57, 0.065), 0 5px 14px rgba(31, 72, 57, 0.045);
  --font-ui: "MiSans", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eaf0f4;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-color: #ebf1f5;
  background-image:
    radial-gradient(ellipse 860px 700px at -10% -12%, rgba(179, 231, 224, 0.3) 0%, rgba(179, 231, 224, 0) 64%),
    radial-gradient(ellipse 1000px 800px at 58% -20%, rgba(224, 235, 252, 0.22) 0%, rgba(224, 235, 252, 0) 70%),
    radial-gradient(ellipse 880px 720px at 110% 106%, rgba(178, 229, 202, 0.46) 0%, rgba(178, 229, 202, 0) 70%),
    radial-gradient(ellipse 820px 620px at 48% 118%, rgba(213, 228, 245, 0.3) 0%, rgba(213, 228, 245, 0) 70%),
    linear-gradient(180deg, #ebf1f6 0%, #ebf1f4 55%, #edf3f3 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

button {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-head {
  position: relative;
  z-index: 2;
  height: 101px;
  padding: 14px 24px 0;
}

.page-head h1 {
  margin: 0;
  color: #27303e;
  font-size: 22px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0.25px;
}

.page-head::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 26px;
  left: 24px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(113, 145, 136, 0.03) 0%,
    rgba(113, 145, 136, 0.12) 22%,
    rgba(113, 145, 136, 0.08) 65%,
    rgba(180, 126, 126, 0.1) 100%
  );
}

.account-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: min(1278px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0 0 30px;
}

.account-card {
  --accent: var(--red-line);
  --name-color: var(--red);
  --pill-bg: var(--red-soft);
  --pill-fg: var(--red-text);
  --power-fg: var(--green);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 286px;
  padding: 13px 12px 19px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.account-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
}

.account-card:hover {
  border-color: #d3e1dc;
  box-shadow: 0 2px 4px rgba(31, 72, 57, 0.08), 0 12px 26px rgba(31, 72, 57, 0.065);
  transform: translateY(-1px);
}

.account-card[data-state="error"] {
  --accent: var(--orange-line);
  --name-color: var(--orange);
  --pill-bg: var(--orange-soft);
  --pill-fg: var(--orange-text);
}

.account-card[data-state="normal"] {
  --accent: var(--green-line);
  --name-color: var(--ink-strong);
  --pill-bg: var(--green-soft);
  --pill-fg: var(--green-teal);
}

.account-card[data-state="frozen"] {
  --accent: #d9a441;
  --name-color: #986b1f;
  --pill-bg: #fff7e8;
  --pill-fg: #a9771e;
}

.account-card[data-state="face"] {
  --accent: #5b8def;
  --name-color: #3557a8;
  --pill-bg: #eef4ff;
  --pill-fg: #3d62b5;
}

.account-card[data-state="unknown"] {
  --accent: #aab5b0;
  --name-color: #52605b;
  --pill-bg: #f1f4f3;
  --pill-fg: #76837e;
}

.card-head {
  display: flex;
  flex: 0 0 46px;
  gap: 10px;
  height: 46px;
  min-width: 0;
}

.avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 8px;
  background: #dfeae7;
  object-fit: cover;
  user-select: none;
}

.head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  height: 21px;
  min-width: 0;
}

.player-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--name-color);
  font-size: 16px;
  font-weight: 600;
  line-height: 21px;
  letter-spacing: 0.16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-tag {
  flex: 0 0 auto;
  color: #7e8c87;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.1px;
}

.meta-row {
  display: flex;
  align-items: center;
  height: 18px;
  margin-top: 4px;
  color: var(--muted-dark);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.server-name {
  flex: 0 0 auto;
}

.server-chevron {
  width: 11px;
  height: 11px;
  margin-left: 2px;
  color: #95a39e;
}

.key-badge {
  display: grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border: 1px dashed #cdd8d4;
  border-radius: 5px;
  color: #9aa7a2;
}

.key-badge svg {
  width: 11px;
  height: 11px;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 24px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  height: 24px;
  margin-top: 9px;
  padding: 0 11px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-size: 12px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.05px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill svg {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-right: 6px;
}

.status-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  margin: 0 4px;
  transform: translateY(-0.5px);
}

.cred-row,
.game-row {
  display: flex;
  align-items: center;
  height: 34px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.cred-row {
  gap: 10px;
  margin-top: 10px;
}

.cred-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.cred-value {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.15px;
  white-space: nowrap;
}

.cred-value .slash {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.password {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 14px;
  overflow: hidden;
  color: #3f4e48;
  white-space: nowrap;
}

.password-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 12px;
  overflow: hidden;
}

.password-dots i {
  display: block;
  flex: 0 0 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #46544e;
}

.password-dots b {
  margin-left: 1px;
  color: #46544e;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.25px;
}

.password.is-visible {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 14px;
  text-overflow: ellipsis;
}

.eye-button {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 -4px 0 auto;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9ba8a3;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.eye-button:hover {
  background: #f3f8f6;
  color: #5f6d68;
}

.eye-button:focus-visible,
.action-button:focus-visible,
.support-pill:focus-visible {
  outline: 2px solid rgba(61, 160, 134, 0.55);
  outline-offset: 2px;
}

.eye-button svg {
  width: 16px;
  height: 16px;
}

.game-row {
  gap: 8px;
}

.game-label {
  flex: 0 0 auto;
  color: var(--muted);
}

.game-time {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-left: auto;
  padding-right: 1px;
  overflow: hidden;
  color: var(--power-fg);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-time.is-danger {
  color: #c9372c;
}

.game-time svg {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  stroke-width: 1.8;
}

.stats {
  display: grid;
  flex: 0 0 55px;
  grid-template-columns: 1fr 1fr;
  height: 55px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  display: flex;
  min-width: 0;
  padding: 6px 0 6px;
  flex-direction: column;
  justify-content: center;
}

.stat + .stat {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

.stat-value {
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex: 0 0 30px;
  gap: 8px;
  height: 30px;
  margin-top: 10px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.action-button svg {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin-right: 7px;
}

.refresh-button {
  flex: 0 0 95px;
  width: 95px;
  border-color: #d8e3df;
  background: #ffffff;
  color: #596a64;
}

.refresh-button:hover {
  border-color: #c7d8d2;
  background: #fbfdfc;
  color: #33443d;
}

.refresh-button:active {
  background: #f4f9f7;
}

.refresh-button:disabled {
  border-color: #d8e3df;
  background: #ffffff;
  color: #596a64;
  cursor: wait;
  opacity: 0.82;
}

.refresh-button:disabled:hover {
  border-color: #d8e3df;
  background: #ffffff;
  color: #596a64;
}

.refresh-button.is-refreshing svg {
  animation: spin 0.8s linear infinite;
}

.primary-button {
  flex: 1 1 auto;
  min-width: 0;
  border-color: var(--button-green);
  background: var(--button-green);
  color: #ffffff;
}

.primary-button:hover {
  border-color: var(--button-green-dark);
  background: var(--button-green-dark);
}

.primary-button:active {
  transform: translateY(0.5px);
}

.primary-button:disabled,
.primary-button[aria-disabled="true"] {
  border-color: #e3ebe8;
  background: #edf1ef;
  color: #9ca6a2;
  cursor: not-allowed;
}

.primary-button:disabled:hover,
.primary-button[aria-disabled="true"]:hover {
  border-color: #e3ebe8;
  background: #edf1ef;
}

.support-pill {
  position: fixed;
  right: -20px;
  bottom: 1px;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 42px;
  padding: 4px 12px 4px 4px;
  border: 1px solid rgba(143, 203, 188, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 16px rgba(53, 126, 106, 0.14);
  color: #1f6f5b;
  cursor: pointer;
  backdrop-filter: blur(7px);
  transition: right 0.24s ease, box-shadow 0.2s ease;
}

.support-pill:hover {
  right: 12px;
  box-shadow: 0 7px 22px rgba(53, 126, 106, 0.2);
}

.support-icon {
  position: relative;
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #45b89a 0%, #2d987e 100%);
  color: #ffffff;
}

.support-icon > svg {
  width: 19px;
  height: 19px;
}

.support-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  background: #35b88d;
}

.support-text {
  margin-left: 8px;
  color: #1f6f5b;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.support-arrow {
  width: 9px;
  height: 9px;
  margin-left: 6px;
  color: #9bc9bc;
}

.toast {
  position: fixed;
  bottom: 34px;
  left: 50%;
  z-index: 60;
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(34, 55, 47, 0.94);
  box-shadow: 0 8px 30px rgba(27, 52, 43, 0.2);
  color: #ffffff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: normal;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 1120px) {
  .account-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .page-head {
    height: 87px;
    padding-top: 7px;
  }

  .page-head h1 {
    font-size: 20px;
  }

  .page-head::after {
    bottom: 21px;
  }

  .account-grid {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 28px);
    padding-bottom: 24px;
  }

  .account-card {
    height: 286px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .support-pill {
    right: 8px;
  }

  .support-pill:hover {
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- account app: auth, header actions, dialog, owned cards ---------- */

[hidden] {
  display: none !important;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #e9f1f5;
  color: var(--muted-dark);
  font-size: 13px;
}

.boot-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(61, 160, 134, 0.22);
  border-top-color: var(--green-line);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.page-head {
  height: 101px;
  padding: 14px 24px 0;
}

.page-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1278px, calc(100% - 48px));
  height: 42px;
  margin: 0 auto;
}

.page-head h1 {
  flex: 0 0 auto;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.add-account-button,
.empty-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid var(--button-green);
  border-radius: 7px;
  background: var(--button-green);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.add-account-button:hover,
.empty-add-button:hover {
  border-color: var(--button-green-dark);
  background: var(--button-green-dark);
}

.add-account-button svg,
.empty-add-button svg {
  width: 14px;
  height: 14px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 3px 7px 3px 3px;
  border: 1px solid #e1ebe7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #4f6059;
  font-size: 12px;
}

.user-chip-avatar {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6fc5ad, #31957c);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}

.user-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #87958f;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #52645c;
}

.header-text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #74857d;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.header-text-button:hover {
  border-color: #dfe9e4;
  background: rgba(255, 255, 255, 0.55);
  color: #425d51;
}

.header-text-button svg {
  width: 14px;
  height: 14px;
}

.auth-view {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 42px 20px;
}

.auth-card {
  width: min(408px, 100%);
  padding: 30px 30px 24px;
  border: 1px solid rgba(220, 232, 227, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(45, 82, 69, 0.1), 0 2px 8px rgba(45, 82, 69, 0.04);
  backdrop-filter: blur(12px);
}

.auth-brand {
  text-align: center;
}

.auth-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: linear-gradient(145deg, #5fc4a9, #2f957c);
  box-shadow: 0 8px 20px rgba(52, 155, 130, 0.24);
  color: #ffffff;
}

.auth-logo svg {
  width: 29px;
  height: 29px;
}

.auth-brand h1 {
  margin: 0;
  color: #273b34;
  font-size: 23px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: 0.3px;
}

.auth-brand p {
  margin: 5px 0 0;
  color: #87958f;
  font-size: 12px;
  line-height: 19px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 9px;
  background: #f0f5f2;
}

.auth-tab {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #84938d;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.auth-tab.is-active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(41, 82, 67, 0.1);
  color: #2d6e5a;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: #5f7069;
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dfe9e4;
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: #263d34;
  font-family: var(--font-ui);
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder {
  color: #b1bdb8;
}

.field input:focus,
.field select:focus {
  border-color: #78bda9;
  box-shadow: 0 0 0 3px rgba(61, 160, 134, 0.12);
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8c9a95 50%),
    linear-gradient(135deg, #8c9a95 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  cursor: pointer;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: #c25a54;
  font-size: 12px;
  line-height: 18px;
}

.form-message:empty {
  min-height: 0;
}

.auth-submit {
  height: 43px;
  margin-top: 1px;
  border: 1px solid var(--button-green);
  border-radius: 7px;
  background: var(--button-green);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.auth-submit:hover {
  border-color: var(--button-green-dark);
  background: var(--button-green-dark);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-note {
  margin: 17px 0 0;
  color: #94a19c;
  font-size: 12px;
  text-align: center;
}

.auth-note button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2d8b73;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}

.auth-note button:hover {
  text-decoration: underline;
}

.app-view {
  position: relative;
  z-index: 1;
}

.avatar-generated {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(
    145deg,
    hsl(var(--avatar-hue) 58% 63%),
    hsl(calc(var(--avatar-hue) + 28) 48% 43%)
  );
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(31, 62, 52, 0.15);
}

.meta-sep {
  margin: 0 6px;
  color: #b6c3be;
}

.qq-badge {
  color: #8b9a94;
  font-size: 11px;
}

.copy-button {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 -4px 0 auto;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9ba8a3;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.copy-button:hover {
  background: #f3f8f6;
  color: #5f6d68;
}

.copy-button svg {
  width: 14px;
  height: 14px;
}

.result-value {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 69%;
  margin-left: auto;
  overflow: hidden;
  color: var(--pill-fg);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-value.is-idle {
  color: var(--muted);
}

.result-value svg {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
}

.delete-button {
  flex: 1 1 auto;
  border-color: #efd9d6;
  background: #ffffff;
  color: #b05b54;
}

.delete-button:hover {
  border-color: #e6bcb7;
  background: #fff8f7;
  color: #9f4841;
}

.delete-button:active {
  background: #fff2f0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(1278px, calc(100% - 64px));
  min-height: 360px;
  margin: 0 auto 30px;
  padding: 42px 20px;
  border: 1px dashed #cbdad4;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(49, 110, 88, 0.08);
  color: #7fb9a7;
}

.empty-icon svg {
  width: 44px;
  height: 44px;
}

.empty-state h2 {
  margin: 0;
  color: #344b42;
  font-size: 17px;
  font-weight: 600;
}

.empty-state p {
  margin: 7px 0 19px;
  color: #8a9993;
  font-size: 12px;
}

.empty-add-button {
  height: 34px;
  font-size: 13px;
}

.account-card[data-state="unchecked"] {
  --accent: #b8c7c1;
  --name-color: #33483f;
  --pill-bg: #f0f4f2;
  --pill-fg: #71817a;
}

.account-dialog {
  width: min(430px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(25, 58, 46, 0.24);
}

.account-dialog::backdrop {
  background: rgba(24, 47, 39, 0.3);
}

.account-form {
  padding: 22px;
}

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

.dialog-head h2 {
  margin: 0;
  color: #283c34;
  font-size: 19px;
  font-weight: 600;
  line-height: 27px;
}

.dialog-head p {
  margin: 4px 0 0;
  color: #8a9993;
  font-size: 12px;
  line-height: 18px;
}

.dialog-close {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #f4f7f5;
  color: #8b9993;
  font-family: var(--font-ui);
  font-size: 21px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: #edf4f0;
  color: #596a63;
}

.account-form .field {
  margin-bottom: 12px;
}

.account-form .form-message {
  margin: 2px 0 1px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.ghost-button,
.dialog-submit {
  height: 34px;
  padding: 0 17px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid #dfe8e4;
  background: #ffffff;
  color: #687770;
}

.ghost-button:hover {
  border-color: #cbdad4;
  background: #fbfdfc;
}

.dialog-submit {
  flex: 0 0 auto;
  width: auto;
}

.dialog-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 700px) {
  .page-head-inner {
    width: calc(100% - 32px);
  }

  .user-chip-name {
    display: none;
  }

  .page-head-actions {
    gap: 6px;
  }

  .add-account-button {
    padding: 0 9px;
    font-size: 12px;
  }

  .header-text-label {
    display: none;
  }

  .header-text-button {
    width: 30px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .page-head {
    height: 96px;
    padding-top: 8px;
  }

  .page-head-inner {
    width: calc(100% - 28px);
    height: 38px;
  }

  .page-head h1 {
    font-size: 20px;
  }

  .page-head::after {
    bottom: 22px;
  }

  .user-chip {
    display: none;
  }

  .auth-view {
    padding: 24px 14px;
  }

  .auth-card {
    padding: 26px 20px 21px;
  }

  .empty-state {
    width: calc(100% - 28px);
    min-height: 330px;
  }
}

/* ---------- account toolbar, filters, password toggle, edit mode ---------- */

.account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1278px, calc(100% - 64px));
  margin: 0 auto 12px;
  padding: 0;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.search-box {
  display: flex;
  align-items: center;
  width: 252px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dce7e2;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: #8e9d97;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-box:focus-within {
  border-color: #83bdaa;
  box-shadow: 0 0 0 3px rgba(61, 160, 134, 0.1);
}

.search-box svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-right: 7px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #334a40;
  font-family: var(--font-ui);
  font-size: 12px;
}

.search-box input::placeholder {
  color: #a9b6b1;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(220, 231, 226, 0.85);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.48);
}

.filter-tab {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #87958f;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.filter-tab.is-active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(38, 79, 64, 0.1);
  color: #317d68;
}

.account-count {
  color: #8c9a94;
  font-size: 11px;
  white-space: nowrap;
}

.refresh-all-button {
  display: inline-flex;
  align-items: center;
  height: 32px;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid #a7d2c5;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  color: #2e8069;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.refresh-all-button:hover {
  border-color: #82bdaa;
  background: #ffffff;
}

.refresh-all-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.refresh-all-button svg {
  width: 13px;
  height: 13px;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: min(1278px, calc(100% - 64px));
  margin: 0 auto;
  padding: 38px 20px;
  border: 1px dashed #cbdad4;
  border-radius: 12px;
  color: #8b9993;
  font-size: 12px;
  text-align: center;
}

.no-results button {
  border: 0;
  background: transparent;
  color: #2f8d74;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}

.no-results button:hover {
  text-decoration: underline;
}

.edit-button {
  flex: 0 0 58px;
  width: 58px;
  border-color: #dbe7e2;
  background: #ffffff;
  color: #677a71;
}

.edit-button:hover {
  border-color: #c5d8d1;
  background: #fbfdfc;
  color: #3d5f51;
}

.edit-button svg {
  margin-right: 4px;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9aa7a2;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: #f2f7f4;
  color: #60746a;
}

.password-toggle svg {
  width: 16px;
  height: 16px;
}

.field input[readonly] {
  border-color: #e7eeeb;
  background: #f6f9f7;
  color: #89968f;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .account-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-left {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1 1 220px;
    width: auto;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .account-toolbar {
    width: calc(100% - 28px);
    gap: 8px;
  }

  .toolbar-left {
    gap: 6px;
  }

  .search-box {
    flex-basis: 100%;
    height: 36px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .filter-tab {
    flex: 0 0 auto;
    padding: 0 9px;
  }

  .refresh-all-button {
    height: 30px;
  }

  .edit-button {
    flex-basis: 53px;
    width: 53px;
    font-size: 12px;
  }

  .edit-button svg {
    margin-right: 3px;
  }

  .no-results {
    width: calc(100% - 28px);
  }
}

/* ---------- final card polish + result dialog ---------- */

.account-card {
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--accent) 16%, var(--card-border));
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  box-shadow: 0 1px 2px rgba(31, 72, 57, 0.05), 0 7px 20px rgba(31, 72, 57, 0.04);
}

.account-card::after {
  content: "";
  position: absolute;
  top: -46px;
  right: -34px;
  width: 150px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 12%, transparent) 0%,
    transparent 72%
  );
  pointer-events: none;
}

.account-card > * {
  position: relative;
  z-index: 1;
}

.account-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, #d3e1dc);
  box-shadow: 0 3px 6px rgba(31, 72, 57, 0.07), 0 16px 30px rgba(31, 72, 57, 0.07);
  transform: translateY(-2px);
}

.avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 4px 10px rgba(31, 72, 57, 0.1);
}

.status-pill {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pill-fg) 7%, transparent);
}

.stats {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.stat {
  padding: 6px 9px;
}

.stat + .stat {
  padding-left: 10px;
}

.actions {
  gap: 7px;
}

.refresh-button {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.edit-button,
.delete-button {
  flex: 0 0 34px;
  width: 34px;
  padding: 0;
}

.edit-button span,
.delete-button span {
  display: none;
}

.edit-button svg,
.delete-button svg {
  margin: 0;
}

.delete-button {
  border-color: #f0dedb;
  background: #fffdfd;
  color: #b35a55;
}

.delete-button:hover {
  border-color: #e8c4bf;
  background: #fff7f6;
  color: #a4423b;
}

.result-dialog {
  --result-color: #55c49b;
  width: min(372px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #20372f;
  box-shadow: 0 24px 80px rgba(13, 35, 27, 0.36);
  color: #ffffff;
}

.result-dialog[data-state="banned"] {
  --result-color: #ef7b73;
}

.result-dialog[data-state="frozen"] {
  --result-color: #dfb05c;
}

.result-dialog[data-state="face"] {
  --result-color: #85a9ff;
}

.result-dialog[data-state="unknown"] {
  --result-color: #a8bab2;
}

.result-dialog[data-state="error"] {
  --result-color: #f0a15f;
}

.result-dialog::backdrop {
  background: rgba(17, 37, 29, 0.38);
}

.result-dialog-inner {
  padding: 25px 24px 22px;
  text-align: center;
}

.result-dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--result-color) 16%, transparent);
  color: var(--result-color);
}

.result-dialog-icon svg {
  width: 24px;
  height: 24px;
}

.result-dialog[data-state="error"] .result-dialog-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  background: rgba(240, 161, 95, 0.16);
}

.result-dialog[data-state="error"] .result-dialog-icon svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 3px 6px rgba(240, 161, 95, 0.25));
}

.result-dialog h2 {
  margin: 0;
  color: #ffffff;
  font-size: 19px;
  font-weight: 600;
  line-height: 27px;
}

.result-dialog-text {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 21px;
}

.result-dialog-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 17px;
  text-align: left;
}

.result-dialog-note[hidden] {
  display: none;
}

.result-dialog-countdown {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(240, 161, 95, 0.2);
  border-radius: 7px;
  background: rgba(240, 161, 95, 0.1);
  color: #ffc38b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}

.result-dialog-countdown[hidden] {
  display: none;
}

.result-dialog-meta {
  min-height: 17px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  line-height: 17px;
}

.result-dialog-button {
  width: 100%;
  height: 38px;
  margin-top: 19px;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: var(--result-color);
  color: #172a22;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.16s ease;
}

.result-dialog-button:hover {
  filter: brightness(1.06);
}

.result-dialog-button:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--result-color) 34%, transparent);
}

/* ---------- password row, import dialog, state tints, taller cards ---------- */

.account-card {
  --card-bg: #ffffff;
  height: 320px;
  background: linear-gradient(180deg, var(--card-bg) 0%, #fdfefe 100%);
}

.account-card[data-state="banned"] {
  --card-bg: #fff7f7;
}

.account-card[data-state="normal"] {
  --card-bg: #f6fbf8;
}

.account-card[data-state="frozen"] {
  --card-bg: #fffbf2;
}

.account-card[data-state="face"] {
  --card-bg: #f7faff;
}

.account-card[data-state="unchecked"] {
  --card-bg: #ffffff;
}

.password-row {
  margin-top: 0;
}

.password-value,
.password-empty {
  min-width: 0;
  overflow: hidden;
  color: #53645c;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-empty {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}

.import-dialog {
  width: min(520px, calc(100% - 28px));
}

.import-dialog textarea {
  width: 100%;
  min-height: 138px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #dfe9e4;
  border-radius: 7px;
  outline: none;
  background: #fbfdfc;
  color: #33483f;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 20px;
  word-break: break-all;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.import-dialog textarea:focus {
  border-color: #78bda9;
  box-shadow: 0 0 0 3px rgba(61, 160, 134, 0.12);
}

.import-hint {
  margin: -2px 0 10px;
  color: #8d9a95;
  font-size: 11px;
  line-height: 17px;
}

@media (max-width: 560px) {
  .account-card {
    height: 320px;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .import-trigger {
    order: 3;
    flex: 1 1 100%;
  }

  .result-dialog {
    width: calc(100% - 28px);
  }
}

/* ---------- meta stats and more prominent dialog actions ---------- */

.account-stat {
  flex: 0 0 auto;
  color: #8a9993;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}

.account-stat b {
  color: #52675d;
  font-weight: 500;
}

.account-stat b.is-unknown {
  color: #a6b2ad;
  font-weight: 400;
}

.meta-row .meta-sep {
  margin: 0 5px;
}

.import-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #e5a13c;
  background: linear-gradient(135deg, #f5b95a 0%, #e79628 100%);
  box-shadow: 0 4px 12px rgba(205, 134, 34, 0.2);
  color: #ffffff;
  font-weight: 600;
}

.import-trigger:hover {
  border-color: #d88b1e;
  background: linear-gradient(135deg, #f8c46c 0%, #eb9d31 100%);
  box-shadow: 0 6px 16px rgba(205, 134, 34, 0.26);
  color: #ffffff;
}

.import-trigger svg {
  width: 14px;
  height: 14px;
}

#saveAccount.dialog-submit {
  height: 36px;
  padding: 0 20px;
  border: 0;
  background: linear-gradient(135deg, #3eac91 0%, #2d8e75 100%);
  box-shadow: 0 5px 14px rgba(45, 142, 117, 0.22);
  color: #ffffff;
  font-weight: 600;
}

#saveAccount.dialog-submit:hover {
  background: linear-gradient(135deg, #48b89b 0%, #33977d 100%);
  box-shadow: 0 7px 18px rgba(45, 142, 117, 0.28);
}

#saveAccount.dialog-submit:disabled {
  background: #edf1ef;
  box-shadow: none;
  color: #9ca6a2;
}

.ghost-button,
.dialog-submit {
  height: 36px;
}

/* ---------- larger, calmer card typography ---------- */

.account-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: min(1340px, calc(100% - 48px));
}

.account-card {
  height: 328px;
  padding: 14px 14px 20px;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.card-head {
  flex-basis: 48px;
  height: 48px;
  gap: 11px;
}

.avatar {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  border-radius: 9px;
}

.avatar-generated {
  font-size: 19px;
}

.name-row {
  height: 22px;
}

.player-name {
  font-size: 16.5px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

.meta-row {
  margin-top: 3px;
  font-size: 11.5px;
}

.account-stat {
  font-size: 11.5px;
}

.stats {
  height: 58px;
}

.action-button,
.refresh-button {
  height: 31px;
}

@media (max-width: 1120px) {
  .account-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .account-grid {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 28px);
    gap: 10px;
  }
}

/* ---------- inline import inside add dialog ---------- */

.add-account-dialog {
  width: min(480px, calc(100% - 28px));
}

.inline-import {
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid #e3ece8;
  border-radius: 10px;
  background: #f8fbfa;
}

.inline-import[hidden] {
  display: none;
}

.inline-import-head {
  margin-bottom: 9px;
}

.inline-import-head h3 {
  margin: 0;
  color: #31483e;
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
}

.inline-import-head p {
  margin: 2px 0 0;
  color: #8b9a94;
  font-size: 11px;
  line-height: 17px;
}

.inline-import textarea {
  width: 100%;
  min-height: 82px;
  max-height: 140px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid #dce8e3;
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: #40564b;
  font-family: var(--font-ui);
  font-size: 11.5px;
  line-height: 18px;
  word-break: break-all;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.inline-import textarea:focus {
  border-color: #79bcaa;
  box-shadow: 0 0 0 3px rgba(61, 160, 134, 0.11);
}

.inline-import-foot {
  display: block;
  margin-top: 8px;
}

.import-run-button {
  flex: 0 0 auto;
  width: 100%;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #e0a03c;
  border-radius: 6px;
  background: linear-gradient(135deg, #f5b95a 0%, #e79628 100%);
  box-shadow: 0 4px 12px rgba(205, 134, 34, 0.16);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.import-run-button:hover {
  background: linear-gradient(135deg, #f8c46c 0%, #eb9d31 100%);
}

.import-run-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.inline-import .form-message {
  margin: 6px 0 0;
  font-size: 11px;
}

.manual-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 13px;
  color: #9aa7a2;
  font-size: 11px;
  white-space: nowrap;
}

.manual-divider::before,
.manual-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #e9efec;
}

.dialog-actions .ghost-button,
.dialog-actions .dialog-submit {
  height: 38px;
  font-size: 13.5px;
}

#saveAccount.dialog-submit {
  height: 38px;
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .account-form {
    padding: 18px;
  }

  .inline-import-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .import-run-button {
    width: 100%;
    height: 36px;
  }
}

/* ---------- state emoji avatars and translucent meta frame ---------- */

.avatar-emoji {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.avatar-emoji img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(31, 62, 52, 0.14));
}

.meta-frame {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border: 1px solid rgba(74, 106, 91, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.meta-frame .meta-sep {
  margin: 0 5px;
}

/* ---------- clearer meta text and boxed account/password ---------- */

.meta-frame {
  height: 22px;
  padding: 0 8px;
  border-color: rgba(61, 120, 99, 0.23);
  background: rgba(255, 255, 255, 0.62);
}

.server-name {
  color: #2e4a3d;
  font-weight: 600;
}

.account-stat {
  color: #526b5f;
  font-weight: 600;
}

.account-stat b {
  color: #1f6b54;
  font-weight: 700;
}

.cred-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 8px;
  margin-top: 10px;
}

.cred-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 58px;
  min-width: 0;
  padding: 0 6px 0 8px;
  border: 1px solid #dfe9e4;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.66);
}

.cred-icon {
  display: grid;
  flex: 0 0 25px;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: #e8f6f1;
  color: #3a9b83;
}

.cred-icon svg {
  width: 14px;
  height: 14px;
}

.cred-icon-password {
  background: #fff3df;
  color: #c08b36;
}

.cred-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.cred-label {
  color: #92a09a;
  font-size: 10px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0;
}

.cred-account,
.password-value {
  min-width: 0;
  overflow: hidden;
  color: #253f34;
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-value {
  font-size: 11px;
  letter-spacing: 0;
}

.password-empty {
  color: #a3b0aa;
  font-size: 12px;
  line-height: 17px;
}

.box-action {
  display: grid;
  flex: 0 0 18px;
  place-items: center;
  width: 18px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9ba9a3;
  cursor: pointer;
}

.box-action:hover {
  background: #eef6f2;
  color: #4a7c68;
}

.box-action svg {
  width: 13px;
  height: 13px;
}

/* ---------- stacked QQ/password inside one frame ---------- */

.account-card {
  height: 340px;
}

.cred-panel {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #dfe9e4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.cred-line {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  min-width: 0;
  padding: 0 9px;
}

.cred-line + .cred-line {
  border-top: 1px solid #edf3f0;
}

.cred-line .cred-body {
  gap: 0;
}

.cred-line .cred-label {
  line-height: 13px;
}

.cred-line .cred-account,
.cred-line .password-value,
.cred-line .password-empty {
  font-size: 12px;
  line-height: 18px;
}

.cred-line .password-value {
  font-size: 11.5px;
  letter-spacing: 0.2px;
}

/* ---------- unchecked state uses a yellow detection button ---------- */

.account-card[data-state="unchecked"] .refresh-button {
  border-color: #e7bd63;
  background: #fff4d6;
  color: #8a5d10;
  font-weight: 600;
}

.account-card[data-state="unchecked"] .refresh-button:hover {
  border-color: #dca83f;
  background: #ffedb9;
  color: #744b06;
}

.account-card[data-state="unchecked"] .refresh-button:active {
  background: #ffe6a3;
}

.account-card[data-state="unchecked"] .refresh-button:disabled {
  border-color: #e7bd63;
  background: #fff4d6;
  color: #8a5d10;
}

.account-card[data-state="unchecked"] .refresh-button svg {
  color: #b27a1e;
}

/* ---------- soft state-colored surrounding shadow, no top stripe ---------- */

.account-card::before {
  display: none;
}

.account-card {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent),
    0 8px 22px color-mix(in srgb, var(--accent) 10%, transparent),
    0 2px 5px rgba(31, 72, 57, 0.035);
}

.account-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, #d3e1dc);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 14px 30px color-mix(in srgb, var(--accent) 14%, transparent),
    0 3px 7px rgba(31, 72, 57, 0.055);
}

/* ---------- roomier mobile layout ---------- */

@media (max-width: 560px) {
  .page-head-inner,
  .account-toolbar,
  .account-grid,
  .no-results,
  .empty-state {
    width: calc(100% - 40px);
  }

  .account-toolbar {
    gap: 10px;
    margin-bottom: 15px;
  }

  .account-grid {
    gap: 14px;
    padding-bottom: 40px;
  }

  .auth-view {
    padding: 28px 20px;
  }

  .auth-card {
    padding: 28px 22px 24px;
  }

  .search-box {
    height: 40px;
    padding: 0 12px;
  }

  .search-box input,
  .field input,
  .field select,
  .field textarea,
  .inline-import textarea {
    font-size: 16px;
  }

  .action-button,
  .refresh-button {
    height: 36px;
    font-size: 13px;
  }

  .account-card {
    height: 352px;
  }

  .cred-line {
    height: 46px;
  }
}

/* ---------- centered batch query result ---------- */

.batch-dialog {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #20372f;
  box-shadow: 0 24px 80px rgba(13, 35, 27, 0.36);
  color: #ffffff;
}

.batch-dialog::backdrop {
  background: rgba(17, 37, 29, 0.38);
}

.batch-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  padding: 22px 22px 20px;
}

.batch-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin-bottom: 13px;
}

.batch-icon {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(85, 196, 155, 0.16);
  color: #55c49b;
}

.batch-dialog[data-state="banned"] .batch-icon {
  background: rgba(239, 123, 115, 0.16);
  color: #ef7b73;
}

.batch-icon svg {
  width: 23px;
  height: 23px;
}

.batch-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
}

.batch-head p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  line-height: 17px;
}

.batch-content {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.batch-group {
  margin-top: 12px;
}

.batch-group:first-child {
  margin-top: 0;
}

.batch-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-group-head h3 {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.batch-group-head span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.batch-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.batch-name {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-qq {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10.5px;
  line-height: 15px;
}

.batch-badge {
  padding: 2px 7px;
  border-radius: 9px;
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
}

.batch-badge.is-banned {
  background: rgba(239, 123, 115, 0.16);
  color: #ff9b94;
}

.batch-badge.is-normal {
  background: rgba(85, 196, 155, 0.14);
  color: #72d6b1;
}

.batch-badge.is-other {
  background: rgba(223, 176, 92, 0.14);
  color: #e7c078;
}

.batch-badge.is-failed {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.batch-detail {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10.5px;
  line-height: 16px;
}

.batch-empty {
  margin: 9px 0 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  line-height: 17px;
}

.batch-close-button {
  flex: 0 0 auto;
  width: 100%;
  height: 38px;
  margin-top: 17px;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: #55c49b;
  color: #172a22;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.batch-close-button:hover {
  filter: brightness(1.06);
}

.batch-close-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(85, 196, 155, 0.35);
}

/* ---------- empty state polish only ---------- */

.empty-state {
  border-color: #d2e2dc;
  background:
    radial-gradient(ellipse 520px 260px at 50% -8%, rgba(168, 226, 211, 0.2), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 253, 252, 0.52));
  box-shadow: 0 18px 48px rgba(42, 93, 73, 0.035);
}

.empty-icon {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff 0%, #eef8f4 100%);
  box-shadow:
    0 12px 28px rgba(49, 110, 88, 0.1),
    inset 0 0 0 1px rgba(195, 221, 211, 0.55);
  color: #4ba98e;
}

.empty-state h2 {
  position: relative;
  font-size: 19px;
  line-height: 27px;
  letter-spacing: 0.2px;
}

.empty-state h2::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin: 9px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #3da086, #a5dccb);
}

#emptyState p {
  max-width: 500px;
  margin: 14px auto 22px;
  padding: 10px 22px;
  border: 1px solid rgba(199, 220, 212, 0.55);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(246, 251, 249, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #6f857b;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.empty-add-button {
  height: 44px;
  padding: 0 24px;
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(45, 142, 117, 0.2);
  font-size: 15px;
  font-weight: 600;
}

.empty-add-button:hover {
  box-shadow: 0 10px 24px rgba(45, 142, 117, 0.26);
}

.empty-add-button svg {
  width: 15px;
  height: 15px;
}

/* ---------- admin console ---------- */

.admin-view {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 64px));
  margin: 0 auto;
  padding: 2px 0 60px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-kicker {
  color: #5b9d87;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  line-height: 16px;
}

.admin-head h1 {
  margin: 2px 0 0;
  color: #2b4438;
  font-size: 26px;
  font-weight: 600;
  line-height: 34px;
}

.admin-head p {
  margin: 3px 0 0;
  color: #87958f;
  font-size: 12px;
  line-height: 18px;
}

.admin-back-button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #d6e4de;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
  color: #5e7168;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}

.admin-back-button:hover {
  border-color: #bdd5cb;
  background: #ffffff;
}

.admin-card {
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid #dce8e3;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 26px rgba(31, 72, 57, 0.035);
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.admin-card-head h2 {
  margin: 0;
  color: #314a3e;
  font-size: 16px;
  font-weight: 600;
  line-height: 23px;
}

.admin-card-head p {
  margin: 2px 0 0;
  color: #92a09a;
  font-size: 11px;
  line-height: 17px;
}

.admin-user-count {
  color: #7c9087;
  font-size: 11px;
  white-space: nowrap;
}

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

.admin-form-grid .field {
  margin-bottom: 12px;
}

.admin-settings-form .field textarea {
  min-height: 92px;
  resize: vertical;
}

.admin-card .field textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #dfe9e4;
  border-radius: 7px;
  outline: none;
  background: #fbfdfc;
  color: #33483f;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 20px;
}

.admin-card .field textarea:focus {
  border-color: #78bda9;
  box-shadow: 0 0 0 3px rgba(61, 160, 134, 0.11);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.admin-save-button {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 22px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #3eac91 0%, #2d8e75 100%);
  box-shadow: 0 5px 14px rgba(45, 142, 117, 0.2);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.admin-save-button:hover {
  filter: brightness(1.04);
}

.admin-save-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.admin-user-list {
  border-top: 1px solid #edf3f0;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid #eef4f1;
}

.admin-user-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-name {
  overflow: hidden;
  color: #30493d;
  font-size: 13px;
  font-weight: 600;
  line-height: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-self {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #edf8f3;
  color: #4d9e82;
  font-size: 9px;
  font-weight: 500;
  vertical-align: 1px;
}

.admin-user-meta {
  color: #9ba8a2;
  font-size: 10px;
  line-height: 15px;
}

.admin-role-badge {
  padding: 2px 7px;
  border-radius: 9px;
  background: #f0f4f2;
  color: #84938c;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}

.admin-role-badge.is-admin {
  background: #e8f6f1;
  color: #348d73;
}

.admin-user-accounts {
  color: #8c9a94;
  font-size: 10px;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.admin-mini-button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #dce8e3;
  border-radius: 5px;
  background: #ffffff;
  color: #63766d;
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-mini-button:hover {
  border-color: #bdd6cc;
  color: #3c6d5a;
}

.admin-mini-button.is-danger {
  border-color: #efd9d6;
  color: #b06a63;
}

.admin-mini-button.is-danger:hover {
  background: #fff7f6;
  border-color: #e6c5c0;
}

.support-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(25, 58, 46, 0.24);
}

.support-dialog::backdrop {
  background: rgba(24, 47, 39, 0.3);
}

.support-dialog-inner {
  padding: 22px;
}

.support-content {
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid #e3ece8;
  border-radius: 9px;
  background: #f8fbfa;
  color: #53685e;
  font-size: 13px;
  line-height: 21px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .admin-view {
    width: calc(100% - 40px);
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .admin-user-accounts {
    grid-column: 1 / 2;
  }

  .admin-user-actions {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
  }
}

@media (max-width: 560px) {
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .admin-head h1 {
    font-size: 22px;
  }

  .admin-card {
    padding: 16px;
  }

  .admin-back-button {
    align-self: flex-end;
  }
}

/* ---------- per-user admin settings ---------- */

.admin-user-accounts {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-admin-dialog {
  width: min(470px, calc(100% - 28px));
}

.user-admin-hint {
  margin: -2px 0 12px;
  color: #8c9b94;
  font-size: 11px;
  line-height: 17px;
}

.user-password-reset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid #f0e0dc;
  border-radius: 8px;
  background: #fffafa;
}

.user-password-reset strong {
  display: block;
  color: #8f554c;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.user-password-reset p {
  margin: 2px 0 0;
  color: #a38b85;
  font-size: 10.5px;
  line-height: 16px;
}

.user-password-reset .admin-mini-button {
  flex: 0 0 auto;
  border-color: #e8cdc7;
  color: #a05c52;
}

.temp-password {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #d7e9e1;
  border-radius: 7px;
  background: #f4fbf8;
}

.temp-password[hidden] {
  display: none;
}

.temp-password span {
  color: #799188;
  font-size: 10px;
  white-space: nowrap;
}

.temp-password code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #2d725c;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-add-account-button {
  display: none;
}

@media (max-width: 560px) {
  .page-head {
    position: static;
    height: 68px;
    padding-top: 8px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .page-head::after {
    bottom: 10px;
  }

  .account-toolbar {
    display: contents;
  }

  .toolbar-left {
    position: sticky;
    top: 0;
    z-index: 35;
    width: 100%;
    margin: 0;
    padding: 6px 20px 8px;
    background: rgba(236, 243, 246, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(196, 215, 207, 0.55);
  }

  .filter-tabs {
    margin-top: 6px;
  }

  .toolbar-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      ". count"
      "add query";
    gap: 6px;
    width: calc(100% - 40px);
    margin: 9px auto 10px;
    padding: 0;
  }

  .account-count {
    grid-area: count;
    justify-self: end;
    padding: 2px 8px;
    border: 1px solid rgba(198, 217, 209, 0.8);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.55);
  }

  .mobile-add-account-button {
    grid-area: add;
    justify-self: stretch;
    margin-left: 0;
  }

  .refresh-all-button {
    grid-area: query;
    height: 34px;
  }

  .page-head .add-account-button {
    display: none;
  }

  .mobile-add-account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 34px;
    margin-left: 0;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid var(--button-green);
    border-radius: 7px;
    background: var(--button-green);
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
  }

  .mobile-add-account-button:hover {
    border-color: var(--button-green-dark);
    background: var(--button-green-dark);
  }

  .mobile-add-account-button svg {
    width: 14px;
    height: 14px;
  }

  .result-dialog {
    width: calc(100% - 48px);
  }

  .result-dialog-inner {
    padding: 16px 16px 15px;
  }

  .result-dialog h2 {
    font-size: 18px;
    line-height: 25px;
  }

  .result-dialog-text {
    margin-top: 5px;
    font-size: 13px;
    line-height: 20px;
  }

  .result-dialog-note,
  .result-dialog-countdown {
    margin-top: 8px;
    padding: 7px 8px;
    font-size: 11.5px;
    line-height: 17px;
  }

  .result-dialog-meta {
    margin-top: 6px;
    font-size: 10.5px;
  }

  .result-dialog-button {
    height: 38px;
    margin-top: 14px;
    font-size: 13.5px;
  }

  .batch-dialog {
    width: calc(100% - 48px);
  }

  .batch-inner {
    padding: 16px 15px 15px;
  }

  .batch-head h2 {
    font-size: 17.5px;
    line-height: 24px;
  }

  .batch-head p {
    font-size: 11px;
  }

  .batch-name {
    font-size: 13px;
  }

  .batch-qq,
  .batch-detail {
    font-size: 11px;
  }

  .batch-badge {
    font-size: 10.5px;
  }

  .batch-close-button {
    height: 38px;
    font-size: 13.5px;
  }
}

@media (max-width: 560px) {
  .account-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px 76px;
    grid-template-areas:
      "search search search"
      "filter add query";
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 35;
    width: 100%;
    margin: 0 auto 10px;
    padding: 6px 20px 9px;
    background: rgba(236, 243, 246, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(196, 215, 207, 0.55);
  }

  .toolbar-left,
  .toolbar-right {
    display: contents;
    position: static;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .search-box {
    grid-area: search;
    width: 100%;
    min-width: 0;
  }

  .filter-tabs {
    grid-area: filter;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    gap: 0;
    overflow: hidden;
    padding: 3px;
  }

  .filter-tab {
    flex: 1 1 0;
    height: 28px;
    padding: 0 2px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .account-count {
    display: none;
  }

  .mobile-add-account-button {
    grid-area: add;
    justify-self: stretch;
    margin-left: 0;
    padding: 0 6px;
    font-size: 12px;
  }

  .refresh-all-button {
    grid-area: query;
    position: relative;
    width: auto;
    min-width: 74px;
    height: 34px;
    padding: 0 7px;
    overflow: visible;
    font-size: 11.5px;
  }

  .refresh-all-button::after {
    content: attr(data-count);
    position: absolute;
    top: -7px;
    right: -4px;
    min-width: 20px;
    height: 15px;
    padding: 0 4px;
    border: 1px solid #cfe5dc;
    border-radius: 8px;
    background: #f1faf6;
    color: #347d66;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 15px;
    text-align: center;
    pointer-events: none;
  }

  .refresh-all-button[data-count=""]::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .result-dialog {
    width: calc(100% - 40px);
  }

  .result-dialog-inner {
    padding: 17px 17px 16px;
  }

  .result-dialog h2 {
    font-size: 21px;
    line-height: 29px;
  }

  .result-dialog-text {
    margin-top: 7px;
    font-size: 15px;
    line-height: 22px;
  }

  .result-dialog-note {
    margin-top: 10px;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 19px;
  }

  .result-dialog-countdown {
    margin-top: 10px;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 19px;
  }

  .result-dialog-meta {
    margin-top: 8px;
    font-size: 12px;
    line-height: 18px;
  }

  .result-dialog-button {
    height: 42px;
    margin-top: 16px;
    font-size: 15px;
  }

  .result-dialog[data-state="error"] .result-dialog-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
  }

  .result-dialog[data-state="error"] .result-dialog-icon svg {
    width: 32px;
    height: 32px;
  }

  .batch-dialog {
    width: calc(100% - 40px);
  }

  .batch-inner {
    padding: 17px 16px 16px;
  }

  .batch-head h2 {
    font-size: 20px;
    line-height: 27px;
  }

  .batch-head p {
    font-size: 12.5px;
    line-height: 18px;
  }

  .batch-name {
    font-size: 14px;
    line-height: 20px;
  }

  .batch-qq {
    font-size: 12px;
    line-height: 17px;
  }

  .batch-detail {
    font-size: 12px;
    line-height: 18px;
  }

  .batch-badge {
    font-size: 11.5px;
    line-height: 17px;
  }

  .batch-close-button {
    height: 42px;
    margin-top: 15px;
    font-size: 15px;
  }
}

/* ---------- card button cooldown sync ---------- */

.account-card .refresh-button.is-cooling {
  border-color: #e5d2b2;
  background: #fff9ee;
  color: #96763f;
  font-weight: 600;
  cursor: not-allowed;
  opacity: 1;
}

.account-card .refresh-button.is-cooling svg {
  color: #b28b4e;
}

.account-card .refresh-button.is-cooling:hover {
  border-color: #e5d2b2;
  background: #fff9ee;
  color: #96763f;
}

/* ---------- slightly smaller dialogs on mobile only ---------- */

@media (max-width: 560px) {
  .result-dialog {
    width: calc(100% - 44px);
    border-radius: 14px;
  }

  .result-dialog-inner {
    padding: 20px 18px 18px;
  }

  .result-dialog-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
  }

  .result-dialog-icon svg {
    width: 22px;
    height: 22px;
  }

  .result-dialog[data-state="error"] .result-dialog-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 9px;
  }

  .result-dialog[data-state="error"] .result-dialog-icon svg {
    width: 30px;
    height: 30px;
  }

  .result-dialog h2 {
    font-size: 17px;
    line-height: 24px;
  }

  .result-dialog-text {
    margin-top: 5px;
    font-size: 12px;
    line-height: 19px;
  }

  .result-dialog-note,
  .result-dialog-countdown {
    margin-top: 8px;
    padding: 7px 9px;
    font-size: 10.5px;
    line-height: 16px;
  }

  .result-dialog-meta {
    margin-top: 6px;
    font-size: 10px;
  }

  .result-dialog-button {
    height: 36px;
    margin-top: 15px;
    font-size: 12.5px;
  }

  .batch-dialog {
    width: calc(100% - 44px);
    max-height: calc(100vh - 48px);
  }

  .batch-inner {
    max-height: calc(100vh - 48px);
    padding: 18px 16px 16px;
  }

  .batch-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .batch-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .batch-icon svg {
    width: 20px;
    height: 20px;
  }

  .batch-head h2 {
    font-size: 16.5px;
    line-height: 23px;
  }

  .batch-head p {
    font-size: 10.5px;
  }

  .batch-row {
    padding: 8px 0;
  }

  .batch-name {
    font-size: 12px;
  }

  .batch-close-button {
    height: 36px;
    margin-top: 13px;
    font-size: 12.5px;
  }
}

/* Final mobile dialog typography: keep this last so it wins. */
@media (max-width: 560px) {
  .result-dialog {
    width: calc(100% - 40px);
  }

  .result-dialog-inner {
    padding: 17px 17px 16px;
  }

  .result-dialog h2 {
    font-size: 21px;
    line-height: 29px;
  }

  .result-dialog-text {
    margin-top: 7px;
    font-size: 15px;
    line-height: 22px;
  }

  .result-dialog-note,
  .result-dialog-countdown {
    margin-top: 10px;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 19px;
  }

  .result-dialog-meta {
    margin-top: 8px;
    font-size: 12px;
    line-height: 18px;
  }

  .result-dialog-button {
    height: 42px;
    margin-top: 16px;
    font-size: 15px;
  }

  .result-dialog[data-state="error"] .result-dialog-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
  }

  .result-dialog[data-state="error"] .result-dialog-icon svg {
    width: 32px;
    height: 32px;
  }

  .batch-dialog {
    width: calc(100% - 40px);
  }

  .batch-inner {
    padding: 17px 16px 16px;
  }

  .batch-head h2 {
    font-size: 20px;
    line-height: 27px;
  }

  .batch-head p {
    font-size: 12.5px;
    line-height: 18px;
  }

  .batch-name {
    font-size: 14px;
    line-height: 20px;
  }

  .batch-qq {
    font-size: 12px;
    line-height: 17px;
  }

  .batch-detail {
    font-size: 12px;
    line-height: 18px;
  }

  .batch-badge {
    font-size: 11.5px;
    line-height: 17px;
  }

  .batch-close-button {
    height: 42px;
    margin-top: 15px;
    font-size: 15px;
  }
}

/* Small icons before the card timestamps */
.stat-emoji {
  display: inline-block;
  margin-right: 3px;
  font-size: 11px;
  line-height: 1;
  vertical-align: -1px;
}

/* ---------- guest mode ---------- */

.header-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--button-green);
  border-radius: 6px;
  background: var(--button-green);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.header-login-button:hover {
  border-color: var(--button-green-dark);
  background: var(--button-green-dark);
}

.login-required-dialog {
  width: min(400px, calc(100% - 32px));
}

.login-required-text {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #e2ede8;
  border-radius: 8px;
  background: #f7fbf9;
  color: #5d6f67;
  font-size: 12.5px;
  line-height: 20px;
}

/* ---------- header home link ---------- */

a.header-text-button {
  text-decoration: none;
  white-space: nowrap;
}

/* Header actions and user management */
.header-action-button {
  height: 32px;
  padding: 0 11px;
  gap: 6px;
  border: 1px solid #cce3d9;
  border-radius: 7px;
  background: rgba(255,255,255,.72);
  color: #327b65;
  font-weight: 600;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.header-action-button:hover { background: #eff9f5; border-color: #8dcab4; color: #246d57; box-shadow: 0 3px 10px rgba(45,142,117,.1); }
.admin-user-list { display: grid; gap: 9px; border: 0; }
.admin-user-row { padding: 13px 14px; border: 1px solid #e0ebe5; border-radius: 9px; background: #fbfdfc; }
.admin-user-row:hover { border-color: #beded1; background: #f6fbf8; }
.admin-mini-button { height: 30px; border-radius: 6px; font-size: 11px; }
.admin-view-button { background: #e9f7f1; border-color: #c4e5d7; color: #258368; font-weight: 600; }
.impersonation-banner { width: min(1080px, calc(100% - 40px)); margin: 14px auto 0; padding: 10px 14px; border: 1px solid #e8d5a1; border-radius: 8px; background: #fff9e9; color: #73591c; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.impersonation-banner[hidden] { display: none; }
.impersonation-banner button { flex: none; padding: 7px 10px; border: 1px solid #d6bd78; border-radius: 6px; background: #fff; color: #73591c; cursor: pointer; }
@media (max-width: 700px) { .header-action-button { width: 32px; padding: 0; } .admin-user-row { grid-template-columns: 1fr auto; } .admin-user-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; flex-wrap: wrap; } .impersonation-banner { align-items: flex-start; flex-direction: column; } }

.manual-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.manual-fields .field { min-width: 0; margin: 0; }
.manual-fields .field input, .manual-fields .field select { min-width: 0; width: 100%; height: 38px; }
.manual-fields .manual-remark { grid-column: 1 / -1; }
.account-remark { display: flex; align-items: center; gap: 8px; min-width: 0; height: 24px; color: #61766b; font-size: 12px; }
.account-remark-label { flex: none; color: #93a29a; }
.account-remark-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 340px) { .manual-fields { grid-template-columns: 1fr; } .manual-fields .manual-remark { grid-column: auto; } }

/* Reserve space for remarks without compressing the account details. */
.account-card { height: 364px; }
.account-card .cred-panel { flex-shrink: 0; }
.account-card .account-remark { flex: 0 0 24px; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-right: 4px; color: #67988a; vertical-align: -3px; }
.stat-icon svg { width: 14px; height: 14px; }
@media (max-width: 560px) { .account-card { height: 376px; } }

/* Site-wide theme switch. The saved theme is applied before styles load. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; min-width: 36px; height: 34px; padding: 0 11px; border: 1px solid #cce3d9; border-radius: 8px; background: rgba(255,255,255,.8); color: #327b65; font-family: inherit; line-height: 1.2; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .16s, border-color .16s; }
.theme-toggle svg { flex: none; width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-sun { display: none; }
.theme-toggle:hover { background: #e7f7f1; border-color: #8dcab4; }
.theme-toggle:focus-visible { outline: 3px solid #26a88b; outline-offset: 3px; }
[data-theme="dark"] .theme-toggle { background: #102332; border-color: #294750; color: #a2e9d9; }
[data-theme="dark"] .theme-toggle:hover { background: #183941; border-color: #4c9b8f; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
@media(max-width:700px) { .theme-toggle { width: 34px; padding: 0; } .theme-toggle [data-theme-label] { display: none; } }
@media(prefers-reduced-motion:reduce) { .theme-toggle { transition: none; } }

.auth-theme-actions { display:flex; justify-content:flex-end; margin:-10px 0 14px; }

/* Dark palette: midnight blue surfaces and teal accents. Light styles above stay intact. */
:root[data-theme="dark"] {
  --ink: #cad8e2; --ink-strong: #eef5fa; --muted: #8a9eaf; --muted-dark: #a9bcc9;
  --line: #233544; --card: #101e2d; --card-border: #2a3d4d;
  --red: #ffaaa5; --red-soft: #38232e; --red-text: #ffaaa5; --red-line: #dc777b;
  --orange: #ffc18b; --orange-soft: #352b26; --orange-text: #ffc18b; --orange-line: #de9c69;
  --green: #75dcb4; --green-teal: #75dfbf; --green-soft: #12372f; --green-line: #47b69b;
  --button-green: #27876f; --button-green-dark: #319a80;
  --shadow-soft: 0 2px 5px #0003, 0 12px 30px #0002;
  --theme-surface: #101e2d; --theme-inset: #0b1725; --theme-hover: #192f3b;
}
html[data-theme="dark"] { background: #020617; }
[data-theme="dark"] body { background: #020617; background-image: radial-gradient(ellipse at 0 0, #0f343b66, transparent 55%), radial-gradient(ellipse at 100% 100%, #134e4a33, transparent 55%); }
[data-theme="dark"] body::before { opacity: .18; }
[data-theme="dark"] :is(.boot-screen,.page-head) { background: #091322; color: var(--ink); }
[data-theme="dark"] .boot-spinner { border-color: #25453e; border-top-color: #5eead4; }
[data-theme="dark"] :is(.page-head h1,.auth-brand h1,.dialog-head h2,.admin-head h1,.admin-card-head h2,.empty-state h2,.inline-import-head h3,.batch-head h2,.batch-group-head h3,.batch-name,.admin-user-name) { color: var(--ink-strong); }
[data-theme="dark"] :is(.auth-card,.account-dialog,.support-dialog,.admin-card,.batch-dialog) { border-color: var(--card-border); background: var(--theme-surface); color: var(--ink); box-shadow: 0 24px 70px #0005; }
[data-theme="dark"] dialog::backdrop { background: #010716b3; }
[data-theme="dark"] .account-card { --card-bg: #111f30; background: linear-gradient(155deg, var(--card-bg), #0d1928); box-shadow: var(--shadow-soft); }
[data-theme="dark"] .account-card[data-state="normal"] { --card-bg: #102d2d; }
[data-theme="dark"] .account-card[data-state="banned"] { --card-bg: #2b202d; }
[data-theme="dark"] .account-card[data-state="frozen"] { --card-bg: #2a2828; --name-color: #f3ce8c; --pill-bg: #3b3022; --pill-fg: #f3ce8c; }
[data-theme="dark"] .account-card[data-state="face"] { --card-bg: #17263d; --name-color: #a8c6ff; --pill-bg: #203354; --pill-fg: #a8c6ff; }
[data-theme="dark"] .account-card[data-state="unknown"] { --name-color: #bac9d5; --pill-bg: #263442; --pill-fg: #b1c0cd; }
[data-theme="dark"] .account-card[data-state="unchecked"] { --card-bg: #132333; --name-color: #d6e2ed; --pill-bg: #263442; --pill-fg: #b1c0cd; }
[data-theme="dark"] .account-card:hover { box-shadow: 0 8px 28px #0005; }
[data-theme="dark"] :is(.cred-panel,.cred-box,.meta-frame,.stats,.inline-import,.support-content,.login-required-text,.user-password-reset,.temp-password) { border-color: var(--line); background: var(--theme-inset); box-shadow: none; }
[data-theme="dark"] :is(.cred-line + .cred-line,.stat + .stat,.batch-row,.batch-group + .batch-group) { border-color: var(--line); }
[data-theme="dark"] :is(.server-name,.account-stat,.cred-account,.password-value,.stat-value,.result-value,.game-time,.temp-password code,.user-password-reset strong) { color: #d4e2ed; }
[data-theme="dark"] .account-stat b { color: #82dbbf; }
[data-theme="dark"] :is(.player-tag,.meta-row,.meta-sep,.cred-label,.password-empty,.stat-label,.game-label,.result-value.is-idle,.account-remark-label,.auth-brand p,.auth-note,.dialog-head p,.import-hint,.inline-import-head p,.admin-head p,.admin-card-head p,.admin-user-count,.admin-user-meta,.admin-user-accounts,.user-admin-hint,.batch-head p,.batch-qq,.batch-detail,.batch-empty,.batch-group-head span,.account-count,.manual-divider,.empty-state p,#emptyState p,.temp-password span,.user-password-reset p) { color: #90a6b7; }
[data-theme="dark"] :is(.account-remark,.support-content,.login-required-text,.field > span,.support-text,.no-results) { color: #b6c9d4; }
[data-theme="dark"] :is(.stat-icon,.cred-icon,.support-icon,.auth-note button,.no-results button,.admin-kicker) { color: #76d9bf; }
[data-theme="dark"] :is(.cred-icon,.auth-logo,.empty-icon,.user-chip-avatar,.admin-self,.admin-role-badge.is-admin) { background: #153c36; color: #86e5c9; }
[data-theme="dark"] .cred-icon-password { background: #3c3022; color: #f2c987; }
[data-theme="dark"] :is(.field input,.field select,.field textarea,.import-dialog textarea,.inline-import textarea,.admin-card .field textarea,.search-box) { border-color: #304757; background-color: #0b1725; color: #e3edf5; }
[data-theme="dark"] :is(.field input,.field textarea,.inline-import textarea,.admin-card .field textarea,.search-box input)::placeholder { color: #7e95a8; }
[data-theme="dark"] .search-box input { color: #e3edf5; }
[data-theme="dark"] :is(.field input,.field select,.field textarea,.import-dialog textarea,.inline-import textarea,.admin-card .field textarea):focus { border-color: #57c6ac; box-shadow: 0 0 0 3px #47c6a820; }
[data-theme="dark"] .field input[readonly] { background: #172534; color: #8ea5b7; border-color: #293e4e; }
[data-theme="dark"] :is(.auth-tabs,.filter-tabs,.user-chip,.admin-role-badge) { background: #0b1725; border-color: var(--line); color: #94aabb; }
[data-theme="dark"] :is(.auth-tab,.filter-tab) { color: #94aabb; }
[data-theme="dark"] :is(.auth-tab.is-active,.filter-tab.is-active) { background: #1b3a3d; color: #94e8d2; box-shadow: 0 1px 5px #0003; }
[data-theme="dark"] :is(.header-text-button,.header-action-button,.logout-button,.admin-back-button,.admin-mini-button,.ghost-button,.edit-button,.delete-button,.import-trigger,.refresh-all-button,.refresh-button,.support-pill,.impersonation-banner button) { background: #152839; color: #b7d8d3; border-color: #304e58; box-shadow: none; }
[data-theme="dark"] :is(.header-text-button,.header-action-button,.logout-button,.admin-back-button,.admin-mini-button,.ghost-button,.edit-button,.import-trigger,.refresh-all-button,.refresh-button,.support-pill,.impersonation-banner button):hover { background: #1e3a43; color: #dcfaf2; border-color: #52998b; }
[data-theme="dark"] :is(.delete-button,.admin-mini-button.is-danger,.user-password-reset .admin-mini-button) { color: #ffaba4; border-color: #694147; background: #30232e; }
[data-theme="dark"] :is(.delete-button,.admin-mini-button.is-danger):hover { background: #472c36; border-color: #bb7275; color: #ffc8c3; }
[data-theme="dark"] :is(.password-toggle,.box-action,.eye-button,.copy-button,.dialog-close) { color: #8fa9b8; }
[data-theme="dark"] :is(.password-toggle,.box-action,.eye-button,.copy-button,.dialog-close):hover { color: #c1ecdf; background: #213a44; }
[data-theme="dark"] .admin-user-row { border-color: #2a3d4d; background: #0c1a28; }
[data-theme="dark"] .admin-user-row:hover { border-color: #427467; background: #122b32; }
[data-theme="dark"] .admin-view-button { color: #86e5c9; background: #153c36; border-color: #316958; }
[data-theme="dark"] .impersonation-banner { background: #302b20; color: #efcd8f; border-color: #6b5939; }
[data-theme="dark"] .manual-divider::before, [data-theme="dark"] .manual-divider::after { background: var(--line); }
[data-theme="dark"] .result-dialog { background: #112c31; border: 1px solid #2c4c50; }
[data-theme="dark"] .result-dialog[data-state="banned"] { background: #2d202c; border-color: #61414b; }
[data-theme="dark"] :is(.game-time.is-danger,.form-message) { color: #ffaaa5; }
[data-theme="dark"] .refresh-button:disabled, [data-theme="dark"] .refresh-button.is-cooling { background: #172836; border-color: #2b4050; color: #8096a6; }
@media(max-width:560px) {
  [data-theme="dark"] .account-toolbar { background: rgba(9,19,34,.95); border-color: var(--line); box-shadow: 0 1px 0 #233544; }
  [data-theme="dark"] :is(.toolbar-left,.toolbar-right) { background: transparent; }
  .page-head { padding-left: 20px; padding-right: 20px; }
  .page-head-inner { width: 100%; gap: 8px; }
  .page-head h1 { font-size: clamp(17px,4.8vw,20px); }
  .page-head-actions { flex: 0 0 auto; gap: 5px; }
  .page-head-actions :is(.theme-toggle,.header-text-button) { flex: 0 0 30px; min-width: 30px; height: 30px; width: 30px; }
  .logout-button { flex: none; white-space: nowrap; }
}

[data-theme="dark"] .dialog-close { background: #1c3241; }
[data-theme="dark"] .account-card[data-state="unchecked"] .refresh-button { background: #3c3020; border-color: #85652d; color: #f0ce8c; }
[data-theme="dark"] .account-card[data-state="unchecked"] .refresh-button:hover { background: #514029; color: #ffe0a0; }
[data-theme="dark"] .account-card[data-state="unchecked"] .refresh-button svg { color: currentColor; }

/* Batch results: distinct, readable status sections */
.batch-dialog { width:min(520px,calc(100% - 28px)); border:1px solid #dce9e3; border-radius:20px; background:#f8fcfa; color:#263f35; box-shadow:0 24px 80px rgba(10,35,27,.28); }
.batch-inner { padding:24px; }
.batch-head { margin-bottom:20px; }
.batch-head h2 { color:#203d32; font-size:19px; font-weight:750; }
.batch-head p { color:#6e877b; font-size:12px; line-height:1.6; }
.batch-content { display:flex; flex-direction:column; gap:12px; padding-right:4px; }
.batch-group, .batch-group:first-child { margin:0; overflow:hidden; border:1px solid #dceae3; border-radius:13px; background:#fff; }
.batch-group-head { padding:11px 14px; border:0; background:#edf8f2; }
.batch-group-head h3 { display:flex; align-items:center; gap:8px; color:#31795e; font-size:13px; font-weight:750; }
.batch-group-head h3::before { content:''; width:8px; height:8px; border-radius:50%; background:#35b788; }
.batch-group-head span { min-width:25px; padding:2px 7px; border-radius:20px; background:#d7f2e5; color:#287c5c; text-align:center; font-weight:700; }
.batch-group:first-child .batch-group-head { background:#fff0ef; }
.batch-group:first-child .batch-group-head h3 { color:#b74a49; }
.batch-group:first-child .batch-group-head h3::before { background:#e46c65; }
.batch-group:first-child .batch-group-head span { background:#fbdedb; color:#b94e4c; }
.batch-group:has(.is-other) .batch-group-head, .batch-group:has(.is-failed) .batch-group-head { background:#fff7e8; }
.batch-group:has(.is-other) .batch-group-head h3, .batch-group:has(.is-failed) .batch-group-head h3 { color:#9a6b25; }
.batch-group:has(.is-other) .batch-group-head h3::before, .batch-group:has(.is-failed) .batch-group-head h3::before { background:#dca448; }
.batch-group:has(.is-other) .batch-group-head span, .batch-group:has(.is-failed) .batch-group-head span { background:#f8e9c9; color:#946723; }
.batch-row { padding:11px 14px; border-bottom:1px solid #edf3ef; }
.batch-row:last-child { border-bottom:0; }
.batch-name { color:#29483b; font-size:13px; }
.batch-qq, .batch-detail { color:#71897d; font-size:11px; }
.batch-empty { margin:0; padding:12px 14px; color:#8b9d93; }
.batch-badge.is-banned { background:#fff0ef; color:#bf514d; }
.batch-badge.is-normal { background:#e7f7ef; color:#25825d; }
.batch-badge.is-other, .batch-badge.is-failed { background:#fff4df; color:#9d712b; }
.batch-close-button { height:42px; border-radius:10px; margin-top:18px; }
[data-theme="dark"] .batch-dialog { background:#101f30; border-color:#2c4454; }
[data-theme="dark"] .batch-group { background:#14283a; border-color:#2b4050; }
[data-theme="dark"] .batch-group-head { background:#173e38; }
[data-theme="dark"] .batch-group-head h3 { color:#83dfba; }
[data-theme="dark"] .batch-group-head span { background:#215347; color:#a0e6c9; }
[data-theme="dark"] .batch-group:first-child .batch-group-head { background:#483039; }
[data-theme="dark"] .batch-group:first-child .batch-group-head h3 { color:#ffaaa4; }
[data-theme="dark"] .batch-group:first-child .batch-group-head span { background:#663e46; color:#ffc2bc; }
[data-theme="dark"] .batch-group:has(.is-other) .batch-group-head, [data-theme="dark"] .batch-group:has(.is-failed) .batch-group-head { background:#453c2e; }
[data-theme="dark"] .batch-group:has(.is-other) .batch-group-head h3, [data-theme="dark"] .batch-group:has(.is-failed) .batch-group-head h3 { color:#f2cc8a; }
[data-theme="dark"] .batch-group:has(.is-other) .batch-group-head span, [data-theme="dark"] .batch-group:has(.is-failed) .batch-group-head span { background:#665239; color:#f7d69d; }
[data-theme="dark"] .batch-row { border-color:#294052; }
[data-theme="dark"] .batch-badge.is-banned { background:#56383e; color:#ffaaa3; }
[data-theme="dark"] .batch-badge.is-normal { background:#1b4b40; color:#91dfbf; }
[data-theme="dark"] .batch-badge.is-other, [data-theme="dark"] .batch-badge.is-failed { background:#51452f; color:#f2cb85; }
@media (max-width:480px) { .batch-inner { padding:18px 16px 16px; } .batch-head { margin-bottom:15px; } .batch-content { gap:10px; } .batch-group-head, .batch-row { padding-left:12px; padding-right:12px; } }

/* Allow the verification result to wrap within the account card. */
.result-value.is-verification { white-space:normal; overflow:visible; text-align:right; line-height:1.35; align-items:flex-start; }
.result-value.is-verification svg { margin-top:2px; }

/* Compact framed remark, aligned across account cards. */
.account-card { height:374px; }
.account-card .account-remark { box-sizing:border-box; flex:0 0 30px; height:30px; margin:6px 0 2px; padding:0 9px; gap:8px; border:1px solid #dceae3; border-radius:7px; background:#f7fbf9; color:#496458; }
.account-remark-label { font-size:11px; font-weight:700; color:#779287; }
.account-remark-value { font-size:12px; }
[data-theme="dark"] .account-card .account-remark { border-color:#294353; background:#0d1e2b; color:#c1d5dc; }
[data-theme="dark"] .account-remark-label { color:#8ea9ae; }
@media (max-width:560px) { .account-card { height:386px; } }

/* Framed result and delete confirmation */
.account-card { height:384px; }
.account-card .game-row { box-sizing:border-box; flex:0 0 auto; min-height:30px; height:auto; padding:6px 9px; margin:3px 0 6px; border:1px solid #dceae3; border-radius:7px; background:#f7fbf9; }
[data-theme="dark"] .account-card .game-row { border-color:#294353; background:#0d1e2b; }
@media(max-width:560px) { .account-card { height:396px; } }
.delete-confirm-dialog { width:min(380px,calc(100% - 32px)); padding:0; border:1px solid #dceae3; border-radius:16px; background:#fff; color:#284538; }
.delete-confirm-inner { padding:24px; text-align:center; }
.delete-confirm-icon { display:grid; place-items:center; width:44px; height:44px; margin:0 auto 12px; border-radius:50%; background:#fff0ee; color:#dc655d; font-size:22px; font-weight:800; }
.delete-confirm-inner h2 { margin:0 0 8px; font-size:18px; }
.delete-confirm-inner p { margin:8px 0; color:#788f83; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.delete-confirm-inner .delete-confirm-name { color:inherit; font-weight:700; }
.delete-confirm-actions { display:flex; gap:10px; margin-top:20px; }
.delete-confirm-actions button { flex:1; min-height:40px; border:1px solid #dceae3; border-radius:8px; background:#f6faf8; color:#466557; font:inherit; font-weight:700; cursor:pointer; }
.delete-confirm-actions button[value="delete"] { border-color:#d75c56; background:#d75c56; color:white; }
[data-theme="dark"] .delete-confirm-dialog { background:#122334; border-color:#304757; color:#e2edf1; }
[data-theme="dark"] .delete-confirm-inner p { color:#9cb2bc; }
[data-theme="dark"] .delete-confirm-inner .delete-confirm-name { color:#e2edf1; }
[data-theme="dark"] .delete-confirm-actions button[value="cancel"] { background:#1b3040; border-color:#355060; color:#d1e4e4; }

/* Keep remark and detection text styles consistent across themes. */
.account-card .account-remark-label { color:var(--muted); font-size:12px; font-weight:400; }
.account-card .game-label { color:#779287; font-size:11px; font-weight:700; }
.account-card .cred-line .cred-label { font-weight:700; }
[data-theme="dark"] .account-card .account-remark-label { color:#90a6b7; }
[data-theme="dark"] .account-card .game-label { color:#8ea9ae; }


/* Status lights for account detection results. */
.result-light { display:inline-block; flex:0 0 9px; width:9px; height:9px; border-radius:50%; background:currentColor; color:#9baeb1; animation:result-breathe 2s ease-in-out infinite; }
.result-light.is-normal { color:#35b989; }
.result-light.is-banned { color:#ef6a6a; }
.result-light.is-warning { color:#e6a64d; }
.result-value.is-verification .result-light { margin-top:4px; }
@keyframes result-breathe { 0%,100% { opacity:.65; box-shadow:0 0 0 0 transparent; } 50% { opacity:1; box-shadow:0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); } }
@media (prefers-reduced-motion:reduce) { .result-light { animation:none; } }

/* Leave room for the status light glow without clipping the text. */
.account-card .result-value { overflow:visible; padding-left:4px; }
.account-card .result-value > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-card .result-value.is-verification > span { overflow:visible; white-space:normal; }

@media (min-width: 561px) {
  .mobile-add-account-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 34px; padding: 0 10px; border: 1px solid var(--button-green); border-radius: 7px; background: var(--button-green); color: #fff; font: 500 12.5px var(--font-ui); white-space: nowrap; cursor: pointer; }
  .mobile-add-account-button:hover { border-color: var(--button-green-dark); background: var(--button-green-dark); }
  .mobile-add-account-button svg { width: 14px; height: 14px; }
}

/* Dashboard refinements */
.dashboard-brand { display:flex; align-items:center; gap:10px; min-width:0; }
.dashboard-logo { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:9px; background:#dff3eb; color:#207d68; }
.dashboard-logo svg { width:22px; height:22px; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
[data-theme="dark"] .dashboard-logo { background:#153c36; color:#86e5c9; }
.page-head .theme-toggle { width:34px; min-width:34px; padding:0; }
.page-head .theme-toggle [data-theme-label] { display:none; }
.logout-button { display:inline-flex; align-items:center; justify-content:center; gap:5px; height:34px; padding:0 10px; border:1px solid #cce3d9; border-radius:8px; background:rgba(255,255,255,.8); color:#52776b; font-weight:600; cursor:pointer; }
.logout-button svg { width:15px; height:15px; }
.logout-button:hover { background:#e7f7f1; border-color:#8dcab4; }
.search-box { position:relative; }
.search-placeholder { position:absolute; left:32px; top:50%; transform:translateY(-50%); color:#849a91; font-size:11px; line-height:13px; pointer-events:none; }
.search-placeholder small { font-size:10px; color:#a2b0aa; }
.search-box input:not(:placeholder-shown) + .search-placeholder, .search-box input:focus + .search-placeholder { display:none; }
.account-card .cred-line:first-child .cred-label { color:#253f34; }
.account-card .cred-line:first-child .cred-account { color:#92a09a; }
[data-theme="dark"] .account-card .cred-line:first-child .cred-label { color:#d4e2ed; }
[data-theme="dark"] .account-card .cred-line:first-child .cred-account { color:#90a6b7; }
.account-card .result-value { font-weight:700; }
.result-light { animation-duration:1.35s; }
.batch-badge.is-other { max-width:180px; white-space:normal; text-align:center; overflow-wrap:anywhere; }
@media(max-width:560px) { .dashboard-brand { gap:6px; } .dashboard-logo { width:28px; height:28px; } .dashboard-logo svg { width:20px; height:20px; } .logout-button { height:30px; padding:0 7px; } }

.dashboard-logo, [data-theme="dark"] .dashboard-logo { background:linear-gradient(135deg,#14b8a6,#0d9488); color:#fff; box-shadow:0 8px 20px rgba(20,184,166,.3); }
.result-light { box-shadow:0 0 0 2px color-mix(in srgb,currentColor 20%,transparent); animation-name:result-breathe-smooth; }
@keyframes result-breathe-smooth { 0%,100% { opacity:.62; transform:scale(.85); } 50% { opacity:1; transform:scale(1.14); } }

/* Verification and account ID controls */
.account-card .status-pill.is-verification { background:#fff3d7; color:#946016; }
.account-card .result-value.is-verification { color:#9a671c; }
[data-theme="dark"] .account-card .status-pill.is-verification { background:#49391e; color:#f4cd7f; }
[data-theme="dark"] .account-card .result-value.is-verification { color:#f4cd7f; }
.copy-player-name { display:inline-flex; align-items:center; justify-content:center; flex:0 0 20px; width:20px; height:20px; padding:2px; border:0; border-radius:4px; background:transparent; color:#78978a; cursor:pointer; }
.copy-player-name:hover { background:rgba(53,185,137,.15); color:#26916d; }
.copy-player-name:focus-visible { outline:2px solid #35b989; outline-offset:1px; }
.copy-player-name svg { width:14px; height:14px; }
.search-placeholder { height:16px; overflow:hidden; line-height:16px; font-size:12px; right:8px; }
.search-hint-track { display:block; animation:search-hint-cycle 7s ease-in-out infinite; }
.search-hint-track > span { display:block; height:16px; white-space:nowrap; }
@keyframes search-hint-cycle { 0%,42% { transform:translateY(0); } 50%,92% { transform:translateY(-16px); } 100% { transform:translateY(-32px); } }
@media (prefers-reduced-motion:reduce) { .search-hint-track { animation:none; } }

/* Appearance settings and dark account details */
[data-theme="dark"] .account-card .cred-line .cred-label,
[data-theme="dark"] .account-card .cred-line:first-child .cred-label { color:#81d8c4; }
.theme-panel[hidden] { display:none; }
.theme-panel { position:fixed; z-index:10000; width:246px; padding:16px; border:1px solid #d6e7df; border-radius:14px; background:#fff; color:#203e35; box-shadow:0 14px 38px rgba(20,55,45,.18); }
.theme-panel-title { font-size:14px; font-weight:750; }
.theme-panel p { margin:4px 0 12px; color:#789087; font-size:11px; }
.theme-options { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.theme-options button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-height:65px; padding:7px 2px; border:1px solid #dfebe5; border-radius:9px; background:#f7faf8; color:#547168; font-family:inherit; font-size:11px; font-weight:600; cursor:pointer; }
.theme-options button:hover { border-color:#70cbb0; }
.theme-options button[aria-pressed="true"] { border-color:#2fa986; background:#e7f7f1; color:#16765b; box-shadow:inset 0 0 0 1px #2fa986; }
.theme-options button:focus-visible { outline:2px solid #2fa986; outline-offset:2px; }
.theme-option-icon { font-size:20px; line-height:1; }
[data-theme="dark"] .theme-panel { background:#102332; border-color:#31505a; color:#e0f1ee; box-shadow:0 14px 38px rgba(0,0,0,.4); }
[data-theme="dark"] .theme-panel p { color:#91acb8; }
[data-theme="dark"] .theme-options button { background:#142e3b; border-color:#2a4953; color:#b4cbd0; }
[data-theme="dark"] .theme-options button[aria-pressed="true"] { background:#17483f; border-color:#59c5a7; color:#a9f1dd; box-shadow:inset 0 0 0 1px #59c5a7; }

.admin-user-main { align-items:flex-start; gap:5px; }
.admin-time { display:inline-block; padding:3px 8px; border:1px solid #dfece5; border-radius:6px; background:#f3f8f5; color:#68877a; }
.admin-role-badge { font-size:12px; padding:4px 10px; font-weight:600; }
.admin-user-search { margin:0 0 12px; }
.admin-user-search input { width:min(100%,300px); padding:9px 12px; border:1px solid #d6e6de; border-radius:8px; background:#fff; color:#30493d; font:inherit; }
.admin-pagination { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-top:14px; color:#71887d; font-size:12px; }
.admin-pagination button { padding:6px 10px; border:1px solid #d6e6de; border-radius:7px; background:#fff; color:#397a66; cursor:pointer; }
.admin-pagination button:disabled { opacity:.45; cursor:default; }
.admin-empty { padding:20px; text-align:center; color:#849c91; }
[data-theme="dark"] .admin-time { background:#102632; border-color:#304b52; color:#a4c2c2; }
[data-theme="dark"] .admin-user-search input, [data-theme="dark"] .admin-pagination button { background:#102332; border-color:#31505a; color:#c2dfd7; }

/* Registered user list refinements */
.admin-user-heading { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.admin-user-search { margin:0; }
.admin-user-search input { width:210px; max-width:100%; }
.admin-user-times { display:flex; flex-wrap:wrap; gap:6px; }
.admin-role-badge { background:#e8f4f1; border:1px solid #cfe8df; color:#3f7667; border-radius:8px; }
.admin-role-badge.is-admin { background:#dcf6ec; border-color:#b9e4d5; color:#13795a; }
.admin-user-accounts { padding:4px 9px; border:1px solid #dbe9e2; border-radius:8px; background:#f7fbf9; }
.admin-mini-button[data-admin-action="limits"] { background:#edf7f5; border-color:#c9e5dd; color:#337d6c; }
.admin-mini-button[data-admin-action="limits"]:hover { background:#daf1eb; border-color:#8dcdb9; }
[data-theme="dark"] .admin-role-badge { background:#1b363c; border-color:#315b5d; color:#add9cc; }
[data-theme="dark"] .admin-role-badge.is-admin { background:#17463a; border-color:#327960; color:#a7efd6; }
[data-theme="dark"] .admin-user-accounts { background:#122b32; border-color:#31505a; color:#b8d5d1; }
[data-theme="dark"] .admin-mini-button[data-admin-action="limits"] { background:#193a3d; border-color:#396960; color:#a9e7d7; }
@media(max-width:560px) { .admin-user-heading { gap:8px; } .admin-user-search input { width:160px; } }

/* Account labels and registered-user layout */
.account-card .cred-line:first-child .cred-label { color:#92a09a; }
.account-card .cred-line:first-child .cred-account { color:#253f34; }
[data-theme="dark"] .account-card .cred-line:first-child .cred-label { color:#90a6b7; }
[data-theme="dark"] .account-card .cred-line:first-child .cred-account { color:#81d8c4; }
.admin-user-main { flex-direction:row; align-items:center; flex-wrap:wrap; gap:8px; }
.admin-user-name { flex:0 1 auto; max-width:100%; }
.admin-time { display:inline-flex; align-items:center; padding:4px 10px; border-radius:8px; font-size:12px; font-weight:600; line-height:16px; }
.admin-user-accounts { display:inline-flex; align-items:center; padding:4px 10px; border:1px solid #cce8de; border-radius:8px; background:#edf8f4; color:#317d69; font-size:12px; font-weight:600; line-height:16px; }
[data-theme="dark"] .admin-user-accounts { background:#193a3b; border-color:#39665b; color:#a7dfce; }
@media (max-width:860px) { .admin-user-main { gap:6px; } .admin-user-times { min-width:0; } .admin-time { white-space:normal; } }

/* Expired bans stay unconfirmed until the next query. */
.account-card[data-state="banned"][data-expired="true"] { --accent:#d9a441; --name-color:#986b1f; --pill-bg:#fff2d7; --pill-fg:#946016; --card-bg:#fffbf2; }
.account-card[data-expired="true"] .result-value.is-expired { color:#946016; }
[data-theme="dark"] .account-card[data-state="banned"][data-expired="true"] { --card-bg:#2a2828; --name-color:#f3ce8c; --pill-bg:#3b3022; --pill-fg:#f3ce8c; }
[data-theme="dark"] .account-card[data-expired="true"] .result-value.is-expired { color:#f3ce8c; }
/* Keep the role and account count as distinct stacked badges. */
.admin-user-row { grid-template-columns:minmax(0,1fr) auto auto; }
.admin-user-summary { display:flex; flex-direction:column; align-items:stretch; gap:5px; min-width:0; }
.admin-user-summary .admin-role-badge, .admin-user-summary .admin-user-accounts { display:flex; justify-content:center; align-items:center; min-height:0; box-sizing:border-box; padding:1px 5px; border-radius:4px; font-size:9px; font-weight:500; line-height:15px; text-align:center; }
.admin-user-actions .admin-mini-button { height:30px; padding:0 10px; border-radius:6px; font-size:11px; font-weight:600; }
@media (max-width:700px) { .admin-user-row { grid-template-columns:minmax(0,1fr) auto; } .admin-user-summary .admin-user-accounts { grid-column:auto; } .admin-user-actions { grid-column:1 / -1; grid-row:auto; } }

/* Compact administration layout. */
.admin-user-row { padding:5px 14px; }
.admin-user-summary { gap:2px; }
#adminSettingsForm { padding:16px 18px; }
#adminSettingsForm .admin-card-head { margin-bottom:10px; }
#adminSettingsForm .admin-form-grid { gap:0 12px; }
#adminSettingsForm .admin-form-grid .field { margin-bottom:8px; }
#adminSettingsForm .field { gap:4px; }
#adminSettingsForm .field input, #adminSettingsForm .field select { height:36px; }
#adminSettingsForm .field textarea { min-height:64px; padding:7px 10px; line-height:18px; }
#adminSettingsForm .admin-save-button { height:34px; padding:0 18px; }
@media (max-width:700px) { .admin-user-row { padding:7px 10px; } #adminSettingsForm { padding:14px; } }

/* Settings and user roles: compact on wide screens, responsive on small screens. */
#adminSettingsForm .admin-form-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
#adminSettingsForm .admin-form-grid .field { min-width:0; }
#adminSettingsForm .admin-form-grid .field > span { white-space:nowrap; }
#adminInviteField { order:1; grid-column:1 / -1; }
.admin-user-summary { display:block; }
.admin-user-summary .admin-role-badge { position:relative; display:inline-flex; height:30px; padding:0 10px; border-radius:6px; font-size:11px; font-weight:600; line-height:normal; background:#e9f7f1; border-color:#c4e5d7; color:#258368; overflow:visible; }
.admin-account-badge { position:absolute; top:-7px; right:-8px; min-width:20px; height:15px; box-sizing:border-box; padding:0 4px; border:1px solid #cfe5dc; border-radius:8px; background:#f1faf6; color:#347d66; font-size:9px; font-variant-numeric:tabular-nums; font-weight:600; line-height:13px; text-align:center; }
[data-theme="dark"] .admin-user-summary .admin-role-badge { color:#86e5c9; background:#153c36; border-color:#316958; }
[data-theme="dark"] .admin-account-badge { color:#a7dfce; background:#193a3b; border-color:#39665b; }
@media (max-width:850px) { #adminSettingsForm .admin-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { #adminSettingsForm .admin-form-grid { grid-template-columns:1fr; } #adminInviteField { grid-column:auto; } }

/* Center management headings while keeping their controls accessible. */
.admin-head { position:relative; justify-content:center; align-items:center; min-height:66px; }
.admin-head > div { text-align:center; }
.admin-head .admin-back-button { position:absolute; right:0; bottom:0; }
#adminSettingsForm .admin-card-head { justify-content:center; text-align:center; }
#adminView .admin-card:has(#adminUserList) > .admin-card-head { position:relative; justify-content:center; align-items:center; }
#adminView .admin-card:has(#adminUserList) .admin-user-count { position:absolute; right:0; }
.admin-account-badge { min-width:20px; white-space:nowrap; }
@media (max-width:700px) { .admin-head { flex-direction:column; align-items:center; } .admin-head .admin-back-button { position:static; align-self:flex-end; } #adminView .admin-card:has(#adminUserList) > .admin-card-head { flex-wrap:wrap; } #adminView .admin-card:has(#adminUserList) .admin-user-count { position:static; } .admin-user-heading { justify-content:center; } }

/* Administration heading and settings refinements. */
#adminView .admin-card:has(#adminUserList) .admin-user-count { position:static; display:block; margin-top:2px; text-align:center; line-height:16px; }
.admin-user-title { text-align:center; }
#adminSettingsForm .field > span { font-size:13px; font-weight:600; }
#adminSettingsForm .admin-actions { justify-content:center; margin-top:8px; }
#adminSettingsForm .admin-save-button { min-width:112px; height:36px; border:1px solid #298b73; border-radius:8px; background:linear-gradient(135deg,#43b99d,#27866f); box-shadow:0 4px 12px rgba(45,142,117,.22); transition:transform .16s ease,box-shadow .16s ease,filter .16s ease; }
#adminSettingsForm .admin-save-button:hover { transform:translateY(-1px); box-shadow:0 6px 16px rgba(45,142,117,.28); }
#adminSettingsForm .admin-save-button:focus-visible { outline:3px solid #a2e5d2; outline-offset:2px; }

/* Mobile administration user cards. */
@media (max-width:700px) {
  .admin-user-row { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"name role" "times actions"; column-gap:8px; row-gap:3px; align-items:start; }
  .admin-user-main { display:contents; }
  .admin-user-name { grid-area:name; justify-self:center; text-align:center; min-width:0; white-space:normal; overflow-wrap:anywhere; }
  .admin-user-times { grid-area:times; align-self:start; flex-direction:column; align-items:flex-start; min-width:0; }
  .admin-user-summary { grid-area:role; justify-self:center; align-self:start; }
  .admin-user-actions { grid-area:actions; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; justify-content:stretch; }
  .admin-user-actions .admin-mini-button[data-admin-action="view"] { grid-column:1 / -1; }
  .admin-user-actions .admin-mini-button { height:27px; padding:0 8px; }
  .admin-pagination { justify-content:center; flex-wrap:wrap; }
}

/* Keep identity beside the username on compact screens. */
.admin-mobile-role { display:none; }
@media (max-width:700px) {
  .admin-user-row { grid-template-areas:"name actions" "times actions"; }
  .admin-user-name { justify-self:center; overflow:visible; line-height:30px; }
  .admin-user-row > .admin-user-summary { display:none; }
  .admin-user-name .admin-mobile-role { display:inline-block; vertical-align:middle; margin:0 8px 0 6px; }
  .admin-user-actions { align-self:start; }
}

/* Place mobile user actions beside the identity and keep dates below. */
@media (max-width:700px) {
  .admin-user-row { grid-template-areas:"name actions" "times times"; column-gap:5px; row-gap:3px; }
  .admin-user-name { justify-self:center; text-align:center; min-width:0; line-height:27px; }
  .admin-user-name .admin-mobile-role { margin-left:4px; margin-right:7px; }
  .admin-user-summary .admin-role-badge { height:26px; padding:0 7px; }
  .admin-user-actions { display:flex; flex-wrap:nowrap; gap:3px; align-self:start; }
  .admin-user-actions .admin-mini-button { height:26px; padding:0 6px; }
  .admin-user-times { flex-direction:row; flex-wrap:wrap; gap:4px; }
}

/* Administrator query-token settings. */
.token-settings .admin-card-head { justify-content:center; text-align:center; }
.token-current { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 12px; padding:10px 12px; border:1px solid var(--line, #d6e8df); border-radius:8px; }
.token-current span, .token-settings .field > span { font-size:13px; font-weight:600; }
.token-current code { font-size:13px; overflow-wrap:anywhere; }
.token-current small, .token-hint { color:#738a80; font-size:12px; }
.token-settings .admin-actions { display:flex; justify-content:center; align-items:center; gap:10px; }
.token-settings .admin-save-button { padding:0 14px; }

.token-temporary { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:14px 0; }
.token-temporary .field { flex:1 1 240px; margin:0; }
.token-temporary small { flex-basis:100%; color:#738a80; }

/* Compact mobile user actions. */
@media (max-width:700px) {
  .admin-user-row { grid-template-columns:minmax(0, 3fr) minmax(0, 2fr); grid-template-areas:"name actions" "times actions"; column-gap:8px; row-gap:4px; }
  .admin-user-name { justify-self:center; max-width:100%; overflow-wrap:anywhere; }
  .admin-user-times { flex-direction:column; flex-wrap:nowrap; align-items:flex-start; min-width:0; }
  .admin-time { max-width:100%; overflow-wrap:anywhere; }
  .admin-user-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; width:100%; min-width:0; align-self:center; }
  .admin-user-actions .admin-mobile-role { display:flex; width:100%; min-width:0; margin:0; }
  .admin-user-actions .admin-role-badge { width:100%; }
  .admin-user-actions .admin-mini-button, .admin-user-actions .admin-mini-button[data-admin-action="view"] { grid-column:auto; width:100%; min-width:0; padding:0 3px; }
}
@media (max-width:700px) {
  .admin-user-actions .admin-mobile-role { grid-area:auto; justify-self:stretch; align-self:stretch; }
}

@media (min-width:701px) {
  .token-current { justify-content:center; }
  .token-temporary .field input, .token-temporary .admin-mini-button { height:40px; }
}

/* Keep mobile user controls compact so dates have room. */
@media (max-width:700px) {
  .admin-user-row { grid-template-columns:minmax(0, 1fr) auto; }
  .admin-user-actions { grid-template-columns:repeat(2, 42px); width:auto; gap:4px; }
  .admin-user-times .admin-time { white-space:nowrap; overflow-wrap:normal; padding-left:6px; padding-right:6px; font-size:11px; }
}

@media (max-width:360px) {
  .admin-user-row { grid-template-areas:"name actions" "times times"; }
}

@media (max-width:700px) {
  .admin-user-actions { width:min(180px, calc(100% - 173px)); grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

@media (max-width:700px) {
  .admin-user-actions { width:min(180px, max(81px, calc(100vw - 239px))); }
}

@media (max-width:700px) { .admin-user-actions { width:min(171px, max(81px, calc(100vw - 259px))); } }

@media (min-width:701px) {
  .token-temporary { justify-content:center; }
  .token-temporary .field { flex:0 1 360px; }
  .token-temporary small { text-align:center; }
}

/* Final mobile admin-card alignment: keep dates and controls in clean columns. */
@media (min-width:401px) and (max-width:700px) {
  .admin-user-row { grid-template-columns:minmax(0,1fr) 165px; grid-template-areas:"name actions" "times actions"; column-gap:8px; }
  .admin-user-actions { width:165px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  .admin-user-times { width:100%; min-width:0; }
  .admin-time { max-width:100%; white-space:nowrap; overflow-wrap:normal; }
}
@media (max-width:400px) and (min-width:361px) {
  .admin-user-row { grid-template-columns:minmax(0,1fr) 110px; grid-template-areas:"name actions" "times actions"; column-gap:8px; }
  .admin-user-actions { width:110px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  .admin-user-times { width:100%; min-width:0; }
  .admin-time { max-width:100%; white-space:nowrap; overflow-wrap:normal; }
}
@media (max-width:360px) {
  .admin-user-row { grid-template-columns:minmax(0,1fr) 96px; grid-template-areas:"name name" "times actions"; column-gap:6px; }
  .admin-user-actions { width:96px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
  .admin-user-times { width:100%; min-width:0; }
  .admin-time { max-width:100%; white-space:nowrap; overflow-wrap:normal; font-size:9px; padding-left:5px; padding-right:5px; }
}

/* Mobile admin users: stable two-column layout with compact controls. */
@media (max-width: 700px) {
  #adminUserList .admin-user-row {
    --admin-actions-width: clamp(104px, 29vw, 118px);
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) var(--admin-actions-width) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "name actions" "times actions" !important;
    column-gap: 8px !important;
    row-gap: 4px !important;
    align-items: start !important;
    min-width: 0 !important;
    padding: 8px 10px !important;
  }

  #adminUserList .admin-user-main {
    display: contents !important;
  }

  #adminUserList .admin-user-name {
    grid-area: name !important;
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 26px !important;
    text-align: left !important;
  }

  #adminUserList .admin-user-times {
    grid-area: times !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #adminUserList .admin-time {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 26px !important;
    padding: 3px 7px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(9px, 2.6vw, 10px) !important;
    line-height: 15px !important;
    letter-spacing: -0.1px !important;
  }

  #adminUserList .admin-user-actions {
    grid-area: actions !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, 30px) !important;
    gap: 4px !important;
    width: var(--admin-actions-width) !important;
    min-width: 0 !important;
    margin: 0 !important;
    align-self: start !important;
    justify-self: end !important;
  }

  #adminUserList .admin-user-actions .admin-mobile-role,
  #adminUserList .admin-user-actions .admin-mini-button {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  #adminUserList .admin-user-actions .admin-mobile-role {
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  #adminUserList .admin-user-actions .admin-role-badge {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    padding: 0 4px !important;
    overflow: visible !important;
    font-size: 11px !important;
    line-height: 16px !important;
  }

  #adminUserList .admin-user-actions .admin-mini-button {
    height: 30px !important;
    padding: 0 3px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 28px !important;
  }

  #adminUserList .admin-user-actions .admin-account-badge {
    right: -5px !important;
    top: -7px !important;
    min-width: 19px !important;
    height: 15px !important;
    padding: 0 3px !important;
    font-size: 9px !important;
    line-height: 13px !important;
  }
}

@media (max-width: 360px) {
  #adminUserList .admin-user-row {
    --admin-actions-width: 104px;
    column-gap: 6px !important;
  }
}

/* Mobile time UI: frame each timestamp by its content and align the action grid with it. */
@media (max-width: 700px) {
  #adminUserList .admin-user-times {
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  #adminUserList .admin-time {
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 26px !important;
    align-self: flex-start !important;
    padding: 4px 8px !important;
  }

  #adminUserList .admin-user-actions {
    position: relative !important;
    top: 30px !important;
  }
}


@media (min-width: 361px) and (max-width: 700px) {
  #adminUserList .admin-user-actions {
    top: 30px !important;
  }
}


/* Mobile admin card final spacing: tighter name row and centered action controls. */
@media (max-width: 700px) {
  #adminUserList .admin-user-row {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  #adminUserList .admin-user-name {
    line-height: 22px !important;
  }

  #adminUserList .admin-user-actions {
    top: 24px !important;
  }
}

@media (max-width: 360px) {
  #adminUserList .admin-user-actions {
    top: 24px !important;
  }
}

/* Mobile admin card: frame the username and center the action grid vertically. */
@media (max-width: 700px) {
  #adminUserList .admin-user-name {
    justify-self: start !important;
    align-self: start !important;
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 26px !important;
    box-sizing: border-box !important;
    padding: 2px 8px !important;
    border: 1px solid #dbe9e2 !important;
    border-radius: 8px !important;
    background: #f7fbf9 !important;
    text-align: left !important;
    line-height: 20px !important;
  }

  #adminUserList .admin-user-actions {
    align-self: center !important;
    top: 0 !important;
  }

  [data-theme="dark"] #adminUserList .admin-user-name {
    border-color: #31505a !important;
    background: #122b32 !important;
  }
}

/* Mobile header safe-area fix: keep the first admin view below iPhone status areas. */
@media (max-width: 560px) {
  .page-head {
    height: calc(68px + env(safe-area-inset-top, 0px)) !important;
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* Desktop dashboard refinements */
.account-card .status-pill {
  font-weight: 700 !important;
}

.account-card .refresh-button {
  border-color: #b9ddd0;
  background: linear-gradient(135deg, #f7fffb 0%, #e8f8f1 100%);
  color: #2c8068;
  box-shadow: 0 2px 6px rgba(38, 128, 101, 0.08);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}

.account-card .refresh-button:hover {
  border-color: #83c4ad;
  background: linear-gradient(135deg, #ffffff 0%, #dff5eb 100%);
  color: #216b56;
  box-shadow: 0 5px 12px rgba(38, 128, 101, 0.15);
  transform: translateY(-1px);
}

.account-card .refresh-button:active {
  background: #d8f0e6;
  box-shadow: 0 2px 5px rgba(38, 128, 101, 0.1);
  transform: translateY(0);
}

@media (min-width: 861px) {
  .account-toolbar {
    position: relative;
  }

  .toolbar-left {
    flex: 1 1 auto;
  }

  .toolbar-left .search-box {
    margin-right: auto;
  }

  .toolbar-left .filter-tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  #accountGrid[data-visible-count="1"] {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 330px);
    margin-inline: auto;
  }

  #accountGrid[data-visible-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 680px);
    margin-inline: auto;
  }

  #accountGrid[data-visible-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 1030px);
    margin-inline: auto;
  }
}

[data-theme="dark"] .account-card .refresh-button {
  border-color: #3c7567;
  background: linear-gradient(135deg, #17362f 0%, #1b443b 100%);
  color: #a9e3d1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .account-card .refresh-button:hover {
  border-color: #5aa88f;
  background: linear-gradient(135deg, #1d473d 0%, #24594c 100%);
  color: #d2f7e9;
}



/* Mobile refresh stability: prevent browser scroll restoration and header reflow. */
@media (max-width: 560px) {
  html,
  body {
    overflow-anchor: none;
  }

  .page-head {
    box-sizing: border-box;
    min-height: 68px;
    height: calc(68px + env(safe-area-inset-top, 0px)) !important;
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: 0 !important;
    padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
    overflow: visible;
  }

  .page-head-inner {
    width: 100% !important;
    max-width: none;
    height: 42px !important;
    min-height: 42px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .dashboard-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
  }

  .dashboard-brand h1 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(17px, 4.8vw, 20px);
  }

  .page-head-actions {
    display: flex !important;
    flex: 0 0 auto;
    width: max-content;
    min-width: max-content;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }

  .page-head-actions > * {
    flex: 0 0 auto !important;
  }

  .page-head-actions :is(.theme-toggle, .header-text-button) {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
  }

  .page-head-actions .logout-button {
    height: 30px !important;
    min-width: 58px;
    padding: 0 7px !important;
  }
}

/* Desktop dashboard follow-up refinements */
@media (min-width: 561px) {
  /* Keep the result action readable while matching the account state. */
  .account-card .refresh-button {
    font-weight: 700;
  }

  .account-card[data-state="normal"] .refresh-button {
    border-color: #b8dfc9;
    background: linear-gradient(135deg, #f4fff8 0%, #e8f8ee 100%);
    color: #2f8a59;
  }

  .account-card[data-state="normal"] .refresh-button:hover {
    border-color: #86c6a0;
    background: linear-gradient(135deg, #ffffff 0%, #ddf4e5 100%);
    color: #236e46;
  }

  .account-card[data-state="banned"] .refresh-button {
    border-color: #e8c0c0;
    background: linear-gradient(135deg, #fff8f8 0%, #ffeded 100%);
    color: #b45353;
  }

  .account-card[data-state="banned"] .refresh-button:hover {
    border-color: #d99494;
    background: linear-gradient(135deg, #ffffff 0%, #ffe2e2 100%);
    color: #963d3d;
  }

  .account-card[data-state="banned"][data-expired="true"] .refresh-button {
    border-color: #e4d0a8;
    background: linear-gradient(135deg, #fffdf6 0%, #fff7e6 100%);
    color: #9a7636;
  }

  .account-card[data-state="unchecked"] .refresh-button {
    border-color: #d8e3df;
    background: #ffffff;
    color: #596a64;
  }

  .account-card[data-state="unknown"] .refresh-button,
  .account-card[data-state="frozen"] .refresh-button,
  .account-card[data-state="face"] .refresh-button {
    border-color: #ead8b4;
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e9 100%);
    color: #92713b;
  }

  .account-card .status-pill {
    margin-right: auto;
    margin-left: auto;
  }

  .batch-detail {
    color: #c94f4f !important;
    font-weight: 600;
  }

  .toolbar-right {
    position: relative;
  }

  /* The account total is represented by the compact badge on 查询全部. */
  .account-count {
    display: none;
  }

  .refresh-all-button {
    position: relative;
    overflow: visible;
  }

  .refresh-all-button::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -6px;
    min-width: 24px;
    height: 16px;
    padding: 0 5px;
    border: 1px solid #cfe5dc;
    border-radius: 9px;
    background: #f1faf6;
    color: #347d66;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
  }

  .refresh-all-button[data-count=""]::after {
    display: none;
  }
}

@media (min-width: 861px) {
  /* Match the toolbar edge to the card grid edge. */
  .account-toolbar {
    width: min(1340px, calc(100% - 48px));
  }

  /* When filtering down, keep the search edge aligned with the centered cards. */
  .account-toolbar[data-visible-count="1"] {
    width: min(100%, 330px);
  }

  .account-toolbar[data-visible-count="2"] {
    width: min(100%, 680px);
  }

  .account-toolbar[data-visible-count="3"] {
    width: min(100%, 1030px);
  }
}

[data-theme="dark"] .batch-detail {
  color: #ff9b9b !important;
}

@media (min-width: 561px) {
  [data-theme="dark"] .refresh-all-button::after {
    border-color: #3e655b;
    background: #1b382f;
    color: #a9e3d1;
  }

  [data-theme="dark"] .account-card[data-state="normal"] .refresh-button {
    border-color: #3c7560;
    background: linear-gradient(135deg, #17382e 0%, #1c4939 100%);
    color: #a9e3c2;
  }

  [data-theme="dark"] .account-card[data-state="banned"] .refresh-button {
    border-color: #75484b;
    background: linear-gradient(135deg, #3d2529 0%, #492d31 100%);
    color: #ffb0b0;
  }

  [data-theme="dark"] .account-card[data-state="banned"][data-expired="true"] .refresh-button {
    border-color: #715c38;
    background: linear-gradient(135deg, #3d3422 0%, #4b3d24 100%);
    color: #f4d38b;
  }

  [data-theme="dark"] .account-card[data-state="unchecked"] .refresh-button {
    border-color: #40515a;
    background: #17232d;
    color: #c3d0d7;
  }

  [data-theme="dark"] .account-card[data-state="unknown"] .refresh-button,
  [data-theme="dark"] .account-card[data-state="frozen"] .refresh-button,
  [data-theme="dark"] .account-card[data-state="face"] .refresh-button {
    border-color: #715c38;
    background: linear-gradient(135deg, #3d3422 0%, #4b3d24 100%);
    color: #f4d38b;
  }
}