:root {
  --bg: #070a12;
  --panel: rgba(10, 13, 25, 0.82);
  --panel-strong: rgba(15, 19, 34, 0.94);
  --line: rgba(122, 139, 181, 0.18);
  --line-strong: rgba(125, 151, 255, 0.34);
  --text: #eef4ff;
  --muted: #8f9bb7;
  --muted-strong: #b4bfd7;
  --primary: #5b7cff;
  --primary-2: #30c7f2;
  --success: #36d399;
  --danger: #ff6b7a;
  --warning: #f5b85b;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(83, 40, 143, 0.28), transparent 24%),
    linear-gradient(140deg, rgba(0, 171, 190, 0.18), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(118, 132, 173, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 132, 173, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
  content: "";
}

body::after {
  position: fixed;
  inset: auto -12vw -32vh auto;
  z-index: -1;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(48, 199, 242, 0.18), transparent 62%);
  content: "";
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 52px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: clamp(42px, 8vw, 78px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #8fb7ff;
  font-weight: 800;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(120, 143, 255, 0.36);
  border-radius: 9px;
  background: rgba(87, 113, 255, 0.16);
  color: #58d8ff;
  box-shadow: 0 0 30px rgba(91, 124, 255, 0.24);
}

.nav-link {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
}

.hero {
  width: min(760px, 100%);
  margin: 0 auto 24px;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(16, 20, 36, 0.78);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px var(--success);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 20px;
  font-size: clamp(32px, 5.8vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

h1 span {
  color: #6f83ff;
  text-shadow: 0 0 26px rgba(91, 124, 255, 0.34);
}

.hero p,
.admin-header p,
.auth-panel p {
  width: min(680px, 100%);
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.tool-card,
.admin-panel,
.account-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tool-card {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.field,
.admin-form label,
.select-wrap {
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(5, 8, 16, 0.68);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(65, 199, 242, 0.72);
  background: rgba(6, 10, 20, 0.9);
  box-shadow: 0 0 0 3px rgba(65, 199, 242, 0.12);
}

textarea {
  min-height: 138px;
  padding: 16px;
  resize: vertical;
  line-height: 1.65;
}

input,
select {
  min-height: 42px;
  padding: 0 13px;
}

select:disabled {
  opacity: 1;
}

.control-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.7fr;
  gap: 12px;
  margin-top: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.copy-btn,
.danger-btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 18px;
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 34px rgba(48, 126, 255, 0.32);
}

.secondary-btn {
  border-color: rgba(120, 143, 255, 0.24);
  background: rgba(91, 124, 255, 0.12);
}

.ghost-btn,
.copy-btn {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.danger-btn {
  border-color: rgba(255, 107, 122, 0.32);
  background: rgba(255, 107, 122, 0.12);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.copy-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.status-bar {
  position: relative;
  height: 18px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(48, 199, 242, 0.42);
  border-radius: 999px;
  background: rgba(0, 187, 212, 0.08);
}

.status-bar span {
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f83ff, #30c7f2);
  transition: width 0.25s ease;
}

.status-bar span.loading {
  width: calc(100% - 6px);
  animation: pulseBar 1.4s ease-in-out infinite alternate;
}

@keyframes pulseBar {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.usage-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 0;
  color: var(--muted);
  font-weight: 800;
}

.usage-hint span {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.results {
  display: grid;
  gap: 16px;
  width: min(920px, 100%);
  margin: 28px auto 0;
}

.account-card {
  overflow: hidden;
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.account-title {
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.account-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  flex: 0 0 auto;
  min-height: 27px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 900;
}

.badge.success {
  background: rgba(54, 211, 153, 0.12);
  color: var(--success);
}

.badge.failed {
  background: rgba(255, 107, 122, 0.12);
  color: var(--danger);
}

.account-body {
  padding: 4px 20px 20px;
}

.empty,
.error-box {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.center-empty {
  text-align: center;
}

.error-box {
  color: var(--danger);
}

.mail-item {
  padding: 18px 0;
  border-top: 1px solid rgba(122, 139, 181, 0.13);
}

.mail-item:first-child {
  border-top: 0;
}

.code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  max-width: 100%;
  border: 1px solid rgba(54, 211, 153, 0.34);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(54, 211, 153, 0.12);
  color: #7fffd1;
  font-size: 26px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.mail-subject {
  margin: 0 0 8px;
  color: #f7faff;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.snippet {
  color: var(--muted-strong);
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.mail-actions {
  margin-top: 12px;
}

.copy-btn,
.compact-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
}

.auth-panel {
  width: min(540px, 100%);
  margin: 6vh auto 0;
}

.admin-panel {
  padding: 22px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-stats article {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(91, 124, 255, 0.14), rgba(48, 199, 242, 0.05)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.admin-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-stats strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 36px;
  line-height: 1;
}

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

.admin-header h1,
.auth-panel h1 {
  font-size: clamp(30px, 5vw, 48px);
}

.admin-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-grid {
  grid-template-columns: 1fr 1fr 150px auto;
  align-items: end;
}

.switch-row {
  display: flex !important;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 8, 16, 0.68);
}

.switch-row input {
  width: 18px;
  min-height: 18px;
}

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

.list-head h2 {
  font-size: 20px;
}

.list-head p {
  margin-top: 5px;
  color: var(--muted);
}

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

.email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.email-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.email-main strong {
  overflow-wrap: anywhere;
}

.email-main span,
.email-main small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 800px) {
  .site-shell,
  .admin-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 16px;
  }

  .nav {
    margin-bottom: 42px;
  }

  .hero {
    text-align: left;
  }

  .hero-kicker {
    font-size: 12px;
  }

  .hero p,
  .admin-header p,
  .auth-panel p {
    margin-left: 0;
    margin-right: 0;
  }

  .control-grid,
  .admin-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .actions > button,
  .admin-grid > button {
    width: 100%;
  }

  .admin-header,
  .account-head,
  .list-head,
  .email-row {
    display: grid;
    justify-items: start;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .tool-card,
  .admin-panel {
    padding: 16px;
  }

  textarea {
    min-height: 156px;
  }
}

@media (max-width: 430px) {
  .site-shell,
  .admin-shell {
    width: min(100% - 14px, 1120px);
    padding-bottom: 30px;
  }

  .nav {
    align-items: flex-start;
  }

  h1 {
    font-size: 30px;
  }

  .tool-card,
  .admin-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }

  .code-row {
    align-items: stretch;
  }

  .code-pill,
  .code-row .copy-btn,
  .mail-actions .copy-btn {
    width: 100%;
  }
}
