* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0b1728;
  --panel: rgba(10, 19, 34, 0.78);
  --panel-border: rgba(148, 163, 184, 0.14);
  --text-main: #e5eefc;
  --text-sub: #98a8c3;
  --accent: #5eead4;
  --accent-strong: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.35);
  --error: #f87171;
  --success: #34d399;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(94, 234, 212, 0.12), transparent 28%),
    linear-gradient(180deg, #050b16 0%, #091321 48%, #07111f 100%);
  color: var(--text-main);
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 92%);
}

.container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 28px 30px;
  backdrop-filter: blur(12px);
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--accent-glow);
  color: var(--accent);
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
}

.desc {
  color: var(--text-sub);
  line-height: 1.7;
  margin: 0;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 720px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

label input:focus {
  border-color: var(--accent-strong);
}

label input::placeholder {
  color: rgba(152, 168, 195, 0.4);
}

.input-hint {
  font-size: 12px;
  margin-top: -12px;
  margin-bottom: 16px;
  min-height: 18px;
}

.input-hint.error {
  color: var(--error);
}

.input-hint.ok {
  color: var(--success);
}

#submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), #1d4ed8);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
  position: relative;
}

#submit-btn:hover {
  opacity: 0.9;
}

#submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-loading {
  display: none;
}

#submit-btn.is-loading .btn-text {
  visibility: hidden;
}

#submit-btn.is-loading .btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

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

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--panel-border);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list code {
  background: rgba(94, 234, 212, 0.12);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.recent-panel {
  margin-top: 0;
}

.recent-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.muted {
  color: var(--text-sub);
  font-size: 13px;
  margin: 4px 0 0;
}

.recent-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.mail-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px 18px;
}

.mail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mail-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
}

.date-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
}

.subject-text {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.code-display {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 22px;
  font-weight: 700;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  letter-spacing: 4px;
  text-align: center;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.06);
  border: 1px dashed rgba(94, 234, 212, 0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.code-display:hover {
  background: rgba(94, 234, 212, 0.12);
  border-color: rgba(94, 234, 212, 0.5);
}

.copy-status {
  text-align: center;
  font-size: 12px;
  color: var(--success);
  min-height: 18px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-status.show {
  opacity: 1;
}
