:root {
  --bg: #f3f4f6;
  --bg-2: #eceef2;
  --text: #1d1d1f;
  --strong: #111114;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.09);
  --line-soft: rgba(15, 23, 42, 0.06);
  --surface: rgba(255, 255, 255, 0.62);
  --surface-strong: rgba(255, 255, 255, 0.8);
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
  --blue: #0a84ff;
  --blue-2: #0071e3;
  --green: #30d158;
  --red: #ff453a;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --bg-image-opacity: 0.5;
  --panel-opacity: 0.6;
}

[data-theme="dark"] {
  --bg: #0a0a0d;
  --bg-2: #111318;
  --text: #f5f5f7;
  --strong: #ffffff;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.09);
  --surface: rgba(20, 22, 28, 0.6);
  --surface-strong: rgba(29, 32, 40, 0.78);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.page-bg {
  position: fixed;
  inset: 0;
  background: url("./bg.png") center center / contain no-repeat;
  opacity: var(--bg-image-opacity);
  filter: saturate(1.02) brightness(1.02);
  transform: none;
  z-index: -3;
  pointer-events: none;
}

.page-mask {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1400px 500px at 50% -10%, rgba(255, 255, 255, 0.58), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(243, 244, 246, 0.76));
  z-index: -2;
}

[data-theme="dark"] .page-mask {
  background:
    radial-gradient(1400px 520px at 50% -10%, rgba(10, 132, 255, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(10, 10, 13, 0.5), rgba(10, 10, 13, 0.82));
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 10;
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, var(--panel-opacity));
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .site-header {
  background: rgba(25, 27, 34, var(--panel-opacity));
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--strong);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  height: 36px;
  transform: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(10, 132, 255, 0.22);
  display: block;
}

.nav-links {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  height: 36px;
  transform: none;
}

.nav-link {
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--strong);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.2s ease, opacity 0.2s ease;
  justify-content: center;
  transform: none;
}

.nav-link:hover {
  color: var(--strong);
  opacity: 0.92;
}

.nav-link img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  transform: none;
}

.header-actions {
  justify-self: end;
  display: inline-flex;
  gap: 8px;
}

.round-btn {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: pointer;
  font-weight: 700;
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: clamp(30px, 7vw, 72px) auto 42px;
}

.glass-card {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, var(--panel-opacity));
  backdrop-filter: blur(30px) saturate(1.1);
  -webkit-backdrop-filter: blur(30px) saturate(1.1);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .glass-card {
  background: rgba(20, 22, 28, var(--panel-opacity));
}

.tool-head {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 22px;
}

.tool-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 24px;
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.16), rgba(10, 132, 255, 0.08));
  border: 1px solid var(--line-soft);
}

.headline {
  margin: 0;
  color: var(--strong);
  font-size: clamp(24px, 4.2vw, 36px);
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

form { display: grid; gap: 12px; }

.email-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  color: var(--strong);
  background: var(--surface-strong);
  font: 600 16px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

input:focus {
  border-color: rgba(10, 132, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.14);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

button { font-family: inherit; }

.primary-btn,
.secondary-btn,
.mini-btn,
.code-display,
.round-btn {
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.primary-btn:active,
.secondary-btn:active,
.mini-btn:active,
.code-display:active,
.round-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.primary-btn {
  flex: 1;
  min-height: 52px;
  border: 0;
  padding: 0 22px;
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.28);
}

.secondary-btn,
.mini-btn {
  min-height: 52px;
  border: 1px solid var(--line);
  padding: 0 20px;
  color: var(--strong);
  background: var(--surface-strong);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
}

.mini-btn { min-width: 84px; }

.result-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid rgba(48, 209, 88, 0.3);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(48, 209, 88, 0.14), transparent 48%),
    rgba(48, 209, 88, 0.08);
  text-align: center;
}

.result-card[hidden],
.status[hidden] { display: none; }

.result-kicker {
  margin: 0 0 12px;
  color: #1d9e4a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.code-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font: 800 clamp(40px, 8vw, 60px)/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
}

.copy-tip {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.timer-row {
  max-width: 320px;
  margin: 0 auto 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.timer-row strong {
  color: var(--green);
  font: 800 15px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.progress {
  max-width: 320px;
  height: 8px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--line-soft);
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #30d158, #34c759);
  transition: width 0.25s ease;
}

.email-preview {
  margin: 14px 0 0;
  color: var(--muted);
  font: 600 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--strong);
  background: rgba(10, 132, 255, 0.12);
  font-size: 14px;
  line-height: 1.55;
}

.status.ok { background: rgba(48, 209, 88, 0.14); }

.status.error {
  color: var(--red);
  background: rgba(255, 69, 58, 0.14);
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr auto;
    border-radius: 26px;
  }

  .nav-links {
    grid-column: 1 / -1;
    width: 100%;
  }

  .nav-link { flex: 1; }
}

@media (max-width: 560px) {
  .site-header { width: min(100% - 20px, 1120px); }
  .shell { width: min(100% - 20px, 760px); margin-top: 22px; }
  .glass-card { border-radius: 24px; }
  .brand span { display: none; }
  .email-box { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .secondary-btn, .mini-btn { width: 100%; }
}
