:root {
  color-scheme: dark;
  --bg: #080807;
  --bg-soft: #11100d;
  --panel: rgba(246, 238, 219, 0.055);
  --panel-strong: rgba(246, 238, 219, 0.092);
  --ink: #f6eedb;
  --muted: #b8ac96;
  --dim: #756d5f;
  --line: rgba(246, 238, 219, 0.17);
  --gold: #d8b767;
  --gold-soft: rgba(216, 183, 103, 0.18);
  --blue: #9db7ff;
  --green: #92d9bd;
  --rose: #e4a6a6;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Serif SC", "Songti SC", serif;
  line-height: 1.78;
  background:
    radial-gradient(circle at 50% -12%, rgba(216, 183, 103, 0.2), transparent 34rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #12100d 0%, #080807 42%, #0e0d0b 100%);
  background-size: auto, 42px 42px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 17%, rgba(216, 183, 103, 0.09) 17% 17.25%, transparent 17.25% 82%, rgba(216, 183, 103, 0.08) 82% 82.25%, transparent 82.25%),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.07), transparent 18rem);
  opacity: 0.86;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: 26px 16px 106px;
}

.topbar {
  display: block;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 10em;
  font-size: clamp(28px, 8.4vw, 68px);
  font-weight: 500;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(24px, 7vw, 44px);
  font-weight: 500;
}

h3 {
  font-size: 17px;
  font-weight: 700;
}

p {
  margin: 9px 0 0;
}

.status-pill,
.route-badge,
.mini-pill {
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(246, 238, 219, 0.07);
  color: var(--green);
  padding: 7px 11px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  margin-top: 14px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: riseIn 420ms ease both;
}

.lesson-hero,
.section-heading {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(246, 238, 219, 0.16), rgba(246, 238, 219, 0.052)),
    var(--panel);
  box-shadow: var(--shadow);
}

.lesson-hero::before,
.section-heading::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.74;
}

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

.term-word {
  margin: 12px 0 2px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 18vw, 148px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(216, 183, 103, 0.18);
}

.soft-text {
  max-width: 68ch;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.lesson-reader {
  display: grid;
  gap: 12px;
}

.lesson-block,
.route-card,
.archive-item,
.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(246, 238, 219, 0.105), rgba(246, 238, 219, 0.045)),
    var(--panel);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
  padding: 18px;
}

.lesson-block::after,
.route-card::after,
.archive-item::after,
.profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lesson-block h3,
.profile-card h3,
.archive-item h3,
.route-card h3 {
  color: var(--gold);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lesson-block p,
.lesson-block li,
.profile-card li,
.route-card p,
.archive-item p {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.lesson-block ul,
.lesson-block ol,
.profile-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.lesson-block li + li,
.profile-card li + li {
  margin-top: 7px;
}

.quiz-block {
  border-color: rgba(216, 183, 103, 0.34);
}

.quiz-block.before {
  background:
    linear-gradient(180deg, rgba(216, 183, 103, 0.13), rgba(246, 238, 219, 0.04)),
    var(--panel);
}

.quiz-block.after {
  border-color: rgba(146, 217, 189, 0.34);
  background:
    linear-gradient(180deg, rgba(146, 217, 189, 0.12), rgba(246, 238, 219, 0.04)),
    var(--panel);
}

.prompt-box {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(157, 183, 255, 0.34);
  border-radius: 8px;
  background: rgba(157, 183, 255, 0.09);
  color: #dce6ff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
}

.route-list,
.archive-list,
.profile-grid {
  display: grid;
  gap: 12px;
}

.route-card {
  border-left: 1px solid var(--line);
}

.route-card::before,
.archive-item::before,
.profile-card::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  right: 18px;
  top: 18px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 22px var(--gold);
}

.route-card:nth-child(2)::before {
  background: var(--blue);
  box-shadow: 0 0 22px var(--blue);
}

.route-card:nth-child(3)::before {
  background: var(--green);
  box-shadow: 0 0 22px var(--green);
}

.archive-item {
  display: grid;
  gap: 8px;
}

.archive-meta {
  color: var(--muted);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

.empty {
  color: var(--dim);
  font-style: normal;
}

.bottom-nav {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(246, 238, 219, 0.16);
  border-radius: 8px;
  background: rgba(12, 11, 9, 0.84);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

.nav-button {
  min-height: 44px;
  min-width: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-button.is-active {
  background: var(--gold);
  color: #16130d;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding: 40px 22px 118px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .status-pill {
    justify-self: end;
    margin-top: 0;
  }

  .lesson-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 30px;
  }

  .lesson-reader,
  .route-list,
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-block:first-child,
  .lesson-block:nth-child(3),
  .profile-card:last-child {
    grid-column: 1 / -1;
  }
}
