:root {
  --bg: #08070f;
  --bg-card: #11101c;
  --bg-card-hover: #16132a;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --text: #e2e0e7;
  --text-dim: #908ca0;
  --border: #1e1938;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 16px;
  --max-w: 960px;
  --glow-rgba: 124, 58, 237;
  --header-bg: rgba(8, 7, 15, 0.9);
}

body.light {
  --bg: #f8f7fc;
  --bg-card: #fff;
  --bg-card-hover: #f3f0fa;
  --accent: #7c3aed;
  --accent-light: #8b5cf6;
  --text: #1e1b2e;
  --text-dim: #6d6880;
  --border: #e8e4f0;
  --glow-rgba: 124, 58, 237;
  --header-bg: rgba(248, 247, 252, 0.92);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--glow-rgba), 0.1), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(var(--glow-rgba), 0.06), transparent 50%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 42px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.logo {
  color: var(--accent-light);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-light), #c4b5fd, var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a,
footer a {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover,
footer a:hover {
  color: var(--accent-light);
}

.lang-switch {
  padding: 5px 11px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.lang-switch:hover {
  color: var(--accent-light);
  border-color: var(--accent);
}

main {
  width: min(var(--max-w), calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 20px;
}

main > section {
  margin-bottom: 72px;
  scroll-margin-top: 100px;
}

main > .section-title:first-child {
  margin-bottom: 28px;
  font-size: clamp(30px, 5vw, 46px);
}

.section-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  letter-spacing: -0.5px;
}

.section-sub {
  max-width: 720px;
  margin: 0 auto 30px;
  color: var(--text-dim);
  font-size: 15px;
  text-align: center;
}

.card {
  padding: 30px 34px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.card.glow {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 45px rgba(var(--glow-rgba), 0.12);
}

.card-header {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.hero-title {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.3;
  text-align: center;
}

.hero-sub {
  max-width: 680px;
  margin: 0 auto 18px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 auto 24px;
}

.hero-point {
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#blog-posts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card {
  display: block;
  min-width: 0;
  padding: 24px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(124, 58, 237, 0.55);
  transform: translateY(-3px);
}

.feature-card h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.75;
}

.feature-icon {
  margin-bottom: 12px;
  font-size: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s, background 0.18s, border-color 0.18s;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-purple {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
}

.btn-outline {
  color: var(--accent-light);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
}

.hero-email-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.hero-email-text {
  min-width: 0;
  flex: 1;
  padding: 0 8px;
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-q {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 4px;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

.faq-a {
  display: none;
  padding: 0 4px 20px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.8;
}

.faq-item.open .faq-a {
  display: block;
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.mail-item {
  padding: 12px;
  margin-bottom: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

.mail-item:hover,
.mail-item.selected {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.mail-item .from {
  color: var(--text);
  font-weight: 650;
}

.mail-item .subject,
.mail-item .time,
.mail-detail .meta {
  color: var(--text-dim);
}

.mail-detail .subject-line {
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 750;
}

.mail-detail .meta {
  padding-bottom: 15px;
  margin-bottom: 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.mail-detail .body {
  padding: 18px;
  color: var(--text);
  background: #fff;
  border-radius: 10px;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.empty-state,
.loading {
  padding: 34px 15px;
  color: var(--text-dim);
  text-align: center;
}

.empty-state .icon {
  margin-bottom: 8px;
  font-size: 36px;
}

.spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  vertical-align: -3px;
  border: 2px solid rgba(167, 139, 250, 0.25);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 2, 10, 0.72);
  backdrop-filter: blur(5px);
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  position: relative;
  width: min(440px, 100%);
  max-height: 90vh;
  padding: 28px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-close {
  position: absolute;
  top: 9px;
  right: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  font-size: 26px;
  cursor: pointer;
}

.modal-box input,
.modal-box textarea {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.modal-box input:focus,
.modal-box textarea:focus {
  border-color: var(--accent);
}

.avatar-wrap {
  position: relative;
}

.avatar-circle {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.avatar-dropdown {
  position: absolute;
  top: 43px;
  right: 0;
  z-index: 150;
  display: none;
  min-width: 190px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.avatar-dropdown.show {
  display: block;
}

.avatar-dropdown a,
.avatar-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.avatar-dropdown a:hover,
.avatar-dropdown button:hover {
  background: var(--bg-card-hover);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 500;
  max-width: min(380px, calc(100% - 44px));
  padding: 12px 17px;
  color: #fff;
  background: var(--success);
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.toast.error {
  background: var(--danger);
}

.animate {
  animation: fade-up 0.28s ease both;
}

footer {
  padding: 34px 16px;
  margin-top: 50px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

@keyframes fade-up {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 780px) {
  header {
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 13px 14px;
  }

  .logo {
    font-size: 23px;
  }

  nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 16px;
    overflow-x: auto;
  }

  nav a {
    font-size: 13px;
    white-space: nowrap;
  }

  main {
    width: min(100% - 24px, var(--max-w));
    padding-top: 28px;
  }

  main > section {
    margin-bottom: 52px;
  }

  .section-title,
  main > .section-title:first-child {
    font-size: 25px;
  }

  .feature-grid,
  #blog-posts-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 23px 18px;
  }

  .hero-email-bar {
    flex-wrap: wrap;
  }

  .hero-email-text {
    width: 100%;
    flex-basis: 100%;
  }
}
