:root {
  --paper: #f2f2f2;
  --paper-deep: #e7e7e7;
  --surface: #ffffff;
  --ink: #001c2a;
  --muted: #454545;
  --line: #dee2e3;
  --accent: #da3b28;
  --accent-dark: #a92a1a;
  --green: #007d02;
  --yellow: #ffd230;
  --blue: #0f6461;
  --lavender: #62bbb9;
  --teal: #62bbb9;
  --teal-deep: #0f6461;
  --teal-tint: #f3f7f7;
  --navy: #001c2a;
  --shadow: 0 18px 50px rgba(0, 28, 42, 0.12);
  --shadow-soft: 0 7px 22px rgba(0, 28, 42, 0.08);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --player: 78px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(98, 187, 185, 0.12), transparent 28rem),
    var(--paper);
  color: var(--ink);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

img {
  max-width: 100%;
}

.svg-defs,
.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -80px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid rgba(98, 187, 185, 0.55);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 68px;
  padding: 0 clamp(18px, 3vw, 40px);
  border-bottom: 1px solid rgba(0, 28, 42, 0.08);
  background: #fffaf2;
  color: var(--navy);
  box-shadow: 0 8px 28px rgba(0, 28, 42, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  flex: 0 0 auto;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-x {
  color: #ff8fb3;
  font-size: 17px;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(251, 114, 153, 0.5);
}

.brand-partner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px 3px 3px;
  border: 0;
  border-radius: 30px;
  background: linear-gradient(135deg, #fb7299 0%, #ff5f7e 55%, #ff8fb3 100%);
  color: white;
  font: 700 13px/1.2 "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(251, 114, 153, 0.35);
  transition: 160ms ease;
}

.brand-partner:hover {
  background: linear-gradient(135deg, #ff7da0 0%, #ff6b8a 55%, #ff9cbc 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(251, 114, 153, 0.5);
}

.brand-partner-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(251, 114, 153, 0.35);
}

.brand-partner svg {
  width: 13px;
  height: 13px;
  opacity: 0.95;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #e04b2a 0%, #ffa100 45%, #149edc 75%, #3fa08c 100%);
  color: white;
  font: 400 18px/1 "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  box-shadow: 0 6px 16px rgba(224, 75, 42, 0.28);
}

.brand-name {
  color: var(--navy);
  font: 400 24px/1 "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.2px;
}

.brand-name span {
  background: linear-gradient(90deg, #e04b2a, #ffa100 50%, #149edc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 28, 42, 0.04);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 11px;
  color: rgba(0, 28, 42, 0.62);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: 160ms ease;
}

.nav-link:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.85);
}

.nav-link.active {
  color: white;
  background: linear-gradient(135deg, #149edc, #3fa08c);
  box-shadow: 0 8px 18px rgba(20, 158, 220, 0.28);
}

.nav-link.active::after {
  display: none;
}

.main-nav .nav-link:nth-child(1).active { background: linear-gradient(135deg, #149edc, #067eb3); box-shadow: 0 8px 18px rgba(20, 158, 220, 0.28); }
.main-nav .nav-link:nth-child(2).active { background: linear-gradient(135deg, #e04b2a, #ffa100); box-shadow: 0 8px 18px rgba(224, 75, 42, 0.28); }
.main-nav .nav-link:nth-child(3).active { background: linear-gradient(135deg, #3fa08c, #149edc); box-shadow: 0 8px 18px rgba(63, 160, 140, 0.28); }
.main-nav .nav-link:nth-child(4).active { background: linear-gradient(135deg, #ffa100, #e04b2a); box-shadow: 0 8px 18px rgba(255, 161, 0, 0.28); }
.main-nav .nav-link:nth-child(5).active { background: linear-gradient(135deg, #f5b942, #e04b2a); box-shadow: 0 8px 18px rgba(245, 185, 66, 0.28); }
.main-nav .nav-link:nth-child(6).active { background: linear-gradient(135deg, #1969a6, #067eb3); box-shadow: 0 8px 18px rgba(25, 105, 166, 0.28); }

.nav-link svg {
  width: 18px;
}

.nav-count {
  margin-left: 2px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--yellow);
  color: var(--navy);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.nav-link.active .nav-count {
  background: rgba(255, 255, 255, 0.92);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.topbar-actions .icon-button {
  color: var(--navy);
}

.mobile-only {
  display: none;
}

.language-switch,
.profile-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  color: rgba(0, 28, 42, 0.7);
  font-size: 13px;
  font-weight: 600;
}

.language-switch:hover {
  background: rgba(0, 28, 42, 0.06);
  color: var(--navy);
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  color: rgba(0, 28, 42, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.admin-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.admin-link:hover {
  background: rgba(0, 28, 42, 0.06);
  color: var(--navy);
}

.profile-button {
  display: grid;
  grid-template-columns: 36px 1fr 16px;
  align-items: center;
  gap: 10px;
  width: auto;
  min-width: 0;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(0, 28, 42, 0.08);
  border-radius: 14px;
  background: white;
  text-align: left;
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(0, 28, 42, 0.06);
}

.profile-button:hover {
  border-color: rgba(20, 158, 220, 0.35);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffa100, #e04b2a);
  color: white;
  font: 700 15px "PingFang SC", "Microsoft YaHei", sans-serif;
}

.profile-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  color: var(--muted);
  font-size: 10px;
}

.profile-button svg {
  width: 15px;
}

.home-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.home-welcome span {
  color: var(--navy);
  font: 700 15px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.home-welcome span::after {
  content: "·";
  margin-left: 12px;
  color: rgba(0, 28, 42, 0.28);
  font-weight: 500;
}

main {
  min-height: calc(100vh - 68px);
  padding: 0 0 calc(var(--player) + 28px);
}

#app {
  width: min(1300px, 100%);
  margin: 0 auto;
  padding: 42px clamp(28px, 4vw, 68px) 70px;
}

.mobile-nav {
  display: none;
}

.page-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-header .eyebrow {
  color: var(--teal-deep);
}

.page-header .subhead {
  color: var(--muted);
}

.page-header h1 {
  color: var(--ink);
}

.page-tools {
  position: relative;
}

.search-field input {
  border-color: var(--line);
  background: var(--surface);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
}

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

h1,
.display-title {
  max-width: 850px;
  margin-bottom: 8px;
  font: 800 clamp(26px, 3.2vw, 38px)/1.2 "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.3px;
}

h2 {
  font: 800 22px/1.3 "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.2px;
}

h3 {
  font-size: 16px;
  line-height: 1.28;
}

.subhead {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.section {
  margin-top: 46px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-header h2,
.section-header p {
  margin: 0;
}

.section-header small {
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.text-link svg {
  width: 16px;
  transition: transform 150ms ease;
}

.text-link:hover svg {
  transform: translateX(3px);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 11px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button.accent {
  border-color: var(--accent);
  background: var(--accent);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button.small {
  min-height: 35px;
  padding: 0 12px;
  font-size: 11px;
}

.button svg {
  width: 17px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.hero-left .stats-row {
  margin-top: auto;
}

.continue-card {
  position: relative;
  min-height: 200px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow-soft);
}

.continue-card::after {
  content: "";
  position: absolute;
  width: 370px;
  height: 370px;
  right: -135px;
  top: -165px;
  border: 70px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 38%;
  overflow: hidden;
  background:
    linear-gradient(145deg, transparent 45%, rgba(0, 0, 0, 0.12)),
    linear-gradient(135deg, var(--hero-color, #c85a3e), var(--hero-to, var(--hero-color, #c85a3e)));
}

.hero-art::before,
.hero-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
}

.hero-art::before {
  width: 180px;
  height: 180px;
  left: -45px;
  top: 30px;
}

.hero-art::after {
  width: 90px;
  height: 90px;
  right: -10px;
  bottom: 22px;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-number {
  position: absolute;
  right: 8%;
  bottom: 12px;
  color: rgba(255, 255, 255, 0.88);
  font: 800 120px/1 "PingFang SC", sans-serif;
  letter-spacing: -12px;
}

.continue-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 200px;
  width: 66%;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 26px;
}

.content-label {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.continue-content h2 {
  max-width: 430px;
  margin: 21px 0 10px;
  font-size: clamp(28px, 3.2vw, 43px);
  line-height: 1.02;
}

.continue-content p {
  color: rgba(255,255,255,.65);
  font-size: 12px;
}

.continue-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: auto;
}

.round-play {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.round-play svg {
  margin-left: 2px;
}

/* Show pause icon while playing, play icon while paused. */
.round-play .icon-pause {
  display: none;
}

.round-play.playing .icon-play {
  display: none;
}

.round-play.playing .icon-pause {
  display: block;
}

/* Equalizer bars over the hero art while playing (community-standard
   "now playing" indicator, similar to podcast/music apps). */
.hero-eq {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  padding: 4px 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.hero-eq.playing {
  opacity: 1;
}

.hero-eq i {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: #fff;
  animation: eq-bounce 1s ease-in-out infinite;
}

.hero-eq i:nth-child(1) { animation-delay: 0s; }
.hero-eq i:nth-child(2) { animation-delay: 0.18s; }
.hero-eq i:nth-child(3) { animation-delay: 0.36s; }
.hero-eq i:nth-child(4) { animation-delay: 0.54s; }

@keyframes eq-bounce {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-eq i,
  .player-cover .player-eq i,
  .chip-cover .chip-eq i {
    animation: none;
    height: 8px;
  }
}

.hero-progress {
  width: min(180px, 24vw);
}

.hero-progress-track {
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255,255,255,.18);
}

.hero-progress-track span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: white;
}

.hero-progress small {
  display: block;
  margin-top: 7px;
  color: rgba(255,255,255,.58);
}

.review-card {
  display: flex;
  min-height: 200px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #fdf3e0 0%, #f8e5bd 55%, #f5cf8f 100%);
}

.review-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.review-icon {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border-radius: 15px;
  background: var(--teal-tint);
  color: var(--teal-deep);
}

.review-icon svg {
  width: 22px;
}

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

.streak strong {
  color: var(--accent-dark);
}

.review-card h2 {
  margin: 22px 0 6px;
  font-size: 24px;
}

.review-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-card .button {
  width: 100%;
  margin-top: auto;
}

.calendar-card {
  display: flex;
  min-height: 200px;
  flex-direction: column;
  padding: 22px 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(218, 59, 40, 0.06), transparent 60%),
    linear-gradient(160deg, #fdf3e0 0%, #f8e5bd 55%, #f5cf8f 100%);
}

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

.calendar-head h3 {
  margin: 0;
  font: 800 18px/1.2 "ZCOOL KuaiLe", "PingFang SC", sans-serif;
}

.calendar-head .eyebrow {
  margin-bottom: 4px;
}

.calendar-head .button {
  min-height: 34px;
  padding: 0 12px;
  margin-top: 0;
  font-size: 11px;
  white-space: nowrap;
}

.calendar-head .button svg {
  width: 14px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.cal-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  opacity: 0.75;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  flex: 1;
}

.cal-day {
  position: relative;
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.cal-day b {
  font-weight: 700;
}

.cal-day.today {
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-soft);
}

.cal-empty {
  min-height: 30px;
}

.cal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-nav {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  transition: 150ms ease;
}

.cal-nav:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: var(--teal-tint);
}

.cal-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.cal-nav svg {
  width: 14px;
}

.cal-nav[data-cal-next] svg {
  transform: rotate(180deg);
}

.cal-marks {
  position: absolute;
  right: 2px;
  bottom: 1px;
  display: flex;
  gap: 1px;
  font-size: 9px;
  line-height: 1;
}

.cal-emoji {
  font-size: 9px;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.25));
}

.cal-day.today .cal-emoji {
  filter: none;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cal-legend .streak {
  margin-left: auto;
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--stat-from, rgba(255,255,255,.6)), var(--stat-to, rgba(255,255,255,.35)));
}

.stat-card .stat-value {
  color: var(--ink);
}

.stat-value {
  min-width: 42px;
  font: 750 24px/1 "PingFang SC", sans-serif;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.series-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.series-grid.compact .series-card {
  min-height: 0;
  padding: 0;
  border-radius: var(--radius-sm);
}

.series-grid.compact .series-card-img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.series-grid.compact .series-card-top {
  position: absolute;
  top: 8px;
  right: 10px;
  justify-content: flex-end;
}

.series-grid.compact .series-card h3 {
  font-size: 15px;
}

.series-grid.compact .series-card p {
  font-size: 10px;
}

.series-grid.compact .follow-icon {
  width: 30px;
  height: 30px;
}

.series-grid.compact .series-card-copy {
  margin-top: 0;
  padding: 10px 12px 12px;
}

.series-grid.compact .series-card:has(.series-card-img) .series-card-copy {
  color: var(--ink);
  text-shadow: none;
}

.series-grid.compact .series-card:has(.series-card-img) {
  background: linear-gradient(140deg, var(--card-color, #a9dad9), var(--card-to, var(--card-color, #a9dad9)));
}

/* Compact card without an image: keep the monogram inside a padded gradient card. */
.series-grid.compact .series-card:not(:has(.series-card-img)) {
  min-height: 150px;
  padding: 14px;
}

.series-card {
  position: relative;
  display: flex;
  min-height: 244px;
  overflow: hidden;
  flex-direction: column;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--card-color, #a9dad9), var(--card-to, var(--card-color, #a9dad9)));
  cursor: pointer;
  transition: 180ms ease;
}

.series-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.series-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-card-img + .series-card-top,
.series-card-img + .series-card-top + .series-card-copy {
  position: relative;
  z-index: 3;
}

.series-card:has(.series-card-img) {
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35)), linear-gradient(140deg, var(--card-color, #a9dad9), var(--card-to, var(--card-color, #a9dad9)));
}

.series-card:has(.series-card-img) .series-card-copy {
  margin-top: auto;
  color: white;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}

.series-card::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -60px;
  bottom: -65px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
}

.series-card::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  right: 10px;
  bottom: -34px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
}

.series-card.dark {
  color: white;
}

.series-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.follow-icon {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid rgba(32,32,31,.18);
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  cursor: pointer;
}

.dark .follow-icon {
  border-color: rgba(255,255,255,.34);
  color: white;
}

.follow-icon.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.dark .follow-icon.active {
  border-color: white;
  background: white;
  color: var(--ink);
}

.follow-icon svg {
  width: 16px;
}

.series-card-copy {
  position: relative;
  z-index: 2;
  margin-top: auto;
}

.series-card h3 {
  margin: 0 0 7px;
  font: 750 19px/1.1 "PingFang SC", sans-serif;
}

.series-card p {
  margin: 0;
  opacity: 0.68;
  font-size: 11px;
}

.lesson-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.35);
  min-height: 360px;
}

.lesson-row {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 12px 18px 12px 22px;
  border-bottom: 1px solid var(--line);
  transition: 150ms ease;
}

.lesson-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 5px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(180deg, var(--row-from), var(--row-to));
  opacity: 0.85;
}

.lesson-row:last-child {
  border-bottom: 0;
}

.lesson-row:hover {
  background: var(--surface);
}

.lesson-row:hover::before {
  opacity: 1;
}

.lesson-cover {
  position: relative;
  display: grid;
  width: 112px;
  height: 63px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--card-color, #ccc), var(--card-to, var(--card-color, #ccc)));
  font: 800 18px "PingFang SC", sans-serif;
}

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

.lesson-cover::after {
  content: "";
  position: absolute;
  width: 37px;
  height: 37px;
  right: -15px;
  bottom: -15px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%;
}

.lesson-copy {
  min-width: 0;
}

.lesson-copy h3 {
  overflow: hidden;
  margin: 0 0 5px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bilingual titles: Chinese + English side by side, same level. */
.tt-zh,
.tt-en {
  display: inline;
}

.tt-zh {
  font-weight: 700;
}

.tt-en {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}

.tt-en::before {
  content: "·";
  margin-right: 8px;
  color: var(--muted);
  opacity: 0.5;
}

.lesson-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-badge,
.asset-badge,
.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.level-badge {
  border-color: transparent;
  background: var(--teal-tint);
  color: var(--teal-deep);
}

.lesson-date,
.lesson-duration {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.lesson-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 3.5rem;
}

.lesson-duration svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.lesson-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 3px;
}

.lesson-actions .icon-button {
  width: 34px;
  height: 34px;
}

.lesson-actions .active {
  color: var(--accent);
}

.page-tools {
  display: flex;
  gap: 10px;
}

.search-field {
  position: relative;
  min-width: 260px;
}

.search-field svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input,
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.search-field input {
  height: 43px;
  padding: 0 14px 0 42px;
}

.search-field input:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229,72,47,.11);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-bar + .filter-bar {
  margin-top: -4px;
}

.filter-chip {
  min-height: 35px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.4);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: 150ms ease;
}

.filter-chip:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.filter-chip.active {
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-soft);
}

.discover-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 0 12px;
}

.discover-results-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discover-results-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sort-select {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 20px;
  background: var(--paper-deep);
  color: var(--muted);
}

.empty-state p {
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  min-height: 43px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  color: var(--ink);
}

.tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #e04b2a, #ffa100);
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.playlist-card {
  min-height: 225px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(98,187,185,.08), transparent 45%),
    var(--surface);
  cursor: pointer;
  transition: 160ms ease;
}

.playlist-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.playlist-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 64px;
  overflow: hidden;
  margin-bottom: 18px;
  border-radius: 12px;
}

.playlist-covers span {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--card-color), var(--card-to, var(--card-color)));
  font: 800 28px "PingFang SC", sans-serif;
}

.playlist-covers span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-card h3 {
  margin-bottom: 7px;
}

.playlist-card p {
  color: var(--muted);
  font-size: 11px;
}

.new-playlist-card {
  display: grid;
  min-height: 225px;
  place-items: center;
  border: 1px dashed #b7bdbd;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.new-playlist-card:hover {
  background: rgba(255,255,255,.35);
  color: var(--ink);
}

.new-playlist-card span {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.vocab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, .55fr);
  gap: 22px;
}

.vocab-table,
.downloads-panel,
.notes-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.36);
}

.downloads-hint {
  margin: -8px 0 20px;
}

.vocab-row {
  display: grid;
  grid-template-columns: minmax(110px,.5fr) minmax(160px,1fr) 105px 42px;
  align-items: center;
  gap: 18px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.vocab-row:last-child {
  border-bottom: 0;
}

.vocab-term strong {
  display: block;
  margin-bottom: 4px;
  font: 750 18px "PingFang SC", sans-serif;
}

.vocab-term small,
.vocab-context,
.vocab-source {
  color: var(--muted);
  font-size: 11px;
}

.vocab-context {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-summary {
  align-self: start;
  padding: 25px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}

.review-summary .ring {
  display: grid;
  width: 94px;
  height: 94px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--ring, 0%), rgba(255,255,255,.12) 0);
}

.ring::after {
  content: attr(data-value);
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  font: 750 25px "PingFang SC", sans-serif;
}

.review-summary h2,
.review-summary p {
  text-align: center;
}

.review-summary p {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.5;
}

.review-summary .button {
  width: 100%;
  margin-top: 12px;
}

.download-row {
  display: grid;
  grid-template-columns: 96px minmax(0,1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 19px;
  border-bottom: 1px solid var(--line);
}

.download-row:last-child {
  border-bottom: 0;
}

.dl-cover {
  position: relative;
  display: grid;
  width: 96px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--card-color, #ccc), var(--card-to, var(--card-color, #ccc)));
  font: 800 16px "PingFang SC", sans-serif;
}

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

.download-meta h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.download-meta p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
}

.dl-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dl-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  background: var(--surface);
}

.dl-chip.ok {
  border-color: transparent;
  background: var(--teal-tint);
  color: var(--teal-deep);
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.dl-chip.ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 28, 42, 0.1);
}

.series-hero {
  position: relative;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 35px;
  min-height: 240px;
  overflow: hidden;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--series-color), var(--series-to, var(--series-color)));
}

.series-hero-art {
  position: relative;
  display: grid;
  min-height: 191px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 20px;
  background: rgba(255,255,255,.18);
  font: 800 96px/.9 "PingFang SC", sans-serif;
}

.series-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-hero-art::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -60px;
  bottom: -60px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
}

.series-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.series-hero-content h1 {
  margin: 13px 0;
  font-size: 44px;
}

.series-hero-content p {
  max-width: 650px;
  margin-bottom: 22px;
  color: rgba(32,32,31,.65);
  font-size: 13px;
  line-height: 1.55;
}

.series-hero-actions {
  display: flex;
  gap: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.back-link svg {
  width: 15px;
  transform: rotate(180deg);
}

.study-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
}

.study-main {
  min-width: 0;
}

.study-header {
  margin-bottom: 22px;
}

.study-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.study-header h1 {
  margin: 15px 0 12px;
  font-size: clamp(32px, 4vw, 50px);
}

.study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.lesson-summary {
  position: relative;
  margin: 16px 0 6px;
  padding: 16px 18px 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 28, 42, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sum-from) 9%, white), color-mix(in srgb, var(--sum-to) 14%, white)),
    var(--surface);
  box-shadow: 0 10px 30px rgba(0, 28, 42, 0.06);
}

.lesson-summary::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--sum-from), var(--sum-to));
}

.lesson-summary::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sum-to) 16%, transparent), transparent 70%);
  pointer-events: none;
}

.lesson-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sum-from), var(--sum-to));
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--sum-from) 35%, transparent);
}

.lesson-summary-label svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lesson-summary-zh {
  position: relative;
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.9;
}

.lesson-summary-en {
  position: relative;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 28, 42, 0.14);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.summary-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--sum-to) 35%, var(--line));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--sum-to);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.summary-toggle:hover {
  background: white;
  box-shadow: 0 3px 10px rgba(0, 28, 42, 0.08);
}

.summary-toggle svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.summary-toggle.open svg {
  transform: rotate(90deg);
}

.study-player {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 150px;
  overflow: hidden;
  margin-bottom: 26px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}

.study-player-art {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--lesson-color), var(--lesson-to, var(--lesson-color)));
  font: 800 82px/.9 "PingFang SC", sans-serif;
}

.study-player-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px;
}

.study-player-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.study-player .round-play {
  width: 43px;
  height: 43px;
}

.scrubber {
  width: 100%;
  height: 4px;
  margin: 17px 0 7px;
  accent-color: var(--accent);
  cursor: pointer;
}

.study-time {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.56);
  font-size: 10px;
}

.transcript-card {
  padding: 27px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.transcript-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
  margin-bottom: 25px;
}

.transcript-tools h2 {
  margin: 0;
}

.transcript {
  font: 400 16px/1.85 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.transcript p {
  margin-bottom: 23px;
}

.transcript strong {
  display: block;
  margin-bottom: 3px;
  color: var(--teal-deep);
  font: 750 10px/1.3 "PingFang SC", sans-serif;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.transcript mark {
  border-radius: 3px;
  background: #ffe9a8;
  color: inherit;
}

.transcript [data-time] {
  cursor: pointer;
}

.transcript [data-time].current {
  margin-inline: -10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--teal-tint);
}

.study-sidebar {
  align-self: start;
  position: sticky;
  top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.5);
}

.study-side-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
}

.study-side-tabs .tab {
  min-height: 46px;
}

.study-side-content {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 18px;
}

.note-composer {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.form-input,
.form-select {
  height: 42px;
  padding: 0 12px;
}

.form-textarea {
  min-height: 94px;
  padding: 11px 12px;
  resize: vertical;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.timestamp-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
}

.note-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.note-item {
  padding: 13px;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(40,35,30,.04);
}

.note-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.timestamp {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 20px;
  background: var(--paper-deep);
  color: var(--teal-deep);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.note-item p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.vocab-composer {
  display: grid;
  gap: 11px;
}

.dictionary-result {
  padding: 12px;
  border-radius: 10px;
  background: var(--paper-deep);
}

.dictionary-result strong {
  display: block;
  margin-bottom: 4px;
  font: 750 17px "PingFang SC", sans-serif;
}

.dictionary-result p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.lesson-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.resource-chip {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.resource-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.resource-chip svg {
  width: 15px;
}

.review-stage {
  display: grid;
  min-height: 520px;
  place-items: center;
}

.flashcard {
  width: min(540px, 100%);
  min-height: 350px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.flashcard small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.flashcard h2 {
  margin: 55px 0 15px;
  font-size: 43px;
}

.flashcard .definition {
  max-width: 400px;
  margin: 0 auto 12px;
  color: var(--muted);
  line-height: 1.6;
}

.flashcard .example {
  max-width: 420px;
  margin: 25px auto;
  font: italic 500 16px/1.55 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.review-ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 28px;
}

.rating-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.rating-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.rating-button small {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.command-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.command-overlay[hidden],
.modal-overlay[hidden] {
  display: none;
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(24, 23, 21, 0.5);
  backdrop-filter: blur(5px);
}

.search-command,
.modal {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(0, 28, 42, 0.06);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 40px 120px rgba(0, 28, 42, 0.28);
  animation: modal-in 230ms cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
}

.command-input {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.command-input svg {
  position: absolute;
  left: 18px;
  color: var(--muted);
}

.command-input input {
  width: 100%;
  height: 65px;
  padding: 0 68px 0 52px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
}

kbd {
  position: absolute;
  right: 16px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--paper);
  font-size: 9px;
}

.command-results {
  max-height: 430px;
  overflow: auto;
  padding: 10px;
}

.command-result {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.command-result:hover {
  background: var(--paper);
}

.command-result .lesson-cover {
  width: 72px;
  height: 40px;
  border-radius: 8px;
  font-size: 15px;
}

.command-result strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.command-result small {
  color: var(--muted);
  font-size: 10px;
}

.modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.modal-form {
  display: grid;
  gap: 18px;
}

.modal-form[hidden],
#auth-register-step[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 8px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 28, 42, 0.06);
}

.auth-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-modal-head > .icon-button {
  margin-left: auto;
  color: var(--muted);
}

.auth-modal-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  border-radius: 14px;
}

.auth-modal-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-modal-head .eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-modal-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.auth-tab {
  position: relative;
  padding: 10px 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 3px 10px rgba(0, 28, 42, 0.12);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.text-input {
  width: 100%;
  height: 50px;
  padding: 0 15px 0 42px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.text-input::placeholder {
  color: #9aa1a6;
}

.text-input:focus {
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 4px rgba(15, 100, 97, 0.12);
}

.auth-note {
  margin: 4px 0 0;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 13px;
  font-size: 14px;
}

.auth-submit:disabled {
  opacity: 0.6;
  transform: none;
}

.auth-account {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(15, 100, 97, 0.05), rgba(255, 255, 255, 0));
}

.auth-account-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #067eb3, #3fa08c);
  color: white;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(6, 126, 179, 0.3);
}

.auth-account div {
  min-width: 0;
}

.auth-account strong {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-account small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

/* Invite-only notice card in the register tab. */
.invite-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  padding: 14px 15px;
  border: 1px solid rgba(15, 100, 97, 0.2);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(98, 187, 185, 0.12), rgba(255, 255, 255, 0.4));
}

.invite-card[hidden] {
  display: none;
}

.invite-avatar {
  flex: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 28, 42, 0.18);
  transition: transform 160ms ease;
}

.invite-avatar:hover {
  transform: scale(1.08) rotate(-4deg);
}

.invite-avatar img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.invite-copy {
  min-width: 0;
}

.invite-copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 13px;
}

.invite-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.invite-copy a {
  color: var(--teal-deep);
  font-weight: 650;
  text-decoration: none;
}

.invite-copy a:hover {
  text-decoration: underline;
}

.account-guest {
  display: grid;
  place-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 40px auto;
  padding: 44px 30px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.account-guest h2 {
  margin: 6px 0 0;
  font-size: 19px;
}

.account-guest p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 100, 97, 0.06), rgba(255, 255, 255, 0));
}

.account-card-copy {
  min-width: 0;
}

.account-card-copy strong {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.account-stats .stat-card {
  display: grid;
  gap: 4px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.account-stats .stat-card strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.account-stats .stat-card span {
  color: var(--muted);
  font-size: 11.5px;
}

.account-sync {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.account-sync strong {
  display: block;
  font-size: 13.5px;
}

.account-sync small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.account-footer {
  justify-content: flex-start;
  margin-top: 0;
}

@media (max-width: 640px) {
  .account-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: calc(var(--player) + 18px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 240ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

.mini-player {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 15px;
  left: 18px;
  display: grid;
  grid-template-columns: 44px 66px minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: var(--player);
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(32, 32, 31, 0.97);
  color: white;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  backdrop-filter: blur(18px);
}

/* Collapse button: prominent, left-most, away from the close button. */
.collapse-player-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.collapse-player-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.collapse-player-button:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
  transform: translateY(-1px);
}

.collapse-player-button:active {
  transform: scale(0.95);
}

.mini-player[hidden] {
  display: none;
}

/* Collapsed state: a compact floating chip in the bottom-right corner.
   Click anywhere on it to expand back to the full player. */
.mini-player-chip {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 6px 8px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(32, 32, 31, 0.97);
  color: white;
  cursor: pointer;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
  animation: chip-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.mini-player-chip[hidden] {
  display: none;
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
}

.mini-player-chip:hover {
  background: rgba(42, 42, 41, 0.98);
}

/* Expand hint: a small chevron badge on the chip's top-left, rotated to point
   up, signalling that the chip can be expanded back to the full player. */
.chip-expand {
  position: absolute;
  top: -7px;
  left: -7px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.chip-expand svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: white;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(180deg);
}

.chip-cover {
  position: relative;
  display: grid;
  width: 56px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--player-color, #62bbb9), var(--player-to, var(--player-color, #62bbb9)));
  font: 800 13px "PingFang SC", sans-serif;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.chip-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Tiny eq badge on the chip cover while playing. */
.chip-cover .chip-eq {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
  padding: 2px 3px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.chip-cover.playing .chip-eq {
  opacity: 1;
}

.chip-cover .chip-eq i {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 1.5px;
  background: #fff;
  animation: eq-bounce 1s ease-in-out infinite;
}

.chip-cover .chip-eq i:nth-child(1) { animation-delay: 0s; }
.chip-cover .chip-eq i:nth-child(2) { animation-delay: 0.2s; }
.chip-cover .chip-eq i:nth-child(3) { animation-delay: 0.4s; }

.chip-meta {
  min-width: 0;
  max-width: 170px;
  text-align: left;
}

.chip-meta strong,
.chip-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-meta strong {
  font-size: 11.5px;
}

.chip-meta small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
}

.chip-play {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.chip-play:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(218, 59, 40, 0.4);
}

.chip-play svg {
  width: 15px;
  height: 15px;
  fill: white;
}

.chip-play .pause-icon {
  display: none;
}

.chip-play.playing .play-icon {
  display: none;
}

.chip-play.playing .pause-icon {
  display: block;
}

.mini-progress {
  position: absolute;
  inset: 0 10px auto;
  z-index: 2;
  width: calc(100% - 20px);
  height: 22px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.mini-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(218, 59, 40, 0.35);
}

.mini-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(218, 59, 40, 0.35);
}

.mini-progress-visual {
  position: absolute;
  inset: 0 10px auto;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.mini-progress-visual span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.player-cover {
  position: relative;
  display: grid;
  width: 66px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--player-color, #62bbb9), var(--player-to, var(--player-color, #62bbb9)));
  font: 800 14px "PingFang SC", sans-serif;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* BBC covers are 16:9 landscape; the cover stays static so the artwork is
   never cropped. The eq badge below shows playing state instead. */
.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

.player-cover .player-eq {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  padding: 3px 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.player-cover .player-eq.playing {
  opacity: 1;
}

.player-cover .player-eq i {
  display: block;
  width: 2.5px;
  height: 4px;
  border-radius: 2px;
  background: #fff;
  animation: eq-bounce 1s ease-in-out infinite;
}

.player-cover .player-eq i:nth-child(1) { animation-delay: 0s; }
.player-cover .player-eq i:nth-child(2) { animation-delay: 0.2s; }
.player-cover .player-eq i:nth-child(3) { animation-delay: 0.4s; }

.player-meta {
  min-width: 0;
  border: 0;
  background: transparent;
  color: white;
  text-align: left;
  cursor: pointer;
}

.player-meta strong,
.player-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-meta strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.player-meta small {
  color: rgba(255,255,255,.5);
  font-size: 9px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-controls .icon-button {
  width: 36px;
  height: 36px;
}

.play-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.play-button .pause-icon {
  display: none;
}

.play-button.playing .play-icon {
  display: none;
}

.play-button.playing .pause-icon {
  display: block;
}

.speed-button {
  min-width: 35px;
  height: 30px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.65);
  font-size: 10px;
  cursor: pointer;
}

.player-time {
  margin: 0 8px;
  color: rgba(255,255,255,.46);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.skeleton {
  border-radius: 7px;
  background: linear-gradient(90deg, #e7e7e7 25%, #f2f2f2 50%, #e7e7e7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 1280px) {
  .brand-partner-name {
    display: none;
  }

  .nav-link {
    padding: 0 11px;
    font-size: 12px;
    gap: 6px;
  }

  .nav-link span:not(.nav-count) {
    display: none;
  }

  .nav-link {
    padding: 0 13px;
  }

  .nav-link svg {
    width: 18px;
  }

  .topbar-actions .profile-copy {
    display: none;
  }

  .profile-button {
    grid-template-columns: 34px;
    gap: 0;
    padding: 4px;
  }

  .profile-button svg {
    display: none;
  }

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

  .lesson-row {
    grid-template-columns: 96px minmax(0, 1fr) auto auto auto;
  }

  .lesson-date {
    display: none;
  }

  .study-shell {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 820px) {
@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url("./fonts/ZCOOL-KuaiLe.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
    --player: 68px;
  }

  .series-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .topbar {
    height: 60px;
    gap: 12px;
    padding: 0 14px;
  }

  .topbar .brand-mark {
    width: 29px;
    height: 29px;
    font-size: 17px;
  }

  .topbar .brand-name {
    font-size: 20px;
  }

  .main-nav {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .admin-link span,
  .language-switch span {
    display: none;
  }

  .admin-link,
  .language-switch {
    padding: 0 8px;
  }

  .profile-copy {
    display: none;
  }

  .profile-button {
    grid-template-columns: 34px;
    gap: 0;
    padding: 4px;
  }

  .profile-button svg {
    display: none;
  }

  main {
    min-height: calc(100vh - 60px);
    padding-bottom: calc(var(--player) + 78px);
  }

  #app {
    padding: 27px 18px 48px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 63px;
    padding: 5px 7px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
  }

  .mobile-nav .nav-link {
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0;
    font-size: 9px;
  }

  .mobile-nav .nav-link.active {
    color: var(--accent);
    background: transparent;
    box-shadow: none;
  }

  .mobile-nav .nav-link.active::before {
    display: none;
  }

  .mobile-nav .nav-link svg {
    width: 20px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 22px;
  }

  h1,
  .display-title {
    font-size: 38px;
    letter-spacing: -1.5px;
  }

  .hero-grid,
  .vocab-layout,
  .study-shell {
    grid-template-columns: 1fr;
  }

  .continue-card,
  .continue-content {
    min-height: 180px;
  }

  .continue-content {
    width: 72%;
    padding: 20px;
  }

  .review-card {
    min-height: 180px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 68px;
  }

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

  .series-card {
    min-height: 215px;
  }

  .lesson-row {
    grid-template-columns: 96px minmax(0, 1fr) 85px;
    gap: 12px;
    min-height: 74px;
    padding: 10px 12px;
  }

  .lesson-row .level-badge,
  .lesson-duration {
    display: none;
  }

  .lesson-cover {
    width: 96px;
    height: 54px;
  }

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

  .study-sidebar {
    position: static;
  }

  .study-side-content {
    max-height: none;
  }

  .series-hero {
    grid-template-columns: 240px 1fr;
    gap: 22px;
    padding: 24px;
  }

  .series-hero-art {
    min-height: 135px;
    font-size: 60px;
  }

  .series-hero-content h1 {
    font-size: 34px;
  }

  .player-cover {
    width: 56px;
    height: 34px;
    font-size: 13px;
  }

  .mini-player {
    right: 8px;
    bottom: 69px;
    left: 8px;
    min-height: var(--player);
    grid-template-columns: 40px 56px minmax(70px, 1fr) auto;
    gap: 8px;
    padding: 8px;
    border-radius: 15px;
  }

  /* Collapsed chip on small screens: sits above the mobile nav bar. */
  .mini-player-chip {
    right: 10px;
    bottom: 69px;
    max-width: calc(100vw - 20px);
  }

.load-more {
  display: grid;
  min-height: 48px;
  margin: 14px auto 0;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 150ms ease;
}

.load-more:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: var(--teal-tint);
}

.back-top {
  position: fixed;
  z-index: 55;
  right: 22px;
  bottom: calc(var(--player) + 20px);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
  pointer-events: none;
}

.back-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top:hover {
  background: var(--teal-deep);
}

.back-top svg {
  width: 18px;
  transform: rotate(180deg);
}

.toast-region {
    right: 12px;
    bottom: 148px;
    left: 12px;
  }

  .toast {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .page-tools {
    width: 100%;
  }

  .search-field {
    width: 100%;
    min-width: 0;
  }

  .hero-art {
    width: 41%;
  }

  .hero-number {
    right: 2%;
    font-size: 140px;
  }

  .continue-content {
    width: 72%;
    padding: 23px 20px;
  }

  .continue-content h2 {
    font-size: 29px;
  }

  .series-grid {
    grid-template-columns: 1fr;
  }

  .series-card {
    min-height: 190px;
  }

  .playlist-grid {
    grid-template-columns: 1fr;
  }

  .lesson-row {
    grid-template-columns: 84px minmax(0, 1fr) 38px;
  }

  .lesson-cover {
    width: 84px;
    height: 47px;
  }

  .lesson-actions .icon-button:not(:last-child) {
    display: none;
  }

  .series-hero {
    grid-template-columns: 1fr;
  }

  .series-hero-art {
    min-height: 125px;
  }

  .series-hero-content h1 {
    margin-top: 8px;
  }

  .study-player {
    grid-template-columns: 95px 1fr;
  }

  .study-player-controls {
    padding: 18px;
  }

  .transcript-card {
    padding: 22px 18px;
  }

  .transcript {
    font-size: 16px;
  }

  .vocab-row {
    grid-template-columns: 1fr 36px;
    gap: 8px;
  }

  .vocab-context,
  .vocab-source {
    grid-column: 1;
  }

  .vocab-row .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  .download-row {
    grid-template-columns: 46px minmax(0,1fr) 40px;
  }

  .download-row .status-badge {
    display: none;
  }

  .flashcard {
    min-height: 390px;
    padding: 28px 18px;
  }

  .review-ratings {
    grid-template-columns: repeat(2, 1fr);
  }

  .desktop-only {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Lesson vocabulary deck === */

.vocab-deck {
  margin-bottom: 26px;
}

.vocab-deck .transcript-tools {
  align-items: flex-end;
}

.vocab-deck .transcript-tools small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.vocab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
}

.vocab-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.vocab-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.vocab-card-top strong {
  font-size: 15px;
}

.vocab-card-top small {
  color: var(--muted);
  font-size: 11px;
}

.vocab-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.vocab-card-zh {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.vocab-card-example {
  color: var(--ink) !important;
  font-style: italic;
}

.vocab-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.vocab-card-actions .icon-button {
  width: 34px;
  height: 34px;
  color: var(--teal-deep);
}

/* === Transcript extras === */

.transcript-tools-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.text-link.active {
  color: var(--teal-deep);
}

.lookup-hint {
  margin: -12px 0 18px;
  color: var(--muted);
  font-size: 11.5px;
}

.transcript .line-en {
  display: block;
}

.transcript .line-zh {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font: 500 14px/1.7 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.transcript .line-zh[hidden] {
  display: none;
}

.transcript [data-time].current .line-zh {
  color: var(--ink);
}

/* EN/中文 switch toggle */
.zh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.zh-toggle:hover {
  border-color: rgba(15, 100, 97, 0.4);
  box-shadow: 0 2px 8px rgba(0, 28, 42, 0.08);
}

.zh-toggle-track {
  position: relative;
  width: 30px;
  height: 18px;
  flex: none;
  border-radius: 999px;
  background: var(--paper-deep);
  transition: background 180ms ease;
}

.zh-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 28, 42, 0.25);
  transition: transform 180ms ease;
}

.zh-toggle.on .zh-toggle-track {
  background: var(--teal-deep);
}

.zh-toggle.on .zh-toggle-thumb {
  transform: translateX(12px);
}

.zh-toggle-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  transition: color 160ms ease;
}

.zh-toggle.on .zh-toggle-label {
  color: var(--teal-deep);
}

/* === Word lookup popover === */

.word-popover {
  position: fixed;
  z-index: 120;
  width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: pop-in 140ms ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.word-popover-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.word-popover-head strong {
  font-size: 15px;
}

.word-popover-head small {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
}

.word-popover-head .icon-button {
  width: 28px;
  height: 28px;
}

.word-popover p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.word-popover-zh {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

/* === Quiz === */

.quiz-card {
  margin-top: 26px;
  padding: 27px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.quiz-card .transcript-tools {
  align-items: flex-end;
}

.quiz-card .transcript-tools small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.quiz-best {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.quiz-question > small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.quiz-prompt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.quiz-target {
  margin: 0 0 16px;
  font: 500 16px/1.7 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 140ms ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.quiz-option.correct {
  border-color: var(--green);
  background: #eaf6ea;
  color: var(--green);
}

.quiz-option.wrong {
  border-color: var(--accent);
  background: #fdeeec;
  color: var(--accent-dark);
}

.quiz-option.dim {
  opacity: 0.5;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option svg {
  width: 16px;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
}

.quiz-feedback.good {
  background: #eaf6ea;
}

.quiz-feedback.bad {
  background: #fdeeec;
}

.quiz-feedback p {
  margin: 0 0 6px;
  font-size: 13.5px;
}

.quiz-feedback .quiz-example {
  color: var(--muted);
  font-style: italic;
}

.quiz-feedback .button {
  margin-top: 8px;
}

.quiz-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 16px 10px;
  text-align: center;
}

.quiz-result-score {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font: 800 30px/1 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.quiz-result-score small {
  font-size: 13px;
  opacity: 0.6;
}

.quiz-result h3 {
  margin: 8px 0 0;
}

.quiz-result p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .quiz-card {
    padding: 22px 18px;
  }

  .word-popover {
    width: min(280px, calc(100vw - 28px));
  }
}

.vocab-deck .lookup-hint {
  margin: 0;
  font-size: 11.5px;
}
