:root {
  --ink: #17332b;
  --muted: #6c7b74;
  --green: #175b47;
  --green-2: #27745b;
  --green-soft: #e7f1ec;
  --paper: #f5f2e9;
  --card: #fffdf8;
  --line: #d9ded8;
  --gold: #bd7c2b;
  --gold-soft: #fff0d6;
  --red: #a8453d;
  --red-soft: #fdecea;
  --blue: #41698a;
  --shadow: 0 18px 55px rgba(25, 54, 45, 0.09);
  --radius: 24px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.95), transparent 31rem),
    linear-gradient(135deg, rgba(23, 91, 71, 0.025), transparent 60%), var(--paper);
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(39, 116, 91, 0.25);
  outline-offset: 2px;
}

.boot-screen,
.fatal-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: var(--green);
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  box-shadow: 0 10px 25px rgba(23, 91, 71, 0.22);
}

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

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid rgba(23, 51, 43, 0.09);
  background: rgba(250, 248, 241, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  color: #65766f;
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  color: var(--green);
  background: rgba(23, 91, 71, 0.07);
}

.nav-item.active::after {
  position: absolute;
  right: 16px;
  bottom: 4px;
  left: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
  content: "";
}

.nav-count {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
}

.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
}

.page-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 30px clamp(16px, 3vw, 46px) 60px;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(248px, 0.66fr) minmax(520px, 1.9fr) minmax(230px, 0.64fr);
  gap: 22px;
  align-items: start;
}

.side-panel,
.info-panel,
.content-card,
.question-card,
.exam-card,
.result-card,
.knowledge-card {
  border: 1px solid rgba(23, 51, 43, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.side-panel,
.info-panel {
  position: sticky;
  top: 102px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.side-panel h1,
.page-heading h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 500;
  line-height: 1.23;
}

.side-intro {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.stat-box {
  padding: 14px 13px;
  border-radius: 15px;
  background: #f1f4ef;
}

.stat-box strong,
.summary-stat strong {
  display: block;
  color: var(--green);
  font-size: 23px;
  line-height: 1.1;
}

.stat-box span,
.summary-stat span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.filter-block {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.aside-label,
.field-label {
  display: block;
  margin-bottom: 7px;
  color: #79867f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #51645c;
  background: transparent;
  cursor: pointer;
  transition: 150ms ease;
}

.filter-button:hover {
  background: #f2f4ef;
}

.filter-button.selected {
  border-color: rgba(23, 91, 71, 0.18);
  color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.filter-button small {
  color: #84918b;
}

.shuffle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 13px 3px 2px;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #cdd3cf;
  cursor: pointer;
  transition: 160ms ease;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  content: "";
  transition: 160ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.question-card {
  position: relative;
  min-height: 610px;
  padding: clamp(22px, 4vw, 42px);
  touch-action: pan-y;
}

.knowledge-return-bar {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(23, 91, 71, 0.2);
  border-radius: 15px;
  color: var(--ink);
  background: linear-gradient(120deg, #eef7f2, #fffdf7);
  box-shadow: 0 8px 24px rgba(23, 51, 43, 0.08);
  cursor: pointer;
  text-align: left;
}

.knowledge-return-bar .return-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: white;
  background: var(--green);
  font-size: 18px;
}

.knowledge-return-bar strong,
.knowledge-return-bar small {
  display: block;
}

.knowledge-return-bar strong {
  font-size: 13px;
}

.knowledge-return-bar small,
.knowledge-return-bar .return-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.question-topline,
.card-actions,
.question-footer,
.section-heading,
.result-heading,
.exam-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.type-group,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-explain-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(80, 71, 144, 0.18);
  border-radius: 11px;
  color: #4f478c;
  background: #f1effc;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.ai-explain-button span {
  font-size: 15px;
}

.doubao-web-button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(220, 70, 94, 0.2);
  border-radius: 11px;
  color: #a62f49;
  background: #fff0f3;
  cursor: pointer;
  font-size: 11px;
  text-decoration: none;
}

.doubao-web-button > span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: linear-gradient(145deg, #f05c77, #d83e61);
  font-size: 11px;
  font-weight: 850;
}

.doubao-web-button b {
  font-weight: 800;
}

.doubao-web-button small {
  padding: 2px 5px;
  border-radius: 999px;
  color: #bc2948;
  background: white;
  font-size: 8px;
  font-weight: 850;
}

.type-pill,
.status-pill,
.knowledge-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 750;
}

.knowledge-pill {
  color: #76521e;
  background: var(--gold-soft);
}

.status-pill.wrong {
  color: var(--red);
  background: var(--red-soft);
}

.progress-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.progress-track {
  height: 5px;
  margin: 17px 0 28px;
  overflow: hidden;
  border-radius: 5px;
  background: #e6e9e5;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #5a9f7e);
  transition: width 250ms ease;
}

.favorite-button,
.icon-button,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.text-button {
  border-radius: 12px;
  cursor: pointer;
  transition: 150ms ease;
}

.favorite-button,
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 20px;
}

.favorite-button.active {
  border-color: #e3b663;
  color: #b8700b;
  background: var(--gold-soft);
}

.question-title {
  margin: 0 0 26px;
  white-space: pre-line;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(23px, 2.45vw, 34px);
  font-weight: 500;
  line-height: 1.52;
}

.options-grid {
  display: grid;
  gap: 11px;
}

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

.option-button:hover:not(:disabled) {
  border-color: rgba(23, 91, 71, 0.4);
  transform: translateY(-1px);
}

.option-button.selected {
  border-color: var(--green);
  background: #eff7f2;
}

.option-button.correct {
  border-color: #4e8d70;
  background: #e9f5ee;
}

.option-button.incorrect {
  border-color: #cf7b73;
  background: var(--red-soft);
}

.option-key {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 800;
}

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

.option-button b {
  white-space: pre-line;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.6;
}

.option-number {
  color: #9aa39f;
  font-size: 11px;
}

.feedback {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 15px 17px;
  border-radius: 15px;
  background: var(--green-soft);
  line-height: 1.6;
}

.feedback.incorrect {
  background: var(--red-soft);
}

.feedback strong {
  display: block;
  color: var(--green);
}

.feedback.incorrect strong {
  color: var(--red);
}

.question-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.footer-hint {
  color: var(--muted);
  font-size: 12px;
}

.footer-buttons {
  display: flex;
  gap: 8px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid transparent;
  font-weight: 680;
}

.primary-button {
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(23, 91, 71, 0.16);
}

.primary-button:hover:not(:disabled) {
  background: #104c3b;
  transform: translateY(-1px);
}

.secondary-button {
  border-color: rgba(23, 91, 71, 0.2);
  color: var(--green);
  background: var(--green-soft);
}

.ghost-button {
  border-color: var(--line);
  background: #fffefa;
}

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

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.text-button {
  padding: 4px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-weight: 700;
}

.essay-box,
.reference-box {
  padding: 21px;
  border: 1px dashed rgba(23, 91, 71, 0.3);
  border-radius: 18px;
  background: #f7faf7;
}

.essay-box p,
.reference-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
  white-space: pre-line;
}

.reference-box {
  border-style: solid;
  background: var(--green-soft);
}

.reference-box h3 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 15px;
}

.essay-self-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 15px;
  border-radius: 15px;
  background: var(--gold-soft);
}

.note-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(23, 51, 43, 0.09);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.96);
}

.note-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 760;
  list-style: none;
}

.note-card summary::-webkit-details-marker {
  display: none;
}

.note-card textarea,
.exam-essay-input {
  width: 100%;
  min-height: 130px;
  margin-top: 14px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fffefa;
  line-height: 1.65;
}

.save-status {
  color: var(--muted);
  font-size: 11px;
}

.info-panel h3 {
  margin: 0 0 15px;
  font-size: 15px;
}

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

.mini-item {
  padding: 12px;
  border-radius: 13px;
  background: #f2f4ef;
}

.mini-item strong {
  display: block;
  font-size: 12px;
}

.mini-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.resume-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  color: #6e4a16;
  background: var(--gold-soft);
  font-size: 12px;
  line-height: 1.6;
}

.swipe-tip {
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin: 6px 0 24px;
}

.page-heading p:not(.eyebrow) {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.content-card,
.exam-card,
.result-card,
.knowledge-card {
  padding: clamp(20px, 3vw, 34px);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.summary-stat {
  padding: 16px;
  border-radius: 16px;
  background: #f0f3ee;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.search-bar input {
  width: 100%;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
}

.collection-list,
.history-list,
.wrong-review-list {
  display: grid;
  gap: 12px;
}

.collection-item,
.history-item,
.wrong-review-item {
  display: grid;
  gap: 10px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefa;
}

.collection-item-top,
.history-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.collection-item h3,
.wrong-review-item h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.note-indicator {
  color: var(--gold);
  font-size: 11px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.empty-symbol {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 22px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 30px;
}

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

.exam-config-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.exam-type-card {
  display: grid;
  gap: 11px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fffefa;
}

.exam-type-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
}

.exam-type-card input[type="number"] {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.exam-notice {
  padding: 14px 16px;
  border-radius: 14px;
  color: #6e4a16;
  background: var(--gold-soft);
  font-size: 12px;
  line-height: 1.65;
}

.exam-running-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 17px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(120deg, var(--green), #2f7d61);
}

.exam-running-banner strong,
.exam-running-banner span {
  display: block;
}

.exam-running-banner span {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.82;
}

.question-palette {
  position: sticky;
  top: 103px;
  padding: 22px;
  border: 1px solid rgba(23, 51, 43, 0.09);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.question-palette h3 {
  margin: 0 0 13px;
  font-size: 14px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.palette-button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  cursor: pointer;
  font-size: 11px;
}

.palette-button.answered {
  border-color: rgba(23, 91, 71, 0.25);
  color: var(--green);
  background: var(--green-soft);
}

.palette-button.current {
  color: white;
  background: var(--green);
}

.result-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(120deg, #e6f2ec, #f7f3e7);
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--score), #dfe7e2 0);
}

.essay-self-check .selected {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.score-ring::before {
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--card);
  content: "";
}

.score-ring strong,
.score-ring span {
  position: relative;
  z-index: 1;
}

.score-ring strong {
  font-size: 35px;
}

.score-ring span {
  margin-top: -38px;
  color: var(--muted);
  font-size: 11px;
}

.result-hero h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.result-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 22px 0;
}

.analysis-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffefa;
}

.analysis-panel h3 {
  margin: 0 0 16px;
  font-size: 15px;
}

.bar-list {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 58px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 9px;
  background: #e8ebe8;
}

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

.bar-row.wrong .bar-track span {
  background: var(--red);
}

.wrong-review-item .answer-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.wrong-review-item .answer-line strong {
  color: var(--green);
}

.mindmap-shell {
  position: relative;
  min-height: 650px;
  max-height: 72vh;
  padding: 24px 16px 36px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: #fbfaf5;
  background-image: radial-gradient(rgba(23, 91, 71, 0.1) 1px, transparent 1px);
  background-size: 18px 18px;
  overscroll-behavior: contain;
}

.mindmap-canvas {
  width: max-content;
  min-width: 100%;
  zoom: var(--mindmap-scale, 1);
}

.mindmap-root {
  min-width: 850px;
}

.mindmap-node {
  position: relative;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 32px;
  align-items: center;
}

.mindmap-node + .mindmap-node {
  margin-top: 12px;
}

.node-children {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 8px 0 8px 35px;
}

.node-children::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 3px;
  width: 2px;
  border-radius: 2px;
  background: #c7d7cf;
  content: "";
}

.mindmap-node:not(.root-node)::before {
  position: absolute;
  top: 50%;
  left: -29px;
  width: 29px;
  height: 2px;
  background: #c7d7cf;
  content: "";
}

.node-card {
  display: flex;
  align-items: center;
  min-width: 170px;
  max-width: 260px;
  overflow: hidden;
  border: 1px solid rgba(23, 91, 71, 0.18);
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 6px 18px rgba(23, 51, 43, 0.07);
}

.depth-1 > .node-card {
  border-color: rgba(23, 91, 71, 0.32);
  background: #f1f8f4;
}

.depth-2 > .node-card {
  border-color: rgba(166, 113, 22, 0.22);
  background: #fffaf0;
}

.depth-3 > .node-card {
  border-color: rgba(61, 86, 125, 0.2);
  background: #f7f9fc;
}

.root-node > .node-card {
  color: white;
  background: var(--green);
}

.node-toggle,
.node-label {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.node-toggle {
  flex: 0 0 35px;
  align-self: stretch;
  color: inherit;
  border-right: 1px solid rgba(23, 91, 71, 0.13);
  font-weight: 900;
}

.root-node > .node-card .node-toggle {
  border-color: rgba(255, 255, 255, 0.2);
}

.node-label {
  flex: 1;
  padding: 12px;
  color: inherit;
  text-align: left;
}

.node-label strong,
.node-label small {
  display: block;
}

.node-level {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.node-label strong {
  font-size: 13px;
}

.node-label small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.root-node > .node-card .node-label small {
  color: rgba(255, 255, 255, 0.75);
}

.root-node > .node-card .node-level {
  color: rgba(255, 255, 255, 0.72);
}

.mindmap-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefa;
}

.zoom-controls,
.tree-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.zoom-controls input[type="range"] {
  width: 170px;
  accent-color: var(--green);
}

.zoom-button,
.zoom-reset {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.zoom-button {
  width: 38px;
  font-size: 19px;
  font-weight: 800;
}

.zoom-reset {
  padding: 0 11px;
  font-size: 11px;
}

.mindmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

.knowledge-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.knowledge-stat {
  padding: 16px;
  border-radius: 16px;
  background: var(--green-soft);
}

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

.knowledge-stat strong {
  font-size: 21px;
  color: var(--green);
}

.knowledge-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 17px;
  border-radius: 14px;
  color: white;
  background: rgba(23, 51, 43, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  animation: toast-in 180ms ease-out;
}

.ai-layer {
  position: fixed;
  z-index: 160;
  inset: 0;
}

.ai-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 27, 25, 0.48);
  backdrop-filter: blur(3px);
  cursor: default;
}

.ai-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(610px, 94vw);
  height: 100dvh;
  color: var(--ink);
  background: #f8f6ef;
  box-shadow: -20px 0 60px rgba(10, 25, 20, 0.22);
  animation: ai-panel-in 180ms ease-out;
}

@keyframes ai-panel-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

.ai-panel-header,
.ai-provider-row,
.ai-composer {
  flex: 0 0 auto;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.ai-panel-header h2 {
  margin: 3px 0 0;
  font-size: 22px;
}

.ai-kicker {
  color: #655aa5;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.ai-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: white;
  cursor: pointer;
  font-size: 23px;
}

.ai-provider-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.ai-provider-row label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ai-provider-row select {
  min-width: 125px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
}

.ai-question-context {
  display: grid;
  gap: 7px;
  margin: 14px 24px 0;
  padding: 13px 15px;
  border: 1px solid rgba(23, 91, 71, 0.13);
  border-radius: 14px;
  background: var(--green-soft);
}

.ai-question-context span {
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
}

.ai-question-context strong {
  font-size: 12px;
  line-height: 1.55;
}

.ai-chat-log {
  flex: 1;
  min-height: 0;
  padding: 18px 24px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ai-message {
  width: min(88%, 500px);
  margin-bottom: 16px;
}

.ai-message > span {
  display: block;
  margin: 0 4px 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.ai-message > div {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: white;
  box-shadow: 0 5px 18px rgba(23, 51, 43, 0.06);
  font-size: 13px;
  line-height: 1.75;
}

.ai-message.user {
  margin-left: auto;
}

.ai-message.user > span {
  text-align: right;
}

.ai-message.user > div {
  color: white;
  border-color: var(--green);
  border-radius: 16px 16px 5px 16px;
  background: var(--green);
}

.ai-message p {
  margin: 0 0 10px;
}

.ai-message p:last-child {
  margin-bottom: 0;
}

.ai-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.ai-empty > span {
  color: #655aa5;
  font-size: 38px;
}

.ai-empty strong {
  margin: 7px 0 0;
  color: var(--ink);
}

.ai-empty p {
  max-width: 330px;
  line-height: 1.6;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 48px;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7b75a5;
  animation: typing-bounce 900ms infinite alternate;
}

.typing-dots i:nth-child(2) {
  animation-delay: 160ms;
}

.typing-dots i:nth-child(3) {
  animation-delay: 320ms;
}

@keyframes typing-bounce {
  to {
    opacity: 0.35;
    transform: translateY(-4px);
  }
}

.ai-error {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 13px 15px;
  border: 1px solid rgba(169, 62, 56, 0.2);
  border-radius: 14px;
  color: var(--red);
  background: #fff1ee;
  font-size: 11px;
}

.ai-error .text-button {
  width: max-content;
  color: var(--red);
}

.ai-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 24px 8px;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.ai-composer textarea {
  min-height: 58px;
  max-height: 130px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: white;
  font: inherit;
  line-height: 1.5;
}

.ai-composer .primary-button {
  align-self: stretch;
  min-width: 72px;
}

.ai-disclaimer {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 24px calc(12px + env(safe-area-inset-bottom));
  color: var(--muted);
  background: #fffdf8;
  font-size: 9px;
  line-height: 1.5;
}

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

@media (max-width: 1180px) {
  .practice-layout {
    grid-template-columns: 245px minmax(0, 1fr);
  }

  .info-panel {
    display: none;
  }

  .main-nav {
    position: fixed;
    z-index: 60;
    top: 70px;
    right: 14px;
    left: 14px;
    display: none;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .mobile-nav-toggle {
    display: block;
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 68px;
    padding: 10px 15px;
  }

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

  .page-shell {
    padding: 16px 12px 45px;
  }

  .practice-layout,
  .exam-layout {
    display: block;
  }

  .side-panel {
    position: static;
    margin-bottom: 14px;
    padding: 17px;
  }

  .side-panel h1,
  .side-intro,
  .stats-grid,
  .resume-box,
  .swipe-tip {
    display: none;
  }

  .filter-block {
    display: flex;
    margin-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-button {
    flex: 0 0 auto;
    width: auto;
    gap: 10px;
    padding: 9px 12px;
  }

  .shuffle-row {
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }

  .question-card {
    min-height: 570px;
    padding: 21px 17px;
    border-radius: 20px;
  }

  .knowledge-return-bar {
    position: sticky;
    z-index: 24;
    top: 78px;
  }

  .question-title {
    font-size: 22px;
    line-height: 1.55;
  }

  .question-footer {
    align-items: flex-end;
  }

  .footer-hint {
    max-width: 115px;
  }

  .page-heading {
    display: block;
  }

  .summary-strip,
  .knowledge-summary {
    grid-template-columns: 1fr 1fr;
  }

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

  .question-palette {
    position: static;
    margin-top: 14px;
  }

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

  .result-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

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

  .mindmap-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .zoom-controls input[type="range"] {
    flex: 1;
    min-width: 90px;
  }

  .tree-controls button {
    flex: 1;
  }

  .mindmap-shell {
    min-height: 560px;
    max-height: 68vh;
    padding: 18px 10px 30px;
  }
}

@media (max-width: 520px) {
  .brand-copy small {
    display: none;
  }

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

  .question-topline,
  .question-footer,
  .section-heading,
  .exam-toolbar {
    align-items: flex-start;
  }

  .question-footer,
  .section-heading {
    flex-direction: column;
  }

  .footer-buttons {
    width: 100%;
  }

  .footer-buttons button {
    flex: 1;
  }

  .option-button {
    grid-template-columns: 34px 1fr;
  }

  .option-number {
    display: none;
  }

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

  .palette-grid {
    grid-template-columns: repeat(6, 1fr);
  }

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

  .score-ring::before {
    width: 102px;
    height: 102px;
  }

  .bar-row {
    grid-template-columns: 72px 1fr 48px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .ai-panel {
    width: 100vw;
  }

  .ai-panel-header {
    padding: calc(14px + env(safe-area-inset-top)) 15px 12px;
  }

  .ai-panel-header h2 {
    font-size: 18px;
  }

  .ai-provider-row,
  .ai-chat-log {
    padding-right: 15px;
    padding-left: 15px;
  }

  .ai-question-context {
    margin-right: 15px;
    margin-left: 15px;
  }

  .ai-composer {
    padding-right: 15px;
    padding-left: 15px;
  }

  .ai-disclaimer {
    padding-right: 15px;
    padding-left: 15px;
  }

  .ai-message {
    width: 94%;
  }
}

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