:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #65736d;
  --line: #d7e0db;
  --paper: #f1f4f1;
  --panel: #ffffff;
  --green: #187b68;
  --green-dark: #0f594c;
  --red: #b84f4b;
  --amber: #b47b24;
  --blue: #356d9d;
  --shadow: 0 10px 26px rgba(28, 48, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px;
}

.account-menu {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--green-dark);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.account-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-title {
  margin-bottom: 10px;
  color: var(--green-dark);
  font-weight: 800;
}

.account-dropdown .secondary {
  margin-top: 0;
}

.account-dropdown .account-create {
  margin-top: 10px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-actions .secondary {
  margin-top: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exam-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.selection-translator {
  position: fixed;
  z-index: 80;
  width: min(340px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid #b9cbc3;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(22, 48, 39, 0.2);
}

.selection-translate-trigger {
  position: fixed;
  z-index: 81;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #0f6958;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 22px rgba(22, 48, 39, 0.24);
  font-size: 14px;
  font-weight: 800;
}

.selection-translate-trigger:hover,
.selection-translate-trigger:focus-visible {
  background: var(--green-dark);
}

.translator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px 10px;
  background: #f7faf8;
}

.translator-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.translator-head strong {
  overflow-wrap: anywhere;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 22px;
}

.translator-eyebrow,
.translator-source {
  color: var(--muted);
  font-size: 11px;
}

.translator-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.translator-body p {
  margin: 0;
}

.translator-meta,
.translator-note,
.translator-notice {
  color: var(--muted);
  font-size: 13px;
}

.translator-meaning {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.translator-context {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--green);
  padding: 7px 10px;
  background: #f1f8f5;
}

.translator-context span {
  color: var(--green-dark);
  font-size: 11px;
}

.translator-loading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
}

.translator-error {
  color: var(--red);
}

.translator-ai-btn {
  width: 100%;
  min-height: 40px;
}

.exam-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.exam-tab.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.exam-tab:not(.active):hover {
  border-color: #b7c9c1;
  background: #eef5f1;
  color: var(--green-dark);
}

.exam-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exam-overview-copy {
  min-width: 0;
}

.exam-overview-copy h2 {
  margin: 2px 0 5px;
  font-size: 24px;
}

.exam-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 8px;
  min-width: 270px;
}

.exam-overview-stats div {
  display: grid;
  gap: 3px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.exam-overview-stats strong {
  font-size: 22px;
  color: var(--green-dark);
}

.exam-overview-stats span {
  color: var(--muted);
  font-size: 12px;
}

.pagearea {
  min-width: 0;
  padding-top: 52px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.practice-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.practice-tools,
.results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand,
.panel,
.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.mainnav {
  display: grid;
  gap: 8px;
}

.navbtn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.navbtn.active {
  border-color: var(--green);
  background: #eef5f1;
  color: var(--green-dark);
  box-shadow: inset 3px 0 0 var(--green);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

.brand p,
.muted,
.meta,
.eyebrow,
.field span,
#answerHint {
  color: var(--muted);
}

#answerHint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel {
  padding: 16px;
}

.panel h2 {
  margin-bottom: 12px;
  font-size: 17px;
}

.panel-titleline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-titleline h2 {
  margin-bottom: 0;
}

.diagnostic {
  display: grid;
  gap: 8px;
}

.diagnostic p,
.profile-next {
  color: var(--muted);
  line-height: 1.5;
}

.profile-recommendation {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #b9d7cb;
  border-radius: 6px;
  background: #f1faf6;
}

.profile-recommendation > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-recommendation > strong {
  color: var(--green-dark);
  font-size: 15px;
}

.profile-recommendation p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-recommendation .secondary {
  min-height: 36px;
  margin-top: 3px;
  padding: 7px 10px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

input[type="number"],
input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.account-create {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 8px;
  align-items: start;
}

.account-create .secondary {
  margin-top: 0;
}

.mini {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checkgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
}

.primary,
.secondary {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 700;
}

.primary {
  background: var(--green);
  color: #fff;
}

.primary:hover {
  background: var(--green-dark);
}

.secondary {
  margin-top: 10px;
  background: #edf2ef;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.profile {
  display: grid;
  gap: 10px;
}

.mastery {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.mastery-head,
.mastery-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mastery-head span,
.mastery-foot span {
  color: var(--muted);
  font-size: 13px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece8;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.mastery.good .meter span {
  background: var(--green);
}

.mastery.low .meter span {
  background: var(--red);
}

.textbtn {
  padding: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  overflow: visible;
}

.page-workspace {
  min-height: calc(100vh - 36px);
}

.page-content {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.study-workspace {
  background: #fff;
}

.study-header {
  align-items: flex-end;
  background: #fbfcfa;
}

.study-exam-tabs {
  margin: 0;
}

.study-content {
  display: grid;
  gap: 30px;
  padding: 24px;
}

.study-content > section + section {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

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

.section-heading h2 {
  font-size: 20px;
}

.compact-heading {
  margin-bottom: 12px;
}

.today-tasks {
  display: grid;
  gap: 8px;
}

.today-task {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1.6fr) minmax(120px, 1fr) 112px;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  background: #fff;
}

.today-task.done {
  background: #f8fbf9;
}

.task-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9f3ef;
  color: var(--green-dark);
  font-weight: 800;
}

.today-task.done .task-index {
  background: var(--green);
  color: #fff;
}

.task-copy {
  display: grid;
  gap: 3px;
}

.task-copy span {
  color: var(--muted);
  font-size: 13px;
}

.task-copy small {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.task-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeeb;
}

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

.today-task .secondary {
  min-height: 38px;
  margin-top: 0;
}

.study-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 34px;
}

.study-split > div + div {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.period-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.period-summary > div {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--blue);
  padding: 6px 10px;
}

.period-summary strong {
  font-size: 25px;
}

.period-summary span,
.period-summary small {
  color: var(--muted);
  font-size: 12px;
}

.daily-trend {
  display: grid;
  grid-template-columns: repeat(7, minmax(36px, 1fr));
  gap: 8px;
  height: 168px;
  margin-top: 18px;
}

.trend-day {
  display: grid;
  grid-template-rows: 1fr 20px 18px;
  align-items: end;
  justify-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.trend-day strong {
  color: var(--ink);
  font-size: 12px;
}

.trend-bar {
  display: flex;
  align-items: flex-end;
  width: min(28px, 70%);
  height: 100%;
  border-radius: 4px 4px 2px 2px;
  background: #eef1ef;
  overflow: hidden;
}

.trend-bar span {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: inherit;
  background: var(--blue);
}

.study-type-mastery {
  display: grid;
  gap: 12px;
}

.study-type-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(80px, 1fr) 30px;
  align-items: center;
  gap: 10px;
}

.study-type-row > div:first-child {
  display: grid;
}

.study-type-row span {
  color: var(--muted);
  font-size: 12px;
}

.study-type-row b {
  text-align: right;
}

.knowledge-map {
  display: grid;
  gap: 22px;
}

.knowledge-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
}

.knowledge-group-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.knowledge-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.knowledge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.knowledge-item:hover {
  border-color: #9fb8ad;
  background: #f8fbf9;
}

.knowledge-item.good {
  border-left-color: var(--green);
}

.knowledge-item.low {
  border-left-color: var(--red);
}

.knowledge-item > span {
  display: grid;
  min-width: 0;
}

.knowledge-item strong {
  overflow-wrap: anywhere;
}

.knowledge-item small {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-item b {
  color: var(--green-dark);
  font-size: 18px;
}

.account-panel {
  max-width: 620px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.topbar-status {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 150px;
}

.quiz-progress {
  display: grid;
  grid-template-columns: minmax(80px, 120px) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.quiz-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece8;
}

.quiz-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.2s ease;
}

.topbar h2 {
  font-size: 25px;
}

.topbar-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 36px;
  text-align: center;
}

.empty.compact {
  min-height: 300px;
}

.empty h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.quiz {
  padding: 18px;
}

.question {
  border-bottom: 1px solid var(--line);
  padding: 18px 4px 20px;
}

.question:first-child {
  padding-top: 4px;
}

.qhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 6px;
  padding: 4px 8px;
  background: #eef5f1;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.source {
  color: var(--muted);
  font-size: 13px;
}

.passage {
  margin: 10px 0 14px;
  padding: 12px;
  border-left: 4px solid var(--blue);
  background: #f2f6fb;
  border-radius: 6px;
  line-height: 1.65;
}

.passage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--blue);
}

.passage-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.passage-body {
  white-space: pre-wrap;
}

.stem {
  margin-bottom: 12px;
  line-height: 1.65;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.option.correct {
  border-color: var(--green);
  background: #edf7f2;
}

.option.wrong {
  border-color: var(--red);
  background: #fff0ef;
}

.question-explanation {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bfd7cc;
  border-radius: 6px;
  background: #f2faf6;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}

.loader {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.submitbar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 4px 4px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.submitbar .primary {
  width: 180px;
}

.score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.score strong {
  display: block;
  font-size: 26px;
}

.score div,
.weakness,
.wrong {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfa;
}

.weakness,
.wrong {
  margin-top: 10px;
}

.weakness strong,
.wrong strong {
  display: block;
  margin-bottom: 4px;
}

.thread {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.65;
}

.wrongbook {
  line-height: 1.6;
}

.wrongbook-exam-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
}

.wrongbook-exam-switch .exam-tabs {
  margin: 0;
}

.wrongbook-content {
  display: grid;
  gap: 14px;
}

.wrongbook-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.wrongbook-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 16px 18px;
}

.wrongbook-stat + .wrongbook-stat {
  border-left: 1px solid var(--line);
}

.wrongbook-stat strong {
  font-size: 25px;
}

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

.wrongbook-toolbar {
  display: grid;
  grid-template-columns: auto minmax(130px, 0.65fr) minmax(170px, 0.9fr) minmax(190px, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.wrongbook-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  align-self: end;
  gap: 2px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #f5f8f6;
}

.segmented button {
  min-width: 68px;
  border-radius: 5px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: var(--panel);
  color: var(--green-dark);
  box-shadow: 0 1px 5px rgba(28, 48, 41, 0.12);
}

.wrongbook-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wrongbook-actions .primary,
.wrongbook-actions .secondary {
  width: auto;
  min-width: 146px;
  margin: 0;
}

.iconbtn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #edf2ef;
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 700;
}

.wrongbook-list {
  display: grid;
  gap: 12px;
}

.wrongbook-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 5px 16px rgba(28, 48, 41, 0.05);
}

.wrongbook-item.pending {
  border-left: 4px solid var(--red);
}

.wrongbook-item.corrected {
  border-left: 4px solid var(--green);
}

.wrongbook-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wrongbook-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wrongbook-heading span,
.wrongbook-history {
  color: var(--muted);
  font-size: 13px;
}

.wrongbook-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.wrongbook-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wrongbook-tag,
.wrongbook-alert {
  border-radius: 4px;
  padding: 3px 7px;
  background: #edf4f0;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.wrongbook-alert {
  background: #fff2e2;
  color: #875718;
}

.wrongbook-stem {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.65;
}

.favorite-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf8;
  color: var(--amber);
  font-size: 21px;
}

.favorite-btn.active {
  border-color: #ddc184;
  background: #fff8e8;
}

.wrongbook-detail {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.wrongbook-detail summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 700;
}

.wrongbook-options {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.wrongbook-option {
  margin: 0;
  border-left: 3px solid transparent;
  padding: 7px 9px;
  background: #f7f9f7;
}

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

.wrongbook-option.selected-wrong {
  border-left-color: var(--red);
  background: #fff3f2;
}

.wrongbook-note {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.wrongbook-note label {
  font-size: 13px;
  font-weight: 700;
}

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

.wrongbook-note-actions .secondary {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
}

.wrongbook-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 42px 20px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.word-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.word-exam-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
}

.word-exam-switch .exam-tabs {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.switch-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.word-main {
  min-height: 520px;
}

.word-side {
  display: grid;
  gap: 14px;
}

.word-controls {
  display: grid;
  grid-template-columns: 180px 160px;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.word-controls .field {
  margin-bottom: 0;
}

.word-card {
  display: grid;
  gap: 14px;
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fbfaf7;
  box-shadow: 0 8px 20px rgba(41, 51, 46, 0.06);
}

.word-session-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece8;
}

.word-session-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.2s ease;
}

.word-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-card h3 {
  display: flex;
  align-items: center;
  min-height: 116px;
  margin: 2px 0 0;
  font-size: 52px;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  justify-content: center;
  text-align: center;
}

.word-meaning {
  min-height: 96px;
  border: 1px solid #bfd7cc;
  border-radius: 6px;
  padding: 14px;
  background: #f2faf6;
  font-size: 18px;
  line-height: 1.7;
}

.word-meaning strong,
.word-examples strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.word-meaning p,
.word-examples p {
  margin: 0;
}

.word-examples {
  display: grid;
  gap: 8px;
  border: 1px solid #d6d9cf;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  line-height: 1.6;
}

.word-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.word-actions button,
.word-nav button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.word-actions button:hover,
.word-nav button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f5f8f6;
}

.word-actions button:nth-child(1) {
  border-color: #b9d7cb;
  color: var(--green-dark);
  background: #f1faf6;
}

.word-actions button:nth-child(2) {
  border-color: #d8ca9a;
  color: #7b5e10;
  background: #fffaf0;
}

.word-actions button:nth-child(3) {
  border-color: #e0b8b7;
  color: var(--red);
  background: #fff5f4;
}

.word-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.word-nav .secondary {
  margin-top: 0;
}

.word-nav .danger {
  border-color: #e0b8b7;
  color: var(--red);
}

.word-feedback {
  display: grid;
  gap: 10px;
}

.linkbtn {
  justify-self: start;
  padding: 0;
  min-height: auto;
  background: transparent;
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-form textarea {
  min-height: 88px;
  resize: vertical;
}

.feedback-form .secondary {
  margin-top: 0;
}

.compact-form {
  margin-top: 12px;
}

.word-summary {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fbfcfa;
}

.word-summary h2 {
  margin-bottom: 0;
}

.word-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.word-summary-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.word-summary-grid strong {
  display: block;
  font-size: 24px;
}

.word-summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.word-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.word-stat-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfa;
}

.word-stat-grid strong {
  display: block;
  font-size: 24px;
}

.word-stat-grid span,
.word-status-list span,
.review-rules span {
  color: var(--muted);
  font-size: 13px;
}

.word-status-list,
.review-rules {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.review-pool {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 340px;
  overflow: auto;
}

.review-pool-list {
  display: grid;
  gap: 8px;
}

.review-pool-item {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.review-pool-item:last-child {
  border-bottom: 0;
}

.review-pool-item strong {
  color: var(--text);
}

.review-pool-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.word-status-list p,
.review-rules p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.followup {
  margin-top: 12px;
}

.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .practice-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .results {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .selection-translator {
    width: min(320px, calc(100vw - 16px));
    max-height: min(46vh, 390px);
  }

  .shell {
    grid-template-columns: 1fr;
    padding: 64px 10px 10px;
  }

  .account-menu {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .account-button,
  .account-dropdown {
    width: 100%;
  }

  .pagearea {
    padding-top: 0;
  }

  .mainnav {
    grid-template-columns: repeat(4, 1fr);
  }

  .navbtn {
    text-align: center;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .submitbar {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-overview-stats {
    min-width: 0;
  }

  .topbar-status {
    justify-items: start;
  }

  .word-exam-switch {
    align-items: flex-start;
    flex-direction: column;
  }

  .wrongbook-exam-switch {
    align-items: flex-start;
    flex-direction: column;
  }

  .wrongbook-exam-switch .exam-tabs {
    width: 100%;
  }

  .wrongbook-exam-switch .exam-tab {
    flex: 1;
  }

  .wrongbook-stats,
  .wrongbook-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .wrongbook-stat:nth-child(3) {
    border-left: 0;
  }

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

  .segmented,
  .wrongbook-search,
  .wrongbook-actions {
    grid-column: 1 / -1;
  }

  .segmented button {
    flex: 1;
    min-width: 0;
  }

  .wrongbook-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 42px;
  }

  .wrongbook-actions .primary,
  .wrongbook-actions .secondary {
    min-width: 0;
  }

  .study-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .study-content {
    padding: 16px;
  }

  .today-task {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .task-progress,
  .today-task .secondary {
    grid-column: 2;
  }

  .study-split,
  .period-summary,
  .knowledge-group,
  .knowledge-list {
    grid-template-columns: 1fr;
  }

  .study-split > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 24px;
    padding-left: 0;
  }

  .word-exam-switch .exam-tabs {
    width: 100%;
  }

  .word-exam-switch .exam-tab {
    flex: 1;
  }

  .submitbar .primary {
    width: 100%;
  }

  .checkgrid,
  .score,
  .word-layout,
  .word-controls,
  .word-actions,
  .word-nav,
  .word-summary-grid,
  .word-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .wrongbook-stats,
  .wrongbook-toolbar {
    grid-template-columns: 1fr;
  }

  .wrongbook-stat + .wrongbook-stat {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .segmented,
  .wrongbook-search,
  .wrongbook-actions {
    grid-column: 1;
  }

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

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

  .wrongbook-actions .iconbtn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .wrongbook-head {
    align-items: stretch;
  }
}
