:root {
  color-scheme: light;
  --aqua: #6dc7d8;
  --aqua-dark: #1f6f97;
  --primary: #007aff;
  --primary-press: #0062cc;
  --primary-soft: rgba(0, 122, 255, 0.12);
  --blue: #0a84ff;
  --ink: #111827;
  --muted: rgba(55, 65, 81, 0.68);
  --line: rgba(255, 255, 255, 0.42);
  --paper: #ffffff;
  --wash: #eef3f8;
  --soft: rgba(255, 255, 255, 0.52);
  --orange: #ff9f0a;
  --red: #ff453a;
  --green: #30d158;
  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.46);
  --glass-line: rgba(255, 255, 255, 0.68);
  --glass-dark: rgba(18, 24, 34, 0.36);
  --radius-sm: 8px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
  --shadow-soft: 0 14px 38px rgba(15, 23, 42, 0.12);
  --shadow-lift: 0 28px 72px rgba(15, 23, 42, 0.22);
  --motion-fast: 160ms cubic-bezier(.2, .8, .2, 1);
  --motion-med: 260ms cubic-bezier(.2, .8, .2, 1);
  --motion-spring: 420ms cubic-bezier(.18, .9, .22, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.46) 0%, transparent 32%),
    linear-gradient(225deg, rgba(255, 69, 58, 0.26) 0%, transparent 30%),
    linear-gradient(35deg, transparent 42%, rgba(48, 209, 88, 0.18) 64%, transparent 78%),
    linear-gradient(180deg, #101722 0%, #223247 48%, #cbd8e4 100%);
  color: var(--ink);
  touch-action: manipulation;
  overscroll-behavior: contain;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 92px),
    linear-gradient(118deg, rgba(10, 132, 255, 0.26), transparent 30%),
    linear-gradient(242deg, transparent 46%, rgba(191, 90, 242, 0.22) 70%, rgba(255, 214, 10, 0.16));
  filter: blur(22px) saturate(142%);
  mix-blend-mode: screen;
  animation: ambientShift 12s ease-in-out infinite alternate;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.22), transparent 46%);
  z-index: -1;
}

body::-webkit-scrollbar,
.study-screen::-webkit-scrollbar,
.exam-passage p::-webkit-scrollbar,
.exam-step-strip::-webkit-scrollbar {
  width: 0;
  height: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast),
    opacity var(--motion-fast);
}

button:active,
button.is-pressing {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(109, 199, 216, 0.34);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1180px);
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
}

.home-header,
.study-header,
.panel-row,
.task-row,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.home-header {
  min-height: 42px;
  padding: 2px 0 10px;
  justify-content: flex-end;
}

body[data-active-view="examView"] .home-header {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.home-title-block {
  display: none;
}

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

h1 {
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  font-size: 23px;
  line-height: 1.24;
}

h3 {
  font-size: 17px;
  line-height: 1.3;
}

.tiny-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.countdown-label {
  color: var(--aqua-dark);
  font-size: clamp(16px, 3.4vw, 22px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  text-align: right;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: screenIn var(--motion-med);
}

.view.active .task-card,
.view.active .panel,
.view.active .stat-card,
.view.active .reminder-card {
  animation: cardRise var(--motion-spring) both;
}

.view.active .task-card:nth-child(2),
.view.active .panel:nth-child(2),
.view.active .stat-card:nth-child(2),
.view.active .reminder-card:nth-child(2) {
  animation-delay: 45ms;
}

.view.active .task-card:nth-child(3),
.view.active .panel:nth-child(3),
.view.active .stat-card:nth-child(3),
.view.active .reminder-card:nth-child(3) {
  animation-delay: 90ms;
}

.view.active .task-card:nth-child(4),
.view.active .panel:nth-child(4),
.view.active .stat-card:nth-child(4),
.view.active .reminder-card:nth-child(4) {
  animation-delay: 135ms;
}

.view.active .momo-card,
.view.active .lesson-card {
  animation: glassRise 520ms cubic-bezier(.18, .9, .22, 1) both;
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0;
  padding: 18px;
  min-height: 132px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(234, 246, 251, 0.98), rgba(255, 255, 255, 0.88) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  border: 1px solid rgba(201, 220, 230, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(145%);
}

.hero-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.hero-copy .tiny-label {
  max-width: 62ch;
  margin-bottom: 0;
}

.hero-note {
  max-width: 58ch;
  color: #475858;
  font-size: 14px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 2px;
}

.hero-primary {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  padding: 9px 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(215, 101, 69, 0.2);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-stats span {
  min-height: 28px;
  border: 1px solid rgba(37, 134, 129, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 9px;
}

.progress-ring {
  display: grid;
  place-items: center;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--ring-color, var(--red)) var(--progress, 0deg), #d7e6e5 0);
  color: var(--ring-color, var(--red));
  font-weight: 800;
}

.lock-banner {
  border: 1px solid #f1d8aa;
  background: #fff8e9;
  color: #8a5c12;
  padding: 12px;
  border-radius: var(--radius-md);
  line-height: 1.55;
  margin-top: 14px;
}

.task-stack,
.compact-list,
.stats-grid,
.reminder-grid {
  display: grid;
  gap: 12px;
}

.task-card,
.panel,
.stat-card,
.reminder-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.18) 58%, rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius-md);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(34px) saturate(185%);
  -webkit-backdrop-filter: blur(34px) saturate(185%);
}

.task-card {
  position: relative;
  overflow: hidden;
  padding: 10px 12px;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast),
    background-color var(--motion-fast);
}

.task-card::before,
.panel::before,
.stat-card::before,
.reminder-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), transparent 38%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.36));
  opacity: 0.78;
}

.task-card::after,
.panel::after,
.stat-card::after,
.reminder-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), transparent 26%),
    linear-gradient(135deg, rgba(10, 132, 255, 0.16), rgba(191, 90, 242, 0.12), rgba(255, 214, 10, 0.09));
  opacity: 0.42;
  mix-blend-mode: overlay;
  transform: translateX(-8%);
  transition: opacity var(--motion-fast), transform var(--motion-spring);
}

.panel,
.stat-card,
.reminder-card {
  position: relative;
  overflow: hidden;
}

.task-card > *,
.panel > *,
.stat-card > *,
.reminder-card > * {
  position: relative;
  z-index: 1;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: rgba(123, 165, 190, 0.48);
  box-shadow: 0 14px 34px rgba(24, 39, 54, 0.11);
}

.task-card:hover::after {
  opacity: 0.58;
  transform: translateX(3%);
}

.task-card.next {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 244, 238, 0.3)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 18px 48px rgba(255, 69, 58, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.task-card.done {
  border-color: rgba(95, 174, 149, 0.34);
  background: rgba(245, 251, 248, 0.82);
}

.reminder-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
}

.reminder-card {
  padding: 12px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.7);
}

.reminder-action {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 14px;
  background: linear-gradient(135deg, var(--primary), #3a74e8);
  color: #fff;
  font-weight: 800;
}

.task-row {
  align-items: center;
  min-height: 46px;
}

.task-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.task-time {
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 0;
  font-weight: 800;
}

.task-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(234, 241, 246, 0.92);
  color: var(--muted);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.task-card.next .task-status {
  background: #fff0e8;
  color: var(--red);
}

.task-card.done .task-status {
  background: #e6f4ef;
  color: #3b806f;
}

.task-title {
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 0;
}

.task-note,
.body-text,
.hint-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.task-card .task-note {
  max-width: 62ch;
  font-weight: 800;
  line-height: 1.2;
}

.task-total {
  flex: 0 0 auto;
  min-width: 82px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
}

.task-total span,
.task-total strong {
  display: block;
}

.task-total strong {
  color: var(--ink);
  font-size: 15px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  padding: 3px 9px;
  font-size: 13px;
}

.round-button,
.small-button,
.primary-button,
.answer-button {
  border: 0;
  border-radius: var(--radius-md);
  min-height: 40px;
  padding: 9px 13px;
}

.round-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #3a74e8);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  backdrop-filter: blur(12px) saturate(140%);
  font-size: 18px;
  font-weight: 800;
}

.icon-button.synced {
  color: var(--primary);
  border-color: rgba(40, 111, 143, 0.28);
  background: var(--soft);
}

.small-button {
  background: var(--soft);
  color: var(--primary);
  font-weight: 700;
}

.task-cta {
  min-width: 58px;
  flex: 0 0 auto;
}

.task-card.next .task-cta {
  background: var(--red);
  color: #fff;
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--primary), #3a74e8);
  color: #fff;
  font-weight: 800;
}

.small-button:hover,
.primary-button:hover,
.answer-button:hover {
  box-shadow: var(--shadow-soft);
}

.primary-button:disabled {
  background: #b8c6cf;
  cursor: not-allowed;
}

.daily-checkout {
  padding: 8px 0 18px;
}

.panel,
.stat-card {
  padding: 15px;
  margin-top: 14px;
}

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

.memory-list {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-right: 4px;
}

.unit-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.unit-group summary {
  cursor: pointer;
  padding: 12px;
  font-weight: 800;
  color: var(--ink);
  background: #f4faf9;
}

.unit-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.memory-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.memory-row strong {
  display: block;
  margin-bottom: 3px;
}

.stat-card strong {
  display: block;
  font-size: 27px;
  margin-bottom: 6px;
}

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

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

.profile-panel {
  margin-top: 0;
}

.profile-panel.wide {
  grid-column: 1 / -1;
}

.profile-panel summary {
  cursor: pointer;
  font-weight: 800;
  line-height: 1.4;
}

.setting-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.setting-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(185, 195, 210, 0.48);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--ink);
}

.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.secret-field .small-button {
  min-width: 62px;
  white-space: nowrap;
}

.library-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.library-stat-grid div,
.library-chip {
  border: 1px solid rgba(185, 195, 210, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2)),
    rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.library-stat-grid div {
  display: grid;
  gap: 4px;
  border-radius: 18px;
  padding: 12px;
}

.library-stat-grid strong {
  font-size: 22px;
  line-height: 1;
}

.library-stat-grid span,
.library-chip {
  color: var(--muted);
  font-size: 12px;
}

.library-group {
  margin-top: 12px;
}

.library-group summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.library-nested {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.library-row-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 8px 2px 2px;
  scrollbar-width: thin;
}

.library-row,
.library-template-row {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(185, 195, 210, 0.36);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.34);
}

.library-row {
  grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
  align-items: baseline;
}

.library-row strong,
.library-template-row strong {
  color: var(--ink);
}

.library-row span,
.library-template-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.library-template-row p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.library-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.library-chip {
  border-radius: 999px;
  padding: 7px 10px;
}

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

.compact-button {
  margin-top: 10px;
}

.device-preview {
  display: grid;
  grid-template-columns: 0.72fr 1.05fr 0.46fr;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.device-preview article {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px solid #2d3b3b;
  background: linear-gradient(180deg, #e5fbf8, #ffffff);
  text-align: center;
  color: var(--ink);
}

.device-preview span {
  color: var(--muted);
  font-size: 12px;
}

.device-preview em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.phone-frame {
  min-height: 210px;
  border-radius: 26px;
}

.pad-frame {
  min-height: 170px;
  border-radius: 18px;
}

.watch-frame {
  min-height: 108px;
  border-radius: 34px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 11px;
}

textarea {
  resize: vertical;
}

.upload-progress {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.upload-panel {
  display: grid;
  gap: 12px;
}

.upload-button {
  margin-top: 0;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.upload-progress-header strong {
  color: var(--ink);
}

.progress-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7ef;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  transition: width 0.25s ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 199, 216, 0.22);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(560px, calc(100vw - 30px));
  padding: 7px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(191, 90, 242, 0.14) 58%, rgba(255, 214, 10, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 249, 252, 0.3)),
    rgba(255, 255, 255, 0.32);
  box-shadow:
    0 26px 70px rgba(15, 23, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(42px) saturate(210%);
  -webkit-backdrop-filter: blur(42px) saturate(210%);
  z-index: 10;
  overflow: hidden;
  animation: navSettle 560ms cubic-bezier(.18, .9, .22, 1) both;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 52%);
}

.bottom-nav::after {
  content: none;
  position: absolute;
  top: -80%;
  bottom: -80%;
  width: 42%;
  left: -52%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, 0.62) 46%, transparent 72%);
  filter: blur(1px);
  opacity: 0;
  animation: none;
}

.nav-button {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 22px;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  isolation: isolate;
  overflow: hidden;
}

.nav-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.24), rgba(96, 165, 250, 0.18), rgba(244, 114, 182, 0.14));
  opacity: 0;
  transition: opacity var(--motion-fast);
}

.nav-button::after {
  content: "";
  position: absolute;
  inset: 4px 22%;
  top: auto;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: translateY(8px) scaleX(0.5);
  transition:
    opacity var(--motion-fast),
    transform var(--motion-spring);
}

.nav-button.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.32)),
    linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(191, 90, 242, 0.12)),
    rgba(255, 255, 255, 0.28);
  color: var(--primary);
  font-weight: 800;
  box-shadow:
    0 12px 28px rgba(0, 122, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.nav-button.active::before {
  opacity: 1;
  animation: prismPulse 2.8s ease-in-out infinite alternate;
}

.nav-button.active::after {
  opacity: 0.75;
  transform: translateY(0) scaleX(1);
}

.exam-summary-panel {
  margin-top: 10px;
}

.exam-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.exam-summary-grid > div {
  min-width: 0;
  border-radius: var(--radius-md);
  background: #f6fbfa;
  border: 1px solid #d8ecea;
  padding: 10px;
}

.exam-summary-grid strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.exam-filter-panel {
  display: grid;
  gap: 12px;
}

.exam-category-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.exam-category-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfc;
  color: var(--muted);
  font-weight: 800;
}

.exam-category-tabs button.active {
  border-color: var(--aqua-dark);
  background: var(--aqua-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 134, 129, 0.18);
}

.exam-year-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.exam-year-select select {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.exam-year-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.exam-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.exam-year-panel {
  padding: 14px;
}

.exam-year-panel h3 {
  margin-bottom: 10px;
}

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

.exam-entry-button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfc;
  color: var(--ink);
  font-weight: 700;
}

.exam-entry-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.exam-entry-button.done {
  border-color: #bfe2d0;
  background: #f2fbf6;
}

.exam-entry-button.done small {
  color: var(--green);
}

.exam-entry-button:active,
.exam-entry-button:hover {
  border-color: var(--aqua-dark);
  color: var(--aqua-dark);
  background: #f3fbfa;
}

.exam-year-tabs {
  display: flex;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

.exam-year-tabs button {
  flex: 0 0 72px;
  scroll-snap-align: start;
}

.analysis-section-card {
  display: grid;
  gap: 12px;
}

.analysis-section-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.analysis-progress-panel {
  margin-top: 12px;
}

.analysis-progress-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.analysis-progress-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analysis-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeee;
}

.analysis-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--aqua-dark);
}

.study-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 96px),
    linear-gradient(135deg, rgba(10, 132, 255, 0.38), transparent 34%),
    linear-gradient(225deg, rgba(191, 90, 242, 0.24), transparent 38%),
    linear-gradient(28deg, transparent 30%, rgba(48, 209, 88, 0.18) 54%, transparent 76%),
    linear-gradient(180deg, #121821 0%, #25364c 50%, #d2dce6 100%);
  padding: 0;
  scrollbar-width: none;
}

.study-screen:not(.hidden) {
  animation: none;
}

.study-screen.swiping {
  transition: none;
  will-change: transform, opacity;
}

.study-screen.closing {
  pointer-events: none;
  transition:
    transform 220ms cubic-bezier(.2, .78, .2, 1),
    opacity 220ms cubic-bezier(.2, .78, .2, 1);
  will-change: transform, opacity;
}

.study-header {
  position: fixed;
  top: max(14px, calc(env(safe-area-inset-top) + 10px));
  left: max(14px, calc(env(safe-area-inset-left) + 10px));
  z-index: 20;
  width: 44px;
  max-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  align-items: center;
  gap: 10px;
}

.study-header .tiny-label {
  margin-bottom: 0;
  display: none;
}

.study-header h2 {
  display: none;
}

.study-header .round-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.32);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  font-size: 30px;
}

.study-body {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 0;
}

.study-screen:not(.exam-mode) .study-body {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  padding: 0;
}

.study-screen:not(.exam-mode) .study-header {
  display: flex;
}

.study-screen.exam-mode .study-header {
  top: max(28px, calc(env(safe-area-inset-top) + 18px));
}

.momo-card {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.08), rgba(96, 165, 250, 0.06), rgba(244, 114, 182, 0.05)),
    rgba(255, 255, 255, 0.78);
  border: 0;
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.momo-top {
  min-height: 118px;
  padding: max(18px, env(safe-area-inset-top)) 18px 14px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(238, 247, 252, 0.66)),
    rgba(255, 255, 255, 0.66);
  border-bottom: 1px solid var(--line);
}

.momo-top h2 {
  font-family: inherit;
  font-size: clamp(34px, 8.8vw, 48px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
}

.phrase-card .momo-top h2 {
  font-size: clamp(30px, 7.8vw, 42px);
}

.memory-card .memory-meta-row,
.phrase-card .memory-meta-row {
  display: none;
}

.momo-progress {
  display: none;
}

.memory-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-type {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.speaker-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #243536;
  font-size: 17px;
}

.momo-middle {
  display: grid;
  align-items: start;
  justify-items: stretch;
  padding: 22px 16px;
  text-align: center;
  border: 0;
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.05), rgba(96, 165, 250, 0.04), rgba(244, 114, 182, 0.04)),
    rgba(255, 255, 255, 0.54);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tap-hint {
  align-self: center;
  justify-self: center;
  color: #929c9c;
  font-size: 21px;
  line-height: 1.55;
}

.answer-panel {
  width: 100%;
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 10px 4px;
  min-height: 0;
  overflow: auto;
}

.phrase-frequency {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--soft);
  color: var(--aqua-dark);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.top-frequency {
  margin: 6px auto 0;
}

.answer-panel h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.answer-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.exam-tag {
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eef3f8;
  color: #31556e;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 800;
}

.answer-panel p {
  margin: 10px 0;
  line-height: 1.75;
  color: #3d4a4a;
}

.speakable {
  color: inherit;
  border-bottom: 1px dotted rgba(37, 134, 129, 0.55);
}

.speakable.speaking,
.token-word.speaking {
  background: rgba(255, 225, 120, 0.55);
  border-radius: 5px;
}

.highlight-term {
  color: #c84633;
  font-weight: 800;
}

.token-word {
  display: inline;
  margin: 0 1px;
  border-radius: 5px;
  padding: 1px 2px;
  color: inherit;
}

.token-word:hover {
  background: var(--soft);
}

.momo-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
}

.answer-button.known {
  background: var(--green);
  color: #fff;
}

.answer-button.unknown {
  background: var(--orange);
  color: #fff;
}

.answer-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.lesson-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.18) 54%, rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  box-shadow:
    0 24px 74px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(44px) saturate(210%);
  -webkit-backdrop-filter: blur(44px) saturate(210%);
  padding: 16px;
  margin-bottom: 14px;
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.28));
}

.lesson-card > * {
  position: relative;
  z-index: 1;
}

.grammar-lesson-stack {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: calc(72px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.grammar-lesson-card {
  margin-bottom: 0;
}

.study-screen:not(.exam-mode) .study-body > .lesson-card {
  width: auto;
  margin: calc(72px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.grammar-lesson-card > .tiny-label {
  display: none;
}

.writing-steps {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.writing-teaching-card,
.writing-slot-card,
.writing-template-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.writing-teaching-card h3,
.writing-slot-card h3,
.writing-template-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.writing-teaching-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.writing-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.writing-stat-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.3);
}

.writing-stat-item strong {
  font-size: 14px;
}

.writing-stat-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-line {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}

.template-line:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.translation-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.writing-step {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.28);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.translation-steps .writing-step {
  display: grid;
  place-items: center;
  min-height: 76px;
  text-align: center;
}

.writing-step.active {
  border-color: var(--aqua-dark);
  background: var(--soft);
  box-shadow: 0 0 0 3px rgba(99, 199, 196, 0.16);
}

.sentence-focus {
  border-radius: 5px;
  background: rgba(255, 231, 132, 0.65);
  padding: 0 3px;
}

.translation-inline {
  display: inline;
  margin-left: 12px;
  color: var(--aqua-dark);
  font-size: 0.85em;
  font-weight: 800;
}

.writing-practice-list {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.writing-practice-card {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.writing-copy-lines {
  display: grid;
  gap: 0;
  margin-top: 10px;
  border: 1px dashed #bdd0cf;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.writing-copy-lines span {
  display: block;
  height: 42px;
  border-bottom: 1px solid #e3eeee;
}

.writing-copy-lines span:last-child {
  border-bottom: 0;
}

.lesson-sentence {
  font-size: 22px;
  line-height: 1.6;
  margin: 10px 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  border-radius: 8px;
  background: #eef3f8;
  color: #31556e;
  padding: 6px 8px;
  font-size: 13px;
}

.exam-shell {
  display: grid;
  gap: 12px;
}

.exam-toolbar,
.exam-report,
.exam-goal,
.exam-analysis,
.exam-question,
.answer-sheet {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(215, 226, 225, 0.88);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.exam-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 58px;
  position: sticky;
  top: 0;
  z-index: 6;
  backdrop-filter: blur(14px);
}

.analysis-exam-shell .exam-toolbar > div:first-child {
  display: none;
}

.analysis-exam-shell .exam-toolbar {
  justify-content: flex-end;
}

.exam-actions,
.exam-mini-actions,
.report-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.exam-goal,
.exam-analysis,
.exam-report {
  padding: 12px;
}

.exam-step-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
}

.exam-step-strip span {
  flex: 0 0 auto;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 7px 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  background: #fbfdfc;
}

.exam-passage {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfc;
  overflow: hidden;
}

.exam-passage h4 {
  margin: 0;
  padding: 10px 12px;
  font-size: 18px;
}

.exam-passage summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 800;
}

.exam-passage p {
  max-height: none;
  overflow: visible;
  padding: 0 12px 12px;
  color: #334141;
  font-size: 14px;
  line-height: 1.75;
}

.analysis-passage-body {
  max-height: none;
  overflow: visible;
  padding: 0 12px 12px;
  color: #334141;
  font-size: 15px;
  line-height: 1.95;
}

.analysis-paragraph {
  margin: 0;
  scroll-margin-top: 96px;
}

.analysis-passage-body .analysis-paragraph + .analysis-paragraph {
  margin-top: 18px;
}

.evidence-anchor {
  display: inline-block;
  position: relative;
  top: -78px;
}

.cloze-blank {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  margin: 0 3px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--aqua-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  vertical-align: baseline;
}

.cloze-blank.selected {
  border-color: #2f7df2;
  background: #2f7df2;
  color: #fff;
}

.cloze-blank.correct {
  border-color: #5fae95;
  background: #5fae95;
  color: #fff;
}

.cloze-blank.wrong,
.cloze-blank.unanswered {
  border-color: #ef4b57;
  background: #fff;
  color: #ef4b57;
}

.evidence-highlight {
  background: linear-gradient(180deg, rgba(255, 232, 148, 0.38), rgba(255, 232, 148, 0.72));
  border-radius: 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.vocab-highlight {
  border-bottom: 0;
  box-shadow: none;
  border-radius: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.evidence-pulse {
  animation: evidencePulse 1.1s ease-out;
}

.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.notes-only-layout {
  display: block;
}

.exam-paper {
  display: grid;
  gap: 12px;
}

.exam-text-panel {
  display: grid;
  gap: 10px;
  border: 0;
  border-top: 1px solid rgba(215, 226, 225, 0.9);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px;
  scroll-margin-top: 74px;
}

.exam-text-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analysis-exam-shell .exam-text-head,
.analysis-exam-shell .analysis-source > h4 {
  display: none;
}

.exam-text-head h3 {
  font-size: 22px;
}

.exam-text-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.exam-text-passage {
  position: sticky;
  top: 78px;
  margin-top: 0;
}

.exam-text-passage .analysis-passage-body {
  max-height: none;
}

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

.compact-exam-question {
  box-shadow: none;
  border-radius: var(--radius-md);
}

.compact-exam-question .question-stem {
  color: #314141;
  font-size: 15px;
}

.cloze-question-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.use-cloze-panel .exam-text-layout {
  display: block;
}

.use-cloze-panel .exam-text-passage {
  position: static;
}

.use-cloze-panel .exam-question-drawer {
  margin-top: 14px;
}

.use-cloze-panel .exam-drawer-head {
  display: none;
}

.cloze-option-matrix {
  display: grid;
  gap: 4px;
  padding: 14px 6px 4px;
}

.cloze-option-row {
  display: grid;
  grid-template-columns: 34px repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  min-height: 31px;
}

.cloze-option-row > strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.cloze-option-row button {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 2px 5px;
  text-align: left;
  font-size: 14px;
  line-height: 1.3;
}

.cloze-option-row button b {
  flex: 0 0 auto;
  font-weight: 800;
}

.cloze-option-row button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cloze-option-row button:hover,
.cloze-option-row button.selected {
  background: #edf7fb;
  box-shadow: inset 0 0 0 1px rgba(40, 111, 143, 0.28);
}

.cloze-option-row button.correct {
  background: #e8f5f1;
  color: #2f7f6d;
}

.cloze-option-row button.wrong-option {
  background: #fff0ea;
  color: #9b4129;
}

.cloze-option-empty {
  min-height: 28px;
}

.use-cloze-panel .exam-question-list {
  display: none;
}

.submitted-exam-shell .use-cloze-panel .exam-question-list {
  display: none;
}

.cloze-inline-analysis {
  grid-column: 1 / -1;
  margin: 2px 0 10px 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.cloze-inline-analysis summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.cloze-inline-analysis summary strong {
  color: var(--aqua-dark);
  font-size: 13px;
  white-space: nowrap;
}

.cloze-inline-analysis.wrong summary strong {
  color: var(--red);
}

.cloze-inline-analysis .analysis-answer-summary,
.cloze-inline-analysis .analysis-block {
  margin: 10px 12px 12px;
}

.cloze-inline-analysis .analysis-block h4 {
  margin-top: 0;
}

.reading-part-panel .exam-text-layout {
  display: block;
}

.reading-part-panel .exam-text-passage {
  position: static;
}

.reading-part-panel .exam-question-drawer {
  margin-top: 18px;
}

.reading-part-panel .exam-drawer-head {
  display: none;
}

.reading-part-panel .exam-question-list {
  gap: 14px;
}

.reading-part-panel .compact-exam-question {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 18px 0 0;
}

.reading-part-panel .compact-exam-question:first-child {
  border-top: 0;
}

.reading-part-panel .compact-exam-question .question-stem {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
}

.reading-part-panel .option-grid {
  gap: 6px;
  margin-top: 8px;
}

.reading-part-panel .option-grid button {
  display: grid;
  grid-template-columns: 10px 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  border-bottom: 1px solid #eef1f5;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
}

.reading-part-panel .option-grid button strong {
  display: inline;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.reading-part-panel .option-grid button:hover,
.reading-part-panel .option-grid button.selected {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 242, 0.18);
}

.reading-part-b-panel .exam-text-layout {
  display: block;
}

.reading-part-b-panel .exam-text-passage {
  position: static;
}

.reading-part-b-panel .exam-question-drawer {
  margin-top: 18px;
}

.part-b-answer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.part-b-answer-grid button {
  display: grid;
  gap: 4px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  padding: 8px;
}

.part-b-answer-grid button.active {
  border-color: rgba(40, 111, 143, 0.36);
  background: #edf7fb;
  box-shadow: inset 0 0 0 1px rgba(40, 111, 143, 0.16);
}

.part-b-answer-grid button.correct {
  background: #e8f5f1;
  color: #2f7f6d;
}

.part-b-answer-grid button.wrong {
  background: #fff0ea;
  color: #9b4129;
}

.part-b-answer-grid strong {
  font-size: 16px;
}

.part-b-answer-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.part-b-option-bank {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.part-b-option-bank button {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  line-height: 1.35;
}

.part-b-option-bank button:hover,
.part-b-option-bank button:active {
  border-color: rgba(37, 134, 129, 0.35);
  background: #eef9f8;
}

.part-b-paper {
  display: grid;
  gap: 18px;
}

.part-b-passage-flow {
  display: grid;
  gap: 14px;
}

.part-b-passage-flow p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.85;
  text-align: left;
}

.part-b-passage-flow .part-b-title {
  font-weight: 900;
  text-align: center;
  line-height: 1.55;
}

.part-b-paper-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfefd;
}

.part-b-paper-options button,
.part-b-match-table button,
.part-b-statement button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

.part-b-paper-options button {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  line-height: 1.35;
}

.part-b-paper-options button:hover,
.part-b-match-table button:hover,
.part-b-statement button:hover,
.part-b-blank-paragraph > button:hover {
  border-color: rgba(37, 134, 129, 0.35);
  background: #eef9f8;
}

.part-b-blank-paragraph {
  display: grid;
  gap: 8px;
}

.part-b-blank-paragraph > button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 156px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 2px 0 4px;
  font-weight: 900;
}

.part-b-blank-paragraph > button.answered {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.part-b-blank-paragraph p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.85;
}

.part-b-match-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #222;
  background: #fff;
  font-size: 14px;
}

.part-b-match-table td {
  border: 1px solid #222;
  vertical-align: top;
  padding: 0;
}

.part-b-left-cell {
  width: 30%;
}

.part-b-match-table button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 0;
  padding: 9px 10px;
  text-align: left;
  line-height: 1.45;
}

.part-b-match-table button.answered {
  background: #eef9f8;
}

.part-b-match-table em {
  margin-left: auto;
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.part-b-statement-list {
  display: grid;
  gap: 10px;
}

.part-b-statement {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.part-b-statement p {
  margin: 0;
  line-height: 1.55;
}

.part-b-statement div {
  display: flex;
  gap: 6px;
}

.part-b-statement button {
  min-width: 34px;
  min-height: 32px;
  padding: 5px 8px;
  font-weight: 900;
}

.part-b-statement button.selected {
  background: #eef9f8;
  color: var(--accent);
}

.part-b-question-list {
  display: none;
}

.submitted-exam-shell .part-b-question-list {
  display: grid;
  margin-top: 14px;
}

.exam-question {
  padding: 12px;
  scroll-margin-top: 96px;
}

.analysis-exam-shell {
  gap: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(215, 226, 225, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.analysis-exam-shell .exam-toolbar {
  border: 0;
  border-bottom: 1px solid rgba(215, 226, 225, 0.9);
  border-radius: 0;
  box-shadow: none;
}

.analysis-exam-shell .exam-layout,
.analysis-exam-shell .exam-notes-panel {
  padding: 12px;
}

.analysis-exam-shell .exam-notes-panel {
  border: 0;
  border-top: 1px solid rgba(215, 226, 225, 0.9);
  border-radius: 0;
  box-shadow: none;
}

.exam-question.wrong {
  border-color: rgba(215, 101, 69, 0.5);
  background: #fff8f4;
}

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

.writing-prompt {
  font-size: 15px;
  line-height: 1.85;
}

.writing-prompt p {
  margin: 0 0 8px;
}

.writing-prompt p:first-child {
  font-weight: 800;
}

.writing-paper {
  display: grid;
  gap: 22px;
}

.writing-question {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

.writing-question + .writing-question {
  margin-top: 6px;
}

.writing-answer-field {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.writing-answer-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.writing-answer-field textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  font: inherit;
  line-height: 1.75;
}

.writing-question:nth-child(2) .writing-answer-field textarea {
  min-height: 260px;
}

.exam-mini-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 13px;
}

.exam-mini-actions button.active {
  color: var(--aqua-dark);
  border-color: rgba(37, 134, 129, 0.35);
  background: var(--soft);
  font-weight: 800;
}

.option-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.use-cloze-panel .exam-question {
  padding: 8px;
}

.use-cloze-panel .exam-question-head {
  margin-bottom: 4px;
}

.use-cloze-panel .question-stem {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.35;
}

.use-cloze-panel .option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.use-cloze-panel .option-grid button {
  min-height: 34px;
  grid-template-columns: 10px 18px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

.use-cloze-panel .option-grid button strong {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.option-grid button {
  display: grid;
  grid-template-columns: 10px 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  border-bottom: 1px solid #eef1f5;
  color: var(--ink);
  text-align: left;
  padding: 8px 10px;
}

.option-grid button i {
  display: block;
  width: 8px;
  height: 8px;
  border: 2px solid #b7bec8;
  border-radius: 999px;
}

.option-analysis {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  margin: 2px 0 12px 42px;
  border-left: 3px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  background: #fbfdfc;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.option-analysis.correct {
  border-left-color: var(--green);
  background: #f5fbf7;
}

.option-analysis.wrong {
  border-left-color: rgba(215, 101, 69, 0.5);
  background: #fff8f4;
}

.option-grid button strong {
  display: block;
  width: 18px;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #7b8794;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.option-grid button.selected {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 242, 0.18);
}

.option-grid button.selected i {
  border-color: #2f7df2;
  background: #2f7df2;
}

.option-grid button.correct {
  border-color: rgba(116, 185, 156, 0.7);
  background: #f2fbf6;
}

.option-grid button.wrong-option {
  border-color: rgba(215, 101, 69, 0.55);
  background: #fff5f0;
}

.option-grid.wide-options button {
  grid-template-columns: 32px minmax(0, 1fr);
}

.analysis-answer-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
}

.analysis-answer-summary.wrong span {
  border-color: rgba(215, 101, 69, 0.48);
  background: #fff4ef;
  color: #9b4129;
}

.analysis-answer-summary span {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfc;
  padding: 6px 8px;
}

.analysis-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.analysis-block h4 {
  margin: 0;
}

.evidence-jump-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid #f0dc91;
  border-radius: var(--radius-md);
  background: #fffbea;
  padding: 8px;
}

.evidence-jump-panel > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.evidence-jump-panel button {
  min-height: 30px;
  border: 1px solid #e6c95d;
  border-radius: 999px;
  background: #fff;
  color: #7b5c00;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.analysis-field {
  display: grid;
  gap: 5px;
}

.analysis-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfc;
  padding: 8px 10px;
}

.analysis-details summary {
  cursor: pointer;
  font-weight: 800;
}

.analysis-field > strong {
  color: var(--ink);
}

.analysis-field p,
.analysis-field ul,
.analysis-field dl {
  margin: 0;
  color: #334141;
  font-size: 14px;
  line-height: 1.7;
}

.analysis-field ul {
  padding-left: 18px;
}

.analysis-field li {
  margin-bottom: 5px;
}

.vocab-line {
  display: block;
}

.analysis-field dl {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px 8px;
}

.analysis-field dt {
  color: var(--aqua-dark);
  font-weight: 900;
}

.analysis-field dd {
  margin: 0;
}

.writing-chart-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  margin-top: 10px;
}

.muted-note {
  color: var(--muted);
}

.exam-explain {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.answer-sheet {
  position: sticky;
  top: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.exam-notes-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(215, 226, 225, 0.88);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.exam-notes-panel textarea {
  min-height: 150px;
  resize: vertical;
}

.answer-dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.answer-dots button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.answer-dots button.answered {
  background: var(--soft);
  color: var(--aqua-dark);
  border-color: rgba(37, 134, 129, 0.35);
}

.answer-dots button.flagged {
  background: #fff3e3;
  color: #9a6417;
  border-color: #f2c986;
}

.canvas-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(215, 226, 225, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.writing-practice-card .canvas-panel {
  margin-top: 10px;
  box-shadow: none;
}

.canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.canvas-submit {
  margin-left: auto;
}

.hand-canvas {
  display: block;
  width: 100%;
  height: 320px;
  border: 1px dashed #b8c7c6;
  border-radius: var(--radius-md);
  background:
    linear-gradient(#fff 31px, #edf3f2 32px),
    #fff;
  background-size: 100% 32px;
  touch-action: none;
}

.writing-practice-card .hand-canvas {
  height: 210px;
}

.grammar-lesson-card .canvas-panel {
  margin-top: 10px;
  padding: 8px;
  box-shadow: none;
}

.grammar-lesson-card .canvas-panel .color-dot,
.grammar-lesson-card .canvas-panel .range-control,
.grammar-lesson-card .canvas-panel [data-eraser],
.grammar-lesson-card .canvas-panel [data-canvas-clear],
.grammar-lesson-card .canvas-panel .tiny-label {
  display: none;
}

.grammar-lesson-card .hand-canvas {
  height: 126px;
}

.color-dot {
  width: 31px;
  height: 31px;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0;
}

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

.range-control {
  width: 112px;
}

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

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.hidden {
  display: none !important;
}

body.cloud-locked .app-shell,
body.cloud-locked .study-screen,
body.cloud-locked .word-popover,
body.cloud-locked .toast {
  display: none !important;
}

.cloud-login-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f8;
}

.cloud-login-card {
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}

.cloud-login-card h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.cloud-login-error {
  min-height: 20px;
  color: #dc2626;
  font-weight: 800;
}

.word-popover {
  position: fixed;
  z-index: 80;
  max-width: min(220px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(37, 134, 129, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(24, 42, 42, 0.14);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

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

.word-popover .dict-line,
.word-popover .context-line {
  display: block;
  margin-top: 6px;
}

.word-popover .context-line {
  color: #145f5a;
  font-weight: 700;
}

.word-popover .suffix-line {
  display: block;
  margin: 2px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.word-popover.missing {
  border-color: rgba(231, 155, 45, 0.35);
  background: rgba(255, 253, 248, 0.98);
}

.popover-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: #fff3e3;
  color: #9a6417;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 82px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(31, 42, 42, 0.94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--motion-fast), transform var(--motion-fast);
  z-index: 50;
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ambientShift {
  from {
    opacity: 0.72;
    filter: hue-rotate(0deg) saturate(1);
  }
  to {
    opacity: 1;
    filter: hue-rotate(12deg) saturate(1.18);
  }
}

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

@keyframes glassRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    filter: saturate(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes navSettle {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes prismPulse {
  from {
    filter: hue-rotate(0deg) saturate(1);
  }
  to {
    filter: hue-rotate(18deg) saturate(1.26);
  }
}

@keyframes evidencePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(231, 155, 45, 0.45);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(231, 155, 45, 0);
  }
}

/* Clear glass system: white background, transparent glass, no frosted blur. */
html,
body {
  width: 100%;
  min-height: 100%;
  background: #ffffff;
}

body::before,
body::after {
  display: none;
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

.view {
  min-height: calc(100svh - 116px);
}

.task-card,
.panel,
.stat-card,
.reminder-card,
.lesson-card,
.writing-teaching-card,
.writing-slot-card,
.writing-template-card,
.writing-step,
.writing-practice-card,
.exam-toolbar,
.exam-report,
.exam-goal,
.exam-analysis,
.exam-question,
.answer-sheet,
.analysis-exam-shell,
.exam-text-panel,
.exam-question-drawer,
.exam-notes-panel,
.canvas-panel,
.answer-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.18)),
    rgba(255, 255, 255, 0.22);
  border-color: rgba(185, 195, 210, 0.42);
  box-shadow:
    0 16px 42px rgba(31, 41, 55, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(31, 41, 55, 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.bottom-nav {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2)),
    rgba(255, 255, 255, 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}

.bottom-nav::after {
  display: none;
  animation: none;
}

.study-screen,
.study-screen.exam-mode,
.exam-text-panel,
.exam-text-passage {
  background: #ffffff;
}

.study-body {
  width: 100%;
  max-width: none;
  min-height: 100svh;
}

.study-screen:not(.exam-mode) .study-body > .lesson-card {
  min-height: calc(100svh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.exam-shell,
.analysis-exam-shell {
  width: 100%;
  min-height: 100svh;
}

.analysis-exam-shell .exam-layout {
  min-height: calc(100svh - 80px);
}

.writing-minimal-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
}

.study-screen.lesson-mode .study-body > .writing-minimal-card {
  width: 100%;
  min-height: 100svh;
  margin: 0;
  padding: calc(84px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.study-screen.lesson-mode .study-body > .writing-minimal-card::before {
  display: none;
}

.writing-template-head {
  display: grid;
  gap: 8px;
}

.writing-template-head h2 {
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.15;
}

.writing-sentence-stack {
  display: grid;
  gap: 16px;
}

.writing-sentence-card {
  display: grid;
  gap: 12px;
  padding: 16px 0 18px;
  border: 0;
  border-top: 1px solid rgba(185, 195, 210, 0.38);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.writing-sentence-card .lesson-sentence {
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.55;
}

.sentence-speak-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid rgba(185, 195, 210, 0.52);
  border-radius: 8px;
  padding: 0;
  color: #007aff;
  background: #ffffff;
  box-shadow: none;
}

.sentence-speak-button strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sentence-speak-button span {
  font-size: 18px;
  line-height: 1;
}

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

@media (min-width: 760px) {
  .settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

@media (max-width: 860px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }

  .answer-sheet {
    position: static;
  }
}

@media (max-width: 680px) {
  .hero-card {
    align-items: stretch;
  }

  .exam-text-layout {
    grid-template-columns: 1fr;
  }

  .exam-text-passage {
    position: static;
  }

  .exam-text-passage .analysis-passage-body {
    max-height: none;
  }

  .translation-steps {
    grid-template-columns: 1fr 1fr;
  }

  .exam-toolbar,
  .exam-question-head {
    align-items: stretch;
    flex-direction: column;
  }

  .task-row {
    gap: 10px;
  }

  .settings-grid,
  .profile-grid,
  .stats-grid,
  .device-preview {
    grid-template-columns: 1fr;
  }

  .momo-actions {
    grid-template-columns: 1fr 1fr;
  }

  .hand-canvas {
    height: 280px;
  }
}

.exam-question-drawer {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.exam-drawer-handle {
  display: none;
  border: 0;
  background: transparent;
}

.exam-drawer-handle b {
  display: none;
}

.exam-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #7c8794;
  font-size: 18px;
}

.exam-drawer-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.exam-drawer-head strong {
  color: #7f8a95;
  font-size: 20px;
}

.exam-drawer-head strong span {
  color: #1f7cf2;
}

.exam-question-drawer.collapsed .exam-question-list,
.exam-question-drawer.collapsed .part-b-answer-grid,
.exam-question-drawer.collapsed .cloze-option-matrix {
  display: none;
}

.exam-help-button {
  display: none;
}

.option-analysis-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.exam-practice-report {
  display: grid;
  gap: 18px;
}

.exam-report-hero {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 10px 4px;
}

.exam-score-ring {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(#2f7df2 var(--score, 0deg), #eef2f6 0);
  color: var(--ink);
}

.exam-score-ring span {
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
}

.exam-score-ring small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.exam-report-stats h3 {
  margin: 2px 0 14px;
  font-size: 23px;
}

.exam-report-stats > div {
  display: grid;
  gap: 10px;
  color: #7b8794;
  font-size: 18px;
}

.exam-report-stats strong {
  color: var(--ink);
  font-size: 28px;
}

.exam-report-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 22px;
  padding: 16px 6px 8px;
}

.exam-report-map button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: #ebedf0;
  color: #9a9da3;
  font-size: 20px;
  font-weight: 900;
}

.exam-report-map button.correct {
  background: #e2f4ef;
  color: #2f7f6d;
}

.exam-report-map button.wrong {
  background: #ffe2dc;
  color: #d95743;
}

.exam-report-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.exam-report-actions .small-button {
  min-height: 48px;
  border-radius: 999px;
}

@media (min-width: 681px) {
  .analysis-exam-shell .exam-practice-report {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    padding: 12px 14px;
    border-radius: 0;
    box-shadow: none;
  }

  .analysis-exam-shell .exam-report-hero {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
  }

  .analysis-exam-shell .exam-score-ring {
    width: 54px;
    height: 54px;
    background:
      radial-gradient(circle at center, #fff 0 60%, transparent 61%),
      conic-gradient(#2f7df2 var(--score, 0deg), #eef2f6 0);
  }

  .analysis-exam-shell .exam-score-ring span {
    font-size: 24px;
  }

  .analysis-exam-shell .exam-score-ring small {
    display: none;
  }

  .analysis-exam-shell .exam-report-stats h3 {
    margin: 0;
    font-size: 17px;
  }

  .analysis-exam-shell .exam-report-stats .tiny-label {
    display: none;
  }

  .analysis-exam-shell .exam-report-stats > div {
    display: flex;
    gap: 10px;
    margin-top: 2px;
    font-size: 13px;
  }

  .analysis-exam-shell .exam-report-stats strong {
    font-size: 15px;
  }

  .analysis-exam-shell .exam-report-map {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    padding: 0;
  }

  .analysis-exam-shell .exam-report-map button {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .analysis-exam-shell .exam-report-actions {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: none;
    gap: 8px;
  }

  .analysis-exam-shell .exam-report-actions .small-button {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  .study-screen.exam-mode {
    padding: 0;
    background: #edf4f7;
  }

  .study-screen.exam-mode .study-body {
    max-width: none;
    padding: 0 0 calc(52svh + env(safe-area-inset-bottom));
  }

  .study-screen.exam-mode .study-header {
    top: max(40px, env(safe-area-inset-top));
    left: 8px;
    z-index: 48;
  }

  .study-screen.exam-mode .study-header .round-button {
    width: 42px;
    height: 42px;
    color: #1f2937;
    font-size: 32px;
  }

  .analysis-exam-shell {
    gap: 0;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .analysis-exam-shell .exam-toolbar,
  .exam-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 44;
    min-height: calc(86px + env(safe-area-inset-top));
    flex-direction: row;
    align-items: end;
    padding: max(14px, env(safe-area-inset-top)) 12px 12px 56px;
    border: 0;
    border-bottom: 1px solid rgba(217, 226, 232, 0.9);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
  }

  .exam-toolbar h3 {
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
  }

  .exam-toolbar .tiny-label {
    display: none;
  }

  .exam-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .exam-actions .pill {
    min-height: 30px;
    padding: 5px 8px;
    border: 0;
    background: transparent;
    color: #1f2937;
    font-size: 18px;
  }

  .exam-actions .pill + .pill {
    display: none;
  }

  .exam-actions .small-button {
    min-height: 34px;
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 15px;
  }

  .analysis-exam-shell .exam-layout,
  .analysis-exam-shell .exam-notes-panel {
    padding: 0;
  }

  .exam-paper {
    display: block;
  }

  .exam-text-panel {
    display: block;
    min-height: 100svh;
    padding: calc(92px + env(safe-area-inset-top)) 0 0;
    border: 0;
    background: #edf4f7;
    scroll-margin-top: 92px;
  }

  .exam-text-head {
    padding: 10px 20px 2px;
  }

  .exam-text-head h3 {
    font-size: 26px;
    font-weight: 700;
  }

  .exam-text-head .tiny-label {
    display: inline-flex;
    border-radius: 4px;
    background: #eaf4ff;
    color: #2675db;
    padding: 5px 8px;
    font-size: 15px;
  }

  .exam-text-head .pill {
    border: 0;
    border-radius: 6px;
    background: #fff1e5;
    color: #cf742b;
    font-size: 14px;
  }

  .exam-text-layout {
    display: block;
  }

  .exam-text-passage {
    position: static;
    min-height: calc(100svh - 150px);
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #edf4f7;
  }

  .exam-text-passage h4 {
    display: none;
  }

  .exam-text-passage .analysis-passage-body {
    padding: 10px 20px calc(50svh + 72px);
    color: #1f2937;
    font-size: 25px;
    line-height: 1.82;
  }

  .analysis-paragraph {
    scroll-margin-top: 104px;
  }

  .cloze-blank {
    min-width: 70px;
    height: 30px;
    border: 2px solid #2c7be5;
    border-radius: 6px;
    background: #fff;
    color: #2c7be5;
    font-size: 22px;
  }

  .cloze-blank.answered,
  .cloze-blank.selected {
    background: #2f7df2;
    color: #fff;
  }

  .exam-question-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 42;
    display: flex;
    flex-direction: column;
    height: min(52svh, 520px);
    border-radius: 18px 18px 0 0;
    background: #fff;
    box-shadow: 0 -16px 38px rgba(20, 30, 44, 0.16);
    padding: 9px 16px max(16px, env(safe-area-inset-bottom));
    overflow: hidden;
    transition: height 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  }

  .submitted-exam-shell .exam-question-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(52svh, 520px);
    margin: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 38px rgba(20, 30, 44, 0.16);
  }

  .submitted-exam-shell .exam-text-panel {
    padding-top: 0;
    min-height: 0;
  }

  .submitted-exam-shell .exam-text-passage .analysis-passage-body {
    padding-bottom: 28px;
  }

  .exam-drawer-handle {
    display: grid;
    align-self: center;
    place-items: center;
    gap: 4px;
    min-width: 112px;
    min-height: 28px;
    padding: 0 16px 4px;
    border: 0;
    border-radius: 999px 999px 12px 12px;
    background: #fff;
    color: #9aa3ad;
  }

  .exam-drawer-handle span {
    display: block;
    align-self: center;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: #d7dbe1;
  }

  .exam-drawer-handle b {
    display: none;
  }

  .exam-drawer-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2px 0 10px;
    border-bottom: 1px solid #eef1f5;
  }

  .exam-question-drawer.collapsed {
    height: calc(78px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 28px rgba(47, 67, 84, 0.12);
  }

  .exam-question-drawer.collapsed .exam-drawer-head {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .reading-part-panel .exam-drawer-head {
    display: flex;
  }

  .cloze-option-matrix {
    display: none;
  }

  .use-cloze-panel .exam-question-list {
    display: grid;
  }

  .part-b-question-list {
    display: none;
  }

  .submitted-exam-shell .part-b-question-list {
    display: grid;
  }

  .exam-drawer-head strong {
    color: #1f2937;
    font-size: 18px;
    letter-spacing: 0;
  }

  .exam-question-list,
  .cloze-question-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    overflow: auto;
    padding: 4px 0 18px;
    scrollbar-width: none;
  }

  .compact-exam-question {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .reading-part-panel .compact-exam-question {
    border: 0;
    padding: 0;
  }

  .compact-exam-question .exam-question-head {
    display: none;
  }

  .compact-exam-question + .compact-exam-question {
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
  }

  .reading-part-panel .compact-exam-question + .compact-exam-question {
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
  }

  .compact-exam-question .exam-question-head {
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
  }

  .compact-exam-question .question-stem {
    margin: 0 0 12px;
    color: #1f2937;
    font-size: 22px;
    line-height: 1.75;
  }

  .reading-part-panel .compact-exam-question .question-stem {
    font-size: 22px;
    line-height: 1.75;
  }

  .option-grid,
  .use-cloze-panel .option-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 6px;
  }

  .option-grid button,
  .use-cloze-panel .option-grid button {
    min-height: 58px;
    grid-template-columns: 16px 24px minmax(0, 1fr);
    gap: 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    border-bottom: 1px solid #eef1f5;
    padding: 10px 14px;
    color: #1f2937;
    font-size: 20px;
  }

  .reading-part-panel .option-grid button {
    display: grid;
    min-height: 58px;
    grid-template-columns: 16px 24px minmax(0, 1fr);
    gap: 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    border-bottom: 1px solid #eef1f5;
    padding: 10px 14px;
    font-size: 20px;
  }

  .option-grid button i,
  .use-cloze-panel .option-grid button i {
    width: 9px;
    height: 9px;
    border: 2px solid #b7bec8;
    border-radius: 999px;
    background: transparent;
  }

  .option-grid button strong,
  .use-cloze-panel .option-grid button strong {
    display: block;
    width: 24px;
    height: auto;
    border: 0;
    background: transparent;
    color: #7b8794;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
  }

  .option-grid button.selected {
    border: 0;
    background: #eef5ff;
    box-shadow: inset 0 0 0 1px rgba(47, 125, 242, 0.18);
  }

  .option-grid button.selected i {
    border-color: #2f7df2;
    background: #2f7df2;
  }

  .option-grid button.correct {
    background: #e8f5f1;
  }

  .option-grid button.correct strong {
    color: #2f7f6d;
  }

  .option-grid button.correct i {
    border-color: #5fae95;
    background: #5fae95;
  }

  .option-grid button.wrong-option {
    background: #fff0ea;
  }

  .option-analysis {
    grid-template-columns: 30px minmax(0, 1fr);
    margin: 0;
    border-left-width: 4px;
    border-radius: 6px;
    font-size: 16px;
  }

  .analysis-answer-summary {
    font-size: 18px;
  }

  .analysis-block {
    margin-top: 16px;
    font-size: 17px;
  }

  .exam-practice-report {
    margin: calc(96px + env(safe-area-inset-top)) 12px 14px;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(47, 67, 84, 0.08);
  }

  .exam-report-hero {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 16px;
  }

  .exam-score-ring {
    width: 132px;
    height: 132px;
  }

  .exam-report-map {
    gap: 14px 18px;
  }

  .exam-report-actions {
    position: sticky;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .exam-report-actions .small-button {
    min-height: 54px;
    font-size: 17px;
  }
}

/* Final fullscreen white-glass overrides for all responsive branches. */
.study-screen.exam-mode,
.study-screen.exam-mode .exam-text-panel,
.study-screen.exam-mode .exam-text-passage,
.study-screen.exam-mode .analysis-exam-shell,
.study-screen.exam-mode .exam-question-drawer,
.study-screen.exam-mode .exam-toolbar,
.submitted-exam-shell .exam-text-panel,
.submitted-exam-shell .exam-text-passage .analysis-passage-body {
  background: #ffffff;
}

.study-screen.exam-mode .study-body {
  width: 100%;
  max-width: none;
}

.study-screen.exam-mode .analysis-exam-shell,
.study-screen.exam-mode .exam-shell {
  min-height: 100svh;
  width: 100%;
}

.study-screen.exam-mode .exam-toolbar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.study-screen.exam-mode .exam-question-drawer,
.study-screen.exam-mode .exam-question,
.study-screen.exam-mode .analysis-exam-shell .exam-notes-panel {
  background: #ffffff;
  border-color: rgba(185, 195, 210, 0.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.study-screen.exam-mode .exam-question-drawer {
  border: 0;
  box-shadow: 0 -16px 38px rgba(20, 30, 44, 0.16);
}

.study-screen.exam-mode .exam-question {
  box-shadow: none;
}

.study-screen.exam-mode .option-grid button {
  background: #ffffff;
}

.study-screen.exam-mode .option-grid button.selected {
  background: #eef5ff;
}

.study-screen.exam-mode .current-question-list {
  display: grid;
}

.study-screen.exam-mode .current-question-list .exam-question-head {
  display: none;
}

.study-screen.exam-mode .exam-question-drawer.collapsed .current-question-list {
  display: none;
}

.momo-card,
.momo-top,
.momo-middle {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.momo-card {
  min-height: 100svh;
}

/* Keep every top-level screen on a stable full-height canvas. */
html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

.app-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.app-shell > main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.view.active {
  width: 100%;
  flex: 1 1 auto;
}

.study-screen.memory-mode {
  overflow: hidden;
}

.study-screen.memory-mode .study-body,
.study-screen.memory-mode .momo-card {
  height: 100svh;
  min-height: 0;
}

.study-screen.memory-mode .momo-middle {
  min-height: 0;
  overflow: auto;
}

.study-screen.memory-mode .momo-actions {
  flex: 0 0 auto;
  background: #ffffff;
}

/* Final iridescent glass pass: keep the full-screen layout, restore the Sunday glass mood. */
html,
body {
  background:
    radial-gradient(circle at 18% 8%, rgba(132, 220, 255, 0.55), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(255, 177, 214, 0.42), transparent 30%),
    radial-gradient(circle at 64% 88%, rgba(178, 255, 214, 0.34), transparent 36%),
    linear-gradient(180deg, #f9fcff 0%, #eef6fb 48%, #ffffff 100%);
}

body::before,
body::after {
  display: block;
}

body::before {
  opacity: 0.78;
  filter: blur(24px) saturate(155%);
}

.task-card,
.panel,
.stat-card,
.reminder-card,
.lesson-card,
.writing-teaching-card,
.writing-slot-card,
.writing-template-card,
.writing-step,
.writing-practice-card,
.exam-toolbar,
.exam-report,
.exam-goal,
.exam-analysis,
.exam-question,
.answer-sheet,
.analysis-exam-shell,
.exam-text-panel,
.exam-question-drawer,
.exam-notes-panel,
.canvas-panel,
.answer-panel,
.momo-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)),
    linear-gradient(315deg, rgba(117, 202, 255, 0.2), rgba(255, 184, 229, 0.18) 45%, rgba(169, 255, 212, 0.14)),
    rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 20px 52px rgba(24, 39, 68, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(112, 130, 160, 0.08);
  backdrop-filter: blur(30px) saturate(185%);
  -webkit-backdrop-filter: blur(30px) saturate(185%);
}

.bottom-nav,
.study-screen.exam-mode .exam-toolbar,
.momo-actions {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.34)),
    linear-gradient(300deg, rgba(117, 202, 255, 0.26), rgba(255, 196, 235, 0.22), rgba(186, 255, 222, 0.18));
  backdrop-filter: blur(42px) saturate(210%);
  -webkit-backdrop-filter: blur(42px) saturate(210%);
}

.bottom-nav::after {
  content: none;
  display: none;
  animation: none;
}

.study-screen.exam-mode,
.study-screen.exam-mode .exam-text-panel,
.study-screen.exam-mode .exam-text-passage,
.study-screen.exam-mode .analysis-exam-shell,
.submitted-exam-shell .exam-text-panel,
.submitted-exam-shell .exam-text-passage .analysis-passage-body,
.momo-top,
.momo-middle {
  background: rgba(255, 255, 255, 0.74);
}

.analysis-passage-body .cloze-paragraph + .cloze-paragraph {
  margin-top: 22px;
}

/* Mobile performance and exam layout repair. */
@media (max-width: 680px) {
  .app-shell {
    min-height: 100dvh;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .app-shell > main,
  .view.active {
    min-height: 0;
  }

  .bottom-nav {
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translate3d(-50%, 0, 0);
    will-change: transform;
  }

  .view.active .task-card,
  .view.active .panel,
  .view.active .stat-card,
  .view.active .reminder-card,
  .view.active .momo-card,
  .view.active .lesson-card {
    animation: none;
  }

  html,
  body {
    background:
      radial-gradient(circle at 18% 0%, rgba(164, 226, 255, 0.5), transparent 34%),
      radial-gradient(circle at 88% 16%, rgba(255, 200, 232, 0.34), transparent 32%),
      linear-gradient(180deg, #f9fdff 0%, #eef8f9 56%, #ffffff 100%);
  }

  body::before,
  body::after {
    animation: none;
    filter: none;
    opacity: 0.48;
  }

  .study-screen {
    contain: paint;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .study-screen.swiping,
  .study-screen.closing {
    box-shadow: -16px 0 34px rgba(20, 30, 44, 0.12);
  }

  .study-screen.swiping *,
  .study-screen.closing * {
    animation-play-state: paused !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .study-screen.swiping .bottom-nav::after,
  .study-screen.closing .bottom-nav::after {
    display: none !important;
  }

  .task-card,
  .panel,
  .stat-card,
  .reminder-card,
  .lesson-card,
  .writing-teaching-card,
  .writing-slot-card,
  .writing-template-card,
  .writing-step,
  .writing-practice-card,
  .exam-report,
  .exam-goal,
  .exam-analysis,
  .exam-question,
  .answer-sheet,
  .analysis-exam-shell,
  .exam-text-panel,
  .exam-question-drawer,
  .exam-notes-panel,
  .canvas-panel,
  .answer-panel,
  .momo-card {
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    box-shadow:
      0 12px 30px rgba(24, 39, 68, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .bottom-nav,
  .momo-actions {
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  .bottom-nav::after {
    display: none;
  }

  .analysis-exam-shell .exam-toolbar,
  .exam-toolbar {
    position: relative !important;
    top: 0 !important;
    z-index: 44;
    min-height: calc(84px + env(safe-area-inset-top)) !important;
    padding: max(12px, env(safe-area-inset-top)) 12px 10px 58px !important;
    align-items: end;
    background:
      linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(239, 249, 255, 0.76)),
      linear-gradient(300deg, rgba(117, 202, 255, 0.18), rgba(255, 196, 235, 0.16));
    box-shadow: 0 1px 0 rgba(205, 218, 228, 0.9);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .analysis-exam-shell .exam-toolbar {
    justify-content: space-between;
  }

  .analysis-exam-shell .exam-toolbar > div:first-child {
    display: block;
    min-width: 0;
  }

  .analysis-exam-shell .exam-toolbar h3 {
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .study-screen.exam-mode .study-header {
    top: max(18px, calc(env(safe-area-inset-top) + 6px));
    left: 12px;
    z-index: 48;
  }

  .exam-text-panel {
    padding-top: 0 !important;
    scroll-margin-top: calc(86px + env(safe-area-inset-top));
  }

  .exam-text-head {
    padding: 14px 18px 8px;
  }

  .exam-text-passage {
    min-height: auto;
  }

  .exam-text-passage .analysis-passage-body {
    padding: 12px 18px calc(46svh + 84px);
    font-size: clamp(17px, 4.2vw, 20px);
    line-height: 1.78;
    text-align: left;
    word-spacing: normal;
    letter-spacing: 0;
    overflow-wrap: normal;
    word-break: normal;
  }

  .analysis-passage-body .analysis-paragraph + .analysis-paragraph,
  .analysis-passage-body .cloze-paragraph + .cloze-paragraph {
    margin-top: 20px;
  }

  .exam-question-drawer {
    height: min(46svh, 430px);
    padding: 8px 18px max(14px, env(safe-area-inset-bottom));
    overflow: hidden;
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
  }

  .exam-question-list,
  .cloze-question-list {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2px 0 18px;
  }

  .compact-exam-question .question-stem,
  .reading-part-panel .compact-exam-question .question-stem {
    font-size: clamp(16px, 4.1vw, 19px);
    line-height: 1.55;
    overflow-wrap: normal;
    word-break: normal;
    word-spacing: normal;
  }

  .option-grid,
  .use-cloze-panel .option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .option-grid button,
  .use-cloze-panel .option-grid button,
  .reading-part-panel .option-grid button {
    display: grid;
    grid-template-columns: 12px 24px minmax(0, 1fr);
    align-items: start;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    gap: 10px;
    padding: 10px 8px;
    font-size: clamp(15px, 3.9vw, 18px);
    line-height: 1.48;
  }

  .option-grid button:not(:has(i)),
  .use-cloze-panel .option-grid button:not(:has(i)),
  .reading-part-panel .option-grid button:not(:has(i)) {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .option-grid button span,
  .use-cloze-panel .option-grid button span,
  .reading-part-panel .option-grid button span,
  .option-analysis span {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    writing-mode: horizontal-tb;
  }

  .option-analysis {
    grid-template-columns: 24px minmax(0, 1fr);
    margin-left: 0;
    font-size: 14px;
    line-height: 1.62;
  }

  .study-screen.exam-mode .option-grid button {
    background: rgba(255, 255, 255, 0.88);
  }

  .study-screen.exam-mode .study-body {
    padding-top: 0;
  }

  .study-screen.exam-mode .exam-text-head {
    display: none;
  }

  .study-screen.exam-mode .exam-text-panel {
    min-height: auto;
  }

  .analysis-passage-body .analysis-paragraph {
    margin: 0 0 16px;
  }

  .legacy-exam-passage {
    padding: 10px 0 0;
  }

  .part-b-paper-options button,
  .part-b-option-bank button {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
  }

  .part-b-paper-options button span,
  .part-b-option-bank button span,
  .token-word {
    writing-mode: horizontal-tb;
    word-break: normal;
    overflow-wrap: anywhere;
  }
}

/* Native-feel stability pass: no delayed re-entry motion after returning home. */
.view.active,
.view.active .task-card,
.view.active .panel,
.view.active .stat-card,
.view.active .reminder-card,
.view.active .momo-card,
.view.active .lesson-card,
.bottom-nav,
.bottom-nav::after {
  animation: none !important;
  animation-delay: 0ms !important;
}

.task-card,
.panel,
.stat-card,
.reminder-card,
.bottom-nav {
  transition: none !important;
}

.study-screen.closing {
  transition: none !important;
}

/* Desktop website mode: keep only the sentence-study workspace. */
body.sentence-site {
  height: 100vh;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f7f9fc 0%, #edf3f8 100%);
  overflow: hidden;
}

body.sentence-site::before,
body.sentence-site::after,
body.sentence-site .home-header,
body.sentence-site .bottom-nav,
body.sentence-site #homeView,
body.sentence-site #examView,
body.sentence-site #statsView,
body.sentence-site #profileView {
  display: none !important;
}

body.sentence-site .app-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(18px, 2vw, 28px);
}

body.sentence-site main {
  height: calc(100vh - clamp(36px, 4vw, 56px));
  min-height: calc(100vh - clamp(36px, 4vw, 56px));
  overflow: hidden;
}

body.sentence-site #sentenceView.view.active {
  display: block;
  height: 100%;
}

body.sentence-site .sentence-shell {
  height: 100%;
  min-height: calc(100vh - clamp(36px, 4vw, 56px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
}

body.sentence-site .sentence-shell.news-only {
  grid-template-rows: auto minmax(0, 1fr);
}

body.sentence-site .sentence-hero {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8e1ea;
  box-shadow: none;
  padding: 18px 22px;
}

body.sentence-site .sentence-hero h2 {
  font-size: clamp(28px, 2.3vw, 40px);
}

body.sentence-site .sentence-tabs,
body.sentence-site .sentence-filters,
body.sentence-site .sentence-queue,
body.sentence-site .sentence-card {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8e1ea;
  box-shadow: none;
}

body.sentence-site .sentence-tabs {
  justify-self: start;
  min-width: 360px;
}

body.sentence-site .sentence-tabs button {
  border-radius: 6px;
}

body.sentence-site .sentence-tabs button.active {
  box-shadow: none;
  background: #111827;
  color: #fff;
}

body.sentence-site .sentence-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

body.sentence-site .sentence-workspace {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(300px, 26vw) minmax(0, 1fr);
  overflow: hidden;
}

body.sentence-site .sentence-queue {
  position: static;
  height: 100%;
  min-height: 0;
}

body.sentence-site .sentence-queue-list {
  max-height: calc(100vh - 180px);
}

body.sentence-site .sentence-card {
  min-height: calc(100vh - 180px);
  max-height: calc(100vh - 180px);
  align-content: start;
  overflow-y: auto;
  padding: clamp(16px, 1.6vw, 24px);
}

body.sentence-site .sentence-original,
body.sentence-site .sentence-block p {
  font-size: clamp(18px, 1.25vw, 22px);
}

body.sentence-site .sentence-block {
  border-radius: 8px;
  background: #fbfdff;
}

body.sentence-site .sentence-block textarea {
  min-height: clamp(130px, 16vh, 210px);
  border-radius: 8px;
}

body.sentence-site .primary-button,
body.sentence-site .small-button,
body.sentence-site .sentence-icon-button,
body.sentence-site .sentence-filter select {
  border-radius: 6px !important;
}

@media (min-aspect-ratio: 16/10) and (min-width: 1180px) {
  body.sentence-site .sentence-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sentence-site .sentence-workspace {
    grid-template-columns: minmax(340px, 24vw) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  body.sentence-site {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.sentence-site .app-shell {
    height: auto;
    overflow: visible;
    padding: 12px;
  }

  body.sentence-site main,
  body.sentence-site #sentenceView.view.active,
  body.sentence-site .sentence-shell,
  body.sentence-site .sentence-workspace {
    height: auto;
    overflow: visible;
  }

  body.sentence-site .sentence-filters,
  body.sentence-site .sentence-workspace,
  body.sentence-site .sentence-answer-grid {
    grid-template-columns: 1fr;
  }

  body.sentence-site .sentence-tabs {
    width: 100%;
    min-width: 0;
  }

  body.sentence-site .sentence-card {
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
}

.bottom-nav::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  animation: none !important;
}

@media (max-width: 680px) {
  html,
  body {
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  body::before,
  body::after {
    display: none !important;
  }

  button {
    transition: none !important;
  }

  button:active,
  button.is-pressing {
    transform: none !important;
  }

  .task-card,
  .panel,
  .lesson-card,
  .writing-teaching-card,
  .writing-slot-card,
  .writing-template-card,
  .writing-step,
  .writing-practice-card,
  .exam-report,
  .exam-goal,
  .exam-analysis,
  .exam-question,
  .answer-sheet,
  .analysis-exam-shell,
  .exam-text-panel,
  .exam-question-drawer,
  .exam-notes-panel,
  .canvas-panel,
  .answer-panel,
  .momo-card,
  .bottom-nav,
  .momo-actions {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Mobile exam final pass: native fixed chrome, scrollable passage, bottom sheet answers. */
@media (max-width: 680px) {
  :root {
    --mobile-exam-top: calc(76px + env(safe-area-inset-top));
    --mobile-exam-drawer: min(43svh, 390px);
    --mobile-tab-safe: calc(116px + env(safe-area-inset-bottom));
  }

  .study-screen.exam-mode {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    contain: none !important;
    transform: none;
  }

  .study-screen.exam-mode::before {
    content: "";
    position: fixed;
    z-index: 46;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-exam-top);
    pointer-events: none;
    background:
      linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 62%, rgba(255, 255, 255, 0.86) 82%, rgba(255, 255, 255, 0) 100%),
      linear-gradient(90deg, rgba(225, 246, 255, 0.7), rgba(255, 245, 253, 0.66), rgba(237, 255, 247, 0.62));
  }

  .study-screen.exam-mode .study-header {
    position: fixed !important;
    top: calc(env(safe-area-inset-top) + 12px) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    z-index: 50 !important;
  }

  .analysis-exam-shell .exam-toolbar,
  .study-screen.exam-mode .exam-toolbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 47 !important;
    min-height: var(--mobile-exam-top) !important;
    padding: calc(env(safe-area-inset-top) + 12px) 12px 10px 60px !important;
    align-items: end !important;
    border: 0 !important;
    border-radius: 0 !important;
    background:
      linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 72%, rgba(255, 255, 255, 0.88) 100%),
      linear-gradient(90deg, rgba(225, 246, 255, 0.68), rgba(255, 245, 253, 0.56), rgba(238, 255, 248, 0.56)) !important;
    box-shadow: 0 1px 0 rgba(220, 228, 236, 0.8) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .study-screen.exam-mode .study-body,
  .study-screen.exam-mode .analysis-exam-shell,
  .study-screen.exam-mode .exam-shell {
    width: 100% !important;
    max-width: none !important;
    min-height: 100svh !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  .study-screen.exam-mode .exam-text-panel {
    min-height: 100svh !important;
    padding: var(--mobile-exam-top) 0 0 !important;
    background: #ffffff !important;
  }

  .study-screen.exam-mode .exam-text-passage {
    min-height: calc(100svh - var(--mobile-exam-top)) !important;
    background: #ffffff !important;
  }

  .study-screen.exam-mode .exam-text-passage .analysis-passage-body {
    padding: 16px 20px calc(var(--mobile-exam-drawer) + 82px + env(safe-area-inset-bottom)) !important;
    font-size: clamp(18px, 4.6vw, 21px) !important;
    line-height: 1.72 !important;
    color: #2f3c3f !important;
    letter-spacing: 0 !important;
    word-spacing: normal !important;
    text-align: left !important;
    overflow: visible !important;
  }

  .study-screen.exam-mode .exam-question-drawer {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 49 !important;
    width: 100% !important;
    height: var(--mobile-exam-drawer) !important;
    max-height: calc(100svh - var(--mobile-exam-top)) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    border: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: #ffffff !important;
    box-shadow: 0 -18px 42px rgba(20, 30, 44, 0.16) !important;
    padding: 8px 20px max(16px, env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    transform: translate3d(0, 0, 0) !important;
  }

  .study-screen.exam-mode .exam-question-drawer.collapsed {
    height: calc(70px + env(safe-area-inset-bottom)) !important;
  }

  .study-screen.exam-mode .exam-drawer-handle {
    flex: 0 0 auto !important;
    display: grid !important;
    place-items: center !important;
    min-height: 26px !important;
    background: #ffffff !important;
  }

  .study-screen.exam-mode .exam-drawer-head {
    flex: 0 0 auto !important;
    min-height: 42px !important;
    padding: 4px 0 10px !important;
    border-bottom: 1px solid #eef1f5 !important;
  }

  .study-screen.exam-mode .exam-question-list,
  .study-screen.exam-mode .cloze-question-list,
  .study-screen.exam-mode .current-question-list {
    flex: 1 1 auto !important;
    display: block !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 6px 0 22px !important;
  }

  .study-screen.exam-mode .exam-question-drawer.collapsed .exam-question-list,
  .study-screen.exam-mode .exam-question-drawer.collapsed .cloze-question-list,
  .study-screen.exam-mode .exam-question-drawer.collapsed .current-question-list,
  .study-screen.exam-mode .exam-question-drawer.collapsed .part-b-answer-grid,
  .study-screen.exam-mode .exam-question-drawer.collapsed .cloze-option-matrix {
    display: none !important;
  }

  .study-screen.exam-mode .compact-exam-question,
  .study-screen.exam-mode .use-cloze-panel .exam-question {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
  }

  .study-screen.exam-mode .compact-exam-question .question-stem,
  .study-screen.exam-mode .reading-part-panel .compact-exam-question .question-stem,
  .study-screen.exam-mode .use-cloze-panel .question-stem {
    width: 100% !important;
    margin: 0 0 12px !important;
    font-size: clamp(17px, 4.2vw, 20px) !important;
    line-height: 1.55 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .study-screen.exam-mode .option-grid,
  .study-screen.exam-mode .use-cloze-panel .option-grid,
  .study-screen.exam-mode .reading-part-panel .option-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  .study-screen.exam-mode .option-grid button,
  .study-screen.exam-mode .use-cloze-panel .option-grid button,
  .study-screen.exam-mode .reading-part-panel .option-grid button {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 20px 34px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 10px !important;
    min-height: 58px !important;
    padding: 12px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #eef1f5 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    text-align: left !important;
    font-size: clamp(17px, 4.5vw, 20px) !important;
    line-height: 1.42 !important;
  }

  .study-screen.exam-mode .option-grid button i {
    justify-self: center !important;
  }

  .study-screen.exam-mode .option-grid button strong,
  .study-screen.exam-mode .use-cloze-panel .option-grid button strong {
    width: 34px !important;
    color: #6b7581 !important;
    font-size: 19px !important;
    font-weight: 600 !important;
    text-align: left !important;
  }

  .study-screen.exam-mode .option-grid button span,
  .study-screen.exam-mode .use-cloze-panel .option-grid button span,
  .study-screen.exam-mode .reading-part-panel .option-grid button span {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
  }

  .study-screen.exam-mode .option-grid button span .token-word {
    display: inline !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
  }

  .study-screen.exam-mode .option-grid button.selected {
    background: #eef5ff !important;
  }

  .bottom-nav {
    z-index: 30 !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    background: #ffffff !important;
    border-color: rgba(224, 232, 240, 0.95) !important;
    box-shadow: 0 14px 34px rgba(24, 39, 68, 0.14) !important;
  }

  .app-shell::after {
    content: "";
    position: fixed;
    z-index: 29;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(150px + env(safe-area-inset-bottom));
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 48%, #ffffff 100%);
  }
}

/* Native interaction system pass. */
:root {
  --motion-touch: 140ms cubic-bezier(.2, .8, .2, 1);
  --motion-page: 340ms cubic-bezier(.2, .82, .18, 1);
  --motion-sheet: 300ms cubic-bezier(.2, .86, .18, 1);
  --nav-index: 0;
}

.app-shell,
.app-shell > main {
  position: relative;
}

.app-shell {
  transform-origin: center top;
  transition: transform var(--motion-page), filter var(--motion-page), opacity var(--motion-page) !important;
}

body.study-active .app-shell {
  transform: scale(.975);
  filter: saturate(.94);
  opacity: .9;
}

.view.active,
.view.leaving {
  display: block;
}

.view.entering,
.view.leaving {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.view.leaving {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.view.entering {
  position: relative;
  z-index: 1;
}

.view.entering-forward {
  animation: pageEnterForward var(--motion-page) both !important;
}

.view.leaving-forward {
  animation: pageLeaveForward var(--motion-page) both !important;
}

.view.entering-back {
  animation: pageEnterBack var(--motion-page) both !important;
}

.view.leaving-back {
  animation: pageLeaveBack var(--motion-page) both !important;
}

button,
[role="button"],
.task-card,
.analysis-section-card,
.exam-entry-button {
  transition:
    background-color var(--motion-touch),
    border-color var(--motion-touch),
    color var(--motion-touch),
    box-shadow var(--motion-touch),
    transform var(--motion-touch),
    opacity var(--motion-touch) !important;
}

button:active,
button.is-pressing,
[role="button"].is-pressing,
.task-card.is-pressing,
.analysis-section-card.is-pressing,
.exam-entry-button.is-pressing {
  transform: translateY(1px) scale(.985) !important;
  filter: brightness(.985);
}

.bottom-nav {
  z-index: 31 !important;
  transition:
    transform var(--motion-page),
    opacity var(--motion-page),
    box-shadow var(--motion-touch),
    background-color var(--motion-touch) !important;
}

body.study-active .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px) scale(.96);
}

.bottom-nav::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  z-index: 0;
  top: 7px;
  bottom: 7px;
  left: 7px;
  width: calc((100% - 26px) / 3);
  border-radius: 21px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(246, 250, 255, .68)),
    linear-gradient(135deg, rgba(10, 132, 255, .16), rgba(48, 209, 88, .08));
  box-shadow:
    0 10px 24px rgba(0, 122, 255, .14),
    inset 0 0 0 1px rgba(255, 255, 255, .76);
  opacity: 1 !important;
  transition: left var(--motion-sheet), opacity var(--motion-touch), transform var(--motion-touch) !important;
  pointer-events: none;
}

body[data-active-view="homeView"] .bottom-nav::after {
  left: 7px;
}

body[data-active-view="examView"] .bottom-nav::after {
  left: calc(7px + ((100% - 26px) / 3) + 6px);
}

body[data-active-view="profileView"] .bottom-nav::after {
  left: calc(7px + ((100% - 26px) / 3) + 6px + ((100% - 26px) / 3) + 6px);
}

body[data-active-view="sentenceView"] .home-header {
  display: none;
}

.sentence-shell {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
}

.sentence-hero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-soft);
}

.sentence-stat {
  display: grid;
  gap: 2px;
  min-width: 82px;
  text-align: right;
}

.sentence-stat strong {
  font-size: 28px;
}

.sentence-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sentence-tabs,
.sentence-filters,
.sentence-actions,
.sentence-nav-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sentence-tabs {
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(255, 255, 255, .72);
}

.sentence-tabs button {
  flex: 1 1 140px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.sentence-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .1);
}

.sentence-filters {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .68);
}

.sentence-filter {
  display: grid;
  gap: 5px;
  flex: 1 1 150px;
}

.sentence-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sentence-filter select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, .36);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.sentence-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sentence-queue,
.sentence-card {
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-soft);
}

.sentence-queue {
  position: sticky;
  top: 10px;
  overflow: hidden;
}

.sentence-queue-head {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.sentence-queue-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sentence-queue-list {
  display: grid;
  gap: 6px;
  max-height: min(68vh, 620px);
  overflow: auto;
  padding: 8px;
}

.sentence-queue-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 3px 8px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 9px;
  text-align: left;
}

.sentence-queue-item.active {
  border-color: rgba(0, 122, 255, .22);
  background: rgba(0, 122, 255, .08);
}

.sentence-queue-item span {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sentence-queue-item strong,
.sentence-queue-item em,
.sentence-queue-item small {
  min-width: 0;
}

.sentence-queue-item strong {
  font-size: 12px;
}

.sentence-queue-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.sentence-queue-item small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.sentence-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.sentence-card.empty {
  min-height: 260px;
  align-content: center;
  text-align: center;
}

.sentence-card-top,
.sentence-block-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.sentence-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .07);
  color: var(--muted);
  font-weight: 900;
}

.sentence-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
}

.sentence-block.original {
  background: #fff;
}

.sentence-block-title strong {
  font-size: 14px;
}

.sentence-block-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sentence-original,
.sentence-block p {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.75;
  word-break: normal;
  overflow-wrap: anywhere;
}

.sentence-block textarea {
  min-height: 116px;
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  line-height: 1.65;
}

.sentence-icon-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 122, 255, .1);
  color: var(--primary);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.sentence-actions .done,
.sentence-nav-actions .done {
  background: rgba(48, 209, 88, .14) !important;
  color: #16733b !important;
}

.sentence-answer {
  display: grid;
  gap: 12px;
}

.sentence-answer-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(0, 122, 255, .18);
  border-radius: 8px;
  background: rgba(0, 122, 255, .06);
}

.sentence-answer-head strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
}

.sentence-answer-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
}

.sentence-answer-ai-button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

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

.sentence-analysis-list {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}

.sentence-analysis-list dt {
  color: var(--muted);
  font-weight: 900;
}

.sentence-analysis-list dd {
  margin: 0;
  line-height: 1.75;
}

.sentence-structure-map {
  display: grid;
  gap: 10px;
}

.sentence-structure-row {
  display: grid;
  grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: #ffffff;
}

.sentence-structure-role {
  display: grid;
  gap: 4px;
}

.sentence-structure-role strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.sentence-structure-role span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sentence-structure-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sentence-structure-text {
  margin: 0;
  font-size: 17px !important;
  line-height: 1.7 !important;
}

.sentence-structure-translation {
  margin: 0;
  color: #1f6f97 !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
  font-weight: 800;
}

.sentence-structure-note {
  margin: 0;
  color: var(--muted) !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
}

.sentence-structure-summary {
  background: rgba(0, 122, 255, .05);
  border-color: rgba(0, 122, 255, .16);
}

.sentence-bullet-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.sentence-bullet-list li span {
  display: block;
  color: var(--muted);
}

.sentence-keyword-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.sentence-keyword {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 1px solid rgba(0, 122, 255, .16);
  border-radius: 12px;
  background: rgba(0, 122, 255, .06);
  padding: 9px;
  text-align: left;
}

.sentence-keyword span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sentence-source-link {
  justify-self: start;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.sentence-nav-actions {
  justify-content: space-between;
}

@media (max-width: 820px) {
  .sentence-workspace,
  .sentence-answer-grid {
    grid-template-columns: 1fr;
  }

  .sentence-queue {
    position: static;
  }

  .sentence-queue-list {
    display: flex;
    overflow-x: auto;
    max-height: none;
  }

  .sentence-queue-item {
    flex: 0 0 240px;
  }

  .sentence-analysis-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .sentence-hero {
    align-items: flex-start;
  }

  .sentence-answer-head {
    grid-template-columns: 1fr;
  }

  .sentence-answer-ai-button {
    justify-self: start;
  }

  .sentence-original,
  .sentence-block p {
    font-size: 16px;
  }
}

.bottom-nav::after {
  width: calc((100% - 32px) / 4) !important;
}

body[data-active-view="homeView"] .bottom-nav::after {
  left: 7px !important;
}

body[data-active-view="sentenceView"] .bottom-nav::after {
  left: calc(7px + ((100% - 32px) / 4) + 6px) !important;
}

body[data-active-view="examView"] .bottom-nav::after {
  left: calc(7px + (((100% - 32px) / 4) + 6px) * 2) !important;
}

body[data-active-view="profileView"] .bottom-nav::after {
  left: calc(7px + (((100% - 32px) / 4) + 6px) * 3) !important;
}

.nav-button {
  background: transparent !important;
  box-shadow: none !important;
}

.nav-button.active {
  transform: none !important;
}

.study-screen.opening {
  animation: studyPushIn var(--motion-page) both !important;
}

.study-screen.closing {
  transition:
    transform 260ms cubic-bezier(.22, .78, .22, 1),
    opacity 260ms cubic-bezier(.22, .78, .22, 1) !important;
}

.study-screen.swiping {
  box-shadow: -16px 0 36px rgba(15, 23, 42, .14);
}

.study-screen.exam-mode .exam-question-drawer {
  transform: translate3d(0, var(--drawer-drag-y, 0), 0) !important;
  transition:
    height var(--motion-sheet),
    transform var(--motion-sheet),
    box-shadow var(--motion-touch),
    border-radius var(--motion-touch) !important;
  will-change: transform, height;
}

.study-screen.exam-mode .exam-question-drawer.dragging {
  transition: none !important;
}

.study-screen.exam-mode .exam-question-drawer:not(.collapsed) {
  box-shadow: 0 -22px 48px rgba(20, 30, 44, .18) !important;
}

.study-screen.exam-mode .exam-drawer-handle span {
  transition: width var(--motion-touch), background-color var(--motion-touch), transform var(--motion-touch) !important;
}

.study-screen.exam-mode .exam-question-drawer.dragging .exam-drawer-handle span {
  width: 52px !important;
  transform: scaleY(1.12);
  background: #9aa7b4 !important;
}

.exam-floating-submit {
  display: none !important;
}

.study-screen.exam-mode .option-grid button,
.study-screen.exam-mode .part-b-answer-grid button,
.study-screen.exam-mode .part-b-option-bank button,
.exam-report-map button {
  transition:
    background-color var(--motion-touch),
    border-color var(--motion-touch),
    color var(--motion-touch),
    box-shadow var(--motion-touch),
    transform var(--motion-touch) !important;
}

.study-screen.exam-mode .option-grid button.selected {
  box-shadow: inset 3px 0 0 var(--primary), 0 8px 18px rgba(0, 122, 255, .08) !important;
}

.study-screen.exam-mode .analysis-passage-body,
.study-screen.exam-mode .exam-question-list,
.study-screen.exam-mode .cloze-question-list,
.study-screen.exam-mode .current-question-list {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 680px) {
  button,
  [role="button"],
  .task-card,
  .analysis-section-card,
  .exam-entry-button {
    transition:
      background-color var(--motion-touch),
      border-color var(--motion-touch),
      color var(--motion-touch),
      box-shadow var(--motion-touch),
      transform var(--motion-touch),
      opacity var(--motion-touch) !important;
  }

  button:active,
  button.is-pressing,
  [role="button"].is-pressing,
  .task-card.is-pressing,
  .analysis-section-card.is-pressing,
  .exam-entry-button.is-pressing {
    transform: translateY(1px) scale(.985) !important;
  }

  .study-screen.opening {
    animation: studyPushInMobile var(--motion-page) both !important;
  }

  .study-screen.exam-mode .exam-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    justify-content: normal !important;
    column-gap: 8px !important;
    transition: box-shadow var(--motion-touch), background-color var(--motion-touch) !important;
  }

  .study-screen.exam-mode .exam-toolbar > div:first-child {
    min-width: 0 !important;
  }

  .study-screen.exam-mode .exam-toolbar h3 {
    max-width: 112px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .study-screen.exam-mode .exam-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    justify-self: end !important;
    min-width: 0 !important;
    gap: 4px !important;
  }

  .study-screen.exam-mode .exam-actions .pill {
    display: none !important;
    min-height: 30px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }

  .study-screen.exam-mode .exam-actions .small-button {
    display: none !important;
  }

  .study-screen.exam-mode .exam-floating-submit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: calc(env(safe-area-inset-top) + 22px) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    z-index: 52 !important;
    min-width: 54px !important;
    max-width: 64px !important;
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .study-screen.exam-mode .exam-question-drawer.collapsed {
    transform: translate3d(0, var(--drawer-drag-y, 0), 0) !important;
  }
}

@keyframes pageEnterForward {
  from { opacity: .86; transform: translate3d(28px, 0, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes pageLeaveForward {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: .72; transform: translate3d(-18px, 0, 0) scale(.988); }
}

@keyframes pageEnterBack {
  from { opacity: .86; transform: translate3d(-22px, 0, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes pageLeaveBack {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: .74; transform: translate3d(24px, 0, 0) scale(.99); }
}

@keyframes studyPushIn {
  from { opacity: .96; transform: translate3d(42px, 0, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes studyPushInMobile {
  from { opacity: .98; transform: translate3d(100%, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* No ghosting: keep tab switches and return states visually stable. */
body.study-active .app-shell {
  transform: none !important;
  filter: none !important;
  opacity: 1 !important;
}

.view.entering,
.view.leaving,
.view.entering-forward,
.view.leaving-forward,
.view.entering-back,
.view.leaving-back {
  animation: none !important;
}

.view.leaving {
  display: none !important;
  position: static !important;
}

.study-screen.opening {
  animation: none !important;
}

/* Fast response pass: keep feedback immediate and avoid long composited work. */
:root {
  --motion-touch: 70ms cubic-bezier(.2, .8, .2, 1);
  --motion-page: 120ms cubic-bezier(.2, .8, .2, 1);
  --motion-sheet: 150ms cubic-bezier(.2, .86, .18, 1);
}

body.study-active .bottom-nav {
  transition: none !important;
}

.task-card,
.panel,
.stat-card,
.reminder-card,
.analysis-section-card,
.exam-entry-button {
  transition:
    transform 70ms cubic-bezier(.2, .8, .2, 1),
    background-color 70ms cubic-bezier(.2, .8, .2, 1),
    border-color 70ms cubic-bezier(.2, .8, .2, 1) !important;
}

.bottom-nav::after {
  transition: left 120ms cubic-bezier(.2, .8, .2, 1) !important;
}

.study-screen.closing {
  transition: none !important;
}
