:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-alt: #fafbfc;
  --surface: #ffffff;
  --surface-sunken: #f6f8fa;
  --border: #e4e8ee;
  --border-strong: #d0d7de;
  --text: #1a1f2e;
  --text-muted: #5b6573;
  --text-subtle: #8693a4;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --ok: #059669;
  --err: #dc2626;
  --code-bg: #f6f8fa;
  --code-inline-bg: #eef1f4;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);

  --r-sm: 6px;
  --r: 12px;
  --r-lg: 18px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Helvetica Neue', 'Noto Sans TC', 'PingFang TC', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --max-w: 1020px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --bg-alt: #0f141e;
    --surface: #141b28;
    --surface-sunken: #0f141e;
    --border: #232e40;
    --border-strong: #2d3a52;
    --text: #e6edf3;
    --text-muted: #8b98a9;
    --text-subtle: #5e6b7d;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.12);
    --danger: #f87171;
    --danger-hover: #ef4444;
    --ok: #34d399;
    --err: #f87171;
    --code-bg: #0f141e;
    --code-inline-bg: #1a2230;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
  /* Sticky footer: body = column flex so footer sits at viewport bottom on short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
body > footer { flex-shrink: 0; margin-top: auto; }
body > .topnav { flex-shrink: 0; }

/* ========= Top nav (sticky, glass) ========= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.topnav > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topnav .brand {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.topnav .brand:hover { color: var(--accent); }
.topnav .nav-links { display: flex; gap: 2px; }
.topnav .nav-links a {
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color .12s, color .12s;
}
.topnav .nav-links a:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .topnav {
    background: rgba(15, 20, 30, 0.65);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  }
  .topnav .nav-links a:hover { background: rgba(129, 140, 248, 0.15); }
}
@media (max-width: 520px) {
  .topnav { padding: 8px 0; }
  .topnav > .container { gap: 10px; flex-wrap: wrap; justify-content: center; }
  .topnav .brand { font-size: 0.92rem; }
  .topnav .nav-links a { padding: 4px 10px; font-size: 0.85rem; }
}

/* Liquid-glass backdrop: colorful diffuse blobs fixed to viewport.
   Glass surfaces (.window, .cta-card, .feature-card) blur over this layer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%,  rgba(129, 140, 248, 0.35), transparent 70%),
    radial-gradient(55% 45% at 92% 18%, rgba(236, 72, 153, 0.28),  transparent 70%),
    radial-gradient(60% 50% at 82% 88%, rgba(52, 211, 153, 0.25),  transparent 70%),
    radial-gradient(55% 45% at 8% 78%,  rgba(251, 146, 60, 0.22),  transparent 70%);
}

@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(60% 50% at 12% 8%,  rgba(129, 140, 248, 0.30), transparent 70%),
      radial-gradient(55% 45% at 92% 18%, rgba(236, 72, 153, 0.18),  transparent 70%),
      radial-gradient(60% 50% at 82% 88%, rgba(52, 211, 153, 0.14),  transparent 70%),
      radial-gradient(55% 45% at 8% 78%,  rgba(251, 146, 60, 0.14),  transparent 70%);
  }
}

/* Shared glass surface. Using Safari's -webkit- prefix for backdrop-filter. */
.glass {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 14px 40px rgba(15, 23, 42, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.06);
}

@media (prefers-color-scheme: dark) {
  .glass {
    background: rgba(20, 26, 40, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04),
      0 18px 50px rgba(0, 0, 0, 0.55),
      0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ========= Hero ========= */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 80px;
  /* No solid background — body::before blobs show through behind glass panels. */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 4px 12px rgba(15, 23, 42, 0.06);
}
@media (prefers-color-scheme: dark) {
  .badge {
    background: rgba(129, 140, 248, 0.18);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.15;
  margin: 20px 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-title-accent {
  background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.08rem;
  color: var(--text);
  margin: 0 0 28px;
  max-width: 540px;
}
.lead .muted { color: var(--text-muted); font-size: 0.95em; }

.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta .btn { padding: 10px 18px; font-size: 0.92rem; }

/* ========= Buttons ========= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: transform .08s ease, background-color .15s ease,
              border-color .15s ease, box-shadow .2s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.32);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: var(--danger-hover); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* ========= Code window mockup ========= */

.window {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 24px 60px rgba(15, 23, 42, 0.2),
    0 8px 24px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  transform: rotate(1.2deg);
  transition: transform .3s ease;
}
.window:hover { transform: rotate(0); }
@media (prefers-color-scheme: dark) {
  .window {
    background: rgba(20, 26, 40, 0.5);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 0 0 1px rgba(255, 255, 255, 0.05),
      0 30px 80px rgba(0, 0, 0, 0.6),
      0 8px 24px rgba(0, 0, 0, 0.4);
  }
}
.window-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
@media (prefers-color-scheme: dark) {
  .window-chrome {
    background: rgba(15, 20, 30, 0.45);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
}
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.window-title {
  margin-left: 10px;
  font-size: 0.82rem;
  color: var(--text-subtle);
}
.window-body {
  margin: 0;
  padding: 18px 22px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  overflow-x: auto;
  color: var(--text);
  white-space: pre;
  background: rgba(255, 255, 255, 0.25);
}
@media (prefers-color-scheme: dark) {
  .window-body { background: rgba(10, 14, 22, 0.35); }
}
.c-comment { color: var(--text-subtle); font-style: italic; }
.c-keyword { color: #c084fc; }
.c-type    { color: #60a5fa; }
.c-num     { color: #fb923c; }

/* ========= Main sections ========= */

main { padding: 8px 0 64px; }
section { margin-bottom: 72px; }
section:last-child { margin-bottom: 0; }

h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.h2-en { color: var(--text-subtle); font-size: 0.65em; font-weight: 500; }

.section-intro {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 1rem;
  max-width: 640px;
}

/* ========= Feature grid ========= */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.feature-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 14px 32px rgba(15, 23, 42, 0.12);
}
@media (prefers-color-scheme: dark) {
  .feature-card {
    background: rgba(20, 26, 40, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 12px 30px rgba(0, 0, 0, 0.5);
  }
  .feature-card:hover {
    background: rgba(28, 36, 54, 0.6);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 18px 40px rgba(0, 0, 0, 0.55);
  }
}
.feature-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 600;
}
.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ========= Mail frame (sample) ========= */

.mail-frame {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 32px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  margin-top: 24px;
}
@media (prefers-color-scheme: dark) {
  .mail-frame {
    background: rgba(20, 26, 40, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 14px 40px rgba(0, 0, 0, 0.5);
  }
}
.mail-chrome {
  background: rgba(255, 255, 255, 0.35);
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
@media (prefers-color-scheme: dark) {
  .mail-chrome {
    background: rgba(15, 20, 30, 0.45);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
}
.mail-row {
  display: flex;
  gap: 14px;
  font-size: 0.86rem;
  margin: 2px 0;
  align-items: baseline;
}
.mail-label {
  flex: 0 0 60px;
  color: var(--text-subtle);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mail-val {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-word;
}
.mail-body > summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mail-body > summary::marker { content: ""; }
.mail-body > summary::-webkit-details-marker { display: none; }
.mail-body > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s ease;
}
.mail-body[open] > summary::before { transform: rotate(90deg); }
.mail-body[open] > summary { border-bottom: 1px solid var(--border); }

.sample {
  padding: 24px 28px 28px;
  color: var(--text);
}
.sample h3 { margin: 0 0 8px; font-size: 1.2rem; }
.sample h4 { margin: 22px 0 8px; font-size: 0.98rem; font-weight: 600; }
.sample p { margin: 8px 0; }
.sample ul { padding-left: 22px; margin: 8px 0; }
.sample pre {
  background: var(--code-bg);
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.7;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}
.sample code {
  background: var(--code-inline-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}
.sample pre code { background: transparent; padding: 0; }

.difficulty {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(5, 150, 105, 0.14);
  color: #059669;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
@media (prefers-color-scheme: dark) {
  .difficulty { background: rgba(52, 211, 153, 0.16); color: #34d399; }
}

.sample-note {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* ========= Subscribe / unsub CTA card ========= */

.cta-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 18px 50px rgba(15, 23, 42, 0.15),
    0 4px 12px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .cta-card {
    background: rgba(20, 26, 40, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04),
      0 24px 60px rgba(0, 0, 0, 0.55),
      0 6px 16px rgba(0, 0, 0, 0.4);
  }
}
.cta-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6 50%, #ec4899);
}
.cta-card h2 { margin-top: 4px; }

.inline-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.inline-form input[type=email] {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface-sunken);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.inline-form input[type=email]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.inline-form input[type=email]::placeholder { color: var(--text-subtle); }

.form-message {
  margin: 14px 0 0;
  font-size: 0.92rem;
  min-height: 1.2em;
  color: var(--text-muted);
}
.form-message.ok  { color: var(--ok); }
.form-message.err { color: var(--err); }

.fine-print {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 10px 0 0;
}

.unsub-cta {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.unsub-cta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.unsub-cta a:hover { text-decoration: underline; }

/* ========= Footer ========= */

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding: 14px 0;
  margin-top: 40px;
  color: var(--text-subtle);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  text-align: center;
}
footer .footer-row {
  display: flex;
  gap: 8px 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
footer .footer-credit {
  margin-top: 6px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.78rem;
}
footer p { margin: 0; }
footer .sep { color: var(--text-subtle); opacity: 0.5; }
@media (prefers-color-scheme: dark) {
  footer {
    background: rgba(15, 20, 30, 0.35);
    border-top-color: rgba(255, 255, 255, 0.05);
  }
}
footer p { margin: 4px 0; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

code { font-family: var(--font-mono); }

.muted { color: var(--text-muted); }

/* ========= Unsubscribe page ========= */

.hero-sm { padding: 48px 0 40px; }
.h1-sm { font-size: 1.8rem; margin: 12px 0 6px; }
.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.back-link:hover { color: var(--accent); }

/* ========= Status pages (verify / unsub-confirm) ========= */

.status-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 24px 48px;
  text-align: center;
}
.status-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow);
}
.status-icon.ok  { background: linear-gradient(135deg, #10b981, #34d399); }
.status-icon.err { background: linear-gradient(135deg, #ef4444, #f87171); }
.status-page h1 { font-size: 1.6rem; margin: 0 0 16px; }
.status-page > div p { color: var(--text-muted); }
.status-page a { color: var(--accent); }

/* ========= Responsive ========= */

@media (max-width: 880px) {
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 460px; margin: 0 auto; width: 100%; }
  .window { transform: rotate(0); }
  main { padding: 4px 0 48px; }
  section { margin-bottom: 56px; }
  h2 { font-size: 1.4rem; }
  .cta-card { padding: 24px; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 1.85rem; }
  .lead { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .inline-form { flex-direction: column; }
  .inline-form input[type=email] { width: 100%; }
  .inline-form .btn { width: 100%; }
  main { padding: 4px 0 40px; }
  .feature-card { padding: 20px; }
  .cta-card { padding: 22px; }
  .sample { padding: 20px; }
}

/* ========= Archive & Problem page ========= */

.problem-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
  font-size: 0.82rem;
}
.problem-chip-row .date { color: var(--text-muted); }

.kind {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.kind-daily {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}
.kind-ti150 {
  background: rgba(236, 72, 153, 0.15);
  color: #be185d;
}
@media (prefers-color-scheme: dark) {
  .kind-ti150 { color: #f9a8d4; }
}

.difficulty {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.difficulty.diff-easy   { background: rgba(16, 185, 129, 0.14); color: #059669; }
.difficulty.diff-medium { background: rgba(234, 179, 8, 0.18);  color: #a16207; }
.difficulty.diff-hard   { background: rgba(239, 68, 68, 0.14);  color: #b91c1c; }
@media (prefers-color-scheme: dark) {
  .difficulty.diff-easy   { color: #34d399; }
  .difficulty.diff-medium { color: #fde047; }
  .difficulty.diff-hard   { color: #fca5a5; }
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(127, 127, 127, 0.1);
  margin-right: 4px;
}

/* Archive list */
.problem-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.problem-item {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 6px 18px rgba(15, 23, 42, 0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.problem-item:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 10px 24px rgba(15, 23, 42, 0.1);
}
.problem-item a {
  display: grid;
  grid-template-columns: 92px auto auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
}
.problem-item .date { color: var(--text-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.problem-item .id { color: var(--text-subtle); font-family: var(--font-mono); font-size: 0.85rem; }
.problem-item .title { font-weight: 500; }
.problem-item .tags { text-align: right; }
.problem-item.empty, li.empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--r);
  border: 1px dashed var(--border);
  list-style: none;
}
@media (prefers-color-scheme: dark) {
  .problem-item {
    background: rgba(20, 26, 40, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
                0 8px 20px rgba(0, 0, 0, 0.4);
  }
  .problem-item:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
                0 12px 28px rgba(0, 0, 0, 0.5);
  }
  li.empty { background: rgba(20, 26, 40, 0.4); }
}
@media (max-width: 680px) {
  .problem-item a {
    grid-template-columns: 1fr auto;
    row-gap: 6px;
  }
  .problem-item .date { grid-column: 1; }
  .problem-item .kind { grid-column: 2; justify-self: end; }
  .problem-item .id { display: none; }
  .problem-item .title { grid-column: 1 / -1; }
  .problem-item .difficulty { grid-column: 1; }
  .problem-item .tags { grid-column: 2; }
}

/* Problem page */
.problem-page {
  padding: 32px 0 8px;
  max-width: 820px;
  margin: 0 auto;
}
.problem-page h1 {
  font-size: 1.9rem;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.problem-page h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  display: block;
}
.problem-page h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.problem-page h4 { font-size: 0.98rem; margin: 16px 0 6px; font-weight: 600; }
.problem-page p { margin: 10px 0; }
.problem-page ul, .problem-page ol { padding-left: 22px; margin: 8px 0; }
.problem-page pre,
.problem-page .highlight pre {
  background: var(--code-bg);
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.7;
  border: 1px solid var(--border);
}
.problem-page code {
  font-family: var(--font-mono);
  background: var(--code-inline-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.problem-page pre code { background: transparent; padding: 0; }
.problem-page table {
  border-collapse: collapse;
  margin: 12px 0;
}
.problem-page th, .problem-page td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.problem-footer {
  max-width: 820px;
  margin: 40px auto 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.problem-footer a { color: var(--accent); }
