:root {
  --ink-950: #14201f;
  --ink-900: #1b2927;
  --ink-800: #2b3b38;
  --ink-700: #485a57;
  --ink-600: #687875;
  --ink-500: #879491;
  --ink-400: #a8b2af;
  --line-strong: #d6dfdc;
  --line: #e5ebe9;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --surface-muted: #f1f5f3;
  --canvas: #f4f7f6;
  --rail: #112f2b;
  --rail-deep: #112f2b;
  --brand: #087d6d;
  --brand-hover: #066b5e;
  --brand-soft: #e6f3ef;
  --brand-pale: #f1f8f6;
  --blue: #3568d4;
  --blue-soft: #eef3ff;
  --amber: #b87318;
  --amber-soft: #fff3df;
  --danger: #a44840;
  --danger-soft: #fff0ed;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius-control: 6px;
  --radius-panel: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 40, 36, .03), 0 7px 20px rgba(20, 40, 36, .045);
  --shadow-md: 0 18px 48px rgba(18, 43, 38, .11);
  --rail-width: 192px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

.network-status-bar {
  position: fixed;
  top: calc(76px + env(safe-area-inset-top));
  left: calc(50% + var(--rail-width) / 2);
  z-index: 115;
  display: flex;
  width: min(430px, calc(100vw - var(--rail-width) - 32px));
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  align-items: center;
  gap: var(--space-3);
  color: #744515;
  background: rgba(255, 249, 237, .98);
  border: 1px solid #e9d0ad;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
  pointer-events: none;
}

.network-status-bar.hidden {
  display: none;
}

.network-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--amber);
  border: 3px solid #f7dfb9;
  border-radius: 50%;
  box-sizing: content-box;
}

.network-status-bar > span:last-child,
.network-status-bar b,
.network-status-bar small {
  display: block;
}

.network-status-bar b {
  font-size: 11px;
}

.network-status-bar small {
  margin-top: 2px;
  color: #896231;
  font-size: 9px;
  line-height: 1.45;
}

.account-danger-section {
  border-bottom: 0;
}

.account-delete-entry > span:last-child {
  flex: 0 0 auto;
  font-weight: 700;
}

.account-deletion-dialog {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  padding: var(--space-4);
  place-items: center;
  background: rgba(15, 24, 22, .48);
  backdrop-filter: blur(8px);
}

.account-deletion-dialog.hidden {
  display: none;
}

.account-deletion-panel {
  width: min(590px, 100%);
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  box-shadow: 0 28px 80px rgba(12, 24, 21, .24);
}

.account-deletion-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  min-height: 72px;
  padding: var(--space-4) var(--space-5);
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}

.account-deletion-head h2 {
  margin: var(--space-1) 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.account-deletion-head > button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink-600);
  background: var(--surface-muted);
  border: 0;
  border-radius: var(--radius-control);
}

.account-deletion-head svg,
.account-deletion-back svg {
  width: 16px;
  height: 16px;
}

.account-deletion-step {
  padding: var(--space-5);
}

.account-deletion-step.hidden,
.account-deletion-field.hidden,
.account-deletion-wechat.hidden,
.account-deletion-check.hidden {
  display: none;
}

.account-deletion-warning {
  padding: var(--space-4);
  color: #743c36;
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.account-deletion-warning b {
  font-size: 13px;
}

.account-deletion-warning p,
.account-deletion-copy p,
.account-deletion-wechat p {
  margin: var(--space-2) 0 0;
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.7;
}

.account-deletion-summary {
  margin: var(--space-4) 0;
  border-top: 1px solid var(--line);
}

.account-deletion-summary > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 46px;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.account-deletion-summary dt {
  color: var(--ink-500);
  font-size: 10px;
}

.account-deletion-summary dd {
  margin: 0;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.account-deletion-check {
  display: flex;
  min-height: 48px;
  padding: var(--space-2) 0;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.55;
}

.account-deletion-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--danger);
}

.account-deletion-message {
  min-height: 20px;
  margin: var(--space-2) 0 0;
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.6;
}

.account-deletion-message.error {
  color: var(--danger);
}

.account-deletion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.account-deletion-actions button {
  min-height: 44px;
  padding: 0 var(--space-4);
  color: var(--ink-700);
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 11px;
  font-weight: 750;
}

.account-deletion-actions button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.account-deletion-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.account-deletion-back {
  display: inline-flex;
  min-height: 34px;
  padding: 0;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-600);
  background: transparent;
  border: 0;
  font-size: 10px;
}

.account-deletion-copy {
  margin: var(--space-3) 0 var(--space-4);
}

.account-deletion-copy > span {
  color: var(--danger);
  font-size: 9px;
  font-weight: 800;
}

.account-deletion-copy h3 {
  margin: var(--space-1) 0 0;
  font-size: 17px;
  letter-spacing: 0;
}

.account-deletion-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface-muted);
  border-radius: var(--radius-panel);
}

.account-deletion-methods button {
  min-height: 38px;
  padding: 0 var(--space-2);
  color: var(--ink-600);
  background: transparent;
  border: 0;
  border-radius: var(--radius-control);
  font-size: 10px;
  font-weight: 700;
}

.account-deletion-methods button.active {
  color: var(--ink-900);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-deletion-methods button.hidden {
  display: none;
}

.account-deletion-field {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 700;
}

.account-deletion-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  color: var(--ink-900);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 500;
}

.account-deletion-field input:focus {
  outline: 2px solid rgba(164, 72, 64, .18);
  border-color: var(--danger);
}

.account-deletion-field small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 500;
}

.account-deletion-code-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.account-deletion-code-control button {
  min-width: 100px;
  padding: 0 var(--space-3);
  color: var(--brand);
  background: var(--brand-pale);
  border: 1px solid var(--brand-soft);
  border-radius: var(--radius-control);
  font-size: 10px;
  font-weight: 750;
}

.account-deletion-wechat {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--brand-pale);
  border: 1px solid var(--brand-soft);
  border-radius: var(--radius-control);
}

.account-deletion-wechat b {
  color: var(--brand-hover);
  font-size: 11px;
}

@media (max-width: 720px) {
  .network-status-bar {
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    width: calc(100vw - 24px);
  }

  .account-deletion-dialog {
    padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-3) max(var(--space-3), env(safe-area-inset-bottom));
  }

  .account-deletion-panel {
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  }

  .account-deletion-head,
  .account-deletion-step {
    padding-inline: var(--space-4);
  }

  .account-deletion-methods {
    grid-template-columns: 1fr;
  }

  .account-deletion-methods button.hidden {
    display: none;
  }
}

/* Practice workspace */
.practice-view {
  --practice-ink: #18201f;
  --practice-muted: #64706e;
  --practice-accent: #087f72;
  --practice-warm: #d79036;
  width: min(100%, 1120px);
  margin-inline: auto;
  padding-bottom: 64px;
}

.practice-view-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 5px 0 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .075);
}

.practice-view-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 750;
}

.practice-view .learning-mode-switcher {
  width: min(100%, 680px);
  margin: 20px auto 24px;
  padding: 4px;
  background: rgba(231, 235, 234, .72);
  border: 1px solid rgba(0, 0, 0, .065);
}

.practice-view .learning-mode-switcher button,
.practice-view .learning-mode-switcher span {
  min-height: 42px;
  font-size: 12px;
}

.practice-pending,
.practice-failed {
  width: min(100%, 760px);
  margin: 64px auto 0;
  padding: 48px;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .07);
}

.practice-pending-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  place-items: center;
  color: var(--practice-accent);
  background: #e8f4f1;
  border-radius: 50%;
}

.practice-pending-mark svg {
  width: 24px;
  height: 24px;
  animation: practice-spin 1.8s linear infinite;
}

@keyframes practice-spin { to { transform: rotate(360deg); } }

.practice-pending h3,
.practice-failed strong {
  display: block;
  margin: 8px 0 10px;
  color: var(--practice-ink);
  font-size: 24px;
}

.practice-pending p,
.practice-failed p {
  color: var(--practice-muted);
  line-height: 1.8;
}

.practice-pending .progress {
  height: 5px;
  margin-top: 28px;
  overflow: hidden;
  background: #edf0ef;
  border-radius: 3px;
}

.practice-pending .progress i {
  display: block;
  width: 2%;
  height: 100%;
  background: var(--practice-accent);
  transition: width .45s ease;
}

.practice-ready {
  width: min(100%, 860px);
  margin-inline: auto;
}

.practice-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 28px 4px 26px;
}

.practice-intro h1 {
  margin: 7px 0 8px;
  color: var(--practice-ink);
  font-size: 34px;
  letter-spacing: 0;
}

.practice-intro p,
.practice-anchor p {
  margin: 0;
  color: var(--practice-muted);
  line-height: 1.75;
}

.practice-mastery {
  min-width: 92px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.practice-mastery strong {
  display: block;
  color: var(--practice-accent);
  font-size: 24px;
}

.practice-mastery span,
.practice-anchor > span {
  color: var(--practice-muted);
  font-size: 11px;
}

.practice-mastery-meter {
  width: 68px;
  height: 3px;
  margin-top: 9px;
  overflow: hidden;
  background: #dce5e2;
  border-radius: 2px;
}

.practice-mastery-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--practice-accent);
  transition: width .35s ease;
}

.practice-anchor {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
  background: #f4f7f6;
  border-left: 3px solid var(--practice-accent);
}

.practice-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0 12px;
}

.practice-step {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 8px 12px;
  text-align: left;
  color: var(--practice-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
}

.practice-step b {
  grid-row: 1 / 3;
  color: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.practice-step span { color: inherit; font-weight: 750; }
.practice-step small { color: inherit; font-size: 10px; font-weight: 500; opacity: .72; }

.practice-step.active {
  color: #fff;
  background: var(--practice-ink);
  border-color: var(--practice-ink);
}

.practice-step.completed:not(.active) {
  color: var(--practice-accent);
  background: #edf7f4;
  border-color: #c8e2dc;
}

.practice-question {
  padding: 38px 44px 42px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 8px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, .065);
}

.practice-question > header > span {
  display: inline-block;
  padding: 5px 9px;
  color: var(--practice-accent);
  background: #eaf5f2;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.practice-question h2 {
  margin: 14px 0 8px;
  color: var(--practice-ink);
  font-size: 25px;
}

.practice-question header p {
  margin: 0;
  color: var(--practice-muted);
  font-size: 13px;
}

.practice-problem {
  margin: 30px 0 24px;
  color: var(--practice-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.9;
  white-space: pre-wrap;
}

.practice-options {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
}

.practice-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px 15px;
  text-align: left;
  color: var(--practice-ink);
  background: #fafbfb;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.practice-option.selected {
  background: #eaf5f2;
  border-color: #78b9af;
}

.practice-answer-field {
  display: grid;
  gap: 8px;
}

.practice-answer-field > span {
  color: var(--practice-muted);
  font-size: 12px;
  font-weight: 700;
}

.practice-answer-field textarea {
  width: 100%;
  min-height: 88px;
  padding: 14px 15px;
  resize: vertical;
  color: var(--practice-ink);
  background: #fafbfb;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  line-height: 1.6;
}

.practice-answer-field textarea:focus {
  outline: 2px solid rgba(8, 127, 114, .16);
  border-color: var(--practice-accent);
}

.practice-actions,
.practice-navigation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.practice-actions button,
.practice-navigation button,
.practice-failed button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 7px;
}

.practice-actions .primary {
  min-width: 132px;
  color: #fff;
  background: var(--practice-accent);
  border-color: var(--practice-accent);
}

.practice-item-state {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  margin-top: 20px;
  padding: 15px 16px;
  color: #165f56;
  background: #edf7f4;
  border: 1px solid #cee6e0;
  border-radius: 7px;
}

.practice-item-state.reviewed {
  color: #80551d;
  background: #fff7e9;
  border-color: #f0dfbd;
}

.practice-item-state-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--practice-accent);
  border-radius: 50%;
}

.practice-item-state.reviewed .practice-item-state-icon { background: var(--practice-warm); }
.practice-item-state-icon svg { width: 17px; height: 17px; }
.practice-item-state strong { display: block; font-size: 14px; }
.practice-item-state p { margin: 3px 0 0; color: var(--practice-muted); font-size: 12px; line-height: 1.6; }
.practice-item-state .practice-submitted-answer { margin-top: 7px; color: #315b55; font-weight: 650; }
.practice-item-state button { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 0 13px; color: var(--practice-accent); background: #fff; border-color: #c9dfda; border-radius: 6px; }
.practice-item-state button svg { width: 15px; height: 15px; }

.practice-feedback {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--practice-muted);
  font-size: 13px;
}

.practice-feedback.correct { color: var(--practice-accent); }
.practice-feedback.incorrect { color: #a45d22; }

.practice-hints,
.practice-solution {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.practice-hints div {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.practice-hints p {
  margin: 0;
  padding: 12px 14px;
  color: #65481f;
  background: #fff7e9;
  border-left: 3px solid var(--practice-warm);
  line-height: 1.7;
}

.practice-correct-answer {
  margin-top: 12px;
  padding: 14px 16px;
  color: var(--practice-accent);
  background: #edf7f4;
  font-weight: 700;
}

#practiceSolutionSteps {
  margin-top: 12px;
}

#practiceSolutionSteps .practice-solution-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.75;
}

#practiceSolutionSteps .practice-solution-step > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: #fff;
  background: var(--practice-accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 750;
}

#practiceSolutionSteps .practice-solution-step > p {
  min-width: 0;
  margin: 0;
  color: var(--practice-ink);
}

#practiceExplanation,
#practiceMistake {
  margin: 16px 0 0;
  line-height: 1.75;
}

#practiceMistake { color: #8b5a27; }

.practice-navigation {
  margin-top: 14px;
}

.practice-completion {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 22px 24px;
  color: #fff;
  background: #17312d;
  border-radius: 8px;
}

.practice-completion-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #17312d;
  background: #d8efe9;
  border-radius: 50%;
}

.practice-completion-mark svg { width: 21px; height: 21px; }
.practice-completion .eyebrow { color: #79c9bb; }
.practice-completion h2 { margin: 5px 0 4px; color: #fff; font-size: 19px; }
.practice-completion p { margin: 0; color: #bfd0cc; font-size: 12px; line-height: 1.65; }
.practice-completion-actions { display: flex; gap: 8px; }
.practice-completion button { min-height: 40px; padding: 0 15px; color: #fff; background: transparent; border-color: #66807b; border-radius: 6px; }
.practice-completion button.primary { color: #17312d; background: #fff; border-color: #fff; }

@media (max-width: 720px) {
  .practice-view-heading {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 64px;
    padding: 7px 0 13px;
  }

  .practice-view-heading h2 { font-size: 20px; }
  .practice-view-heading .view-badge { display: none; }
  .practice-view .learning-mode-switcher { margin: 12px 0 16px; }
  .practice-view .learning-mode-switcher button,
  .practice-view .learning-mode-switcher span { padding-inline: 6px; font-size: 11px; }
  .practice-pending,
  .practice-failed { margin-top: 26px; padding: 34px 20px; }
  .practice-pending h3 { font-size: 20px; }
  .practice-intro { gap: 14px; padding: 18px 2px; }
  .practice-intro h1 { font-size: 27px; }
  .practice-mastery { min-width: 74px; padding-left: 14px; }
  .practice-mastery-meter { width: 54px; }
  .practice-anchor { grid-template-columns: 1fr; gap: 6px; padding: 15px 16px; }
  .practice-steps { gap: 5px; }
  .practice-step { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 2px; min-height: 54px; padding: 7px 4px; text-align: center; font-size: 11px; }
  .practice-step b { display: none; }
  .practice-step small { font-size: 9px; }
  .practice-question { padding: 26px 18px 30px; }
  .practice-question h2 { font-size: 21px; }
  .practice-problem { margin-top: 22px; font-size: 16px; }
  .practice-actions button { flex: 1; padding-inline: 8px; }
  .practice-item-state { grid-template-columns: 32px minmax(0, 1fr); padding: 13px; }
  .practice-item-state button { grid-column: 1 / -1; justify-content: center; }
  .practice-completion { grid-template-columns: 38px minmax(0, 1fr); gap: 13px; padding: 18px; }
  .practice-completion-mark { width: 38px; height: 38px; }
  .practice-completion-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; }
}

/* The mini program owns the native top chrome; avoid rendering a second H5 header. */
body.inside-mini-program .shell > header {
  display: none;
}

body.inside-mini-program .shell {
  padding-top: max(16px, env(safe-area-inset-top));
}

/* Web account clarity and mobile layout stability. Keep these selectors scoped so
   account capability modes cannot alter unrelated pages. */
.video-policy-hidden {
  display: none !important;
}

.account-security-section {
  grid-column: 1 / -1;
  min-height: 0;
}

.account-security-list {
  display: grid;
}

.account-security-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

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

.account-security-row > span:nth-child(2),
.account-security-row > span:nth-child(2) b,
.account-security-row > span:nth-child(2) small {
  display: block;
  min-width: 0;
}

.account-security-row > span:nth-child(2) b {
  color: var(--ink-900);
  font-size: 11px;
}

.account-security-row > span:nth-child(2) small {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.5;
}

.account-security-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-pale);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.account-security-mark svg {
  width: 15px;
  height: 15px;
}

.account-security-row > strong {
  max-width: 210px;
  overflow: hidden;
  color: var(--brand-deep);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-security-row > strong.pending,
#accountConnectionBadge.pending {
  color: #9a5a13;
}

.account-security-row > button {
  grid-column: 3;
  min-width: 64px;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  color: #fff;
  background: var(--brand);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
}

@media (max-width: 720px) {
  .workspace,
  .drop,
  .upload-choice-row,
  .upload-choice {
    min-width: 0;
    max-width: 100%;
  }

  .upload-choice-row {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-choice {
    display: flex;
    width: 100%;
    padding-inline: 8px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
  }

  .upload-choice svg {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
  }

  .global-video-task {
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    grid-template-columns: 30px minmax(0, 1fr) auto 28px;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    padding: 9px;
    gap: 6px 8px;
  }

  .global-video-icon {
    width: 30px;
    height: 30px;
  }

  .global-video-copy {
    min-width: 0;
  }

  .global-video-task > #globalVideoAction {
    min-width: 42px;
    padding-inline: 8px;
  }

  .account-security-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .account-security-row > strong {
    max-width: 116px;
  }
}

@media (max-width: 380px) {
  .upload-choice-row {
    grid-template-columns: 1fr;
  }

  .account-security-row {
    grid-template-columns: 32px minmax(0, 1fr);
    padding-block: 9px;
  }

  .account-security-row > strong,
  .account-security-row > button {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
  }
}

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

body {
  font-size: 14px;
}

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

.shell {
  padding: 32px 40px 64px calc(var(--rail-width) + 40px);
}

.shell > header {
  width: var(--rail-width);
  padding: 26px 18px;
  background: var(--rail);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  gap: 11px;
}

.logo {
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  color: var(--rail);
  border-radius: 7px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
}

.brand-button b {
  font-size: 16px;
  font-weight: 780;
}

.brand-button small {
  margin-top: 4px;
  color: rgba(232, 246, 241, .62);
  font-size: 10px;
}

footer nav {
  top: 98px;
  width: var(--rail-width);
  padding: 0 12px;
  gap: 6px;
}

footer nav .nav-item,
footer nav button {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  color: rgba(230, 244, 239, .7);
  border-radius: 7px;
}

footer nav .nav-item > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
}

footer nav .nav-item small {
  font-size: 12px;
  font-weight: 650;
}

footer nav .nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

footer nav .nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 3px 0 #68c7b5;
}

footer > p {
  position: fixed;
  bottom: 24px;
  left: 22px;
  z-index: 31;
  display: block;
  width: calc(var(--rail-width) - 44px);
  margin: 0;
  color: rgba(226, 242, 236, .5);
  font-size: 10px;
  line-height: 1.6;
}

.header-actions {
  top: 28px;
  right: 38px;
}

.icon-btn,
.header-energy {
  min-height: 38px;
  border-color: rgba(210, 222, 218, .9);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

#homeView,
.page-view {
  width: min(100%, 1180px);
}

#homeView:not(.hidden) {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px 22px;
}

.hero {
  min-height: 136px;
  padding: 20px 120px 26px 0;
  align-items: center;
}

.tag,
.eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0;
}

.hero h2,
.view-heading h2,
.community-heading h2,
.community-detail-heading h2,
.announcement-head h2,
.visitor-guide-head h3 {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

.hero h2 {
  max-width: 760px;
  margin: 8px 0 10px;
  font-size: 42px;
  font-weight: 820;
  line-height: 1.22;
}

.hero h2 em {
  color: var(--brand);
}

.hero p {
  max-width: 680px;
  color: var(--ink-600);
  font-size: 14px;
  line-height: 1.75;
}

.workspace,
.result,
.profile-section,
.auth-panel,
.admin-section,
.admin-overview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace,
.result {
  padding: 24px;
}

.workspace-title {
  margin-bottom: 18px;
}

.workspace-title b {
  font-size: 18px;
  font-weight: 780;
}

.workspace-title span:not(.secure) {
  margin-top: 5px;
  font-size: 12px;
}

.secure {
  padding: 5px 8px;
  color: var(--brand);
  background: var(--brand-pale);
  border-radius: 4px;
  font-size: 10px;
}

.home-flow {
  margin-bottom: 18px;
}

.drop {
  min-height: 286px;
  padding: 34px 22px;
  border-color: #9ebfb7;
  background: #fbfdfc;
  border-radius: 8px;
}

.drop:hover {
  transform: none;
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(8, 125, 109, .08);
}

.camera-ring {
  width: 64px;
  height: 64px;
  border: 1px solid #b9d9d1;
  background: var(--brand-soft);
}

.drop strong {
  margin-top: 4px;
  color: var(--ink-900);
  font-size: 15px;
}

.drop > span:not(.camera-ring) {
  color: var(--ink-500);
  font-size: 11px;
}

.upload-choice-row {
  width: min(100%, 360px);
  margin-top: 10px;
}

.upload-choice {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
}

.action-row .primary,
.auth-submit,
.community-dialog-submit,
.crop-confirm,
.announcement-footer button,
#communityFilterApply {
  border-radius: 6px;
  background: var(--brand);
}

.quick {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.quick .quick-item,
.quick > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 74px;
  padding: 12px 14px;
  align-items: center;
  gap: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.quick .quick-item:hover {
  transform: translateY(-2px);
  border-color: #b7cbc5;
  box-shadow: 0 12px 26px rgba(22, 48, 42, .08);
}

.quick-icon {
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  border-radius: 7px;
}

.quick b {
  align-self: end;
  font-size: 13px;
}

.quick small {
  align-self: start;
  color: var(--ink-500);
  font-size: 10px;
}

.continue-learning {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.page-view {
  padding-top: 8px;
}

.view-heading,
.community-heading,
.community-detail-heading {
  min-height: 94px;
  margin-bottom: 22px;
  padding: 8px 2px 20px;
  border-bottom: 1px solid var(--line);
}

.view-heading h2,
.community-heading h2 {
  margin: 6px 0 0;
  font-size: 30px;
  font-weight: 800;
}

.view-badge,
.community-count {
  min-height: 28px;
  padding: 0 10px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 720;
}

.sync-note,
.record-tools,
.chat-context,
.feature-usage-line {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.record-stats {
  margin: 16px 0 18px auto;
  border: 0;
  background: transparent;
}

.record-stats div {
  min-width: 108px;
}

.record-tools {
  padding: 10px;
}

.record-item {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.record-item:hover {
  border-color: #b7cbc5;
  box-shadow: 0 12px 28px rgba(20, 48, 42, .08);
}

.chat-empty {
  min-height: 420px;
}

.chat-empty h3 {
  font-size: 24px;
}

.prompt-list button {
  border-radius: 6px;
  background: #fff;
}

.chat-composer {
  border-color: var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(18, 43, 38, .12);
}

.profile-identity {
  padding: 22px;
  border-radius: 8px;
  background: var(--rail);
  box-shadow: var(--shadow-md);
}

.profile-avatar {
  background: #dff2ed;
  color: var(--rail);
}

.auth-panel,
.profile-section {
  padding: 20px;
}

.auth-form input,
.profile-name-editor input,
.community-search,
.community-filters select,
#recordSearch {
  border-radius: 6px;
  background: #fbfcfc;
}

.usage-list > div,
.setting-action,
.setting-row,
.danger-row {
  min-height: 52px;
}

.energy-section {
  border-color: #d8e3df;
}

.energy-balance-row {
  padding: 22px;
  border-radius: 7px;
  background: var(--rail);
}

.energy-package {
  border-radius: 8px;
}

.community-toolbar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.community-filters {
  padding: 12px 2px 14px;
}

.community-feed {
  gap: 22px 18px;
}

.community-card {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.community-cover,
.community-player-wrap {
  border-radius: 7px;
}

.community-course-info h1 {
  font-size: 26px;
}

.lesson-document,
.lesson-content,
.lesson-sidebar,
.lesson-aside {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.learning-mode-switcher {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf2f0;
}

.learning-mode-switcher button {
  border-radius: 5px;
}

.learning-mode-switcher button.active {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 45, 40, .08);
}

.video-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  box-shadow: var(--shadow-sm);
}

.video-stage {
  border-radius: 7px;
  background: #182321;
  box-shadow: 0 16px 42px rgba(10, 26, 23, .18);
}

.video-viewer-meta,
.video-viewer-lesson {
  border-color: var(--line);
}

.announcement-dialog,
.visitor-guide-dialog,
.payment-dialog,
.community-dialog {
  background: rgba(13, 31, 28, .56);
  backdrop-filter: blur(8px);
}

.announcement-panel,
.visitor-guide,
.payment-dialog-panel,
.community-dialog-panel {
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(8, 28, 23, .24);
}

.global-video-task,
.toast-region > * {
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(13, 37, 32, .16);
}

.tutor-launcher {
  filter: drop-shadow(0 12px 18px rgba(12, 40, 34, .16));
}

@media (max-width: 1000px) and (min-width: 721px) {
  :root {
    --rail-width: 176px;
  }

  .shell {
    padding-right: 26px;
    padding-left: calc(var(--rail-width) + 26px);
  }

  #homeView:not(.hidden) {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .hero {
    padding-right: 0;
  }

  .hero h2 {
    font-size: 36px;
  }
}

@media (max-width: 720px) {
  #homeView.has-fresh-result #continueLearning {
    display: none !important;
  }

  :root {
    --rail-width: 0px;
  }

  body {
    background: #f6f8f7;
  }

  .shell {
    padding: calc(66px + env(safe-area-inset-top)) 14px calc(82px + env(safe-area-inset-bottom));
  }

  .shell > header {
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
    background: rgba(255, 255, 255, .94);
    border-right: 0;
    box-shadow: 0 1px 0 var(--line);
  }

  .logo {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    color: #fff;
    background: var(--brand);
    border-radius: 6px;
    font-size: 14px;
  }

  .brand-button b {
    color: var(--ink-900);
    font-size: 14px;
  }

  .header-actions {
    position: static;
  }

  #homeView,
  .page-view {
    width: min(100%, 560px);
    margin-inline: auto;
  }

  #homeView:not(.hidden) {
    display: block;
  }

  .hero {
    min-height: 0;
    padding: 15px 2px 22px;
  }

  .tag {
    font-size: 10px;
  }

  .hero h2 {
    max-width: 360px;
    margin: 8px 0 9px;
    font-size: 30px;
    line-height: 1.26;
  }

  .hero p {
    max-width: 430px;
    font-size: 12px;
    line-height: 1.7;
  }

  .workspace,
  .result {
    padding: 17px 14px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
  }

  .workspace-title b {
    font-size: 16px;
  }

  .drop {
    min-height: 240px;
    padding: 26px 12px;
  }

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

  .quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .quick .quick-item,
  .quick > div {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 72px;
    padding: 10px;
    gap: 2px 8px;
  }

  .quick-icon {
    width: 34px;
    height: 34px;
  }

  .quick b {
    font-size: 12px;
  }

  .quick small {
    font-size: 9px;
  }

  .page-view {
    min-height: calc(100dvh - 144px);
    padding-top: 5px;
  }

  .view-heading,
  .community-heading,
  .community-detail-heading {
    min-height: 74px;
    margin-bottom: 14px;
    padding: 4px 1px 14px;
  }

  .view-heading h2,
  .community-heading h2 {
    font-size: 24px;
  }

  .record-tools,
  .sync-note {
    border-radius: 7px;
  }

  .record-item {
    padding: 14px;
  }

  .profile-identity,
  .auth-panel,
  .profile-section {
    border-radius: 8px;
  }

  .profile-identity {
    padding: 18px;
  }

  .auth-panel,
  .profile-section {
    padding: 16px;
  }

  .community-toolbar {
    padding: 9px;
  }

  .community-feed {
    gap: 18px 10px;
  }

  .community-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .community-cover {
    border-radius: 7px;
  }

  .learning-mode-switcher {
    position: sticky;
    top: calc(58px + env(safe-area-inset-top));
    z-index: 18;
  }

  .video-view {
    width: 100%;
    min-height: 0;
    margin: 0;
    border-radius: 8px;
  }

  .video-view-heading {
    padding-inline: 12px;
  }

  .video-stage {
    border-radius: 0;
  }

  footer > p {
    display: none;
  }

  footer nav {
    inset: auto 0 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 30px rgba(18, 42, 37, .07);
    backdrop-filter: blur(16px);
  }

  footer nav .nav-item,
  footer nav button {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 52px;
    padding: 0;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: var(--ink-400);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
  }

  footer nav .nav-item:hover {
    color: var(--ink-500);
    background: transparent;
  }

  footer nav .nav-item.active {
    color: var(--brand);
    background: transparent;
    box-shadow: none;
  }

  footer nav .nav-item.active::before {
    position: absolute;
    top: 3px;
    width: 18px;
    height: 3px;
    background: var(--brand);
    border-radius: 3px;
    content: "";
  }

  footer nav .nav-item > span {
    width: 24px;
    height: 24px;
  }

  footer nav .nav-item small {
    min-height: 0;
    font-size: 9px;
    line-height: 1.1;
  }
}

@media (max-width: 390px) {
  .shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .quick .quick-item,
  .quick > div {
    grid-template-columns: 32px minmax(0, 1fr);
    padding-inline: 9px;
  }

  .quick-icon {
    width: 31px;
    height: 31px;
  }
}

/* Product polish: restrained surfaces, stronger typography and denser workflows. */
:root {
  --ink-950: #1d1d1f;
  --ink-900: #242426;
  --ink-800: #363638;
  --ink-700: #515154;
  --ink-600: #68686d;
  --ink-500: #85858a;
  --ink-400: #a7a7ac;
  --line-strong: #d8d8dd;
  --line: #e6e6ea;
  --surface-soft: #fafafa;
  --surface-muted: #f1f2f3;
  --canvas: #f5f5f7;
  --rail: rgba(251, 251, 253, .92);
  --rail-deep: #fbfbfd;
  --brand: #087f70;
  --brand-hover: #066d61;
  --brand-soft: #e7f3f0;
  --brand-pale: #f2f8f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .025), 0 8px 24px rgba(0, 0, 0, .045);
  --shadow-md: 0 22px 60px rgba(0, 0, 0, .12);
  --rail-width: 208px;
}

html {
  color-scheme: light;
}

body {
  color: var(--ink-900);
  background: var(--canvas);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--ink-950);
  background: #bfe6dc;
}

.shell {
  min-height: 100dvh;
  padding: 30px 48px 72px calc(var(--rail-width) + 48px);
}

.shell > header {
  width: var(--rail-width);
  padding: 26px 18px;
  color: var(--ink-900);
  background: var(--rail);
  border-right: 1px solid rgba(0, 0, 0, .065);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .7);
  backdrop-filter: none;
}

.logo {
  color: #fff;
  background: var(--brand);
  font-family: inherit;
  font-size: 16px;
  font-weight: 760;
  box-shadow: 0 5px 14px rgba(8, 127, 112, .2);
}

.brand-button b {
  color: var(--ink-950);
  font-size: 16px;
  font-weight: 760;
}

.brand-button small {
  color: var(--ink-500);
  font-size: 10px;
}

footer nav {
  top: 104px;
  width: var(--rail-width);
  padding: 0 12px;
  gap: 5px;
}

footer nav .nav-item,
footer nav button {
  min-height: 46px;
  color: var(--ink-600);
  border-radius: 7px;
}

footer nav .nav-item:hover {
  color: var(--ink-950);
  background: rgba(0, 0, 0, .035);
}

footer nav .nav-item.active {
  color: var(--ink-950);
  background: var(--brand-soft);
  box-shadow: none;
}

footer nav .nav-item.active > span {
  color: var(--brand);
}

footer nav .nav-item small {
  font-size: 13px;
}

footer > p {
  left: 23px;
  color: var(--ink-500);
  font-size: 10px;
}

.header-energy,
.icon-btn {
  border-color: rgba(0, 0, 0, .09);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

#homeView,
.page-view {
  width: min(100%, 1160px);
  margin-inline: auto;
}

.app-view.active {
  animation: ui-view-enter .28s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes ui-view-enter {
  from { opacity: .35; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

#homeView:not(.hidden) {
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 22px;
}

.hero {
  min-height: 164px;
  padding: 22px 0 27px;
}

.tag,
.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 720;
}

.hero h2 {
  margin: 9px 0 11px;
  color: var(--ink-950);
  font-size: 42px;
  font-weight: 780;
  line-height: 1.18;
}

.hero p {
  color: var(--ink-600);
  font-size: 15px;
  line-height: 1.7;
}

.workspace,
.result,
.profile-section,
.auth-panel,
.admin-section,
.admin-overview {
  border-color: rgba(0, 0, 0, .075);
  box-shadow: var(--shadow-sm);
}

.workspace {
  padding: 26px;
}

.workspace-title b {
  color: var(--ink-950);
  font-size: 19px;
}

.workspace-title span:not(.secure) {
  color: var(--ink-500);
  font-size: 12px;
}

.secure {
  color: var(--brand);
  font-size: 11px;
}

.home-flow span {
  font-size: 11px;
}

.drop {
  min-height: 294px;
  border: 1px dashed #9ac6bc;
  background: #fdfefe;
}

.drop strong {
  font-size: 17px;
}

.drop > span:not(.camera-ring) {
  font-size: 12px;
}

.upload-choice {
  font-size: 12px;
}

.action-row .primary {
  min-height: 44px;
  font-size: 13px;
}

.quick {
  gap: 11px;
}

.quick .quick-item,
.quick > div {
  min-height: 78px;
  padding: 13px 14px;
  border-color: rgba(0, 0, 0, .07);
}

.quick b {
  color: var(--ink-900);
  font-size: 14px;
}

.quick small {
  color: var(--ink-500);
  font-size: 11px;
}

.quick .quick-item:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 127, 112, .22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .075);
}

.view-heading,
.community-heading,
.community-detail-heading {
  min-height: 112px;
  margin-bottom: 22px;
  padding: 16px 2px 23px;
}

.view-heading h2,
.community-heading h2 {
  color: var(--ink-950);
  font-size: 34px;
  font-weight: 760;
}

.community-heading p {
  color: var(--ink-600);
  font-size: 13px;
}

.view-badge,
.community-count {
  min-height: 30px;
  padding-inline: 11px;
  font-size: 11px;
}

.sync-note {
  min-height: 64px;
  padding: 12px 14px;
  border-color: rgba(0, 0, 0, .07);
}

.sync-note b {
  font-size: 12px;
}

.sync-note span {
  font-size: 10px;
}

.record-stats {
  width: min(440px, 100%);
}

.record-stats div {
  min-width: 0;
  padding-inline: 18px;
}

.record-stats strong {
  font-size: 21px;
}

.record-stats span {
  font-size: 10px;
}

.record-tools {
  padding: 11px;
  border-color: rgba(0, 0, 0, .07);
}

.record-item {
  min-height: 96px;
  padding: 14px 16px;
  border-color: rgba(0, 0, 0, .07);
}

.record-meta {
  font-size: 10px;
}

.record-item h3 {
  margin-top: 7px;
  font-size: 14px;
  font-weight: 650;
}

.record-item p {
  font-size: 11px;
}

.record-actions button {
  min-height: 34px;
  font-size: 11px;
}

#profileView:not(.hidden) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

#profileView > .view-heading,
#profileView > .profile-identity,
#profileView > .auth-panel,
#profileView > .energy-section {
  grid-column: 1 / -1;
}

#profileView > .view-heading {
  width: 100%;
  margin-bottom: 8px;
}

.profile-identity,
.profile-section,
.auth-panel {
  margin-top: 0;
}

.profile-identity {
  min-height: 100px;
  padding: 22px;
  background: #17332f;
}

.profile-identity b {
  font-size: 15px;
}

.profile-identity small {
  font-size: 11px;
}

.profile-section,
.auth-panel {
  min-height: 152px;
  padding: 20px;
}

.profile-section-title h3 {
  font-size: 15px;
}

.profile-section-title span {
  font-size: 10px;
}

.usage-list span,
.usage-list strong,
.setting-action b,
.setting-row b,
.danger-row b {
  font-size: 12px;
}

.setting-action small,
.setting-row small,
.danger-row small,
.profile-name-editor > label small {
  font-size: 10px;
  line-height: 1.55;
}

.profile-name-editor > label {
  font-size: 12px;
}

.profile-name-editor input,
.profile-name-editor button {
  min-height: 42px;
  font-size: 12px;
}

.community-toolbar {
  padding: 11px;
  border-color: rgba(0, 0, 0, .07);
}

.community-filters {
  padding-block: 14px 17px;
}

.community-feed {
  gap: 24px 18px;
}

.community-card {
  border-color: rgba(0, 0, 0, .075);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .055);
}

.community-cover {
  color: #24433d;
  background: #eaf1ef;
}

.community-cover::before {
  right: auto;
  left: 0;
  width: 4px;
  background: var(--brand);
}

.community-cover.subject-physics {
  color: #294257;
  background: #e8eef3;
}

.community-cover.subject-physics::before {
  background: #3e7094;
}

.community-cover.subject-chemistry {
  color: #4c543e;
  background: #eef0e8;
}

.community-cover.subject-chemistry::before {
  background: #7d8d5d;
}

.community-cover-head {
  font-size: 9px;
}

.community-cover-paper {
  border: 1px solid rgba(0, 0, 0, .055);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .045);
}

.community-cover-paper p {
  font-size: 11px;
}

.community-cover-duration {
  color: var(--ink-700);
  background: rgba(255, 255, 255, .82);
}

.community-card-body {
  padding: 17px;
}

.community-card-subject {
  font-size: 10px;
}

.community-card h3 {
  font-size: 16px;
}

.community-card p,
.community-card-meta {
  font-size: 10px;
}

.lesson-document,
.lesson-content,
.lesson-sidebar,
.lesson-aside,
.video-view {
  border-color: rgba(0, 0, 0, .075);
}

.lesson-document {
  padding: 30px 34px 38px;
}

.lesson-document h1 {
  color: var(--ink-950);
  font-size: 22px;
  line-height: 1.7;
}

.learning-mode-switcher {
  min-height: 52px;
  background: #eceeed;
}

.learning-mode-switcher button,
.learning-mode-switcher span {
  font-size: 13px;
}

.video-view {
  overflow: hidden;
  background: #fff;
}

.video-stage {
  background: #141716;
}

.announcement-dialog,
.visitor-guide-dialog,
.payment-dialog,
.community-dialog {
  background: rgba(24, 24, 27, .42);
  backdrop-filter: saturate(120%) blur(18px);
}

.announcement-panel,
.visitor-guide,
.payment-dialog-panel,
.community-dialog-panel {
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .22);
}

@media (max-width: 1000px) and (min-width: 721px) {
  :root { --rail-width: 184px; }
  .shell { padding-right: 30px; padding-left: calc(var(--rail-width) + 30px); }
}

@media (max-width: 720px) {
  :root { --rail-width: 0px; }

  body {
    font-size: 14px;
    background: #f5f5f7;
  }

  .shell {
    padding: calc(66px + env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom));
  }

  .shell > header {
    width: 100%;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    background: rgba(251, 251, 253, .86);
    border-bottom: 1px solid rgba(0, 0, 0, .07);
    box-shadow: none;
    backdrop-filter: saturate(180%) blur(20px);
  }

  .brand-button > span:last-child {
    display: grid;
    width: auto;
  }

  .brand-button {
    width: auto;
  }

  .brand-button b {
    display: block;
    color: var(--ink-950);
    font-size: 14px;
  }

  .brand-button small {
    display: none;
  }

  .logo {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  #homeView,
  .page-view {
    width: min(100%, 560px);
  }

  .hero {
    padding: 20px 2px 21px;
  }

  .hero h2 {
    margin-block: 8px 10px;
    font-size: 31px;
    line-height: 1.22;
  }

  .hero p {
    font-size: 13px;
  }

  .workspace,
  .result {
    padding: 16px 14px;
  }

  .workspace-title b {
    font-size: 17px;
  }

  .home-flow {
    gap: 4px;
  }

  .home-flow span {
    gap: 4px;
    font-size: 9px;
  }

  .drop {
    min-height: 242px;
    padding: 26px 10px;
  }

  .drop strong {
    font-size: 15px;
  }

  .quick {
    gap: 8px;
  }

  .quick .quick-item,
  .quick > div {
    min-height: 76px;
    padding: 11px;
  }

  .quick b {
    font-size: 13px;
  }

  .quick small {
    font-size: 10px;
  }

  .view-heading,
  .community-heading,
  .community-detail-heading {
    min-height: 92px;
    margin-bottom: 14px;
    padding: 16px 1px 16px;
  }

  .view-heading h2,
  .community-heading h2 {
    font-size: 27px;
  }

  .record-stats {
    width: 100%;
  }

  .record-stats div {
    padding-inline: 6px;
  }

  .record-item {
    padding: 14px;
  }

  .record-item h3 {
    font-size: 13px;
  }

  .record-actions {
    display: grid;
    grid-template-columns: 34px 34px minmax(92px, 1fr) 54px 54px;
    width: 100%;
    gap: 5px;
  }

  .record-actions button,
  .record-actions button.open-record,
  .record-actions button.watch-video,
  .record-actions button.open-interactive {
    width: 100%;
    min-width: 0;
    padding-inline: 4px;
  }

  #profileView:not(.hidden) {
    display: block;
  }

  #profileView > .view-heading {
    margin-bottom: 14px;
  }

  .profile-identity,
  .profile-section,
  .auth-panel {
    margin-top: 12px;
  }

  .profile-section,
  .auth-panel {
    min-height: 0;
    padding: 17px 16px;
  }

  .profile-name-editor > div {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .community-toolbar {
    padding: 9px;
  }

  .community-feed {
    gap: 20px 10px;
  }

  .community-cover {
    border: 1px solid rgba(0, 0, 0, .055);
    border-radius: 6px;
  }

  .community-cover-paper {
    box-shadow: none;
  }

  .community-card h3 {
    min-height: 38px;
    font-size: 12px;
  }

  .community-card-meta {
    font-size: 8px;
  }

  .lesson-document {
    padding: 22px 16px 30px;
  }

  .learning-mode-switcher {
    min-height: 48px;
  }

  footer nav {
    inset: auto 0 0;
    top: auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    background: rgba(251, 251, 253, .88);
    border-top-color: rgba(0, 0, 0, .07);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .055);
    backdrop-filter: saturate(180%) blur(20px);
  }

  footer nav .nav-item,
  footer nav button {
    color: #929297;
  }

  footer nav .nav-item.active {
    color: var(--brand);
  }

  footer nav .nav-item.active::before {
    width: 16px;
    height: 2px;
  }
}

@media (max-width: 380px) {
  .record-actions {
    grid-template-columns: 32px 32px minmax(82px, 1fr) 50px 50px;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view.active {
    animation: none;
  }

  .quick .quick-item,
  .record-item,
  .community-card {
    transition: none;
  }
}

/* V3: consumer product layout with a lightweight top navigation. */
@media (min-width: 721px) {
  :root {
    --rail-width: 0px;
  }

  .shell {
    padding: 92px clamp(28px, 4vw, 64px) 76px;
  }

  .shell > header {
    inset: 0 0 auto;
    z-index: 32;
    width: 100%;
    height: 64px;
    padding: 0 clamp(24px, 4vw, 64px);
    align-items: center;
    color: var(--ink-900);
    background: rgba(250, 250, 252, .82);
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .72);
    backdrop-filter: saturate(180%) blur(22px);
  }

  .brand-button {
    width: auto;
    flex: 0 0 auto;
  }

  .brand-button small {
    display: none;
  }

  .brand-button b {
    font-size: 15px;
    letter-spacing: 0;
  }

  .logo {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(8, 127, 112, .18);
  }

  .header-energy {
    position: absolute;
    top: 13px;
    right: clamp(24px, 4vw, 64px);
    min-height: 38px;
    padding-inline: 7px 12px;
    border-color: rgba(0, 0, 0, .08);
    background: rgba(255, 255, 255, .8);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .055);
  }

  footer nav {
    inset: 0 auto auto 50%;
    top: 0;
    z-index: 33;
    display: grid;
    grid-template-columns: repeat(5, minmax(74px, auto));
    width: auto;
    height: 64px;
    padding: 0;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: translateX(-50%);
  }

  footer nav .nav-item,
  footer nav button {
    display: flex;
    grid-template-columns: none;
    width: auto;
    min-width: 74px;
    min-height: 38px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #737378;
    border-radius: 7px;
  }

  footer nav .nav-item > span {
    width: 18px;
    height: 18px;
  }

  footer nav .nav-item small {
    font-size: 12px;
    font-weight: 600;
  }

  footer nav .nav-item:hover {
    color: var(--ink-950);
    background: rgba(0, 0, 0, .035);
  }

  footer nav .nav-item.active {
    color: var(--ink-950);
    background: rgba(8, 127, 112, .09);
  }

  footer nav .nav-item.active > span {
    color: var(--brand);
  }

  footer > p {
    display: none;
  }

  #homeView,
  .page-view {
    width: min(100%, 1180px);
  }

  #homeView:not(.hidden) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero {
    display: grid;
    min-height: 208px;
    padding: 29px 0 34px;
    place-items: center;
    text-align: center;
  }

  .hero-copy {
    display: grid;
    justify-items: center;
  }

  .tag {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(8, 127, 112, .13);
    background: rgba(231, 243, 240, .7);
    border-radius: 7px;
  }

  .hero h2 {
    max-width: 900px;
    margin: 14px 0 11px;
    font-size: clamp(44px, 4vw, 54px);
    font-weight: 760;
    line-height: 1.12;
  }

  .hero p {
    max-width: 700px;
    font-size: 15px;
  }

  .workspace {
    width: min(100%, 920px);
    margin-inline: auto;
    padding: 28px;
    border-color: rgba(0, 0, 0, .065);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .075);
  }

  .workspace-title {
    margin-bottom: 20px;
  }

  .drop {
    min-height: 312px;
    border-color: #acd0c8;
    background: #fbfdfc;
  }

  .camera-ring {
    width: 70px;
    height: 70px;
    background: #eaf5f2;
  }

  .quick {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 920px);
    margin: 16px auto 0;
    gap: 10px;
  }

  .quick .quick-item,
  .quick > div {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 84px;
    padding: 13px;
  }

  .quick-icon {
    width: 38px;
    height: 38px;
  }

  .continue-learning,
  #result:not(.hidden) {
    width: min(100%, 920px);
    margin-inline: auto;
  }

  .page-view {
    padding-top: 8px;
  }

  .view-heading,
  .community-heading,
  .community-detail-heading {
    min-height: 126px;
    padding-top: 25px;
  }

  .view-heading h2,
  .community-heading h2 {
    font-size: 38px;
  }

  .record-tools,
  .sync-note,
  .community-toolbar {
    background: rgba(255, 255, 255, .84);
  }

  .record-item {
    min-height: 100px;
    padding-inline: 18px;
  }

  .record-item h3 {
    font-size: 15px;
  }

  .community-feed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 18px;
  }

  .community-card:hover,
  .community-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .11);
  }

  #profileView:not(.hidden) {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  #profileView > .view-heading,
  #profileView > .profile-identity,
  #profileView > .auth-panel,
  #profileView > .energy-section {
    grid-column: 1 / -1;
  }

  #profileView > .profile-section:not(.energy-section) {
    grid-column: span 6;
  }

  .profile-identity {
    min-height: 112px;
    padding-inline: 24px;
    box-shadow: 0 20px 48px rgba(12, 42, 36, .16);
  }

  .profile-section {
    min-height: 164px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .055);
  }

  .learning-mode-switcher {
    width: min(100%, 620px);
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .shell > header {
    padding-inline: 20px;
  }

  .brand-button b {
    display: none;
  }

  footer nav {
    grid-template-columns: repeat(5, minmax(62px, auto));
  }

  footer nav .nav-item,
  footer nav button {
    min-width: 62px;
    padding-inline: 9px;
  }

  .header-energy {
    right: 20px;
  }

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

@media (max-width: 720px) {
  .hero {
    display: grid;
    padding: 26px 2px 24px;
    justify-items: center;
    text-align: center;
  }

  .hero-copy {
    display: grid;
    justify-items: center;
  }

  .tag {
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(8, 127, 112, .13);
    background: rgba(231, 243, 240, .72);
    border-radius: 7px;
  }

  .hero h2 {
    max-width: 360px;
    margin-top: 13px;
    font-size: 32px;
  }

  .hero p {
    max-width: 350px;
  }

  .workspace {
    box-shadow: 0 14px 42px rgba(0, 0, 0, .075);
  }

  .quick .quick-item,
  .quick > div {
    border-color: rgba(0, 0, 0, .065);
    box-shadow: 0 7px 22px rgba(0, 0, 0, .05);
  }
}

/* V3 secondary experiences: lesson, chat, video and commerce. */
#chatView,
#lessonView,
#videoView {
  --reading-width: 920px;
}

#chatView {
  width: min(100%, 980px);
  min-height: calc(100dvh - 168px);
}

#chatView .view-heading {
  min-height: 112px;
  padding-bottom: 24px;
}

#chatView .view-heading h2 {
  font-size: 38px;
  font-weight: 760;
}

#chatView .chat-context {
  min-height: 54px;
  margin-top: 0;
  padding: 10px 14px;
  border-color: rgba(0, 0, 0, .07);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .045);
  backdrop-filter: blur(18px);
}

#chatView .chat-context small {
  font-size: 10px;
}

#chatView .chat-context b {
  font-size: 13px;
}

#chatView .feature-usage-line {
  min-height: 42px;
  padding-inline: 5px;
  font-size: 11px;
}

#chatView .chat-empty {
  min-height: 390px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 44px 20px 72px;
}

#chatView .chat-empty::before {
  content: "AI";
  width: 54px;
  height: 54px;
  display: grid;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(8, 125, 109, .12);
  border-radius: 8px;
  color: var(--brand);
  background: linear-gradient(145deg, #f5fbf9, #e9f5f1);
  box-shadow: 0 14px 34px rgba(8, 125, 109, .1);
  font-size: 14px;
  font-weight: 800;
}

#chatView .chat-empty h3 {
  margin-bottom: 22px;
  font-family: inherit;
  font-size: 26px;
  font-weight: 740;
}

#chatView .prompt-list {
  max-width: 680px;
  gap: 9px;
}

#chatView .prompt-list button {
  min-height: 38px;
  padding-inline: 14px;
  border-color: rgba(0, 0, 0, .085);
  background: rgba(255, 255, 255, .78);
  font-size: 11px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .035);
}

#chatView .chat-thread {
  min-height: 360px;
  padding: 24px 2px 34px;
}

#chatView .chat-composer {
  bottom: 18px;
  min-height: 58px;
  padding: 8px 9px 8px 18px !important;
  border-color: rgba(0, 0, 0, .09) !important;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .1);
}

#chatView .chat-composer input {
  min-height: 40px;
  font-size: 13px;
}

#chatView .chat-composer button {
  min-width: 68px;
  min-height: 40px;
  border-radius: 7px;
}

.lesson-view-heading,
.video-view-heading {
  min-height: 74px;
  padding: 5px 0 18px;
  border-bottom-color: rgba(0, 0, 0, .075);
}

.lesson-view-heading h2,
.video-view-heading h2 {
  margin-top: 4px;
  font-family: inherit;
  font-size: 24px;
  font-weight: 750;
}

.lesson-view .learning-mode-switcher,
.video-view .learning-mode-switcher {
  width: min(100%, 560px);
  margin: 20px auto 24px;
  padding: 4px;
  border-color: rgba(0, 0, 0, .065);
  background: rgba(231, 235, 234, .72);
}

.lesson-view .learning-mode-switcher button,
.lesson-view .learning-mode-switcher span,
.video-view .learning-mode-switcher button,
.video-view .learning-mode-switcher span {
  min-height: 42px;
  font-size: 12px;
}

.lesson-document {
  width: min(100%, var(--reading-width));
  margin-inline: auto;
  padding: 44px 56px 52px;
  border-color: rgba(0, 0, 0, .065);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .07);
}

.lesson-document-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.lesson-document .lesson-meta {
  margin-bottom: 20px;
  padding: 0;
  font-size: 10px;
}

#lessonProblem {
  margin: 0;
  font-family: inherit;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.85;
}

.lesson-question-source {
  margin: 0 0 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfb;
}

.lesson-question-source img {
  max-height: 420px;
  margin-inline: auto;
  object-fit: contain;
}

.lesson-answer-block,
.lesson-process-block,
.lesson-summary-block {
  padding-top: 30px;
}

.lesson-answer,
#lessonAnswer {
  margin: 11px 0 0;
  padding: 18px 20px;
  border: 1px solid rgba(8, 125, 109, .13);
  border-left: 3px solid var(--brand);
  border-radius: 0 7px 7px 0;
  background: #f1f8f6;
  font-size: 17px;
  line-height: 1.75;
}

#lessonSteps .step {
  position: relative;
  padding: 21px 0 21px 42px;
  border-bottom: 1px solid var(--line);
}

#lessonSteps .step::before {
  content: counter(lesson-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 23px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
}

#lessonSteps {
  counter-reset: lesson-step;
}

#lessonSteps .step {
  counter-increment: lesson-step;
}

.lesson-info-grid {
  gap: 12px;
  margin-top: 30px;
}

.lesson-info-grid > section {
  min-height: 132px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfb;
}

#lessonKnowledge,
#lessonPitfalls,
#lessonExplanation {
  font-size: 13px;
  line-height: 1.85;
}

.lesson-summary-block {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.lesson-detail-actions {
  width: min(100%, var(--reading-width));
  margin: 14px auto 0;
}

.lesson-detail-actions button {
  min-height: 42px;
  border-radius: 7px;
}

.video-view {
  width: min(100%, 1120px);
}

.video-stage {
  margin-top: 0;
  padding: 8px;
  border-color: rgba(0, 0, 0, .12);
  border-radius: 8px;
  background: #1b1d1d;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .18);
}

.video-stage video {
  border-radius: 5px;
  background: #050606;
}

.video-viewer-pending,
.video-viewer-error {
  background: radial-gradient(circle at 50% 40%, #202725 0, #0d1110 68%);
}

.video-viewer-pending strong,
.video-viewer-error strong {
  font-size: 20px;
  font-weight: 720;
}

.video-viewer-pending span,
.video-viewer-error > span {
  color: #9eaaa7;
  font-size: 12px;
}

.video-viewer-meta {
  gap: 7px;
  margin-top: 14px;
  font-size: 10px;
}

.video-viewer-meta span {
  padding: 7px 10px;
  border: 1px solid rgba(0, 0, 0, .05);
  background: rgba(255, 255, 255, .66);
}

.video-viewer-lesson {
  margin-top: 32px;
  padding-top: 24px;
}

.video-viewer-question {
  gap: 18px;
}

.video-viewer-lesson h3 {
  min-height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, .72);
  font-size: 14px;
  line-height: 1.9;
}

.energy-section {
  overflow: hidden;
  padding: 0 0 24px;
  background: #fff;
}

.energy-balance-row {
  min-height: 150px;
  padding: 28px 30px;
  color: #fff;
  border-bottom: 0;
  background: #17332f;
}

.energy-balance-row > div > span,
.energy-balance-row small {
  color: rgba(239, 249, 246, .66);
  font-size: 10px;
}

.energy-balance-row strong {
  margin: 5px 0;
  color: #fff;
  font-size: 38px;
  font-weight: 760;
}

.energy-account-badge {
  min-height: 34px;
  color: #dff5ef;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .09);
}

.energy-balance-row .energy-account-badge b {
  color: #e8f8f4;
  font-size: 10px;
}

.energy-pricing,
.energy-purchase-heading,
.energy-packages,
.energy-purchase-assurance,
.energy-section > .payment-message,
.energy-order-heading,
.payment-order-list,
.energy-section > .payment-order-empty {
  margin-inline: 24px;
}

.energy-pricing {
  gap: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.energy-pricing span {
  padding: 8px 10px;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
}

.energy-pricing span + span {
  border-left: 1px solid var(--line);
}

.energy-package {
  min-height: 128px;
  padding: 18px 14px;
  border-color: rgba(0, 0, 0, .08);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .04);
}

.energy-package:hover,
.energy-package:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .08);
}

.payment-dialog {
  background: rgba(18, 24, 23, .48);
  backdrop-filter: saturate(125%) blur(18px);
}

.payment-dialog-panel {
  width: min(780px, 100%);
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .28);
}

.payment-order-summary {
  grid-template-columns: repeat(3, 1fr);
  background: #f6f8f7;
}

.payment-dialog-body {
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 30px;
}

.payment-qr-wrap img {
  width: 202px;
  height: 202px;
  border-radius: 7px;
}

.announcement-panel,
.visitor-guide,
.payment-dialog-panel {
  border-radius: 8px;
}

.announcement-head h2,
.visitor-guide-head h3,
.payment-dialog-head h2 {
  font-family: inherit;
  font-weight: 740;
}

.global-video-task {
  border-color: rgba(0, 0, 0, .09);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(0, 0, 0, .16);
}

@media (max-width: 720px) {
  #chatView {
    min-height: calc(100dvh - 104px);
  }

  #chatView .view-heading {
    min-height: 86px;
    padding-top: 8px;
  }

  #chatView .view-heading h2 {
    font-size: 30px;
  }

  #chatView .chat-empty {
    min-height: 330px;
    padding: 34px 8px 52px;
  }

  #chatView .chat-empty h3 {
    font-size: 23px;
  }

  #chatView .prompt-list {
    gap: 7px;
  }

  #chatView .prompt-list button {
    min-height: 36px;
    padding-inline: 10px;
  }

  #chatView .chat-composer {
    bottom: 8px;
  }

  .lesson-view-heading,
  .video-view-heading {
    min-height: 60px;
    padding-bottom: 12px;
  }

  .lesson-view-heading h2,
  .video-view-heading h2 {
    font-size: 20px;
  }

  .lesson-view .learning-mode-switcher,
  .video-view .learning-mode-switcher {
    margin: 12px 0 16px;
  }

  .lesson-document {
    padding: 26px 20px 32px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .065);
  }

  #lessonProblem {
    font-size: 16px;
    line-height: 1.8;
  }

  .lesson-document-header {
    padding-bottom: 22px;
  }

  .lesson-answer-block,
  .lesson-process-block,
  .lesson-summary-block {
    padding-top: 24px;
  }

  #lessonSteps .step {
    padding: 18px 0 18px 34px;
  }

  #lessonSteps .step::before {
    top: 20px;
  }

  .lesson-info-grid {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .lesson-info-grid > section {
    min-height: 0;
  }

  .lesson-detail-actions {
    margin-bottom: 24px;
  }

  .video-heading-actions {
    gap: 5px;
  }

  .video-heading-actions .view-badge {
    display: none;
  }

  .video-download,
  .video-publish {
    min-height: 34px;
    padding-inline: 9px;
  }

  .video-stage {
    width: calc(100% + 16px);
    margin-left: -8px;
    padding: 4px;
    border-radius: 7px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .2);
  }

  .video-viewer-question {
    grid-template-columns: 1fr;
  }

  .video-viewer-lesson h3 {
    padding: 16px;
  }

  .energy-balance-row {
    min-height: 132px;
    padding: 24px 20px;
  }

  .energy-balance-row strong {
    font-size: 34px;
  }

  .energy-pricing,
  .energy-purchase-heading,
  .energy-packages,
  .energy-purchase-assurance,
  .energy-section > .payment-message,
  .energy-order-heading,
  .payment-order-list,
  .energy-section > .payment-order-empty {
    margin-inline: 16px;
  }

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

  .energy-pricing span:nth-child(3) {
    border-left: 0;
  }

  .energy-pricing span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .payment-dialog {
    padding: 10px;
    place-items: start center;
  }

  .payment-dialog-panel {
    margin-block: 8px;
  }

  .payment-dialog-head {
    padding: 15px 16px 12px;
  }

  .payment-dialog-head h2 {
    font-size: 18px;
  }

  .payment-order-summary > div {
    padding: 10px 12px;
  }

  .payment-order-summary strong {
    font-size: 15px;
  }

  .payment-assurance-line {
    padding-block: 10px;
  }

  .payment-dialog-body {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 16px 16px;
  }

  .payment-qr-wrap img {
    width: 122px;
    height: 122px;
  }

  .payment-qr-wrap > span,
  .payment-qr-wrap small {
    font-size: 8px;
  }

  .payment-flow-title span,
  .payment-steps {
    display: none;
  }

  .payment-order-number,
  .payment-trade-field {
    margin-top: 7px;
  }

  .payment-review-note {
    margin-block: 6px 8px;
  }

  .global-video-task {
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }
}

/* Mobile solve handoff: keep the fresh result and the full lesson visually coherent. */
#lessonSteps .step::before {
  display: none;
  content: none;
}

#lessonSteps .step {
  padding-left: 0;
}

@media (max-width: 720px) {
  #result {
    scroll-margin-top: 68px;
    padding: 20px 18px 22px;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .065);
  }

  #result .result-head {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  #result > h3 {
    margin: 16px 0 10px;
    font-size: 16px;
    line-height: 1.75;
  }

  #result > .answer-label {
    margin-top: 14px;
  }

  #result > .answer {
    margin-top: 8px;
    padding: 14px 15px;
    border-left: 3px solid var(--brand);
    border-radius: 0 7px 7px 0;
    color: var(--brand-deep);
    background: var(--brand-pale);
    font-size: 20px;
    line-height: 1.65;
  }

  #result > .answer mjx-container,
  #result > h3 mjx-container {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  #result > .open-lesson-detail {
    min-height: 44px;
    margin-top: 12px;
  }

  #result > .creation-tools {
    display: block;
    margin-top: 22px;
    border-top: 1px solid var(--line);
  }

  #result .creation-tools .video-maker,
  #result .creation-tools .interactive-maker,
  #result .creation-tools .practice-maker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding: 17px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink-800);
    background: transparent;
  }

  #result .creation-tools .video-maker > div,
  #result .creation-tools .interactive-maker > div,
  #result .creation-tools .practice-maker > div {
    min-width: 0;
  }

  #result .creation-tools .video-maker b,
  #result .creation-tools .interactive-maker b,
  #result .creation-tools .practice-maker b {
    color: var(--ink-900) !important;
    font-size: 13px;
  }

  #result .creation-tools .video-maker span,
  #result .creation-tools .interactive-maker span,
  #result .creation-tools .practice-maker span {
    margin-top: 4px;
    color: var(--ink-600) !important;
    font-size: 10px;
    line-height: 1.55;
  }

  #result .creation-tools .video-maker small,
  #result .creation-tools .interactive-maker small,
  #result .creation-tools .practice-maker small {
    margin-top: 5px;
    color: var(--brand) !important;
    font-size: 9px;
  }

  #result .creation-tools .video-maker button,
  #result .creation-tools .interactive-maker button,
  #result .creation-tools .practice-maker button {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 88px;
    min-height: 38px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #fff;
    background: var(--brand);
    font-size: 10px;
    font-weight: 750;
  }

  #result > .result-chat-entry {
    margin-top: 0;
    padding-top: 17px;
    border-top: 0;
  }

  #result > .result-chat-entry button {
    flex: none;
    min-height: 38px;
  }

  .lesson-view-heading {
    min-height: 64px;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    padding: 7px 0 13px;
  }

  .lesson-view-heading .view-badge {
    display: none;
  }

  .lesson-view .learning-mode-switcher {
    margin: 12px 0 16px;
  }

  .lesson-document {
    padding: 22px 18px 28px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .055);
  }

  .lesson-question-source {
    padding: 8px;
    background: #f7f9f8;
  }

  .lesson-question-source img {
    max-height: 280px;
    object-position: center;
  }

  #lessonSteps .step {
    padding: 16px 0;
  }

  .lesson-info-grid > section {
    padding: 16px 17px;
  }

  .lesson-summary-block {
    padding: 17px 16px 7px;
  }

  .lesson-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    bottom: calc(8px + env(safe-area-inset-bottom));
    margin-bottom: 18px;
  }

  body[data-active-view="lesson"] .context-tutor {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body[data-active-view="lesson"] .context-tutor-launcher {
    width: 54px;
    height: 62px;
  }

  body[data-active-view="lesson"] .tutor-mascot-launcher {
    left: 0;
    top: -8px;
    scale: .76;
    transform-origin: bottom center;
  }

  body[data-active-view="lesson"] .context-tutor-launcher-label {
    display: none;
  }
}

/* Final web mobile guards. This stylesheet has accumulated several generations
   of responsive rules; these narrow selectors intentionally win the cascade. */
@media (max-width: 720px) {
  .workspace,
  .drop,
  .upload-choice-row,
  .upload-choice {
    min-width: 0;
    max-width: 100%;
  }

  .upload-choice-row {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-choice {
    display: flex;
    width: 100%;
    padding-inline: 8px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
  }

  .upload-choice svg {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
  }

  .global-video-task {
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    grid-template-columns: 30px minmax(0, 1fr) auto 28px;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    padding: 9px;
    gap: 6px 8px;
  }

  .global-video-copy {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .upload-choice-row {
    grid-template-columns: 1fr;
  }
}
body.learning-access-disabled .learning-policy-hidden {
  display: none !important;
}

body.learning-access-disabled .context-tutor {
  display: none !important;
}

body.learning-access-disabled > .shell > header .brand,
body.learning-access-disabled > .shell > header .header-actions,
body.learning-access-disabled > .shell > footer {
  display: none !important;
}

body.learning-access-disabled > .shell {
  padding-bottom: 32px;
}

/* Course covers: subject-led, readable at desktop and the two-column mobile feed. */
.community-card {
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(18, 46, 40, .07);
}

.community-cover {
  isolation: isolate;
  color: #163c35;
  background: #e8f3ef;
}

.community-cover.subject-physics {
  color: #183d58;
  background: #e8f1f7;
}

.community-cover.subject-chemistry {
  color: #3e472d;
  background: #f0f2e7;
}

.community-cover::before {
  inset: 0 auto 0 0;
  width: 5px;
  background: #0b8c76;
}

.community-cover.subject-physics::before { background: #3c75a0; }
.community-cover.subject-chemistry::before { background: #7d8f54; }

.community-cover-motif {
  position: absolute;
  z-index: -1;
  top: 20px;
  right: 8px;
  width: 82px;
  height: 82px;
  opacity: .16;
}

.community-cover-motif i {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 18px;
  font-style: normal;
  font-weight: 650;
}

.community-cover-motif i:nth-child(1) { top: 0; right: 0; }
.community-cover-motif i:nth-child(2) { top: 28px; left: 0; }
.community-cover-motif i:nth-child(3) { right: 3px; bottom: 0; width: 25px; height: 25px; font-size: 11px; }

.community-cover-head {
  top: 12px;
  right: 14px;
  left: 16px;
  font-size: 9px;
}

.community-cover-head > span {
  font-weight: 800;
}

.community-cover-head b {
  padding: 4px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  font-size: 8px;
}

.community-cover-paper {
  top: 39px;
  right: 14px;
  bottom: 31px;
  left: 16px;
  padding: 12px 13px;
  border: 1px solid rgba(20, 54, 46, .075);
  border-radius: 6px;
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 10px 24px rgba(20, 54, 46, .06);
}

.community-cover-paper small {
  color: currentColor;
  font-size: 8px;
  opacity: .66;
}

.community-cover-paper p {
  max-height: 57px;
  color: #172723;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.58;
}

.community-cover-tags { left: 16px; }
.community-cover-tags span { font-size: 8px; }

.community-cover-duration {
  right: 12px;
  color: #fff;
  background: rgba(18, 39, 34, .78);
}

@media (max-width: 720px) {
  .community-card { border-radius: 7px; }
  .community-cover-head { top: 9px; right: 9px; left: 11px; }
  .community-cover-head > span { font-size: 7px; }
  .community-cover-head b { padding: 3px 5px; font-size: 7px; }
  .community-cover-paper { top: 31px; right: 9px; bottom: 25px; left: 11px; padding: 8px 9px; }
  .community-cover-paper small { margin-bottom: 3px; font-size: 6px; }
  .community-cover-paper p { max-height: 43px; font-size: 8px; line-height: 1.45; -webkit-line-clamp: 3; }
  .community-cover-tags { bottom: 6px; left: 11px; gap: 3px; }
  .community-cover-tags span { font-size: 6px; }
  .community-cover-duration { right: 7px; bottom: 5px; padding: 2px 4px; font-size: 7px; }
  .community-cover-motif { top: 14px; right: 4px; scale: .72; transform-origin: top right; }
}

/* Accessibility baseline: stable touch targets and readable secondary text. */
.tag,
#homeStudyCue {
  color: #066d62;
}

.workspace-title span:not(.secure),
.home-flow span,
.drop > span:not(.camera-ring) {
  color: #66696e;
}

.quick .quick-item small {
  color: #606a68;
}

footer nav .nav-item small {
  color: #505157;
}

footer nav .nav-item.active small {
  color: #055b52;
}

.brand-button {
  min-height: 44px;
  min-width: 44px;
}

.upload-choice {
  min-height: 46px;
}

.context-tutor-launcher-label {
  color: #fff;
  background: #066d62;
}

#profilePlanBadge,
#accountConnectionBadge {
  color: #066d62;
}

#profileView .account-security-row small,
#profileView .profile-section-title > span,
#profileView .profile-name-editor label small,
#profileView .energy-pricing > span,
#profileView .energy-purchase-heading p,
#profileView .energy-package-bonus,
#profileView .payment-order-empty,
#profileView .setting-action small,
#profileView #autoSaveDescription,
#profileView .danger-row small,
.account-deletion-summary dt {
  color: #66696e;
}

#headerEnergy,
#logout,
#communityNameInput,
#saveCommunityName,
#refreshPaymentOrders,
#closeAccountDeletion,
#accountDeletionBack,
.account-deletion-methods button {
  min-height: 44px;
}

#logout,
#refreshPaymentOrders,
#closeAccountDeletion {
  min-width: 44px;
}

footer nav .nav-item,
#visitorGuideSkip,
#visitorGuideBack,
#visitorGuideNext,
#visitorRegister,
#visitorTryDemo {
  min-height: 44px;
}

#visitorGuideSkip {
  min-width: 44px;
}

.visitor-guide-steps button:not(.active) > small,
.visitor-upload-sheet > span,
.visitor-upload-demo > small,
#visitorGuideProgress {
  color: #626b68;
}

@media (max-width: 720px) {
  .context-tutor:not(.is-open) .context-tutor-launcher {
    width: 66px;
    height: 66px;
  }

  .context-tutor:not(.is-open) .context-tutor-launcher-label {
    min-width: 31px;
    min-height: 22px;
    font-size: 9px;
  }
}

/* Browser-gate accessibility corrections. Keep the hierarchy quiet while
   ensuring secondary copy remains readable on every light surface. */
:root {
  --ink-600: #55555a;
  --ink-500: #626267;
  --ink-400: #6f6f74;
  --brand: #066d62;
  --brand-hover: #055b52;
  --amber: #8c5410;
}

.view-badge,
.community-count,
.tag,
#homeStudyCue,
#profilePlanBadge,
#accountConnectionBadge {
  color: var(--brand);
}

.section-title.warn {
  color: var(--amber);
}

.tutor-selection-guide-close {
  width: 44px;
  height: 44px;
}

.tutor-selection-demo {
  min-height: 44px;
}

body[data-active-view="chat"] .context-tutor:not(.is-open) {
  bottom: 132px;
}

.wechat-native-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  margin: 18px 24px 4px;
  padding: 22px;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f8faf9;
}

.wechat-native-checkout.hidden {
  display: none;
}

.wechat-native-checkout-copy > span {
  color: var(--brand);
  font-size: 10px;
  font-weight: 750;
}

.wechat-native-checkout-copy h4 {
  margin: 7px 0 8px;
  color: var(--ink-950);
  font-size: 20px;
}

.wechat-native-checkout-copy p,
.wechat-native-checkout-copy small {
  display: block;
  margin: 0;
  color: var(--ink-500);
  line-height: 1.65;
}

.wechat-native-checkout-copy small {
  margin-top: 10px;
  color: var(--brand);
}

.wechat-native-checkout-copy button {
  min-height: 44px;
  margin-top: 18px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink-800);
  background: #fff;
  font-weight: 700;
}

.wechat-native-qr {
  display: grid;
  width: 220px;
  height: 220px;
  padding: 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wechat-native-qr img {
  display: block;
  width: 200px;
  height: 200px;
}

@media (max-width: 768px) {
  #recordsView .segmented button,
  #recordsView #recordSearch,
  #recordsView .sync-note button,
  #recordsView .empty-state button,
  #chatView #chatQuotaAction,
  #chatView .prompt-list button,
  #chatView .chat-composer input,
  #chatView .chat-composer button,
  #communityView .community-subjects button,
  #communityView .community-search,
  #communityView .community-search input,
  #communityView .community-search button,
  #communityView .community-filter-toggle,
  #communityView .community-filters select,
  #communityView .community-filter-actions button,
  #profileView .auth-tabs button,
  #profileView .auth-method-tabs button,
  #profileView .auth-form input,
  #profileView .auth-form > button,
  #profileView .auth-code-control button,
  #profileView .auth-link,
  #lessonView .learning-mode-switcher button,
  #lessonView .lesson-detail-actions button {
    min-height: 44px;
  }

  #recordsView .segmented button,
  #recordsView .sync-note button,
  #chatView #chatQuotaAction,
  #communityView .community-subjects button,
  #communityView .community-search button,
  #profileView .auth-tabs button,
  #profileView .auth-link {
    min-width: 44px;
  }

  #profileView .auth-legal-links a {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  #chatView {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  #chatView .chat-composer {
    position: fixed;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 105;
    width: auto;
    margin: 0 !important;
  }

  body[data-active-view="chat"] .context-tutor {
    display: none;
  }

  .wechat-native-checkout {
    grid-template-columns: 1fr;
    margin-inline: 0;
    justify-items: center;
    text-align: center;
  }
}
