:root {
  --ink: #172a2f;
  --ink-soft: #405257;
  --muted: #6f7b7d;
  --canvas: #f4f1ea;
  --surface: #fffdf8;
  --line: #d9d4c9;
  --line-strong: #c8c1b5;
  --nav: #12343a;
  --nav-soft: #1b4549;
  --teal: #0d6b65;
  --teal-dark: #09544f;
  --teal-soft: #e1efec;
  --orange: #dd6b3d;
  --orange-soft: #fbe9df;
  --green: #2e7d5b;
  --green-soft: #e4f1e9;
  --red: #b7473c;
  --red-soft: #f8e7e4;
  --blue: #2e6688;
  --blue-soft: #e5eef4;
  --shadow-sm: 0 1px 2px rgba(23, 42, 47, 0.06);
  --shadow-md: 0 14px 36px rgba(23, 42, 47, 0.09);
  --sidebar-width: 252px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: radial-gradient(circle at 1px 1px, rgba(23, 42, 47, 0.055) 1px, transparent 0);
  background-size: 24px 24px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

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

button {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  color: #fff;
  background: var(--teal);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 18px 18px;
  color: #f3f5f2;
  background: var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 2px 8px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #b8e4d7;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

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

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-copy small {
  color: rgba(243, 245, 242, 0.58);
  font-size: 11px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 38px;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  color: rgba(243, 245, 242, 0.67);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  transition: color 160ms ease, background 160ms ease;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
  color: #fff;
  background: var(--nav-soft);
}

.nav-link.active::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -18px;
  width: 3px;
  background: #f1a06f;
  border-radius: 0 3px 3px 0;
  content: "";
}

.nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 1px 6px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  font-size: 11px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
}

.user-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease;
}

.user-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #12343a;
  background: #b8e4d7;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
}

.user-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.user-copy strong,
.user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.user-edit {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-left: auto;
  place-items: center;
  color: rgba(255, 255, 255, 0.34);
  transition: color 150ms ease;
}

.user-edit svg {
  width: 15px;
  height: 15px;
}

.user-chip:hover .user-edit {
  color: rgba(255, 255, 255, 0.75);
}

.storage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  line-height: 1.4;
}

.storage-icon {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: #75bca3;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(117, 188, 163, 0.12);
}

.storage-row .icon-button {
  margin-left: auto;
}

.mobile-header,
.mobile-nav {
  display: none;
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 38px clamp(26px, 4vw, 64px) 56px;
  outline: none;
}

.page,
.practice-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  animation: page-in 220ms ease both;
}

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

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

.page-head-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 2px;
  background: var(--orange);
  content: "";
}

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

h1 {
  margin-bottom: 8px;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.page-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: #aca496;
}

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

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

.button svg {
  width: 17px;
  height: 17px;
}

.button.primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 5px 14px rgba(13, 107, 101, 0.18);
}

.button.primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.button.dark {
  color: var(--ink);
  background: #f3f5f2;
  border-color: #f3f5f2;
}

.button.dark:hover {
  background: #fff;
  border-color: #fff;
}

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

.button.ghost {
  background: transparent;
  border-color: transparent;
}

.button.ghost:hover {
  background: rgba(23, 42, 47, 0.05);
  border-color: transparent;
}

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

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

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

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

.icon-button.subtle {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  color: rgba(255, 255, 255, 0.38);
  border-color: transparent;
}

.icon-button.subtle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.continue-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.55fr);
  gap: 28px;
  align-items: center;
  min-height: 158px;
  margin-bottom: 23px;
  padding: 28px 30px;
  overflow: hidden;
  color: #f4f6f3;
  background: var(--nav);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.continue-band::after {
  position: absolute;
  top: -54px;
  right: -54px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255, 255, 255, 0.025), 0 0 0 72px rgba(255, 255, 255, 0.018);
  content: "";
  pointer-events: none;
}

.continue-copy,
.continue-progress {
  position: relative;
  z-index: 1;
}

.continue-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #a9d6c8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.continue-kicker svg {
  width: 15px;
  height: 15px;
}

.continue-band h2 {
  margin-bottom: 7px;
  font-size: 21px;
  line-height: 1.35;
}

.continue-band p {
  margin-bottom: 0;
  color: rgba(244, 246, 243, 0.55);
  font-size: 12px;
  line-height: 1.7;
}

.continue-progress {
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.continue-progress-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.continue-progress-row strong {
  font-size: 26px;
  line-height: 1;
}

.continue-progress-row span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: #f1a06f;
  border-radius: inherit;
  transition: width 260ms ease;
}

.continue-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
}

.continue-actions .button {
  flex: 0 0 auto;
}

.continue-actions .ghost {
  color: rgba(255, 255, 255, 0.62);
}

.continue-actions .ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 34px;
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 7px;
}

.metric:nth-child(2) .metric-icon {
  color: var(--green);
  background: var(--green-soft);
}

.metric:nth-child(3) .metric-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric:nth-child(4) .metric-icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metric-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.metric-copy strong {
  font-size: 18px;
  line-height: 1.2;
}

.metric-copy strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.metric-copy span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.section-block {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.text-link svg {
  width: 15px;
  height: 15px;
}

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

.training-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 156px;
  flex-direction: column;
  align-items: stretch;
  padding: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.training-card:hover {
  transform: translateY(-2px);
  border-color: #b7afa2;
  box-shadow: 0 10px 24px rgba(23, 42, 47, 0.08);
}

.training-card:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.training-card[aria-disabled="true"] {
  cursor: default;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.training-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.training-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 7px;
}

.training-symbol svg {
  width: 19px;
  height: 19px;
}

.training-card:nth-child(2) .training-symbol {
  color: var(--blue);
  background: var(--blue-soft);
}

.training-card:nth-child(3) .training-symbol {
  color: var(--green);
  background: var(--green-soft);
}

.training-card:nth-child(4) .training-symbol {
  color: var(--orange);
  background: var(--orange-soft);
}

.training-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.training-card h3 {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.4;
}

.training-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.mini-progress .progress-track {
  flex: 1;
  height: 4px;
  background: #ebe7df;
}

.mini-progress .progress-fill {
  background: var(--teal);
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  margin-top: 32px;
}

.flat-panel {
  min-width: 0;
  padding: 21px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 19px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

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

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
}

.distribution-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.distribution-row .progress-track {
  height: 7px;
  background: #ebe7df;
}

.distribution-row:nth-child(1) .progress-fill {
  background: var(--teal);
}

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

.distribution-row:nth-child(3) .progress-fill {
  background: var(--green);
}

.distribution-number {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.wrong-preview-list {
  display: flex;
  flex-direction: column;
}

.wrong-preview-item {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #e7e2d8;
  cursor: pointer;
}

.wrong-preview-item:first-child {
  padding-top: 0;
}

.wrong-preview-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.wrong-preview-item:hover .wrong-preview-text {
  color: var(--teal);
}

.wrong-index {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--orange);
  background: var(--orange-soft);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.wrong-preview-text {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  text-overflow: ellipsis;
  transition: color 140ms ease;
  white-space: nowrap;
}

.wrong-preview-item svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.quiet-empty {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.quiet-empty svg {
  width: 25px;
  height: 25px;
  color: var(--green);
}

.quiet-empty strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.quiet-empty p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

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

.type-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 126px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.type-card-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: var(--radius);
}

.type-card-icon svg {
  width: 24px;
  height: 24px;
}

.type-card.multi .type-card-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.type-card.judge .type-card-icon {
  color: var(--green);
  background: var(--green-soft);
}

.type-card.fill .type-card-icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.type-card-copy {
  min-width: 0;
}

.type-card h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.type-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.type-card .mini-progress {
  max-width: 280px;
}

.type-card-action {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.type-card-action:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.type-card-action:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.type-card-action svg {
  width: 17px;
  height: 17px;
}

.mode-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 26px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mode-strip-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mode-strip-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 7px;
}

.mode-strip-icon svg {
  width: 20px;
  height: 20px;
}

.mode-strip h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.mode-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.practice-toolbar {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 21px;
}

.practice-toolbar-copy {
  min-width: 0;
}

.practice-toolbar h1 {
  overflow: hidden;
  margin: 0 0 3px;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.practice-toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
}

.question-column {
  min-width: 0;
}

.question-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 10px;
}

.question-progress strong {
  color: var(--ink);
  font-size: 11px;
}

.question-progress .progress-track {
  width: 160px;
  height: 4px;
  background: #e4dfd5;
}

.question-progress .progress-fill {
  background: var(--teal);
}

.question-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.badge.muted {
  color: var(--muted);
  background: #efebe3;
}

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

.question-title {
  margin: 0 0 24px;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 9px 14px 9px 10px;
  color: var(--ink-soft);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease;
}

.option-button:hover {
  background: #faf8f2;
  border-color: #b8b0a3;
}

.option-button.selected {
  color: var(--ink);
  background: #eff7f5;
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(13, 107, 101, 0.08);
}

.option-button.correct {
  color: #225f46;
  background: var(--green-soft);
  border-color: #78ad91;
}

.option-button.wrong {
  color: #8c332c;
  background: var(--red-soft);
  border-color: #d99189;
}

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

.option-letter {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink-soft);
  background: #f1ede5;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.option-button.selected .option-letter {
  color: #fff;
  background: var(--teal);
}

.option-button.correct .option-letter {
  color: #fff;
  background: var(--green);
}

.option-button.wrong .option-letter {
  color: #fff;
  background: var(--red);
}

.option-text {
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.option-indicator {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: transparent;
  border: 1px solid #cfc8bb;
  border-radius: 50%;
}

.option-button.multi .option-indicator {
  border-radius: 4px;
}

.option-button.selected .option-indicator {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.option-button.correct .option-indicator {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.option-button.wrong .option-indicator {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.option-indicator svg {
  width: 11px;
  height: 11px;
}

.fill-fields {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.fill-field {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

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

.fill-field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.fill-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 107, 101, 0.1);
}

.fill-field input:disabled {
  color: var(--ink-soft);
  background: #f7f4ed;
}

.feedback {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 20px;
  padding: 14px;
  border-radius: 7px;
}

.feedback.correct {
  color: #225f46;
  background: var(--green-soft);
  border: 1px solid #bfdccb;
}

.feedback.wrong {
  color: #8c332c;
  background: var(--red-soft);
  border: 1px solid #ecc5c0;
}

.feedback-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
}

.feedback.wrong .feedback-icon {
  background: var(--red);
}

.feedback-icon svg {
  width: 14px;
  height: 14px;
}

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

.feedback-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.feedback-copy p {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.feedback-answer {
  color: var(--ink);
  font-weight: 700;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #ebe6dc;
}

.question-actions .button:last-child {
  margin-left: auto;
}

.action-spacer {
  flex: 1;
}

.practice-side {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.side-panel {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.side-panel-head h2,
.side-panel-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.side-panel-head span {
  color: var(--muted);
  font-size: 9px;
}

.session-ring {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  margin: 8px auto 14px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--ring-progress, 0%), #e9e4da 0);
}

.session-ring::before {
  position: absolute;
  inset: 9px;
  background: var(--surface);
  border-radius: 50%;
  content: "";
}

.session-ring-copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.session-ring-copy strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.session-ring-copy span {
  color: var(--muted);
  font-size: 9px;
}

.session-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #ebe6dc;
}

.session-stat {
  text-align: center;
}

.session-stat strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

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

.question-map {
  display: grid;
  max-height: 236px;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.map-button {
  display: grid;
  height: 29px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: #f5f1e9;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 9px;
}

.map-button:hover {
  border-color: var(--line-strong);
}

.map-button.current {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
  font-weight: 800;
}

.map-button.correct {
  color: #fff;
  background: var(--green);
}

.map-button.wrong {
  color: #fff;
  background: var(--red);
}

.map-button.answered {
  background: #9ab8b2;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  background: #9ab8b2;
  border-radius: 50%;
}

.legend-dot.correct {
  background: var(--green);
}

.legend-dot.wrong {
  background: var(--red);
}

.wrong-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.wrong-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 17px 19px;
  border-bottom: 1px solid #e9e4da;
}

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

.wrong-row-index {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--orange);
  background: var(--orange-soft);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.wrong-row-copy {
  min-width: 0;
}

.wrong-row-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wrong-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.wrong-row-actions {
  display: flex;
  gap: 7px;
}

.empty-panel {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: var(--radius);
}

.empty-symbol svg {
  width: 27px;
  height: 27px;
}

.empty-panel h2 {
  margin-bottom: 7px;
  font-size: 17px;
}

.empty-panel p {
  max-width: 390px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: min(340px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: #f5f7f4;
  background: #18383d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  box-shadow: 0 14px 36px rgba(23, 42, 47, 0.2);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in 180ms ease both;
}

.toast.success {
  background: #205f49;
}

.toast.warning {
  background: #8b5538;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

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

.confirm-dialog,
.name-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(23, 42, 47, 0.25);
}

.confirm-dialog::backdrop,
.name-dialog::backdrop {
  background: rgba(12, 31, 35, 0.48);
  backdrop-filter: blur(2px);
}

.confirm-dialog form,
.name-dialog form {
  padding: 24px;
}

.dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
  border-radius: var(--radius);
}

.dialog-icon svg {
  width: 20px;
  height: 20px;
}

.confirm-dialog h2,
.name-dialog h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.confirm-dialog p,
.name-dialog p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.name-dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: var(--radius);
}

.name-dialog-icon svg {
  width: 20px;
  height: 20px;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 22px;
}

.name-field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.name-field input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.name-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 107, 101, 0.1);
}

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

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

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

  .practice-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .question-map {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 980px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

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

  .practice-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .question-map {
    max-height: 190px;
    grid-template-columns: repeat(10, 1fr);
  }

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

@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }

  body {
    background-size: 20px 20px;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    color: #f3f5f2;
    background: rgba(18, 52, 58, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
  }

  .brand.compact {
    padding: 0;
  }

  .brand.compact .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

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

  .brand.compact .brand-copy strong {
    font-size: 14px;
  }

  .brand.compact .brand-copy small {
    font-size: 9px;
  }

  .mobile-storage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 9px;
  }

  .status-dot {
    width: 6px;
    height: 6px;
    background: #79c2a7;
    border-radius: 50%;
  }

  .app-main {
    margin-left: 0;
    padding: 24px 16px 96px;
  }

  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: 10px;
    left: 12px;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 6px;
    background: rgba(18, 52, 58, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    box-shadow: 0 14px 36px rgba(23, 42, 47, 0.28);
    backdrop-filter: blur(12px);
  }

  .mobile-nav-link {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255, 255, 255, 0.48);
    border-radius: 7px;
    font-size: 8px;
  }

  .mobile-nav-link svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-nav-link .nav-count {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 15px;
    padding: 0 4px;
    font-size: 8px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 27px;
  }

  .page-head > .button,
  .page-head > .page-actions {
    width: 100%;
  }

  .page-head > .page-actions .button {
    flex: 1;
  }

  .continue-band {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 23px 20px;
  }

  .continue-progress {
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .continue-band::after {
    opacity: 0.6;
  }

  .metrics {
    margin-bottom: 28px;
  }

  .metric {
    padding: 14px 12px;
  }

  .metric-icon {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .metric-copy strong {
    font-size: 16px;
  }

  .training-grid {
    gap: 10px;
  }

  .training-card {
    min-height: 144px;
    padding: 14px;
  }

  .practice-toolbar {
    align-items: flex-start;
  }

  .practice-toolbar-copy {
    padding-top: 4px;
  }

  .practice-toolbar-actions .button span {
    display: none;
  }

  .practice-toolbar-actions .button {
    width: 36px;
    padding: 0;
  }

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

  .question-panel {
    padding: 19px 16px;
  }

  .question-title {
    margin-bottom: 19px;
    font-size: 16px;
  }

  .option-button {
    grid-template-columns: 28px minmax(0, 1fr) 16px;
    min-height: 51px;
    padding-right: 12px;
  }

  .option-letter {
    width: 28px;
    height: 28px;
  }

  .option-text {
    font-size: 12px;
  }

  .question-actions {
    flex-wrap: wrap;
  }

  .question-actions .button {
    flex: 1;
  }

  .question-actions .action-spacer {
    display: none;
  }

  .question-actions .button:last-child {
    flex: 1.2;
    margin-left: 0;
  }

  .question-map {
    grid-template-columns: repeat(8, 1fr);
  }

  .wrong-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    padding: 15px;
  }

  .wrong-row-index {
    width: 34px;
    height: 34px;
  }

  .wrong-row-actions {
    grid-column: 2;
  }

  .type-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 116px;
    padding: 16px;
  }

  .type-card-icon {
    width: 46px;
    height: 46px;
  }

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

  .mode-strip .button {
    width: 100%;
  }

  .toast-region {
    right: 16px;
    bottom: 84px;
    left: 16px;
    width: auto;
  }
}

@media (max-width: 520px) {
  .training-grid {
    grid-template-columns: 1fr;
  }

  .training-card {
    min-height: 128px;
  }

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

  .metric {
    gap: 9px;
  }

  .metric-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section-head {
    align-items: flex-start;
  }

  .dashboard-grid {
    margin-top: 26px;
  }

  .flat-panel {
    padding: 17px;
  }

  .distribution-row {
    grid-template-columns: 48px minmax(0, 1fr) 46px;
    gap: 8px;
  }

  .question-progress .progress-track {
    width: 105px;
  }

  .question-map {
    grid-template-columns: repeat(7, 1fr);
  }

  .type-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .type-card-icon {
    width: 42px;
    height: 42px;
  }

  .type-card h3 {
    font-size: 14px;
  }

  .page-head > .page-actions {
    flex-direction: column;
  }

  .page-head > .page-actions .button {
    width: 100%;
  }
}

@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;
  }
}
