:root {
  --ink: #14231c;
  --ink-soft: #536158;
  --ink-muted: #89938c;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --canvas-deep: #e9efeb;
  --forest: #10231a;
  --forest-soft: #1a3b29;
  --green: #25b876;
  --green-soft: #e4f5ea;
  --lime: #d8ff65;
  --blue: #4f7cff;
  --orange: #f18358;
  --violet: #a866db;
  --yellow: #e1ad2f;
  --line: rgba(20, 35, 28, 0.09);
  --shadow: 0 18px 48px rgba(20, 43, 32, 0.075);
  --bottom-height: 84px;
  --display: "Helvetica Neue", "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

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

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-height) + env(safe-area-inset-bottom) + 18px);
  background: var(--canvas);
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: calc(70px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(244, 247, 245, 0.91);
  border-bottom: 1px solid rgba(20, 35, 28, 0.055);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--forest);
  border-radius: 13px;
}

.brand-shield {
  position: absolute;
  top: 8px;
  left: 11px;
  width: 19px;
  height: 24px;
  border: 2.4px solid var(--lime);
  border-radius: 9px 9px 12px 12px;
}

.brand-cross,
.brand-cross::after {
  position: absolute;
  top: 14px;
  left: 18px;
  width: 5px;
  height: 11px;
  content: "";
  background: var(--lime);
  border-radius: 2px;
}

.brand-cross::after {
  top: 3px;
  left: -3px;
  width: 11px;
  height: 5px;
}

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

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.icon-button:active {
  background: rgba(20, 35, 28, 0.06);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.icon-button path,
.icon-button circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.home-hero {
  padding: 30px 22px 68px;
  color: #f8fbf6;
  background:
    radial-gradient(circle at 88% 10%, rgba(216, 255, 101, 0.15), transparent 38%),
    linear-gradient(150deg, var(--forest) 0%, var(--forest-soft) 68%, #205139 100%);
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
}

.hero-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(248, 251, 246, 0.6);
  font-size: 11px;
}

.status-badge {
  padding: 6px 10px;
  color: var(--forest);
  background: var(--lime);
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.countdown-row {
  margin-top: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.countdown-row > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.countdown-row p {
  align-self: center;
  margin-right: 4px;
  color: rgba(248, 251, 246, 0.58);
  font-size: 12px;
}

.countdown-row strong {
  font-family: var(--display);
  font-size: 66px;
  font-weight: 900;
  line-height: 1;
}

.countdown-row span {
  color: rgba(248, 251, 246, 0.68);
}

.soft-button {
  min-height: 37px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--lime);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.soft-button svg {
  width: 15px;
  height: 15px;
}

.soft-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-note {
  max-width: 350px;
  margin-top: 17px;
  color: rgba(248, 251, 246, 0.62);
  font-size: 12px;
  line-height: 1.6;
}

.hero-stats {
  padding-top: 21px;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stats > div + div {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  font-family: var(--display);
  font-size: 19px;
}

.hero-stats span {
  margin-top: 2px;
  color: rgba(248, 251, 246, 0.52);
  font-size: 10px;
}

.view-content {
  padding: 0 14px;
  margin-top: -35px;
}

.view > .view-heading + .view-content {
  margin-top: 0;
}

.dashboard-card {
  padding: 23px 19px;
  margin-bottom: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
}

.card-heading h2 {
  max-width: 270px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.28;
}

.card-heading > strong {
  color: var(--green);
  font-family: var(--display);
  font-size: 19px;
}

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

.quick-quiz {
  min-height: 142px;
  padding: 17px 15px;
  color: var(--paper);
  border-radius: 18px;
  text-align: left;
}

.quick-quiz.random {
  background: linear-gradient(145deg, #3159d7, #4f7cff);
}

.quick-quiz.weak {
  background: linear-gradient(145deg, #1d9d63, #25b876);
}

.quick-quiz-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}

.quick-quiz-icon svg {
  width: 22px;
  height: 22px;
}

.quick-quiz-icon path,
.quick-quiz-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-quiz strong,
.quick-quiz small {
  display: block;
}

.quick-quiz strong {
  margin-top: 25px;
  font-size: 14px;
}

.quick-quiz small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 10px;
}

.progress-track,
.quiz-progress-track {
  height: 8px;
  margin-top: 17px;
  overflow: hidden;
  background: var(--canvas-deep);
  border-radius: 999px;
}

.progress-track span,
.quiz-progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--green);
  border-radius: inherit;
  transition: width 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.task-summary {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 10px;
}

.task-summary strong {
  color: var(--ink-soft);
}

.reminder-card {
  min-height: 122px;
  padding: 16px 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 17px;
  text-align: left;
}

.reminder-card span,
.reminder-card strong,
.reminder-card small {
  display: block;
}

.reminder-card span {
  color: var(--ink-muted);
  font-size: 10px;
}

.reminder-card strong {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 21px;
}

.reminder-card.mistake strong {
  color: var(--orange);
}

.reminder-card.bookmark strong {
  color: var(--blue);
}

.reminder-card small {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.4;
}

.weak-subject-list {
  margin-top: 14px;
}

.weak-subject-item {
  min-height: 61px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #edf0eb;
}

.weak-subject-item:first-child {
  border-top: 0;
}

.weak-subject-item > span:first-child {
  width: 9px;
  height: 38px;
  flex: 0 0 9px;
  border-radius: 999px;
}

.weak-subject-main {
  min-width: 0;
  flex: 1;
}

.weak-subject-main strong,
.weak-subject-main small {
  display: block;
}

.weak-subject-main strong {
  font-size: 12px;
}

.weak-subject-main small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 9px;
}

.weak-subject-value {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.view-heading {
  padding: 34px 22px 27px;
}

.view-heading > p {
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.view-heading h1 {
  margin-top: 11px;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
  text-wrap: balance;
}

.search-card {
  padding-bottom: 17px;
}

.search-box {
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--canvas);
  border: 1px solid #e4eae5;
  border-radius: 15px;
}

.search-box svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--ink-muted);
}

.search-box path,
.search-box circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-box input {
  width: 100%;
  height: 100%;
  font-size: 13px;
}

.search-meta {
  margin-top: 9px;
  color: var(--ink-muted);
  font-size: 10px;
}

.subject-grid {
  margin-top: 16px;
  display: grid;
  gap: 9px;
}

.subject-card {
  min-height: 74px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
}

.subject-card-color {
  width: 9px;
  height: 42px;
  flex: 0 0 9px;
  border-radius: 999px;
}

.subject-card-main {
  min-width: 0;
  flex: 1;
}

.subject-card-main strong,
.subject-card-main small {
  display: block;
}

.subject-card-main strong {
  font-size: 13px;
}

.subject-card-main small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.5;
}

.subject-card-count {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.question-search-list {
  margin-top: 15px;
}

.question-search-item {
  padding: 14px 0;
  border-top: 1px solid #edf0eb;
}

.question-search-item:first-child {
  border-top: 0;
}

.question-search-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.55;
}

.question-search-item small {
  display: block;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 9px;
}

.real-bank-card {
  overflow: hidden;
}

.real-bank-copy {
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.real-bank-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.real-year-row {
  margin: 18px -19px -23px;
  padding: 12px 19px 17px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  background: var(--canvas);
  -webkit-overflow-scrolling: touch;
}

.real-year-chip {
  min-width: 58px;
  min-height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.mock-hero {
  padding: 24px 20px;
  margin-bottom: 12px;
  color: var(--paper);
  background: linear-gradient(145deg, #162e21, #24563b);
  border-radius: 23px;
  box-shadow: var(--shadow);
}

.mock-hero > span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 850;
}

.mock-hero h2 {
  margin-top: 12px;
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.25;
}

.mock-hero p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  line-height: 1.65;
}

.mock-option-grid {
  margin-top: 17px;
  display: grid;
  gap: 9px;
}

.mock-option-grid button {
  min-height: 65px;
  padding: 12px 14px;
  color: var(--ink-soft);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
}

.mock-option-grid button.is-active {
  color: var(--forest);
  background: var(--green-soft);
  border-color: rgba(37, 184, 118, 0.38);
}

.mock-option-grid strong,
.mock-option-grid small {
  display: block;
}

.mock-option-grid strong {
  font-size: 13px;
}

.mock-option-grid small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 46px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  color: var(--forest);
  background: var(--lime);
}

.secondary-button {
  color: var(--ink-soft);
  background: var(--canvas-deep);
}

.danger-button {
  color: #a74435;
  background: #fce9e4;
}

.text-button {
  min-height: 38px;
  padding: 0 3px;
  color: var(--green);
  font-size: 11px;
}

.full-button {
  width: 100%;
  margin-top: 17px;
}

.mock-history {
  margin-top: 14px;
}

.mock-history-item {
  min-height: 62px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #edf0eb;
}

.mock-history-item:first-child {
  border-top: 0;
}

.mock-history-score {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 15px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 850;
}

.mock-history-copy {
  min-width: 0;
  flex: 1;
}

.mock-history-copy strong,
.mock-history-copy small {
  display: block;
}

.mock-history-copy strong {
  font-size: 12px;
}

.mock-history-copy small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 9px;
}

.empty-state {
  padding: 22px 0 10px;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: center;
}

.source-note {
  padding: 20px;
  color: #707b74;
  background: var(--canvas-deep);
  border-radius: 18px;
  font-size: 11px;
  line-height: 1.65;
}

.source-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
}

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

.review-overview article,
.stat-grid article {
  min-height: 106px;
  padding: 17px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.review-overview span,
.review-overview strong,
.stat-grid span,
.stat-grid strong,
.stat-grid small {
  display: block;
}

.review-overview span,
.stat-grid span {
  color: var(--ink-muted);
  font-size: 10px;
}

.review-overview strong,
.stat-grid strong {
  margin-top: 7px;
  color: var(--green);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.2;
}

.stat-grid small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 9px;
}

.mistake-list,
.bookmark-list {
  margin-top: 14px;
}

.mistake-item,
.bookmark-item {
  padding: 14px 0;
  border-top: 1px solid #edf0eb;
}

.mistake-item:first-child,
.bookmark-item:first-child {
  border-top: 0;
}

.mistake-item strong,
.mistake-item p,
.mistake-item small,
.bookmark-item strong,
.bookmark-item small {
  display: block;
}

.mistake-item strong,
.bookmark-item strong {
  font-size: 12px;
  line-height: 1.55;
}

.mistake-item p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.mistake-item small,
.bookmark-item small {
  margin-top: 5px;
  color: var(--orange);
  font-size: 9px;
}

.week-chart {
  height: 166px;
  margin-top: 18px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chart-day {
  height: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.chart-bar-shell {
  width: 100%;
  height: 112px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--canvas-deep);
  border-radius: 10px;
}

.chart-bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, #4cd492, var(--green));
  border-radius: 10px 10px 0 0;
}

.chart-day span,
.chart-day strong {
  color: var(--ink-muted);
  font-size: 9px;
}

.subject-stats {
  margin-top: 15px;
}

.subject-stat-item {
  padding: 14px 0;
  border-top: 1px solid #edf0eb;
}

.subject-stat-item:first-child {
  border-top: 0;
}

.subject-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.subject-stat-head strong {
  font-size: 12px;
}

.subject-stat-head span {
  color: var(--ink-soft);
  font-size: 10px;
}

.subject-stat-meter {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  background: var(--canvas-deep);
  border-radius: 999px;
}

.subject-stat-meter span {
  height: 100%;
  display: block;
  border-radius: inherit;
}

.subject-stat-item p {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 9px;
}

.settings-form {
  margin-top: 16px;
}

.settings-form > label {
  display: block;
  margin-bottom: 14px;
}

.settings-form label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.settings-form input[type="date"],
.settings-form input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  background: var(--canvas);
  border: 1px solid #e4eae5;
  border-radius: 14px;
  font-size: 13px;
}

.toggle-row {
  padding: 13px 0;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #edf0eb;
  border-bottom: 1px solid #edf0eb;
}

.toggle-row > span {
  margin: 0 !important;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 12px;
}

.toggle-row small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 9px;
}

.toggle-row input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  accent-color: var(--green);
}

.data-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.data-actions .danger-button {
  grid-column: 1 / -1;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  min-height: calc(var(--bottom-height) + env(safe-area-inset-bottom));
  padding: 7px 8px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--line);
  box-shadow: 0 -15px 42px rgba(20, 43, 32, 0.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.nav-item {
  min-height: 61px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8a948e;
  font-size: 10px;
  font-weight: 700;
}

.nav-item svg {
  width: 21px;
  height: 21px;
}

.nav-item path,
.nav-item circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active {
  color: var(--green);
}

.mock-nav {
  position: relative;
}

.nav-fab {
  width: 43px;
  height: 43px;
  margin-top: -25px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--lime);
  border: 4px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(20, 43, 32, 0.16);
}

.nav-fab svg {
  width: 20px;
  height: 20px;
}

.quiz-screen,
.quiz-result-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--canvas);
}

.quiz-screen {
  display: flex;
  flex-direction: column;
}

.quiz-header {
  min-height: calc(66px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
}

.quiz-progress-copy {
  min-width: 0;
}

.quiz-progress-copy span,
.quiz-progress-copy strong {
  display: block;
}

.quiz-progress-copy span {
  color: var(--ink-muted);
  font-size: 9px;
}

.quiz-progress-copy strong {
  font-size: 12px;
}

.timer-button {
  min-height: 36px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 750;
}

.timer-button svg {
  width: 15px;
  height: 15px;
}

.timer-button path,
.timer-button circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.quiz-progress-track {
  height: 5px;
  margin: 0;
  background: #e5ebe6;
  border-radius: 0;
}

.quiz-content {
  padding: 22px 18px 120px;
  overflow-y: auto;
  flex: 1;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.question-meta > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.bookmark-button {
  min-height: 35px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.bookmark-button.is-active {
  color: var(--blue);
  background: #eef3ff;
  border-color: rgba(79, 124, 255, 0.25);
}

.bookmark-button svg {
  width: 15px;
  height: 15px;
}

.bookmark-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.question-stem {
  margin-top: 18px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
}

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

.option-button {
  min-height: 60px;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 8px 22px rgba(20, 43, 32, 0.035);
}

.option-button > span:first-child {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--canvas);
  border-radius: 9px;
  font-weight: 850;
}

.option-button.is-selected {
  color: #244c8c;
  background: #edf3ff;
  border-color: rgba(79, 124, 255, 0.36);
}

.option-button.is-correct {
  color: #135c39;
  background: #e4f5e9;
  border-color: rgba(37, 184, 118, 0.38);
}

.option-button.is-wrong {
  color: #9c3d32;
  background: #fcebe6;
  border-color: rgba(241, 131, 88, 0.38);
}

.answer-panel {
  padding: 17px;
  margin-top: 17px;
  color: var(--ink-soft);
  background: #eef3fa;
  border-radius: 16px;
  font-size: 12px;
}

.answer-panel strong {
  display: block;
  color: var(--blue);
  margin-bottom: 6px;
}

.answer-panel p {
  line-height: 1.65;
}

.quiz-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 105;
  padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.quiz-result-screen {
  padding: calc(62px + env(safe-area-inset-top)) 24px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow-y: auto;
}

.result-confetti {
  width: 92px;
  height: 92px;
  margin-top: 30px;
  background:
    radial-gradient(circle at 50% 50%, var(--lime) 0 31%, transparent 32%),
    conic-gradient(from 45deg, transparent 0 12%, var(--green) 12% 18%, transparent 18% 37%, var(--blue) 37% 43%, transparent 43% 62%, var(--orange) 62% 68%, transparent 68%);
  border-radius: 50%;
}

.result-kicker {
  margin-top: 27px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.quiz-result-screen h1 {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.result-accuracy {
  margin-top: 8px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
}

.result-copy {
  max-width: 330px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.result-stat-row {
  width: 100%;
  padding: 19px 0;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stat-row > div + div {
  border-left: 1px solid var(--line);
}

.result-stat-row span,
.result-stat-row strong {
  display: block;
}

.result-stat-row span {
  color: var(--ink-muted);
  font-size: 10px;
}

.result-stat-row strong {
  margin-top: 5px;
  font-size: 18px;
}

.result-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sheet {
  width: min(calc(100% - 20px), 460px);
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  margin: auto auto 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -28px 70px rgba(16, 37, 27, 0.23);
}

.sheet[open] {
  animation: sheet-up 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet::backdrop {
  background: rgba(8, 17, 12, 0.46);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 18px;
  background: #d9ded8;
  border-radius: 999px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sheet-header h2 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 850;
}

.answer-sheet-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.answer-sheet-button {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 750;
}

.answer-sheet-button.is-answered {
  color: #17603d;
  background: var(--green-soft);
  border-color: rgba(37, 184, 118, 0.28);
}

.answer-sheet-button.is-current {
  color: var(--forest);
  background: var(--lime);
  border-color: var(--lime);
}

.papers-screen {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: var(--canvas);
}

.papers-header {
  min-height: calc(68px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.papers-header > div {
  min-width: 0;
  text-align: center;
}

.papers-header span,
.papers-header strong {
  display: block;
}

.papers-header span {
  color: var(--ink-muted);
  font-size: 9px;
}

.papers-header strong {
  font-size: 14px;
}

.papers-content,
.paper-reader {
  height: calc(100vh - 68px - env(safe-area-inset-top));
  padding: 17px 14px calc(30px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.paper-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.paper-filters button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.paper-filters button.is-active {
  color: var(--paper);
  background: var(--forest);
  border-color: var(--forest);
}

.paper-library-meta {
  margin-top: 13px;
  color: var(--ink-muted);
  font-size: 10px;
}

.paper-list {
  margin-top: 8px;
}

.paper-card {
  width: 100%;
  min-height: 92px;
  padding: 15px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.paper-type {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 850;
}

.paper-type.comprehensive {
  color: var(--blue);
  background: #edf3ff;
}

.paper-card-main {
  min-width: 0;
  flex: 1;
}

.paper-card-main strong,
.paper-card-main small,
.paper-card-main span {
  display: block;
}

.paper-card-main strong {
  font-size: 12px;
  line-height: 1.5;
}

.paper-card-main small {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 9px;
}

.paper-card-main span {
  margin-top: 5px;
  color: var(--green);
  font-size: 9px;
  font-weight: 750;
}

.paper-reader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.paper-reader-meta span {
  padding: 6px 10px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.paper-reader h1 {
  margin-top: 17px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.3;
}

.paper-reader-text {
  padding: 22px 17px;
  margin-top: 18px;
  color: #39443d;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: calc(var(--bottom-height) + env(safe-area-inset-bottom) + 18px);
  z-index: 150;
  max-width: calc(100% - 36px);
  padding: 10px 16px;
  color: var(--paper);
  background: rgba(20, 35, 28, 0.94);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(circle at 14% 8%, rgba(37, 184, 118, 0.08), transparent 30%),
      var(--canvas);
  }

  .app-shell {
    width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 70px rgba(20, 43, 32, 0.1);
  }

  .bottom-nav {
    right: auto;
    left: 50%;
    width: 480px;
    transform: translateX(-50%);
  }

  .quiz-screen,
  .quiz-result-screen,
  .papers-screen {
    right: auto;
    left: 50%;
    width: 480px;
    transform: translateX(-50%);
    box-shadow: 0 0 70px rgba(20, 43, 32, 0.16);
  }

  .quiz-footer {
    right: auto;
    left: 50%;
    width: 480px;
    transform: translateX(-50%);
  }
}

@media (max-width: 360px) {
  .view-heading h1 {
    font-size: 34px;
  }

  .countdown-row strong {
    font-size: 56px;
  }

  .answer-sheet-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

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