:root {
  --bg: #f4efe7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #fffdfa;
  --surface-dark: #182843;
  --surface-dark-soft: rgba(24, 40, 67, 0.9);
  --line: rgba(21, 33, 59, 0.12);
  --ink: #15213b;
  --muted: #63708c;
  --accent: #20395f;
  --accent-soft: #eadcc8;
  --highlight: #d2a56a;
  --success: #5b8a70;
  --danger: #a85656;
  --shadow: 0 18px 50px rgba(18, 32, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(210, 165, 106, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(32, 57, 95, 0.12), transparent 24%),
    linear-gradient(180deg, #faf6f0 0%, var(--bg) 55%, #efe6db 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Manrope", "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

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

button,
input,
select {
  font: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", "IBM Plex Mono", monospace;
}

.site-shell {
  filter: blur(0);
  transition: filter 0.25s ease;
}

body.is-locked .site-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(255, 253, 250, 0.78);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 44px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  font-weight: 700;
}

.brand__mark {
  align-items: center;
  background: linear-gradient(145deg, #ff9b7d, #d35a52);
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand__text {
  font-size: 19px;
  letter-spacing: 0.01em;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

.nav a,
.nav__action {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav__action {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.section {
  margin: 0 auto;
  max-width: 1240px;
  padding: 88px clamp(18px, 4vw, 44px);
}

.section--demo,
.section--auth,
.section--dashboard {
  padding-top: 42px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: calc(100vh - 110px);
}

.eyebrow {
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.section__heading h2,
.section--split h2 {
  font-size: clamp(42px, 7vw, 72px);
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 14px 0 18px;
  max-width: 12ch;
}

.section__heading h2,
.section--split h2 {
  font-size: clamp(30px, 4.6vw, 48px);
  max-width: 14ch;
}

.hero p,
.section__heading p,
.copy-stack p,
.dashboard-copy {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
  max-width: 62ch;
}

.hero__actions,
.settings-actions,
.training-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero__meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero__meta span,
.pill {
  background: rgba(32, 57, 95, 0.08);
  border: 1px solid rgba(32, 57, 95, 0.08);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 8px 12px;
}

.pill--soft {
  background: rgba(210, 165, 106, 0.12);
}

.pill--danger {
  background: rgba(168, 86, 86, 0.12);
  color: var(--danger);
}

.button {
  align-items: center;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, #20395f, #32527f);
  border: 1px solid transparent;
  box-shadow: 0 12px 26px rgba(32, 57, 95, 0.18);
  color: #fff;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(21, 33, 59, 0.12);
  color: var(--ink);
}

.button--danger {
  background: linear-gradient(135deg, #a85656, #884848);
  border: 1px solid transparent;
  color: #fff;
}

.button--full {
  width: 100%;
}

.hero__panel,
.demo-shot,
.dashboard-card,
.resource-card,
.story-card,
.feature-card,
.info-card,
.auth-layout,
.vocabulary-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.browser-card {
  background: var(--surface-strong);
  border-radius: 28px;
  overflow: hidden;
}

.browser-card__bar {
  background: rgba(21, 33, 59, 0.06);
  display: flex;
  gap: 8px;
  padding: 16px 18px;
}

.browser-card__bar span {
  background: rgba(21, 33, 59, 0.16);
  border-radius: 999px;
  display: block;
  height: 10px;
  width: 10px;
}

.browser-card__content {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 280px;
  padding: 20px;
}

.browser-card__article {
  background: linear-gradient(180deg, #fffdf8, #f8f1e8);
  border: 1px solid rgba(21, 33, 59, 0.08);
  border-radius: 24px;
  min-height: 340px;
  padding: 24px;
}

.tag {
  background: rgba(210, 165, 106, 0.16);
  border-radius: 999px;
  color: #8a6035;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 7px 10px;
  text-transform: uppercase;
}

.browser-card__article h2 {
  font-size: 34px;
  line-height: 1.1;
  margin: 20px 0 12px;
}

.browser-card__lines {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.line {
  border-radius: 999px;
  display: block;
  height: 15px;
}

.line--red {
  background: rgba(90, 57, 66, 0.84);
  width: 92%;
}

.line--amber {
  background: rgba(107, 86, 64, 0.8);
  width: 76%;
}

.line--green {
  background: rgba(70, 101, 78, 0.8);
  width: 84%;
}

.line--blue {
  background: rgba(64, 91, 115, 0.82);
  width: 68%;
}

.browser-card__panel {
  background: linear-gradient(180deg, rgba(24, 40, 67, 0.96), rgba(24, 40, 67, 0.92));
  border-radius: 24px;
  color: #f6f7fb;
  padding: 18px;
}

.panel-mini__metric {
  font-size: 28px;
  font-weight: 700;
  margin-top: 12px;
}

.panel-mini__meter {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  height: 12px;
  margin-top: 16px;
  overflow: hidden;
}

.panel-mini__meter span {
  background: linear-gradient(90deg, #bb6b74, #6f9d7a);
  display: block;
  height: 100%;
  width: 82%;
}

.panel-mini__list {
  color: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 18px;
}

.section__heading {
  margin-bottom: 28px;
}

.demo-grid,
.section--split,
.auth-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.demo-shot,
.auth-layout {
  padding: 18px;
}

.demo-shot__screen {
  align-items: center;
  background: linear-gradient(135deg, #162744, #27406a);
  border-radius: 22px;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  justify-content: center;
  min-height: 360px;
  padding: 24px;
}

.demo-shot__placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.38);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
}

.demo-copy,
.resource-list,
.story-grid,
.feature-grid,
.dashboard-grid,
.metric-grid,
.profile-meta,
.progress-stack,
.vocabulary-list {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.story-card,
.info-card,
.resource-card,
.dashboard-card,
.vocabulary-panel {
  padding: 22px;
}

.feature-card__icon {
  align-items: center;
  background: rgba(32, 57, 95, 0.1);
  border-radius: 14px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: 0.08em;
  width: 42px;
}

.feature-card h3,
.story-card h3,
.info-card h3,
.resource-card h3,
.dashboard-card h3 {
  font-size: 20px;
  margin: 16px 0 10px;
}

.feature-card p,
.story-card p,
.info-card p,
.resource-card p,
.dashboard-copy,
.form-status,
label span,
.training-card__pinyin,
.training-card__meaning,
.profile-handle {
  color: var(--muted);
  line-height: 1.6;
}

.story-card__badge {
  background: rgba(32, 57, 95, 0.08);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
}

.auth-layout {
  grid-template-columns: 180px 1fr;
}

.auth-rail {
  display: grid;
  gap: 10px;
}

.auth-switch {
  background: rgba(32, 57, 95, 0.06);
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 52px;
}

.auth-switch.is-active {
  background: linear-gradient(135deg, #20395f, #32527f);
  color: #fff;
}

.auth-panels {
  min-height: 100%;
  position: relative;
}

.auth-panel {
  display: none;
  gap: 14px;
}

.auth-panel.is-active {
  display: grid;
}

.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

input,
select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(21, 33, 59, 0.12);
  border-radius: 16px;
  color: var(--ink);
  min-height: 50px;
  padding: 0 16px;
}

input:focus,
select:focus {
  border-color: rgba(32, 57, 95, 0.4);
  box-shadow: 0 0 0 4px rgba(32, 57, 95, 0.08);
  outline: none;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-card--admin,
.dashboard-card--danger,
.vocabulary-panel {
  grid-column: 1 / -1;
}

.profile-card__header,
.card-title-row,
.profile-meta div,
.metric {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.profile-card__header {
  justify-content: flex-start;
  margin-bottom: 22px;
}

.profile-avatar {
  align-items: center;
  background: linear-gradient(145deg, #996ae2, #7d57ca);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 26px;
  font-weight: 700;
  height: 74px;
  justify-content: center;
  overflow: hidden;
  width: 74px;
}

.profile-avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.profile-name {
  font-size: 28px;
  font-weight: 700;
}

.profile-meta {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.profile-meta strong,
.metric strong {
  font-size: 22px;
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0;
}

.metric {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(21, 33, 59, 0.08);
  border-radius: 18px;
  flex-direction: column;
  justify-content: center;
  min-height: 124px;
  padding: 18px;
}

.progress-stack {
  gap: 12px;
}

.progress-row {
  display: grid;
  gap: 10px;
}

.progress-row__top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}

.progress-row__bar {
  background: rgba(32, 57, 95, 0.08);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-row__bar span {
  background: linear-gradient(90deg, #20395f, #d2a56a);
  display: block;
  height: 100%;
}

.training-card {
  background: linear-gradient(180deg, rgba(32, 57, 95, 0.08), rgba(32, 57, 95, 0.02));
  border: 1px solid rgba(21, 33, 59, 0.1);
  border-radius: 22px;
  min-height: 180px;
  padding: 20px;
}

.training-card__term {
  font-size: 36px;
  font-weight: 700;
}

.training-card__pinyin {
  font-size: 18px;
  margin-top: 8px;
}

.training-card__meaning {
  margin-top: 14px;
}

.sync-snippet {
  background: #11213a;
  border-radius: 18px;
  color: #dfe8f5;
  margin: 18px 0 0;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  padding: 14px 10px;
  text-align: left;
}

.vocabulary-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.vocab-chip {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(21, 33, 59, 0.08);
  border-radius: 18px;
  padding: 16px;
}

.vocab-chip strong {
  display: block;
  font-size: 24px;
  margin-bottom: 6px;
}

.gate {
  align-items: center;
  background: rgba(17, 28, 47, 0.36);
  backdrop-filter: blur(10px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 40;
}

body.is-locked .gate {
  display: flex;
}

body:not(.is-locked) .gate {
  display: none;
}

.gate__card {
  background: rgba(255, 253, 250, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(18, 32, 58, 0.18);
  max-width: 460px;
  padding: 30px;
  width: 100%;
}

.gate__card h2 {
  font-size: 32px;
  line-height: 1.08;
  margin: 14px 0 12px;
}

.toast {
  background: var(--surface-dark-soft);
  border-radius: 999px;
  bottom: 22px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  left: 50%;
  padding: 12px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 60;
}

@media (max-width: 1100px) {
  .hero,
  .demo-grid,
  .section--split,
  .auth-layout,
  .browser-card__content {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-grid,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-rail {
    grid-auto-flow: column;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .nav,
  .hero__actions,
  .hero__meta,
  .training-actions,
  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    gap: 10px;
  }

  .feature-grid,
  .story-grid,
  .dashboard-grid,
  .metric-grid,
  .vocabulary-list {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 72px 18px;
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .hero h1,
  .section__heading h2,
  .section--split h2 {
    max-width: none;
  }

  .browser-card__panel {
    order: -1;
  }
}
