:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-strong: #e2e8f0;
  --text: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --primary: #2d58e1;
  --primary-hover: #1a3aab;
  --primary-soft: #eef2ff;
  --accent: #ff8b3d;
  --accent-hover: #e5731f;
  --success: #10b981;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 12px 40px rgb(45 88 225 / 0.1);
  --sidebar: 232px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --focus: 0 0 0 3px rgb(45 88 225 / 0.24);
}

/* Authentication workspace: WeChat Official Accounts visual language */
.auth-shell {
  --auth-pointer-x: 0;
  --auth-pointer-y: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f5f7f6;
  color: rgb(0 0 0 / 90%);
}

.auth-ambient {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-ambient-grid {
  position: absolute;
  inset: 0;
  opacity: .42;
  background-image: linear-gradient(rgb(7 193 96 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(7 193 96 / 4%) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

.auth-ambient-orb {
  position: absolute;
  width: 520px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .48;
  will-change: transform, opacity;
  transition: transform 1.4s cubic-bezier(.22, 1, .36, 1);
  animation: auth-breathe 7s ease-in-out infinite alternate;
}

.auth-ambient-orb.orb-one {
  top: -260px;
  left: -160px;
  background: radial-gradient(circle, rgb(7 193 96 / 25%), rgb(7 193 96 / 0%) 70%);
  transform: translate(calc(var(--auth-pointer-x) * 26px), calc(var(--auth-pointer-y) * 22px));
}

.auth-ambient-orb.orb-two {
  right: -210px;
  bottom: -250px;
  background: radial-gradient(circle, rgb(56 178 255 / 18%), rgb(56 178 255 / 0%) 70%);
  transform: translate(calc(var(--auth-pointer-x) * -34px), calc(var(--auth-pointer-y) * -26px));
  animation-delay: -2.4s;
}

.auth-ambient-orb.orb-three {
  top: 28%;
  left: 48%;
  width: 340px;
  background: radial-gradient(circle, rgb(255 255 255 / 90%), rgb(255 255 255 / 0%) 72%);
  transform: translate(calc(var(--auth-pointer-x) * 18px), calc(var(--auth-pointer-y) * -18px));
  animation-delay: -4s;
}

@keyframes auth-breathe {
  0% { scale: .92; opacity: .32; }
  100% { scale: 1.08; opacity: .58; }
}

.auth-shell .auth-header {
  position: relative;
  z-index: 2;
  height: 72px;
  padding: 0 clamp(24px, 5vw, 72px);
  border-bottom: 1px solid rgb(0 0 0 / 7%);
  background: rgb(255 255 255 / 72%);
  backdrop-filter: blur(18px);
}

.auth-shell .brand { color: rgb(0 0 0 / 88%); }
.auth-shell .brand-mark { border-radius: 10px; background: #07c160; box-shadow: 0 8px 20px rgb(7 193 96 / 20%); }
.auth-shell .inline-link { color: #07c160; }

.auth-shell .auth-main {
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: clamp(40px, 7vh, 88px) 0;
}

.auth-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(360px, 1.18fr);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid rgb(0 0 0 / 8%);
  border-radius: 22px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 28px 80px rgb(25 55 40 / 12%);
  backdrop-filter: blur(18px);
}

.auth-form-panel,
.auth-qr-panel {
  min-width: 0;
}

.auth-qr-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px clamp(30px, 5vw, 64px);
  overflow: hidden;
  border-right: 1px solid rgb(0 0 0 / 7%);
  background: linear-gradient(155deg, #f2fbf6 0%, #f8faf9 56%, #eef8f7 100%);
  text-align: center;
}

.auth-qr-panel::before {
  position: absolute;
  top: -110px;
  left: -80px;
  width: 270px;
  aspect-ratio: 1;
  border: 1px solid rgb(7 193 96 / 13%);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 42px rgb(7 193 96 / 3%), 0 0 0 86px rgb(7 193 96 / 2%);
}

.auth-qr-copy { position: relative; z-index: 1; max-width: 360px; }
.auth-eyebrow { display: block; margin-bottom: 12px; color: #07a653; font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.auth-qr-copy h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.auth-qr-copy p { margin: 12px 0 0; color: rgb(0 0 0 / 50%); font-size: 14px; line-height: 1.7; }

.auth-qr-frame-wrap {
  position: relative;
  width: 228px;
  height: 228px;
  margin: 34px auto 18px;
  overflow: hidden;
  border: 10px solid #fff;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgb(30 80 50 / 12%);
}

.auth-qr-frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.auth-scan-line { position: absolute; right: 12px; left: 12px; top: 18px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, transparent, #07c160, transparent); box-shadow: 0 0 10px rgb(7 193 96 / 55%); animation: auth-scan 3.2s ease-in-out infinite; }
@keyframes auth-scan { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(170px); opacity: 1; } }
.auth-refresh-qr { border: 0; background: transparent; color: #07a653; cursor: pointer; font-size: 13px; }
.auth-trust-row { display: flex; align-items: center; gap: 8px; margin-top: 28px; color: rgb(0 0 0 / 42%); font-size: 12px; }
.auth-trust-row > span { width: 7px; height: 7px; border-radius: 50%; background: #07c160; box-shadow: 0 0 0 4px rgb(7 193 96 / 10%); }
.auth-profile-preview { width: min(100%, 330px); margin: 36px 0 12px; text-align: left; }

.auth-form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px clamp(34px, 6vw, 78px); background: rgb(255 255 255 / 94%); }
.auth-form-panel .auth-card { width: min(100%, 440px); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-alternate { color: rgb(0 0 0 / 55%); font-size: 14px; line-height: 22px; text-align: right; }
.auth-alternate-standalone { width: min(100%, 440px); margin-bottom: 24px; }
.auth-alternate .inline-link { margin-left: 8px; font-weight: 600; }
.auth-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.auth-card-meta :is(.auth-eyebrow, .auth-alternate) { font-size: 14px; line-height: 22px; }
.auth-card-meta .auth-eyebrow { margin: 0; letter-spacing: 0; }
.auth-card-meta .auth-alternate { width: auto; margin: 0; }
.auth-form-panel .auth-card h1 { font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.auth-form-panel .auth-card > p { margin: 10px 0 30px; color: rgb(0 0 0 / 48%); font-size: 14px; line-height: 1.7; }
.auth-form-panel .form-grid { gap: 20px; }
.auth-form-panel .form-row { gap: 8px; }
.auth-form-panel .form-row label, .auth-label-row label { color: rgb(0 0 0 / 78%); font-size: 14px; font-weight: 500; }
.auth-form-panel :is(.input, .select) { min-height: 48px; padding: 11px 14px; border-color: rgb(0 0 0 / 13%); border-radius: 7px; background: #fff; font-size: 15px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.auth-form-panel :is(.input, .select):focus { border-color: #07c160; box-shadow: 0 0 0 3px rgb(7 193 96 / 10%); outline: none; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; }
.auth-label-row a { color: #07a653; font-size: 13px; }
.auth-form-panel .auth-primary-action { min-height: 48px; border-radius: 7px; background: #07c160; box-shadow: none; font-size: 15px; font-weight: 600; }
.auth-form-panel .auth-primary-action:hover { background: #06ad56; }
.auth-form-panel .auth-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 20px; font-size: 16px; line-height: 24px; color: rgb(0 0 0 / 55%); }
.auth-divider::before, .auth-divider::after { flex: 1; height: 1px; background: rgb(0 0 0 / 8%); content: ""; }
.auth-google-button { min-height: 48px; border-color: rgb(0 0 0 / 13%); border-radius: 7px; background: #fff; box-shadow: none; color: rgb(0 0 0 / 76%); font-weight: 500; }
.auth-google-button:hover { border-color: rgb(0 0 0 / 24%); background: #f8f8f8; }
.google-mark { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgb(0 0 0 / 12%); border-radius: 50%; color: #4285f4; font-weight: 700; }
.google-signin-slot { width: 100%; max-width: 400px; min-height: 48px; display: grid; place-items: center; margin-inline: auto; overflow: visible; color: var(--text-muted); font-size: 14px; }
.google-signin-slot > div { transform: scale(1.5); transform-origin: center; }
.google-signin-slot iframe { max-width: none; }
.google-signin-unavailable { width: 100%; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-muted); }
.activation-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.activation-input-row .button { min-height: 48px; border-radius: 7px; }
.auth-agreement { display: flex; align-items: flex-start; gap: 9px; color: rgb(0 0 0 / 50%); font-size: 12px; line-height: 1.6; }
.auth-agreement input { margin-top: 3px; accent-color: #07c160; }
.auth-local-entry { display: block; margin: 18px auto 0; border: 0; background: transparent; color: rgb(0 0 0 / 38%); cursor: pointer; font-size: 12px; }

@media (max-width: 820px) {
  .auth-shell .auth-header { height: 64px; padding: 0 20px; }
  .auth-shell .auth-header .header-copy { display: none; }
  .auth-shell .auth-main { width: min(100% - 28px, 560px); padding: 24px 0 40px; }
  .auth-workspace { grid-template-columns: 1fr; border-radius: 16px; }
  .auth-qr-panel { min-height: 310px; padding: 32px 24px; border-right: 0; border-bottom: 1px solid rgb(0 0 0 / 7%); }
  .auth-qr-copy h2 { font-size: 22px; }
  .auth-qr-frame-wrap { width: 176px; height: 176px; margin: 22px auto 12px; }
  .auth-scan-line { animation-name: auth-scan-mobile; }
  @keyframes auth-scan-mobile { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(120px); } }
  .auth-trust-row { margin-top: 18px; }
  .auth-form-panel { padding: 38px 24px 44px; }
  .auth-alternate-standalone { margin-bottom: 20px; text-align: left; }
  .auth-card-meta { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-ambient-orb, .auth-scan-line { animation: none; }
  .auth-ambient-orb { transition: none; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #172033;
    --surface-soft: #1e293b;
    --surface-strong: #334155;
    --text: #f1f5f9;
    --muted: #cbd5e1;
    --line: #334155;
    --primary: #7ea1ff;
    --primary-hover: #a7bcff;
    --primary-soft: #20335f;
    --accent: #ff9d5c;
    --accent-hover: #ffb27f;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --shadow: 0 18px 48px rgb(2 6 23 / 0.34);
  }

  :root .button.secondary {
    border-color: #334155 !important;
    background: #172033 !important;
    color: #f1f5f9 !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

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

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

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
}

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

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 12% 14%, rgb(45 88 225 / 0.1), transparent 30%),
    var(--bg);
}

.auth-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #5b8dff);
  color: #ffffff;
  font-family: ui-sans-serif, sans-serif;
  font-size: 13px;
}

.auth-main {
  width: min(100%, 520px);
  margin: auto;
  padding: 48px 24px 72px;
}

.auth-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.wechat-login-button {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
  min-height: 48px;
  margin-top: 22px;
}

.wechat-login-button:hover {
  background: #06ad56;
  border-color: #06ad56;
}

.wechat-login-note {
  color: #8a8a8a;
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
}

.wechat-qr-dialog {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgb(0 0 0 / 18%);
  max-width: calc(100vw - 32px);
  padding: 0;
  width: 360px;
}

.wechat-qr-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.wechat-qr-header {
  align-items: center;
  border-bottom: 1px solid #ededed;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.wechat-qr-header button {
  background: transparent;
  border: 0;
  color: #8a8a8a;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.wechat-qr-dialog iframe {
  border: 0;
  display: block;
  height: 330px;
  width: 100%;
}

.wechat-qr-dialog > p {
  color: #8a8a8a;
  font-size: 12px;
  margin: 0;
  padding: 0 18px 16px;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.auth-divider + h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.wechat-profile-preview {
  align-items: center;
  background: #f7f7f7;
  border: 1px solid #ededed;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 12px;
}

.wechat-profile-preview img,
.wechat-profile-placeholder {
  align-items: center;
  background: #e8f8ee;
  border-radius: 50%;
  display: flex;
  height: 48px;
  justify-content: center;
  object-fit: cover;
  width: 48px;
}

.wechat-profile-preview div {
  display: grid;
  gap: 4px;
}

.wechat-profile-preview span {
  color: #8a8a8a;
  font-size: 13px;
}

.email-code-row .input {
  flex: 1;
}

.avatar:is(img) {
  object-fit: cover;
}

.auth-card h1,
.page-title h1,
.lesson-heading h1 {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.auth-card h1 {
  font-size: clamp(28px, 5vw, 38px);
}

.auth-card > p {
  margin: 8px 0 28px;
  color: var(--muted);
}

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

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label,
.section-label {
  font-size: 13px;
  font-weight: 650;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
}

.field-hint,
.field-error,
.meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.field-error {
  color: var(--danger);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 650;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  background: var(--primary-hover);
}

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

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

.button.secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

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

.button.danger {
  background: var(--danger);
}

.button.full {
  width: 100%;
}

.auth-card .button.full {
  background: linear-gradient(135deg, var(--accent), #ff6b00);
  box-shadow: 0 4px 14px rgb(255 139 61 / 0.32);
}

.auth-card .button.full:hover {
  background: linear-gradient(135deg, var(--accent-hover), #e85f00);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.inline-link {
  color: var(--primary);
  font-weight: 650;
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 34px;
}

.sidebar .brand-mark {
  width: 36px;
  height: 36px;
}

.nav-link {
  min-height: 46px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 650;
}

.nav-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  inline-size: 16px !important;
  block-size: 16px !important;
  min-width: 16px;
  max-width: 16px;
  min-height: 16px;
  max-height: 16px;
  display: block;
  flex: 0 0 16px;
  overflow: visible;
  stroke-width: 1.5;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.app-column {
  width: 100%;
  max-width: none;
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-start {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.lesson-topbar-context {
  flex: 1;
}

.lesson-topbar-back {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.lesson-topbar-back:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.lesson-topbar-back:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.lesson-topbar-back svg {
  width: 18px;
  height: 18px;
}

.lesson-topbar-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.lesson-topbar-breadcrumb a {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.lesson-topbar-breadcrumb > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-wrap {
  position: relative;
}

.avatar-button {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.avatar-button:hover,
.avatar-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface);
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 750;
}

.user-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 280px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-popover[hidden] {
  display: none;
}

.user-summary {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.user-summary strong,
.user-summary span {
  display: block;
}

.popover-nav {
  display: grid;
  gap: 4px;
  padding-top: 8px;
}

.popover-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.popover-item:hover {
  background: var(--surface-soft);
}

.popover-item.logout {
  color: var(--danger);
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.page-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 36px 32px 80px;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.page-title h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tab {
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.active,
.tab:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.search {
  width: min(100%, 320px);
}

.featured-course,
.course-card,
.panel,
.status-panel,
.live-card,
.document-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.featured-course {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.2fr;
  overflow: hidden;
  margin-bottom: 26px;
}

.course-cover-image {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  object-position: center;
}

.featured-content {
  padding: 30px;
}

.featured-content h2,
.course-card h2,
.panel h2,
.live-card h2 {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  line-height: 1.25;
}

.featured-content p,
.course-card p {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.tag.live {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}

.progress-line {
  height: 6px;
  overflow: hidden;
  margin: 14px 0 8px;
  border-radius: 3px;
  background: var(--surface-strong);
}

.progress-line span {
  display: block;
  height: 100%;
  background: var(--success);
}

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

.course-card {
  overflow: hidden;
  padding: 0;
}

.course-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
}

.course-card-content {
  padding: 20px 22px 22px;
}

.course-card h2 {
  font-size: 20px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel + .panel {
  margin-top: 18px;
}

.course-progress-overview {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 2.15fr);
  gap: 0;
  overflow: hidden;
  margin: 22px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.course-progress-primary {
  min-width: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.course-progress-ring {
  position: relative;
  isolation: isolate;
  width: 88px;
  height: 88px;
  display: grid;
  place-content: center;
  justify-items: center;
  background: conic-gradient(var(--success) calc(var(--course-progress) * 1%), var(--surface-strong) 0);
  border-radius: 50%;
}

.course-progress-ring::before {
  position: absolute;
  z-index: -1;
  inset: 8px;
  border-radius: inherit;
  background: var(--surface);
  content: "";
}

.course-progress-ring strong {
  color: var(--success);
  font-size: 21px;
  line-height: 1.1;
}

.course-progress-ring small {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
}

.course-progress-copy {
  min-width: 0;
  overflow: hidden;
}

.course-progress-copy > div:first-child {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.course-progress-primary h2 {
  margin: 0;
  font-size: 18px;
}

.course-progress-copy p {
  margin: 10px 0 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-progress-primary small,
.course-progress-metrics small {
  color: var(--muted);
}

.course-progress-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.course-progress-metrics > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.course-progress-metrics > div:last-child {
  border-right: 0;
}

.course-progress-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.course-progress-metrics strong {
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.course-progress-metrics small {
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.course-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.course-catalog-panel {
  min-width: 0;
}

.chapter {
  border-top: 1px solid var(--line);
}

.chapter:first-child {
  border-top: 0;
}

.chapter summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  cursor: pointer;
  font-weight: 750;
}

.chapter-progress {
  min-width: 220px;
  display: grid;
  grid-template-columns: auto 104px;
  align-items: center;
  justify-content: end;
  gap: 14px;
  color: var(--muted);
  font-weight: 500;
}

.chapter-progress > span {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.chapter-progress b {
  color: var(--text);
  font-size: 13px;
}

.chapter-progress small {
  font-size: 11px;
}

.chapter-progress-line {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-strong);
}

.chapter-progress-line > b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--success);
}

.lesson-list {
  display: grid;
  gap: 4px;
  padding: 0 0 16px;
}

.lesson-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.lesson-row:hover,
.lesson-row.current {
  background: var(--primary-soft);
}

.status-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.lesson-row.completed .status-icon {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.video-frame {
  aspect-ratio: 16 / 9;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgb(11 24 96 / 0.8), rgb(15 23 42 / 0.96)),
    repeating-linear-gradient(120deg, rgb(255 255 255 / 0.025) 0 1px, transparent 1px 18px);
  color: #ffffff;
}

.lesson-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-breadcrumb a:hover {
  color: var(--primary);
}

.lesson-workspace {
  display: grid;
  grid-template-areas:
    "video rail"
    "summary rail"
    "manuscript rail";
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 18px 22px;
  align-items: start;
}

.lesson-player-card {
  grid-area: video;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.lesson-video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 9px;
  background: #111827;
}

.lesson-video-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111827;
}

.lesson-video .watermark {
  top: 16px;
  right: 16px;
  bottom: auto;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgb(15 23 42 / 0.4);
  color: rgb(255 255 255 / 0.72);
  text-shadow: 0 1px 2px rgb(15 23 42 / 0.36);
}

.lesson-summary {
  grid-area: summary;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.lesson-summary h1 {
  margin-top: 5px;
  font-family: ui-sans-serif, "Noto Sans SC", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 760;
}

.lesson-summary p {
  margin: 7px 0 0;
}

.lesson-mobile-tools {
  display: none;
  grid-area: mobile-tools;
}

.lesson-rail {
  position: sticky;
  top: 86px;
  grid-area: rail;
  display: grid;
  min-width: 0;
}

.lesson-catalog-card {
  min-width: 0;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.lesson-rail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.lesson-rail-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.lesson-catalog-card > .progress-line {
  margin-top: 12px;
}

.lesson-document-outline {
  display: grid;
  gap: 3px;
  margin-top: 16px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--line);
}

.lesson-document-outline-link {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px 7px calc(8px + (var(--outline-depth, 1) - 1) * 12px);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lesson-document-outline-link span {
  color: #98a2b3;
  font-variant-numeric: tabular-nums;
}

.lesson-document-outline-link strong {
  overflow: hidden;
  color: inherit;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-document-outline-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.lesson-document-outline-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.lesson-document-outline-link.active strong {
  font-weight: 680;
}

.lesson-outline-empty {
  margin-top: 16px;
  padding: 18px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.course-document [data-document-heading] {
  scroll-margin-top: 96px;
}

.lesson-catalog {
  max-height: calc(100dvh - 210px);
  overflow-y: auto;
  margin: 14px -6px -6px;
  padding: 0 6px 6px;
  scrollbar-width: thin;
}

.catalog-chapter-group {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.catalog-chapter-group:first-child {
  margin-top: 0;
}

.catalog-chapter-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--line);
  border-radius: 0 9px 9px 0;
  background: var(--surface-strong);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.catalog-chapter-heading::-webkit-details-marker {
  display: none;
}

.catalog-chapter-heading:hover {
  background: color-mix(in srgb, var(--primary-soft) 32%, var(--surface-strong));
}

.catalog-chapter-heading:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.catalog-chapter-group.current .catalog-chapter-heading {
  border-left-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
}

.catalog-chapter-number {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.catalog-chapter-copy {
  min-width: 0;
}

.catalog-chapter-copy h3 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.catalog-chapter-copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-chapter-group.current .catalog-chapter-copy span,
.catalog-chapter-group.current .catalog-chapter-count {
  color: var(--primary);
}

.catalog-chapter-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.catalog-chapter-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.catalog-chapter-toggle {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition: transform 150ms ease;
}

.catalog-chapter-group[open] .catalog-chapter-toggle {
  transform: rotate(180deg);
}

.catalog-card-list {
  display: grid;
  gap: 9px;
  padding-left: 10px;
}

.catalog-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 150ms ease, background 150ms ease;
}

.catalog-card:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 32%, var(--surface));
}

.catalog-card.current {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface));
}

.catalog-card.locked {
  opacity: 0.6;
}

.catalog-card-type {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.catalog-card.current .catalog-card-type {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  background: var(--primary-soft);
  color: var(--primary);
}

.catalog-card-body {
  min-width: 0;
}

.catalog-card-body strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
}

.catalog-card-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.catalog-card-state {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.catalog-card.current .catalog-card-state {
  color: var(--primary);
  font-weight: 650;
}

.play-button {
  width: 62px;
  height: 62px;
  border: 1px solid rgb(255 250 244 / 0.45);
  border-radius: 50%;
  background: rgb(45 88 225 / 0.94);
  color: #ffffff;
  cursor: pointer;
  font-size: 20px;
}

.watermark {
  position: absolute;
  right: 6%;
  bottom: 8%;
  color: rgb(255 250 244 / 0.56);
  font-size: 12px;
  pointer-events: none;
}

.lesson-article {
  max-width: 780px;
  margin: 30px auto 0;
  font-size: 17px;
  line-height: 1.85;
}

.lesson-manuscript {
  grid-area: manuscript;
  max-width: none;
  margin: 0;
  padding: 24px 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

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

.lesson-content-tabs .tab {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
}

.lesson-content-tabs .tab:hover {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.lesson-content-tabs .tab.active {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 -2px var(--primary);
  color: var(--text);
  font-weight: 650;
}

.lesson-tab-panel > p,
.lesson-tab-panel > h2,
.lesson-tab-panel > h3,
.lesson-tab-panel > pre,
.lesson-tab-panel > .resource-link {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.lesson-resources-panel > header {
  max-width: 760px;
  margin: 0 auto 20px;
}

.lesson-resources-panel > header h2 {
  margin: 10px 0 4px;
}

.lesson-resources-panel > header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.lesson-article h2,
.lesson-article h3 {
  font-family: "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  line-height: 1.35;
}

.lesson-manuscript h2,
.lesson-manuscript h3 {
  font-family: ui-sans-serif, "Noto Sans SC", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.015em;
}

.lesson-manuscript h2 {
  font-size: 24px;
  font-weight: 720;
}

.lesson-manuscript h3 {
  font-size: 18px;
  font-weight: 680;
}

.lesson-manuscript p {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 16px;
  line-height: 1.82;
}

.lesson-manuscript ul {
  display: grid;
  gap: 8px;
  padding-left: 24px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 16px;
  line-height: 1.72;
}

.lesson-manuscript blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  line-height: 1.75;
}

.code-block {
  overflow-x: auto;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: #111827;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.lesson-content-image {
  margin: 24px 0;
}

.lesson-content-image img {
  width: 100%;
  max-height: 680px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.lesson-content-image figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.course-document-image {
  width: min(var(--course-image-width, 360px), 100%);
  margin: 24px auto;
}

.course-document-image.align-left { margin-right: auto; margin-left: 0; }
.course-document-image.align-center { margin-right: auto; margin-left: auto; }
.course-document-image.align-right { margin-right: 0; margin-left: auto; }

.course-document-image-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--course-image-crop-ratio, 16 / 9);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.course-document-image img {
  position: absolute;
  top: var(--course-image-offset-y, 0%);
  left: var(--course-image-offset-x, 0%);
  width: calc(var(--course-image-scale, 100) * 1%);
  max-width: none;
  height: auto;
  display: block;
  transform: rotate(var(--course-image-rotation, 0deg));
  transform-origin: center;
}

.course-document-image.is-natural-auto .course-document-image-viewport { aspect-ratio: auto; }
.course-document-image.is-natural-auto img {
  position: static;
  width: 100%;
  max-width: 100%;
}

.course-document-image.is-legacy-crop img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--course-image-x, 50%) var(--course-image-y, 50%);
}

.course-document-image.style-border .course-document-image-viewport { border-color: #b8bec8; }
.course-document-image.style-shadow .course-document-image-viewport { box-shadow: 0 12px 32px rgb(15 23 42 / 0.18); }
.course-document-image > a { display: block; color: inherit; }

.course-document-image figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.course-column-layout {
  display: grid;
  grid-template-columns: repeat(var(--course-column-count, 2), minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.course-column {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-soft) 52%, var(--surface));
}

.course-column > :first-child { margin-top: 0; }
.course-column > :last-child { margin-bottom: 0; }

.course-diagram {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 58%, var(--surface));
}

.course-diagram figcaption {
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 700;
}

.course-diagram > div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.course-diagram strong,
.course-diagram span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.course-diagram-mindmap strong { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.course-diagram-flowchart > div { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
.course-diagram-flowchart span + span::before { content: "→"; margin-right: 14px; color: var(--muted); }

.course-diagram { margin: 24px 0; padding: 20px; border: 1px solid #dce2ea; border-radius: 14px; background: #fbfcfe; }
.course-diagram figcaption { margin-bottom: 18px; color: #172033; font-size: 18px; font-weight: 700; text-align: center; }
.course-diagram-nodes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; }
.course-diagram-nodes > * { padding: 10px 14px; border: 1px solid #cfd8f2; border-radius: 9px; background: #fff; color: #344054; }
.course-diagram-mindmap .course-diagram-nodes > strong { border-color: #3157d5; background: #3157d5; color: #fff; }
.course-diagram-flowchart .course-diagram-nodes { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }
.course-diagram-flowchart .course-diagram-nodes > span::before { margin-right: 14px; color: #98a2b3; content: "→"; }

@media (max-width: 700px) {
  .course-column-layout { grid-template-columns: 1fr; }
  .admin-column-layout { grid-template-columns: 1fr; }
}

@media (max-width: 1400px) {
  .course-progress-overview {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
  }

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

  .course-progress-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .course-progress-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .course-progress-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-progress-primary {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .course-progress-ring {
    width: 72px;
    height: 72px;
  }

  .course-progress-ring::before {
    inset: 7px;
  }

  .course-progress-ring strong {
    font-size: 18px;
  }

  .course-progress-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-progress-metrics > div,
  .course-progress-metrics > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .course-progress-metrics > div:last-child {
    border-bottom: 0;
  }

  .chapter summary {
    align-items: flex-start;
  }

  .chapter-progress {
    min-width: 112px;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .chapter-progress > span {
    display: grid;
    justify-items: end;
    gap: 1px;
  }
}

.lesson-inline-video {
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #0f172a;
}

.lesson-inline-video video {
  width: 100%;
  max-height: 620px;
  display: block;
  background: #0f172a;
}

.lesson-inline-video figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  background: white;
}

.lesson-inline-video figcaption span {
  color: var(--muted);
  font-size: 12px;
}

.lesson-file-block {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.lesson-table-wrap {
  overflow-x: auto;
  margin: 22px 0;
}

.lesson-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.lesson-table-wrap th,
.lesson-table-wrap td {
  min-width: 100px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #e4e7ec);
  text-align: left;
  vertical-align: top;
}

.lesson-table-wrap th {
  background: #f8fafc;
}

.lesson-task-list {
  padding-left: 0;
  list-style: none;
}

.lesson-task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lesson-file-block:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.07);
  transform: translateY(-1px);
}

.lesson-file-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff3e8;
  color: #b45309;
  font-size: 11px;
  font-weight: 750;
}

.lesson-file-block > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.lesson-file-block strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-file-block small,
.lesson-file-block > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.resource-link {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.resource-link:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
}

.resource-link > span:last-child {
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
}

.resource-preview-dialog {
  width: min(calc(100% - 32px), 980px);
  max-width: 980px;
  height: min(86dvh, 900px);
  max-height: 900px;
  overflow: hidden;
}

.resource-preview-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.resource-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.resource-preview-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.resource-preview-stage {
  overflow: auto;
  padding: 30px;
  background: var(--surface-strong);
}

.resource-preview-sheet {
  width: min(100%, 760px);
  min-height: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.resource-preview-sheet h2 {
  margin: 20px 0 12px;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
}

.resource-preview-sheet p {
  color: var(--muted);
}

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 22px;
  min-width: 0;
}

.live-card {
  min-width: 0;
  padding: 20px;
}

.live-card h2 {
  overflow-wrap: anywhere;
}

.live-list {
  display: grid;
  gap: 12px;
}

.live-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.live-item.current {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

.document-toolbar {
  position: sticky;
  top: 68px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.document-stage {
  display: grid;
  place-items: center;
  padding: 30px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.document-sheet {
  width: min(100%, 820px);
  min-height: 920px;
  padding: clamp(28px, 7vw, 76px);
  box-shadow: var(--shadow);
}

.document-sheet h2 {
  font-family: "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.12;
}

.diagram-box {
  min-height: 240px;
  display: grid;
  place-items: center;
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
}

.profile-layout {
  max-width: 860px;
  display: grid;
  gap: 20px;
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

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

.profile-activation-panel {
  display: grid;
  gap: 18px;
}

.profile-activation-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.profile-activation-list article {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.profile-activation-list article > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-activation-list article > div:last-child {
  justify-items: end;
  color: var(--muted);
  font-size: 13px;
}

.profile-activation-list code {
  color: var(--text);
  font-size: 14px;
}

.status-page {
  min-height: calc(100dvh - 180px);
  display: grid;
  place-items: center;
}

.status-panel {
  width: min(100%, 620px);
  padding: 40px;
  text-align: center;
}

.status-symbol {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
}

.status-panel h1 {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  font-size: clamp(28px, 5vw, 42px);
}

.status-panel p {
  max-width: 48ch;
  margin: 12px auto 24px;
  color: var(--muted);
}

dialog {
  width: min(calc(100% - 32px), 440px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgb(25 22 19 / 0.48);
}

.dialog-content {
  padding: 24px;
}

.dialog-content h2 {
  margin-top: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 960px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    grid-template-columns: 1fr;
    overflow-x: clip;
  }

  .app-column {
    width: 100%;
    max-width: 100vw;
    grid-column: 1;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-start {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .featured-course,
  .split-layout,
  .live-layout {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .live-card {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 1180px) {
  .lesson-workspace {
    grid-template-areas:
      "video"
      "summary"
      "rail"
      "manuscript";
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-rail {
    position: static;
  }

  .lesson-catalog {
    max-height: 440px;
  }
}

@media (max-width: 700px) {
  .auth-header {
    padding: 0 18px;
  }

  .auth-header .header-copy,
  .avatar-name {
    display: none;
  }

  .auth-main {
    padding: 30px 16px 56px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .profile-activation-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-activation-list article > div:last-child {
    justify-items: start;
  }

  .page-main {
    padding: 26px 16px 64px;
  }

  .page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title .button-row,
  .button-row.mobile-stack {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title .button-row {
    align-items: flex-start;
    flex-direction: row;
  }

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

  .featured-course {
    display: block;
  }

  .course-cover-image {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .featured-content,
  .panel,
  .live-card {
    padding: 18px;
  }

  .live-card {
    max-width: calc(100vw - 32px);
  }

  .search {
    width: 100%;
  }

  .document-toolbar {
    top: 68px;
  }

  .document-sheet {
    min-height: 720px;
    padding: 28px 22px;
  }

  .resource-preview-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .resource-preview-header {
    padding: 12px 16px;
  }

  .resource-preview-stage {
    padding: 16px;
  }

  .resource-preview-sheet {
    min-height: 680px;
    padding: 28px 22px;
  }

  .lesson-player-card {
    padding: 6px;
  }

  .lesson-summary {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .lesson-summary .button {
    width: fit-content;
  }

  .lesson-rail {
    display: none;
  }

  .lesson-workspace {
    grid-template-areas:
      "video"
      "summary"
      "mobile-tools"
      "manuscript";
  }

  .lesson-mobile-tools {
    display: block;
    padding: 0 18px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .lesson-mobile-tools > summary {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    list-style: none;
  }

  .lesson-mobile-tools > summary::-webkit-details-marker {
    display: none;
  }

  .lesson-mobile-tools > summary strong {
    color: var(--primary);
    font-size: 13px;
  }

  .lesson-catalog-card,
  .lesson-manuscript {
    padding: 18px;
  }

  .lesson-catalog {
    max-height: 55dvh;
  }

  .lesson-video .watermark {
    top: 10px;
    right: 10px;
    bottom: auto;
    max-width: 62%;
    font-size: 9px;
    text-align: right;
  }

  .status-panel {
    padding: 30px 20px;
  }
}

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

/* Student design system: WeChat Official Accounts workspace */
:root {
  color-scheme: light;
  --student-canvas: #f7f7f7;
  --student-canvas-deep: #ededed;
  --student-sheet: #fff;
  --student-ink: rgb(0 0 0 / 90%);
  --student-muted: rgb(0 0 0 / 55%);
  --student-tips: rgb(0 0 0 / 30%);
  --student-line: rgb(0 0 0 / 10%);
  --student-accent: #07c160;
  --student-accent-active: #06ae56;
  --student-accent-deep: #06ae56;
  --student-accent-soft: rgb(7 193 96 / 10%);
  --student-font-display: system-ui, -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --student-font-body: system-ui, -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --student-font-mono: "SFMono-Regular", Consolas, monospace;
  --student-type-meta: 12px;
  --student-type-small: 14px;
  --student-type-body: 16px;
  --student-type-reading: 17px;
  --student-type-subtitle: 20px;
  --student-type-section: 22px;
  --student-type-title: 24px;
  --student-leading-body: 1.6;
  --student-leading-title: 1.4;
  --student-space-1: 4px;
  --student-space-2: 8px;
  --student-space-3: 12px;
  --student-space-4: 16px;
  --student-space-5: 24px;
  --student-space-6: 32px;
  --student-space-7: 48px;
  --student-space-page: clamp(20px, 4vw, 56px);
  --student-radius: 8px;
  --student-shadow-float: 0 8px 24px rgb(0 0 0 / 8%);
  --bg: var(--student-canvas);
  --surface: var(--student-sheet);
  --surface-soft: var(--student-canvas);
  --surface-strong: var(--student-canvas-deep);
  --text: var(--student-ink);
  --muted: var(--student-muted);
  --line: var(--student-line);
  --primary: var(--student-accent);
  --primary-hover: var(--student-accent-deep);
  --primary-soft: var(--student-accent-soft);
  --accent: var(--student-accent);
  --accent-hover: var(--student-accent-deep);
  --success: var(--student-accent);
  --shadow: var(--student-shadow-float);
  --sidebar: 216px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --focus: 0 0 0 3px rgb(7 193 96 / 18%);
}

html,
body {
  background: var(--student-canvas);
}

body {
  overflow-x: hidden;
  font-family: var(--student-font-body);
  font-size: var(--student-type-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.auth-card h1,
.page-title h1,
.lesson-heading h1,
.featured-content h2,
.course-card h2,
.panel h2,
.live-card h2 {
  font-family: var(--student-font-display);
}

.app-shell {
  background: var(--student-canvas);
}

.sidebar {
  padding: 20px 18px;
  border-right: 1px solid var(--student-line);
  background: #f5f6f7;
  backdrop-filter: none;
}

.brand {
  gap: 9px;
  color: var(--student-ink);
  font-family: var(--student-font-display);
  font-size: var(--student-type-body);
  letter-spacing: 0;
}

.brand-mark,
.sidebar .brand-mark {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--student-accent);
  color: #fff;
  font-family: var(--student-font-mono);
  font-size: var(--student-type-meta);
  box-shadow: none;
}

.sidebar-nav {
  gap: 2px;
  margin-top: 32px;
}

.nav-link {
  min-height: 48px;
  padding: 0 12px 0 4px;
  border-radius: 4px;
  color: var(--student-muted);
  font-size: var(--student-type-small);
  font-weight: 400;
  transition: color 180ms cubic-bezier(.22, 1, .36, 1), transform 180ms cubic-bezier(.22, 1, .36, 1);
}

.nav-link:hover {
  background: rgb(0 0 0 / 2%);
  color: var(--student-ink);
  transform: none;
}

.nav-link.active {
  background: var(--student-sheet);
  box-shadow: none;
  color: var(--student-accent-active);
  font-weight: 500;
}

.nav-icon {
  width: 36px;
  height: 36px;
}

.sidebar-note {
  padding: 14px 0 0;
  border-top: 1px solid var(--student-line);
  font-family: var(--student-font-body);
  font-size: var(--student-type-meta);
  letter-spacing: 0.04em;
}

.topbar {
  height: 64px;
  padding: 0 var(--student-space-page);
  border-bottom: 1px solid var(--student-line);
  background: var(--student-sheet);
  backdrop-filter: none;
}

.topbar-title {
  color: var(--student-muted);
  font-family: var(--student-font-body);
  font-size: var(--student-type-small);
  font-weight: 400;
  letter-spacing: 0;
}

.mobile-menu-button {
  padding: 0;
  font-size: var(--student-type-small);
  white-space: nowrap;
}

.avatar-button {
  border-radius: 4px;
  font-size: var(--student-type-small);
}

.avatar-button:hover,
.avatar-button[aria-expanded="true"] {
  border-color: var(--student-line);
  background: var(--student-sheet);
}

.avatar {
  border: 1px solid rgb(7 193 96 / 28%);
  background: var(--student-accent-soft);
  color: var(--student-accent-deep);
  font-family: var(--student-font-body);
  font-size: 12px;
}

.user-popover {
  width: 292px;
  padding: 8px;
  border-color: var(--student-line);
  border-radius: var(--student-radius);
  background: var(--student-sheet);
  box-shadow: var(--student-shadow-float);
}

.popover-nav {
  gap: 0;
}

.popover-item {
  min-height: 44px;
  border-radius: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--student-line) 70%, transparent);
}

.popover-item:hover {
  background: var(--student-canvas);
  color: var(--student-accent-deep);
}

.page-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(26px, 3.5vw, 52px) var(--student-space-page) clamp(72px, 9vw, 120px);
}

.page-title {
  margin-bottom: var(--student-space-6);
}

.page-title h1 {
  max-width: 18ch;
  font-size: var(--student-type-title);
  font-weight: 500;
  letter-spacing: 0;
  line-height: var(--student-leading-title);
}

.page-title p {
  max-width: 62ch;
  margin-top: var(--student-space-2);
  font-size: var(--student-type-small);
  line-height: 1.6;
}

.button {
  min-height: 40px;
  border-radius: 4px;
  background: var(--student-accent);
  font-size: var(--student-type-small);
  font-weight: 400;
  box-shadow: none;
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), opacity 180ms cubic-bezier(.22, 1, .36, 1);
}

.button:hover {
  background: var(--student-accent-active);
}

.button.secondary {
  border-color: var(--student-line);
  border-radius: 4px;
  background: var(--student-sheet);
  color: var(--student-ink);
  box-shadow: none;
}

.button.secondary:hover {
  border-color: rgb(0 0 0 / 18%);
  background: #f7f7f7;
}

.featured-course,
.course-card,
.panel,
.status-panel,
.live-card,
.document-sheet {
  border-color: var(--student-line);
  border-radius: var(--student-radius);
  background: var(--student-sheet);
  box-shadow: none;
}

.course-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-top: 0;
}

.course-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border-width: 1px;
  border-radius: var(--student-radius);
  color: inherit;
  text-decoration: none;
}

.featured-course {
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.course-card-cover {
  display: block;
  overflow: hidden;
  background: var(--student-canvas-deep);
}

.course-card-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  font-family: var(--student-font-body);
}

.course-cover-image,
.course-card-image {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.course-card:hover .course-cover-image,
.course-card:hover .course-card-image {
  transform: scale(1.015);
}

.course-card-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 12px;
}

.course-card-type {
  color: var(--student-muted);
  font-size: var(--student-type-small);
  line-height: 1.5;
}

.course-card h2,
.featured-course h2 {
  margin: 0;
  font-size: var(--student-type-subtitle);
  font-weight: 500;
  line-height: var(--student-leading-title);
}

.course-card h2 a {
  color: inherit;
  text-decoration: none;
}

.course-card h2 a:hover {
  color: var(--student-accent-active);
}

.course-card p,
.featured-course p {
  margin: 0;
  line-height: 1.6;
}

.course-card-description {
  min-height: calc(1.6em * 2);
  margin-top: 12px !important;
  display: -webkit-box;
  overflow: hidden;
  color: var(--student-muted);
  font-size: var(--student-type-small);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-card-learning-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--student-line);
}

.course-card-learning-meta span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.course-card-learning-meta small {
  color: var(--student-muted);
  font-size: var(--student-type-small);
  line-height: 1.5;
}

.course-card-learning-meta strong {
  overflow: hidden;
  color: var(--student-ink);
  font-size: var(--student-type-small);
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-card-content > .progress-line {
  width: 100%;
  margin: 20px 0 8px;
}

.course-card-progress-copy {
  color: var(--student-muted);
  font-size: var(--student-type-small);
}

.course-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.course-card-actions .button {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding-inline: 12px;
}

.tag {
  min-height: 24px;
  padding: 2px 7px;
  border: 0;
  border-radius: 4px;
  background: var(--student-accent-soft);
  color: var(--student-accent-active);
  font-family: var(--student-font-body);
  font-size: var(--student-type-meta);
  letter-spacing: 0;
}

.meta {
  font-size: var(--student-type-meta);
}

.progress-line {
  height: 3px;
  border-radius: 0;
  background: var(--student-canvas-deep);
}

.progress-line span {
  background: var(--student-accent);
}

.lesson-breadcrumb {
  gap: 8px;
  margin-bottom: 16px;
  color: var(--student-muted);
  font-family: var(--student-font-body);
  font-size: var(--student-type-small);
  letter-spacing: 0;
}

.lesson-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 292px);
  gap: 16px 24px;
}

.lesson-player-card {
  padding: 20px;
  border: 0;
  border-radius: var(--student-radius);
  background: var(--student-sheet);
}

.lesson-video {
  border-radius: 6px;
  background: #171b18;
  box-shadow: none;
}

.lesson-summary {
  padding: 24px;
  border: 0;
  border-radius: var(--student-radius);
  background: var(--student-sheet);
}

.lesson-summary h1 {
  max-width: 22ch;
  margin-top: 7px;
  font-family: var(--student-font-display);
  font-size: var(--student-type-title);
  font-weight: 500;
  letter-spacing: 0;
  line-height: var(--student-leading-title);
}

.lesson-summary p {
  margin-top: 8px;
  font-size: var(--student-type-small);
  line-height: 1.6;
}

.lesson-summary .meta {
  font-family: var(--student-font-body);
  font-size: var(--student-type-small);
  letter-spacing: 0;
  text-transform: none;
}

.lesson-rail {
  top: 88px;
  padding-left: 0;
  border-left: 0;
}

.lesson-catalog-card {
  padding: 20px;
  border: 0;
  border-radius: var(--student-radius);
  background: var(--student-sheet);
}

.lesson-rail-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--student-line);
}

.lesson-rail-heading h2 {
  font-family: var(--student-font-display);
  font-size: var(--student-type-body);
  font-weight: 500;
}

.lesson-document-outline {
  gap: 0;
  margin-top: 8px;
  padding: 0;
  border-left: 0;
}

.lesson-document-outline-link {
  min-height: 44px;
  gap: 10px;
  padding: 10px 8px 10px calc(8px + (var(--outline-depth, 1) - 1) * 12px);
  border-bottom: 1px solid var(--student-line);
  border-radius: 4px;
  font-size: var(--student-type-small);
}

.lesson-document-outline-link span {
  font-family: var(--student-font-mono);
  font-size: var(--student-type-meta);
}

.lesson-document-outline-link:hover {
  background: #f7f7f7;
  color: var(--student-ink);
  transform: none;
}

.lesson-document-outline-link.active {
  background: var(--student-accent-soft);
  box-shadow: none;
  color: var(--student-accent-active);
}

.lesson-manuscript {
  padding: 24px 32px 48px;
  border: 0;
  border-radius: var(--student-radius);
  background: var(--student-sheet);
}

.lesson-content-tabs {
  gap: 32px;
  margin-bottom: 32px;
  border-bottom-color: var(--student-line);
}

.lesson-content-tabs .tab {
  font-size: var(--student-type-small);
  letter-spacing: 0;
}

.lesson-content-tabs .tab.active {
  box-shadow: inset 0 -2px var(--student-accent);
  color: var(--student-accent-active);
}

.lesson-tab-panel.course-document {
  max-width: 680px;
  margin: 0;
}

.lesson-tab-panel > :is(h1, h2, h3, h4, p, pre, blockquote, ul, ol, .resource-link) {
  max-width: none;
  margin-right: 0;
  margin-left: 0;
}

.lesson-tab-panel.course-document > :first-child {
  margin-top: 0;
}

.lesson-tab-panel.course-document > h2 {
  margin: 48px 0 16px;
  font-size: var(--student-type-subtitle);
  font-weight: 500;
  line-height: 1.4;
}

.lesson-tab-panel.course-document > h3 {
  margin: 32px 0 8px;
  font-size: var(--student-type-reading);
  font-weight: 500;
  line-height: 1.4;
}

.lesson-tab-panel.course-document > p {
  margin: 0 0 24px;
  font-size: var(--student-type-reading);
  line-height: 1.6;
}

.lesson-tab-panel.course-document > p + p {
  margin-top: 0;
}

.lesson-tab-panel.course-document > :is(pre, blockquote, ul, ol) {
  margin-top: 0;
  margin-bottom: 24px;
}

.lesson-manuscript h2,
.lesson-manuscript h3 {
  max-width: 42ch;
  font-family: var(--student-font-display);
  color: var(--student-ink);
}

.lesson-manuscript h2 {
  margin-top: 48px;
  font-size: var(--student-type-subtitle);
  font-weight: 500;
  letter-spacing: 0;
}

.lesson-manuscript h3 {
  margin-top: 32px;
  font-size: var(--student-type-reading);
  font-weight: 500;
}

.lesson-manuscript p {
  max-width: 680px;
  color: color-mix(in srgb, var(--student-ink) 90%, var(--student-muted));
  font-size: var(--student-type-reading);
  line-height: 1.6;
}

.lesson-manuscript blockquote {
  max-width: 65ch;
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--student-accent);
  background: transparent;
  color: var(--student-muted);
}

.catalog-chapter-group {
  gap: 0;
  margin-top: 0;
}

.catalog-chapter-heading {
  position: static;
  min-height: 62px;
  padding: 10px 2px;
  border: 0;
  border-top: 1px solid var(--student-line);
  border-radius: 0;
  background: transparent;
}

.catalog-chapter-group.current .catalog-chapter-heading,
.catalog-chapter-heading:hover {
  border-left: 0;
  background: transparent;
  color: var(--student-accent-deep);
}

.catalog-chapter-copy h3 {
  font-family: var(--student-font-display);
  font-size: var(--student-type-small);
  font-weight: 650;
}

.catalog-card-list {
  gap: 0;
  padding-left: 18px;
}

.catalog-card {
  min-height: 64px;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid var(--student-line);
  border-radius: 0;
  background: transparent;
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), opacity 180ms cubic-bezier(.22, 1, .36, 1);
}

.catalog-card:hover {
  border-color: var(--student-line);
  background: transparent;
  transform: translateX(3px);
}

.catalog-card.current {
  border-color: var(--student-line);
  background: var(--student-accent-soft);
  box-shadow: inset 2px 0 var(--student-accent);
}

.catalog-card-type {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 2px;
  background: var(--student-canvas-deep);
  font-family: var(--student-font-mono);
  font-size: var(--student-type-meta);
}

.catalog-card-body strong {
  font-size: var(--student-type-small);
}

.catalog-card-meta,
.catalog-card-state,
.catalog-chapter-number,
.catalog-chapter-copy span,
.catalog-chapter-count {
  font-size: var(--student-type-meta);
}

.catalog-card.current .catalog-card-type {
  border: 0;
  background: var(--student-accent);
  color: var(--student-sheet);
}

.resource-link,
.lesson-file-block,
.course-document-file {
  border-color: var(--student-line);
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
}

.resource-link:hover,
.lesson-file-block:hover {
  border-color: var(--student-accent);
  background: var(--student-accent-soft);
  box-shadow: none;
}

.resource-preview-dialog {
  border: 1px solid var(--student-line);
  border-radius: 2px;
  background: var(--student-sheet);
  box-shadow: var(--student-shadow-float);
}

.resource-preview-header {
  border-bottom-color: var(--student-line);
  background: var(--student-sheet);
}

.resource-preview-stage {
  background: var(--student-canvas-deep);
}

.resource-preview-sheet {
  border-color: var(--student-line);
  border-radius: 0;
  background: var(--student-sheet);
  box-shadow: 0 8px 30px rgb(29 33 29 / .08);
}

dialog {
  border: 1px solid var(--student-line);
  border-radius: 2px;
  background: var(--student-sheet);
  color: var(--student-ink);
  box-shadow: var(--student-shadow-float);
}

dialog::backdrop {
  background: rgb(29 33 29 / .48);
  backdrop-filter: blur(2px);
}

.toast {
  border-radius: 2px;
  background: var(--student-ink);
  color: var(--student-sheet);
  box-shadow: var(--student-shadow-float);
}

/* Profile page: restrained WeUI account settings rhythm */
.profile-layout {
  align-items: start;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 24px;
}

.profile-layout > .panel {
  margin: 0;
  padding: 32px;
  border: 1px solid var(--student-line);
  border-radius: var(--student-radius);
}

.profile-layout .panel h2 {
  margin: 0;
  font-size: var(--student-type-subtitle);
  font-weight: 500;
  line-height: var(--student-leading-title);
}

.profile-panel-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 24px;
}

.profile-panel-heading p {
  margin: 0;
  color: var(--student-muted);
  font-size: var(--student-type-small);
  line-height: 1.6;
}

.profile-layout .form-grid {
  gap: 24px;
}

.profile-layout .form-row {
  gap: 8px;
}

.profile-layout .form-row label {
  color: var(--student-ink);
  font-size: var(--student-type-small);
  font-weight: 500;
  line-height: 1.5;
}

.profile-layout :is(.input, .textarea) {
  min-height: 44px;
  padding: 10px 12px;
  border-color: var(--student-line);
  border-radius: 6px;
  background: var(--student-sheet);
  color: var(--student-ink);
  font-size: var(--student-type-body);
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.profile-layout .textarea {
  min-height: 120px;
}

.profile-layout :is(.input, .textarea):focus {
  outline: 0;
  border-color: var(--student-accent);
  box-shadow: var(--focus);
}

.profile-layout .input:disabled {
  background: var(--student-canvas);
  color: var(--student-muted);
  cursor: not-allowed;
  opacity: 1;
}

.profile-layout :is(.field-hint, .field-error) {
  min-height: 18px;
  font-size: var(--student-type-meta);
  line-height: 1.5;
}

.avatar-editor {
  gap: 16px;
  margin: 0 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--student-line);
}

.avatar.large {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  font-size: var(--student-type-subtitle);
}

.avatar-editor-actions {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.avatar-editor-actions > span {
  color: var(--student-muted);
  font-size: var(--student-type-meta);
  line-height: 1.5;
}

.profile-layout .button-row .button {
  min-width: 128px;
}

.profile-activation-panel {
  grid-column: 1 / -1;
  gap: 0;
}

.profile-activation-list {
  border-top-color: var(--student-line);
}

.profile-activation-list article {
  gap: 24px;
  padding: 20px 0;
  border-bottom-color: var(--student-line);
}

.profile-activation-list strong {
  font-size: var(--student-type-body);
  font-weight: 500;
}

.profile-activation-list article span,
.profile-activation-list code {
  font-size: var(--student-type-meta);
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-workspace {
    gap: 26px;
  }

  .lesson-rail {
    padding: 0;
    border-left: 0;
  }
}

@media (max-width: 960px) {
  .sidebar {
    background: var(--student-canvas);
  }

}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-activation-panel {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 14px;
  }

  .page-main {
    padding: 24px 16px 72px;
  }

  .page-title h1 {
    font-size: 22px;
  }

  .profile-layout {
    gap: 16px;
  }

  .profile-layout > .panel {
    padding: 24px 20px;
  }

  .avatar-editor {
    align-items: flex-start;
  }

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

  .course-card-content {
    padding: 24px;
  }

  .course-card-actions {
    gap: 8px;
  }

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

  .lesson-summary {
    gap: 20px;
    padding: 20px;
  }

  .lesson-summary h1 {
    font-size: 22px;
  }

  .lesson-manuscript {
    padding: 20px 16px 40px;
  }

  .lesson-player-card {
    padding: 12px;
  }

  .lesson-mobile-tools {
    padding: 0 0 16px;
    border: 0;
    border-top: 1px solid var(--student-line);
    border-bottom: 1px solid var(--student-line);
    border-radius: 0;
    background: transparent;
  }

  .lesson-catalog-card {
    padding: 0;
  }

  .resource-preview-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .resource-preview-stage {
    padding: 12px;
  }

  .resource-preview-sheet {
    padding: 28px 20px;
  }
}

/* Keep authentication overrides last in the cascade. */
.auth-shell { background: #f5f7f6; color: rgb(0 0 0 / 90%); }
.auth-form-panel .auth-card .button.full.auth-primary-action { background: #07c160; box-shadow: none; }
.auth-form-panel .auth-card .button.full.auth-primary-action:hover { background: #06ad56; }
.auth-form-panel .auth-card .button.full.auth-google-button { border-color: rgb(0 0 0 / 13%); background: #fff; box-shadow: none; color: rgb(0 0 0 / 76%); }
.auth-form-panel .auth-card .button.full.auth-google-button:hover { border-color: rgb(0 0 0 / 24%); background: #f8f8f8; }
