:root {
  --bg: #f7f8fb;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #181b22;
  --muted: #747b8b;
  --line: rgba(30, 35, 48, 0.08);
  --accent: #6977ff;
  --accent-soft: rgba(105, 119, 255, 0.11);
  --success: #0f9f7a;
  --danger: #d95757;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --nav-h: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(105, 119, 255, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(15, 159, 122, 0.08), transparent 26%),
    var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(560px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 22px);
}

.screen {
  display: none;
  animation: softIn 180ms ease-out;
}

.screen-active {
  display: block;
}

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

.splash-screen {
  min-height: calc(100vh - 36px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 36px 22px;
}

.splash-screen.screen-active {
  display: flex;
}

.brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  background: linear-gradient(145deg, #ffffff, #edf0ff);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 36px;
  letter-spacing: -0.06em;
}

h2 {
  font-size: 24px;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h3 {
  font-size: 15px;
  letter-spacing: -0.01em;
}

p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.splash-screen p {
  max-width: 260px;
  margin: 8px 0 22px;
}

.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 999px;
  min-height: 46px;
  padding: 0 20px;
  font-weight: 700;
  transition: transform 130ms ease, opacity 130ms ease;
}

.primary-btn:active, .secondary-btn:active, .ghost-btn:active, .lesson-card:active, .chip:active {
  transform: scale(0.98);
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--accent), #8d98ff);
  box-shadow: 0 14px 25px rgba(105, 119, 255, 0.22);
}

.secondary-btn {
  color: var(--accent);
  background: var(--accent-soft);
}

.ghost-btn {
  color: var(--text);
  background: #f1f3f8;
}

.topbar, .simple-header {
  padding: 12px 2px 16px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

.simple-header p {
  margin-top: 7px;
}

.mini-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--card-solid);
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.06);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-radius: 20px;
  padding: 0 15px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(31, 41, 55, 0.06);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-box input::placeholder {
  color: #a2a8b6;
}

.sticky-search {
  position: sticky;
  top: 10px;
  z-index: 4;
}

.section-block {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.text-btn {
  color: var(--accent);
  background: transparent;
  font-weight: 700;
  font-size: 12px;
  padding: 8px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  white-space: nowrap;
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  color: #555c6d;
  font-size: 12px;
  font-weight: 700;
}

.chip-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(105, 119, 255, 0.23);
}

.filters {
  margin: 13px 0 8px;
}

.lesson-list {
  display: grid;
  gap: 10px;
}

.lesson-card, .soft-card, .profile-card, .detail-card, .continue-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.055);
  backdrop-filter: blur(16px);
}

.lesson-card {
  width: 100%;
  padding: 15px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.lesson-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lesson-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
  font-size: 11px;
}

.time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.save-dot {
  color: #c7ccd8;
  font-size: 21px;
  line-height: 1;
}

.save-dot.saved {
  color: var(--accent);
}

.continue-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.continue-card .primary-btn {
  width: max-content;
  min-height: 40px;
  font-size: 13px;
}

.back-btn {
  margin: 6px 0 12px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--card-solid);
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.055);
}

.detail-card {
  padding: 18px;
}

.detail-card h2 {
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 15px;
}

.content-block {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.content-block p {
  color: #424958;
}

.key-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.key-list li {
  background: #f5f6fb;
  color: #424958;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
}

.example-box {
  margin-top: 12px;
  padding: 13px;
  border-radius: 16px;
  background: #f7f4ee;
  color: #5a4b38;
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.quiz-box {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.quiz-question {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 13px;
  border-radius: 15px;
  background: #f5f6fb;
  color: #394050;
  font-weight: 700;
}

.quiz-option.correct {
  background: rgba(15, 159, 122, 0.12);
  color: var(--success);
}

.quiz-option.wrong {
  background: rgba(217, 87, 87, 0.12);
  color: var(--danger);
}

.quiz-feedback {
  margin-top: 10px;
  font-size: 13px;
  color: #4d5565;
}

.empty-state {
  text-align: center;
  padding: 34px 20px;
  background: var(--card);
  border: 1px dashed rgba(30, 35, 48, 0.13);
  border-radius: var(--radius-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 16px;
}

.stat-card {
  padding: 15px 10px;
  text-align: center;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.stat-card strong {
  display: block;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-card, .soft-card {
  padding: 17px;
  margin-bottom: 12px;
}

.profile-main {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
}

.profile-main h3 {
  font-size: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(528px, calc(100% - 24px));
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.14);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.nav-item {
  border-radius: 19px;
  background: transparent;
  color: #8c93a3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}

.nav-item span {
  font-size: 20px;
  line-height: 1;
}

.nav-item small {
  font-size: 10px;
  font-weight: 800;
}

.nav-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.hidden {
  display: none !important;
}

@media (max-width: 360px) {
  .app-shell { padding-inline: 12px; }
  h2 { font-size: 22px; }
  .bottom-nav { width: calc(100% - 16px); }
  .nav-item small { font-size: 9px; }
}
