:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --bg-deep: #e9e3d5;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --surface-muted: #f0ecdf;
  --ink: #172620;
  --ink-soft: #40504a;
  --muted: #78817c;
  --line: rgba(23, 38, 32, 0.12);
  --line-strong: rgba(23, 38, 32, 0.2);
  --brand: #123f35;
  --brand-light: #1e6654;
  --accent: #d9ff78;
  --accent-strong: #bce94b;
  --accent-ink: #24350f;
  --orange: #f2a95c;
  --red: #c94f4b;
  --red-soft: #fff0ee;
  --green-soft: #ebf9e8;
  --blue-soft: #e9f2ff;
  --shadow-sm: 0 4px 15px rgba(39, 48, 39, 0.06);
  --shadow-md: 0 18px 55px rgba(39, 48, 39, 0.11);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(217, 255, 120, 0.34), transparent 26rem),
    radial-gradient(circle at 100% 50%, rgba(242, 169, 92, 0.18), transparent 26rem),
    linear-gradient(180deg, #f8f5ed 0%, var(--bg) 38%, #eee9dc 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(18, 63, 53, 0.3);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  top: 14rem;
  left: -8rem;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(18, 63, 53, 0.08);
}

.ambient-two {
  right: -7rem;
  bottom: 8rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(217, 255, 120, 0.24), transparent 68%);
}

.app-shell {
  width: calc(100% - 32px);
  max-width: 1040px;
  margin: 0 auto;
  padding-bottom: 120px;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 20px 0 14px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 15px;
  background: var(--brand);
  box-shadow: 0 8px 22px rgba(18, 63, 53, 0.2);
  color: #fff;
}

.brand-mark svg {
  width: 31px;
  height: 31px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.connection-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink-soft);
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55a869;
  box-shadow: 0 0 0 4px rgba(85, 168, 105, 0.13);
}

.connection-pill[data-state="offline"] .connection-dot {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(242, 169, 92, 0.14);
}

.install-button {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

main {
  position: relative;
}

.screen {
  display: none;
  animation: screen-in 320ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

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

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

.loading-state,
.error-state {
  display: grid;
  min-height: 65vh;
  place-items: center;
  text-align: center;
}

.loader {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border: 4px solid rgba(18, 63, 53, 0.12);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.loading-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
}

.error-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
  gap: 30px;
  min-height: 330px;
  padding: 44px 45px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--brand);
  box-shadow: 0 24px 75px rgba(18, 63, 53, 0.19);
  color: white;
}

.hero::before {
  position: absolute;
  top: -9rem;
  right: 8%;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.hero::after {
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  opacity: 0.12;
}

.hero-copy,
.progress-orbit-wrap {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 22px;
  height: 1px;
  background: var(--accent);
  content: "";
}

.hero-title {
  max-width: 590px;
  margin: 0;
  font-size: clamp(36px, 5.2vw, 62px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero-title em {
  color: var(--accent);
  font-style: normal;
}

.hero-title-tail {
  display: inline;
}

.hero-description {
  max-width: 540px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 27px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.button:active {
  transform: translateY(0) scale(0.985);
}

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

.button-primary {
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(217, 255, 120, 0.13);
  color: var(--accent-ink);
}

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

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

.button-dark {
  background: var(--brand);
  color: white;
}

.button-hero-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

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

.button-wide {
  width: 100%;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.progress-orbit-wrap {
  display: grid;
  align-items: center;
  justify-items: center;
}

.progress-orbit {
  --progress: 0deg;
  position: relative;
  display: grid;
  width: 172px;
  height: 172px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), rgba(255, 255, 255, 0.11) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.progress-orbit::before {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}

.progress-orbit-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.orbit-value {
  font-size: 38px;
  font-weight: 760;
  letter-spacing: -0.055em;
}

.orbit-value small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 600;
}

.orbit-label {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.orbit-caption {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.57);
  font-size: 12px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.mini-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(12px);
}

.mini-stat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-muted);
}

.mini-stat-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mini-stat strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.mini-stat span {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-section {
  margin-top: 44px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.section-heading p,
.page-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.text-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand-light);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.continue-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.continue-icon,
.mode-icon,
.category-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: var(--surface-muted);
  color: var(--brand);
}

.continue-icon {
  width: 48px;
  height: 48px;
}

.continue-icon svg,
.mode-icon svg,
.category-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

.continue-copy strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.continue-progress {
  width: min(230px, 26vw);
  flex: 0 0 auto;
}

.continue-progress-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.continue-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.continue-progress small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

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

.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  align-items: center;
  min-height: 126px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(18, 63, 53, 0.24);
  box-shadow: var(--shadow-md);
}

.mode-card.is-accent {
  background:
    linear-gradient(125deg, rgba(217, 255, 120, 0.32), transparent 58%),
    var(--surface);
}

.mode-icon {
  width: 50px;
  height: 50px;
  background: var(--surface-muted);
}

.mode-card.is-accent .mode-icon {
  background: var(--accent);
  color: var(--accent-ink);
}

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

.mode-title {
  display: block;
  font-size: 15px;
}

.mode-description {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.mode-meta {
  display: inline-block;
  margin-top: 9px;
  color: var(--brand-light);
  font-size: 11px;
  font-weight: 700;
}

.mode-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
}

.mode-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.category-card {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, 0.63);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.category-card:hover {
  transform: translateY(-2px);
  background: var(--surface);
}

.category-icon {
  width: 41px;
  height: 41px;
  border-radius: 12px;
}

.category-copy strong {
  display: block;
  font-size: 13px;
}

.category-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.activity-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  gap: 28px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.activity-copy h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

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

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 115px;
}

.week-day {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.week-bar-wrap {
  display: flex;
  width: 100%;
  height: 76px;
  align-items: end;
  justify-content: center;
}

.week-bar {
  width: min(20px, 65%);
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: var(--brand);
  opacity: 0.24;
}

.week-day.is-today .week-bar {
  background: var(--accent-strong);
  opacity: 1;
}

.week-day small {
  color: var(--muted);
  font-size: 9px;
}

.week-day.is-today small {
  color: var(--ink);
  font-weight: 700;
}

.practice-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0 22px;
}

.practice-title-wrap {
  min-width: 0;
  flex: 1;
}

.session-kicker {
  color: var(--brand-light);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.session-title {
  margin: 5px 0 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.practice-tools {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink-soft);
  cursor: pointer;
}

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

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

.icon-button.is-favorite {
  border-color: rgba(242, 169, 92, 0.35);
  background: #fff7e9;
  color: #d97727;
}

.icon-button.is-favorite svg {
  fill: currentColor;
}

.question-progress {
  margin-bottom: 17px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 63, 53, 0.09);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #4c9b7c);
  transition: width 300ms ease;
}

.question-card {
  padding: clamp(24px, 4vw, 43px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

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

.question-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #315c87;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.question-badge[data-category="multiple"] {
  background: #fff3df;
  color: #98601f;
}

.question-badge[data-category="judge"] {
  background: #eef7ec;
  color: #40733c;
}

.question-index {
  color: var(--muted);
  font-size: 11px;
}

.question-stem {
  margin: 26px 0 25px;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.62;
}

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

.option-button {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr 24px;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.option-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(18, 63, 53, 0.27);
  background: #fff;
}

.option-button.is-selected {
  border-color: var(--brand);
  background: #f2f8f5;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.option-button.is-correct {
  border-color: #76a96c;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px #76a96c;
}

.option-button.is-wrong {
  border-color: #dc7d78;
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px #dc7d78;
}

.option-button.is-muted {
  opacity: 0.63;
}

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

.option-key {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.option-button.is-selected .option-key {
  background: var(--brand);
  color: white;
}

.option-button.is-correct .option-key {
  background: #5c9b52;
  color: white;
}

.option-button.is-wrong .option-key {
  background: var(--red);
  color: white;
}

.option-copy {
  font-size: 14px;
  line-height: 1.55;
}

.option-marker {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.option-button[data-category="multiple"] .option-marker {
  border-radius: 6px;
}

.option-button.is-selected .option-marker {
  border: 0;
  background: var(--brand);
  color: white;
}

.option-button.is-correct .option-marker {
  border: 0;
  background: #5c9b52;
  color: white;
}

.option-button.is-wrong .option-marker {
  border: 0;
  background: var(--red);
  color: white;
}

.option-marker svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.answer-feedback {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(18, 63, 53, 0.12);
  border-radius: 18px;
  background: #f4f8f4;
  animation: feedback-in 250ms ease both;
}

.answer-feedback.is-wrong {
  border-color: rgba(201, 79, 75, 0.2);
  background: #fff7f5;
}

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

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

.feedback-heading strong {
  font-size: 16px;
}

.feedback-heading span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(18, 63, 53, 0.08);
  color: var(--brand);
  font-size: 10px;
  font-weight: 750;
}

.answer-feedback.is-wrong .feedback-heading span {
  background: rgba(201, 79, 75, 0.1);
  color: var(--red);
}

.answer-line {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.answer-line strong {
  color: var(--ink);
  font-size: 14px;
}

.explanation {
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.explanation-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.practice-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.practice-actions .button {
  min-width: 126px;
}

.summary-card {
  position: relative;
  padding: clamp(30px, 5vw, 58px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.summary-card::before {
  position: absolute;
  top: -120px;
  left: 50%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(217, 255, 120, 0.28);
  content: "";
  transform: translateX(-50%);
}

.summary-content {
  position: relative;
}

.summary-icon {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 24px;
  background: var(--brand);
  box-shadow: 0 16px 35px rgba(18, 63, 53, 0.2);
  color: var(--accent);
}

.summary-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.summary-card h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.05em;
}

.summary-card > .summary-content > p {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.summary-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 28px 0;
}

.summary-score strong {
  font-size: 64px;
  letter-spacing: -0.07em;
  line-height: 1;
}

.summary-score span {
  color: var(--muted);
  font-size: 18px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 550px;
  margin: 0 auto 28px;
}

.summary-stat {
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.74);
}

.summary-stat strong {
  display: block;
  font-size: 22px;
}

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

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.empty-state {
  display: grid;
  min-height: 50vh;
  place-items: center;
  padding: 40px 16px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--brand);
}

.empty-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.empty-state h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.empty-state p {
  max-width: 420px;
  margin: 10px auto 23px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
}

.data-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--brand);
  color: white;
  box-shadow: 0 24px 70px rgba(18, 63, 53, 0.17);
}

.big-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), rgba(255, 255, 255, 0.11) 0);
}

.big-ring::before {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}

.big-ring-content {
  position: relative;
  text-align: center;
}

.big-ring-content strong {
  display: block;
  font-size: 41px;
  letter-spacing: -0.06em;
  line-height: 1;
}

.big-ring-content strong small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.big-ring-content span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.data-hero-copy h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.data-hero-copy p {
  margin: 9px 0 24px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.7;
}

.data-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.data-kpi {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.data-kpi strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.data-kpi span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
}

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

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.panel-heading span {
  color: var(--muted);
  font-size: 10px;
}

.category-progress-list {
  display: grid;
  gap: 17px;
}

.progress-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.progress-row-head span {
  color: var(--muted);
}

.progress-row-head strong {
  font-size: 11px;
}

.progress-row .progress-track {
  height: 7px;
}

.progress-row:nth-child(1) .progress-fill {
  background: #4b8476;
}

.progress-row:nth-child(2) .progress-fill {
  background: var(--orange);
}

.progress-row:nth-child(3) .progress-fill {
  background: #87a65c;
}

.info-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

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

.info-row dt {
  color: var(--muted);
}

.info-row dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
}

.status-good {
  color: #4a8c5a;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.data-actions .button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 12px;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  width: calc(100% - 30px);
  max-width: 560px;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px;
  border: 1px solid rgba(23, 38, 32, 0.11);
  border-radius: 21px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 16px 50px rgba(34, 45, 39, 0.17);
  backdrop-filter: blur(18px);
  transform: translateX(50%);
}

.bottom-nav-item {
  display: flex;
  min-height: 51px;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

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

.bottom-nav-item.is-active {
  background: var(--brand);
  color: white;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 104px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 40px));
  pointer-events: none;
}

.toast {
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(23, 38, 32, 0.94);
  box-shadow: var(--shadow-md);
  color: white;
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 220ms ease both;
  backdrop-filter: blur(12px);
}

.toast.is-error {
  background: rgba(151, 48, 45, 0.95);
}

.toast.is-success {
  background: rgba(24, 87, 66, 0.96);
}

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

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(23, 38, 32, 0.3);
  color: var(--ink);
}

.confirm-dialog::backdrop {
  background: rgba(17, 31, 26, 0.52);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  padding: 28px;
}

.dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 13px;
  background: #fff1df;
  color: #a7611a;
  font-size: 20px;
  font-weight: 800;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.confirm-dialog p {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}

.dialog-actions .button {
  min-height: 42px;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 100;
  padding: 16px;
  border-radius: 14px;
  background: var(--red);
  color: white;
  text-align: center;
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100% - 24px);
    max-width: 700px;
    padding-bottom: 108px;
  }

  .topbar {
    min-height: 78px;
    padding-top: 14px;
  }

  .brand-mark {
    width: 41px;
    height: 41px;
  }

  .brand-copy small {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 31px 25px 30px;
    border-radius: 27px;
  }

  .hero-title {
    font-size: clamp(34px, 10vw, 42px);
  }

  .hero-title-tail {
    display: block;
  }

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

  .progress-orbit-wrap {
    display: none;
  }

  .dashboard-stats {
    gap: 8px;
  }

  .mini-stat {
    display: block;
    min-height: 70px;
    padding: 13px;
  }

  .mini-stat-icon {
    display: none;
  }

  .mini-stat strong {
    font-size: 20px;
  }

  .dashboard-section {
    margin-top: 34px;
  }

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

  .mode-card {
    min-height: 110px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .category-card {
    padding: 13px;
  }

  .activity-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 21px;
  }

  .continue-card {
    align-items: stretch;
    flex-direction: column;
    gap: 17px;
  }

  .continue-progress {
    width: 100%;
  }

  .practice-head {
    padding-top: 2px;
  }

  .session-title {
    font-size: 17px;
  }

  .practice-tools {
    gap: 6px;
  }

  .icon-button {
    width: 39px;
    height: 39px;
  }

  .question-card {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .question-stem {
    margin: 22px 0;
    font-size: 20px;
    line-height: 1.65;
  }

  .option-button {
    grid-template-columns: 32px 1fr 20px;
    gap: 10px;
    min-height: 58px;
    padding: 11px 13px;
  }

  .option-key {
    width: 31px;
    height: 31px;
  }

  .option-copy {
    font-size: 13px;
  }

  .answer-feedback {
    padding: 17px;
  }

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

  .practice-actions .button {
    width: 100%;
  }

  .page-heading {
    padding-top: 6px;
  }

  .data-hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 28px 23px;
    text-align: center;
  }

  .big-ring {
    width: 154px;
    height: 154px;
    margin: 0 auto;
  }

  .data-kpi-grid {
    text-align: left;
  }

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

  .summary-stats {
    gap: 7px;
  }

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

  .summary-actions .button {
    width: 100%;
  }

  .toast-region {
    right: 12px;
    bottom: 92px;
    width: calc(100% - 24px);
  }
}

@media (max-width: 390px) {
  .connection-pill {
    padding: 0 9px;
  }

  .connection-pill #connection-text {
    display: none;
  }

  .install-button {
    padding: 0 11px;
  }

  .hero-actions .button {
    width: 100%;
  }

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

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111713;
    --bg-deep: #0c110e;
    --surface: #1a221d;
    --surface-strong: #202923;
    --surface-muted: #27312b;
    --ink: #f2f3ec;
    --ink-soft: #c5cbc5;
    --muted: #939d96;
    --line: rgba(240, 244, 237, 0.1);
    --line-strong: rgba(240, 244, 237, 0.19);
    --brand: #174d40;
    --brand-light: #91d5bb;
    --accent: #d9ff78;
    --accent-strong: #c5ef59;
    --green-soft: #1c3322;
    --red-soft: #382020;
    --blue-soft: #1c2b3a;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.17);
    --shadow-md: 0 18px 55px rgba(0, 0, 0, 0.26);
  }

  body {
    background:
      radial-gradient(circle at 8% 8%, rgba(91, 146, 75, 0.16), transparent 26rem),
      radial-gradient(circle at 100% 50%, rgba(138, 91, 39, 0.11), transparent 26rem),
      linear-gradient(180deg, #111914 0%, var(--bg) 38%, #0d120f 100%);
  }

  .connection-pill,
  .icon-button {
    background: rgba(25, 34, 29, 0.87);
  }

  .mini-stat,
  .category-card {
    background: rgba(24, 33, 28, 0.75);
  }

  .option-button {
    background: #19211c;
  }

  .option-button:hover:not(:disabled) {
    background: #202a24;
  }

  .option-button.is-selected {
    background: #1c332b;
  }

  .question-badge {
    color: #9dc9f8;
  }

  .question-badge[data-category="multiple"] {
    color: #f0bd79;
  }

  .question-badge[data-category="judge"] {
    color: #a5cf98;
  }

  .answer-feedback {
    background: #19271f;
  }

  .answer-feedback.is-wrong {
    background: #291d1c;
  }

  .bottom-nav {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(23, 31, 26, 0.9);
  }

  .summary-icon {
    background: #1d5849;
  }
}

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