:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #182026;
  --muted: #66737d;
  --line: #d8e0e6;
  --brand: #1d6f8f;
  --accent: #b85c38;
  --mastery-not-started: #9aa4ad;
  --mastery-basic: #d94d45;
  --mastery-medium: #d6a72c;
  --mastery-deep: #2e9b57;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(520px, auto);
  align-items: start;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 46px) 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.top-intro {
  display: grid;
  gap: 18px;
}

.top-actions {
  position: relative;
  display: grid;
  grid-template-columns: 330px auto;
  gap: 12px 20px;
  justify-content: end;
  min-width: 520px;
}

.account-box {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  align-items: flex-start;
  justify-self: end;
  min-height: 52px;
  min-width: 210px;
}

.account-login-button,
.account-menu-button {
  min-height: 44px;
  color: #111;
  background: #fff;
}

.account-menu-button {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
  padding: 0 6px;
}

.account-menu-button span:first-child {
  display: grid;
  gap: 4px;
  text-align: left;
}

.account-menu-button strong {
  font-size: 18px;
}

.account-menu-button small {
  font-size: 14px;
}

.account-arrow {
  color: var(--muted);
  font-size: 24px;
}

.login-panel,
.account-menu {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 20;
  width: 310px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(24 32 38 / 12%);
}

.login-panel label {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-status {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-actions {
  display: flex;
  gap: 8px;
}

.account-menu-validity {
  margin: 0;
  color: inherit;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.login-actions button:last-child,
.account-menu button {
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
}

.account-menu {
  display: grid;
  gap: 8px;
  color: var(--ink);
}

.account-menu-stats {
  display: grid;
  gap: 8px;
}

.account-menu p {
  margin: 0;
}

.account-menu button {
  color: inherit;
}

.home-view .segmented {
  display: none;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.segment-button {
  min-height: 34px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segment-button.is-active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.top-nav-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}

.top-nav-actions button {
  min-width: 110px;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
}

.top-nav-actions button:disabled {
  color: #9aa4ad;
  background: #f8fafb;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 800;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 5vw, 44px);
}

.subject-context {
  display: grid;
  grid-template-columns: 112px minmax(0, 620px);
  align-items: center;
  gap: 18px;
}

.subject-context strong {
  color: #4c75c9;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1;
  white-space: nowrap;
}

.subject-context p {
  max-width: 620px;
  margin: 0;
  color: #111;
  font-size: 17px;
  line-height: 1.55;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(560px, 2fr);
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px;
}

.app-main.page-question-bank {
  grid-template-columns: 1fr;
  max-width: 1180px;
}

.app-main.page-admin {
  grid-template-columns: 1fr;
  max-width: 1180px;
}

.app-main.page-home {
  grid-template-columns: 1fr;
  max-width: 1280px;
}

.app-main.page-home [data-panel="home"] {
  grid-column: 1 / -1;
}

.app-main.page-question-bank [data-panel="question-bank"] {
  grid-column: 1 / -1;
}

.app-main.page-admin [data-panel="admin"] {
  grid-column: 1 / -1;
}

[data-panel] {
  display: none;
}

.app-main [data-panel].is-visible {
  display: block;
}

.full-span {
  grid-column: 1 / -1;
}

.panel {
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.home-panel {
  min-height: calc(100vh - 170px);
  padding: clamp(22px, 5vw, 56px);
  background: #fff;
}

.subject-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: clamp(34px, 6vw, 72px) clamp(36px, 7vw, 92px);
  max-width: 1040px;
  margin: clamp(34px, 7vw, 82px) auto 0;
}

.subject-card {
  display: grid;
  align-content: center;
  min-height: 126px;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 18px 22px;
  color: #111;
  text-align: center;
  box-shadow: inset 0 1px 10px rgb(255 255 255 / 45%);
}

.subject-card strong {
  color: #fff;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.1;
}

.subject-card span {
  display: block;
  white-space: nowrap;
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.45;
}

.subject-card.subject-warm {
  border-color: #f57c2f;
  background: linear-gradient(#f6bca6, #ffa47d);
}

.subject-card.subject-cool {
  border-color: #4776c8;
  background: linear-gradient(#aebde3, #87a0d9);
}

.subject-card.subject-green {
  border-color: #6faf4f;
  background: linear-gradient(#bfdeb0, #a4cf91);
}

.admin-grid {
  display: grid;
  gap: 14px;
}

.admin-workbench {
  display: grid;
  gap: 14px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-tabs button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.admin-tabs button.is-active {
  color: #fff;
  background: var(--brand);
}

.admin-panel {
  display: none;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.admin-panel.is-active {
  display: grid;
  gap: 14px;
}

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

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-form .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.admin-form .checkbox-line input {
  width: auto;
  min-height: 0;
}

.admin-placeholder {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-create-account {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.admin-create-account label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.admin-create-account input,
.admin-create-account select {
  min-width: 0;
}

.admin-account-query {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 20px;
}

.admin-account-query label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-account-query label:first-child {
  flex: 1 1 240px;
}

.admin-account-query input,
.admin-account-query select {
  min-width: 0;
  width: 100%;
}

.account-validity-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  white-space: nowrap;
}

.account-validity-actions input {
  width: 158px;
  min-width: 148px;
}

.graph-panel {
  max-height: calc(100vh - 136px);
  overflow: hidden;
}

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

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

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

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.warning-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #efc9ae;
  border-radius: 8px;
  background: #fff7f1;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
  margin: 14px 0 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.legend-item,
.mastery-pill {
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.mastery-not-started {
  background: var(--mastery-not-started);
}

.mastery-basic {
  background: var(--mastery-basic);
}

.mastery-medium {
  color: #2d2510;
  background: var(--mastery-medium);
}

.mastery-deep {
  background: var(--mastery-deep);
}

.mastery-learning,
.mastery-basic-mastered,
.mastery-skilled,
.mastery-deep-mastered,
.mastery-need-review {
  background: var(--mastery-not-started);
}

.knowledge-tree {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding-right: 4px;
}

.stage-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mind-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mind-group summary,
.mind-subgroup summary {
  cursor: pointer;
  list-style: none;
}

.mind-group summary::-webkit-details-marker,
.mind-subgroup summary::-webkit-details-marker {
  display: none;
}

.mind-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.mind-title-main {
  display: grid;
  gap: 3px;
}

.mind-title-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mind-branches {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.mind-subgroup {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mind-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.mind-subtitle span:first-child::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 7px;
  vertical-align: middle;
  background: var(--brand);
}

.mind-points {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px 28px;
  border-left: 2px solid #e3edf1;
  margin-left: 16px;
}

.stage-title {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 900;
}

.theme-group {
  border-bottom: 1px solid var(--line);
}

.theme-group:last-child {
  border-bottom: 0;
}

.theme-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.theme-points {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.kp-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px 6px 0;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.kp-row:hover,
.kp-row.is-selected {
  border-color: var(--brand);
  background: #eef8fa;
}

.mastery-bar {
  width: 8px;
  height: 100%;
  min-height: 32px;
  border-radius: 8px;
}

.kp-row-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.kp-row-name strong,
.kp-row-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kp-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stage-chip {
  flex: 0 0 auto;
  border: 1px solid #cfe0e7;
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--brand);
  background: #eef8fa;
  font-size: 11px;
  font-weight: 800;
}

.kp-row-meta span:not(.stage-chip) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-badge {
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: #eef2f5;
  font-size: 12px;
  font-weight: 800;
}

.grid {
  display: grid;
  gap: 10px;
}

.kp-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfb;
  text-align: left;
}

.kp-card:hover {
  border-color: var(--brand);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: #eef3ef;
  font-size: 12px;
  font-weight: 700;
}

.detail-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.detail {
  display: grid;
  gap: 14px;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.learning-material {
  display: grid;
  gap: 14px;
  background: #ffffff;
}

.learning-section {
  display: grid;
  gap: 10px;
}

.chinese-purpose-section {
  border-top: 4px solid #2f6d5a;
}

.chinese-lesson-context,
.chinese-thought-section {
  border-top: 4px solid #6b6f3d;
}

.chinese-author-section {
  border-top: 4px solid #6b6f3d;
}

.chinese-whole-section {
  border-top: 4px solid #2f6d5a;
}

.chinese-appreciation-section {
  border-top: 4px solid #a15c35;
}

.chinese-language-section {
  border-top: 4px solid #446a8a;
}

.chinese-part-heading,
.chinese-author-section .learning-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chinese-part-heading h3,
.chinese-author-section .learning-header h3 {
  margin: 0;
}

.chinese-part-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 28px;
  border: 1px solid currentColor;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.chinese-section-lead,
.chinese-central-idea p,
.chinese-appreciation-list p {
  margin: 0;
  line-height: 1.75;
}

.chinese-background-list,
.chinese-language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.chinese-background-list {
  grid-template-columns: minmax(0, 1fr);
}

.chinese-author-section h4,
.chinese-whole-section h4 {
  margin: 2px 0 0;
  font-size: 14px;
}

.chinese-full-interpretation {
  display: grid;
  gap: 10px;
}

.chinese-full-interpretation p {
  margin: 0;
  line-height: 1.8;
}

.chinese-background-list > div,
.chinese-language-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chinese-background-list dt,
.chinese-language-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chinese-background-list dd,
.chinese-language-grid dd {
  margin: 5px 0 0;
  line-height: 1.65;
}

.chinese-language-grid dt span {
  margin-left: 8px;
  color: var(--brand);
  font-weight: 700;
}

.chinese-central-idea {
  padding: 12px 14px;
  border-left: 4px solid #2f6d5a;
  background: #f5f8f6;
}

.chinese-central-idea strong {
  display: block;
  margin-bottom: 5px;
  color: #245847;
}

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

.chinese-appreciation-list article {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.chinese-appreciation-list article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.chinese-appreciation-list blockquote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid #a15c35;
  background: #fbf7f4;
  line-height: 1.8;
}

.chinese-appreciation-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chinese-appreciation-meta strong {
  color: #7b472c;
  text-align: right;
}

.chinese-technique-section {
  border-top: 4px solid #a15c35;
}

.chinese-transfer-section {
  border-top: 4px solid #446a8a;
}

.chinese-lesson-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px 28px;
  border-left: 2px solid #dfe8df;
  margin-left: 16px;
}

.chinese-lesson-list > p {
  margin: 0 0 2px;
  line-height: 1.55;
}

.chinese-lesson-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding-left: 6px;
}

.lesson-order {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  color: #2f6d5a;
  border-right: 2px solid #719382;
  font-size: 12px;
  font-weight: 900;
}

.lesson-state {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.study-status-not_started {
  --study-status-accent: #68737c;
  --study-status-surface: #f0f2f3;
}

.study-status-completed {
  --study-status-accent: #2d7a4d;
  --study-status-surface: #eaf5ee;
}

.lesson-state[class*="study-status-"] {
  min-width: 52px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--study-status-accent);
  background: var(--study-status-surface);
  text-align: center;
  white-space: nowrap;
}

.study-status-control {
  display: grid;
  flex: 0 0 150px;
  gap: 5px;
  width: 150px;
  padding: 8px 10px;
  border-left: 4px solid var(--study-status-accent);
  border-radius: 6px;
  background: var(--study-status-surface);
}

.study-status-control label {
  color: var(--study-status-accent);
  font-size: 12px;
  font-weight: 800;
}

.study-status-control select {
  min-height: 34px;
  border-color: var(--study-status-accent);
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.study-status-control small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chinese-context-grid,
.chinese-thought-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.chinese-context-grid > div,
.chinese-thought-list > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chinese-context-grid > div:nth-child(2n),
.chinese-thought-list > div:nth-child(2n) {
  border-right: 0;
}

.chinese-context-grid > div:nth-last-child(-n + 2),
.chinese-thought-list > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.chinese-context-grid dt,
.chinese-thought-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chinese-context-grid dd,
.chinese-thought-list dd {
  margin: 5px 0 0;
  line-height: 1.65;
}

.chinese-technique-list {
  display: grid;
  border: 1px solid var(--line);
  background: #fff;
}

.chinese-technique-list article {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.chinese-technique-list article:last-child {
  border-bottom: 0;
}

.chinese-technique-list article > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chinese-technique-list article > div span,
.chinese-technique-list small {
  color: var(--muted);
}

.chinese-technique-list blockquote,
.chinese-technique-list p {
  margin: 0;
  line-height: 1.7;
}

.chinese-technique-list blockquote {
  padding-left: 10px;
  border-left: 3px solid #a15c35;
}

.chinese-text-examples,
.chinese-evidence-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chinese-text-examples article,
.chinese-evidence-levels article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.chinese-text-examples article > div,
.chinese-evidence-levels article > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chinese-text-examples article > div span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.chinese-text-examples blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid #719382;
  background: #f5f8f6;
  line-height: 1.75;
}

.chinese-foundation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.chinese-foundation-grid > div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chinese-foundation-grid > div:nth-child(2n) {
  border-right: 0;
}

.chinese-foundation-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.chinese-foundation-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chinese-foundation-grid dd {
  margin: 5px 0 0;
  line-height: 1.6;
}

.chinese-evidence-levels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chinese-evidence-levels article {
  display: grid;
  align-content: start;
  gap: 10px;
}

.chinese-evidence-levels article p {
  margin: 0;
}

.chinese-evidence-levels article button {
  align-self: end;
}

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

.physics-experiment-card,
.manual-review-item {
  border: 1px solid #d8e0e6;
  padding: 12px;
  background: #fbfdfe;
}

.physics-experiment-card h4,
.manual-review-item strong {
  display: block;
  margin: 0 0 8px;
}

.physics-experiment-card p,
.manual-review-item p {
  margin: 6px 0;
}

.physics-experiment-card img {
  display: block;
  width: min(100%, 440px);
  max-height: 260px;
  object-fit: contain;
  margin: 8px 0;
  border: 1px solid #d8e0e6;
  background: #ffffff;
}

.history-fact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.history-fact-list div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.history-fact-list div:last-child {
  border-right: 0;
}

.history-fact-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-fact-list dd {
  margin: 4px 0 0;
  line-height: 1.5;
}

.history-key-points {
  display: grid;
  gap: 8px;
}

.history-key-points p {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.history-key-points p:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.biology-key-points {
  display: grid;
  gap: 8px;
}

.biology-key-points p {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.biology-key-points p:last-child {
  border-bottom: 0;
}

.biology-experiment-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.biology-experiment {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.biology-experiment summary {
  cursor: pointer;
  font-weight: 800;
}

.biology-experiment p {
  margin: 7px 0;
  line-height: 1.65;
}

.biology-experiment img {
  display: block;
  width: min(100%, 620px);
  max-height: 360px;
  object-fit: contain;
  margin: 10px 0;
  border: 1px solid var(--line);
  background: #fff;
}

.chemistry-representation-list,
.chemistry-experiment dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.chemistry-representation-list > div,
.chemistry-experiment dl > div {
  display: grid;
  grid-template-columns: minmax(88px, 112px) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.chemistry-representation-list dt,
.chemistry-experiment dt {
  font-weight: 700;
  color: var(--ink);
}

.chemistry-representation-list dd,
.chemistry-experiment dd {
  margin: 0;
}

.chemistry-safety {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid #b4533c;
  background: #fff6f2;
}

.morality-lessons,
.morality-frames {
  display: grid;
  gap: 8px;
}

.morality-lesson {
  border-left: 3px solid #4f6f57;
  background: #fff;
}

.morality-lesson > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 750;
}

.morality-frames {
  padding: 0 10px 10px 16px;
}

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

.morality-frame-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 7px;
}

.morality-frame-title span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.morality-concept-grid,
.morality-source-list {
  display: grid;
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.morality-concept-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.morality-concept-grid > div,
.morality-source-list > div {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.morality-concept-grid > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.morality-concept-grid > div:nth-last-child(-n + 2),
.morality-source-list > div:last-child {
  border-bottom: 0;
}

.morality-concept-grid dt,
.morality-source-list dt {
  color: #355a43;
  font-size: 13px;
  font-weight: 800;
}

.morality-concept-grid dd,
.morality-source-list dd {
  margin: 5px 0 0;
  line-height: 1.65;
}

.chemistry-experiment-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.chemistry-experiment {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.chemistry-experiment summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

.chemistry-experiment summary small {
  color: var(--muted);
  font-weight: 500;
}

.chemistry-experiment > img,
.chemistry-experiment > dl {
  margin: 0 14px 14px;
}

@media (max-width: 620px) {
  .detail-title-row {
    flex-wrap: wrap;
  }

  .study-status-control {
    flex-basis: 100%;
    width: 100%;
  }

  .chemistry-representation-list > div,
  .chemistry-experiment dl > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .morality-concept-grid {
    grid-template-columns: 1fr;
  }

  .morality-concept-grid > div,
  .morality-concept-grid > div:nth-child(odd),
  .morality-concept-grid > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .morality-concept-grid > div:last-child {
    border-bottom: 0;
  }
}

.manual-review-queue {
  margin-bottom: 16px;
}

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

.compact-header {
  align-items: center;
}

.compact-header h3 {
  margin-bottom: 0;
}

.learning-header p {
  margin-bottom: 0;
}

.learning-subsection {
  display: grid;
  gap: 8px;
}

.learning-subsection h4 {
  margin: 0;
  font-size: 15px;
}

.clean-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.example-grid,
.guidance-grid,
.mistake-list {
  display: grid;
  gap: 8px;
}

.example-grid,
.guidance-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.example-card,
.guidance-card,
.mistake-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.example-card p,
.guidance-card p,
.mistake-card p {
  margin-bottom: 0;
}

.compact-examples,
.depth-grid,
.depth-level-list {
  display: grid;
  gap: 8px;
}

.compact-examples {
  margin-top: 2px;
}

.compact-example,
.depth-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mistake-correction-list {
  display: grid;
  gap: 8px;
}

.mistake-correction {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-example p,
.depth-item p,
.mistake-correction p {
  margin-bottom: 0;
}

.depth-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.depth-level-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.depth-level {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.depth-level p {
  margin-bottom: 0;
}

.depth-level:not(:disabled):hover {
  border-color: var(--brand);
  background: #f4fbfd;
}

.depth-level:disabled {
  cursor: not-allowed;
}

.depth-level-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.depth-level-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.depth-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 0.6);
}

.depth-dot-basic {
  background: var(--mastery-basic);
}

.depth-dot-medium {
  background: var(--mastery-medium);
}

.depth-dot-deep {
  background: var(--mastery-deep);
}

.depth-state {
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: #eef3ef;
  font-size: 12px;
  font-weight: 800;
}

.depth-level-passed .depth-state {
  color: #1d6b3d;
  background: #e6f4ea;
}

.depth-level-current {
  border-color: var(--brand);
  background: #f4fbfd;
}

.depth-level-locked {
  color: #8d98a1;
  background: #f7f7f7;
}

.depth-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.relation-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.relation-list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.muted {
  color: var(--muted);
}

.ai-result {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.generated-question {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.practice-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}

.practice-tab {
  min-width: 0;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.practice-tab.is-active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.practice-panels {
  display: grid;
  gap: 10px;
}

.practice-panel {
  display: none;
}

.practice-panel.is-active {
  display: grid;
  gap: 10px;
}

.practice-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.practice-panel-header p {
  margin-bottom: 0;
}

.question-bank-item {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.question-bank-item:first-of-type {
  border-top: 0;
}

.answer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.answer-feedback {
  grid-column: 1 / -1;
}

.media-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.media-figure {
  display: grid;
  gap: 6px;
  margin: 0;
}

.media-figure img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.media-figure figcaption {
  color: var(--muted);
  font-size: 12px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action-row.compact {
  margin-top: 8px;
}

.action-row.compact button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.print-preview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.print-preview .generated-question {
  break-inside: avoid;
  page-break-inside: avoid;
}

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

.record-table-wrap {
  grid-column: 1 / -1;
  overflow-x: auto;
}

.record-filter-header {
  margin-bottom: 12px;
}

.record-filter-header h3 {
  margin-bottom: 4px;
}

.record-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.compact-empty {
  min-height: 160px;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.record-table th,
.record-table td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.record-table th {
  color: var(--muted);
  background: #f5f8fa;
  font-size: 13px;
}

.question-page-content {
  display: grid;
  gap: 12px;
}

.bank-page {
  display: grid;
  gap: 12px;
}

.task-builder {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.bank-point-selector {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bank-filter-grid {
  display: grid;
  grid-template-columns: 160px 180px minmax(0, 1fr);
  gap: 10px;
}

.bank-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bank-point-selector select {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.bank-filter-grid select {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.selected-point-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.selected-point-summary p {
  margin-bottom: 0;
}

.task-preview {
  margin-top: 10px;
}

.task-preview:empty {
  display: none;
}

.task-preview-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

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

.planner-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.planner-grid select,
.planner-grid input {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

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

.bank-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bank-stat span {
  color: var(--muted);
}

.question-set-preview {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.question-page-actions {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.question-page-actions .action-row {
  margin-top: 0;
}

.quiz-shell {
  display: grid;
  gap: 18px;
  max-width: 860px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  padding: 24px;
  overflow: auto;
  background: rgba(20, 28, 34, 0.52);
}

.quiz-overlay.is-visible {
  display: block;
}

.quiz-overlay-content {
  width: min(920px, 100%);
  margin: 0 auto;
}

.quiz-overlay .quiz-shell {
  box-shadow: 0 24px 80px rgba(11, 22, 32, 0.28);
}

.quiz-header,
.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-header h3 {
  margin: 4px 0 0;
}

.quiz-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f2;
}

.quiz-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3478f6;
}

.quiz-question-list {
  display: grid;
  gap: 14px;
}

.quiz-question {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quiz-question-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.quiz-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
}

.quiz-options input {
  width: auto;
  min-height: 0;
}

.quiz-prompt-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.token-order-control {
  display: grid;
  gap: 10px;
}

.token-order-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 52px;
  padding: 9px;
  border: 1px solid #9db9ad;
  border-radius: 6px;
  background: #f7fbf9;
}

.token-order-result > span {
  color: var(--muted);
}

.token-order-result button,
.token-order-options button {
  min-width: 38px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #8fa99d;
  color: #17362c;
  background: #fff;
}

.token-order-options,
.token-order-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.token-order-options button:disabled {
  opacity: 0.3;
}

.token-order-tools {
  justify-content: flex-end;
}

.print-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0;
}

.print-token-list span {
  padding: 4px 8px;
  border: 1px solid #777;
  border-radius: 4px;
}

.quiz-explanation {
  display: none;
  gap: 8px;
  padding: 12px;
  border: 1px solid #9fc7ff;
  border-radius: 8px;
  background: #eaf4ff;
}

.quiz-explanation.is-visible {
  display: grid;
}

.quiz-explanation p {
  margin-bottom: 0;
}

.quiz-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 140px;
  text-align: left;
}

.quiz-result h3 {
  margin-bottom: 4px;
}

.quiz-result-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 44px;
  font-weight: 900;
}

.quiz-result-pass .quiz-result-mark {
  background: var(--mastery-deep);
}

.quiz-result-review .quiz-result-mark {
  background: var(--mastery-basic);
}

.dashboard-feedback {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.dashboard-feedback:empty {
  display: none;
}

.dashboard-card {
  min-height: 150px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.dashboard-card.wide-card {
  grid-column: 1 / -1;
}

.dashboard-card h3 {
  margin-top: 0;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.table-actions {
  margin-top: 0;
  justify-content: center;
}

.english-language-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.english-language-block h4 {
  margin: 0 0 10px;
}

.english-block-heading,
.english-word-actions,
.english-depth-heading,
.english-depth-actions,
.english-repeat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.english-block-heading {
  justify-content: space-between;
}

.english-chip-list,
.english-recitation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.english-speech-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.english-speak-button {
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 13px;
  white-space: nowrap;
}

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

.english-vocabulary-groups {
  display: grid;
  gap: 10px;
}

.english-vocabulary-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.english-vocabulary-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  cursor: pointer;
}

.english-vocabulary-group summary span {
  color: var(--muted);
  font-size: 13px;
}

.english-vocabulary-group .english-vocabulary-grid {
  padding: 0 10px 10px;
}

.english-word-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.english-word-card p {
  margin: 7px 0 0;
}

.english-word-phrase {
  font-weight: 600;
  color: var(--ink, #24313a);
}

.english-word-actions {
  justify-content: space-between;
  margin-top: 8px;
}

.english-repeat-select {
  min-height: 30px;
  padding: 0 10px;
}

.english-repeat-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.english-repeat-prompts button {
  flex: 0 0 auto;
  background: #fff;
}

.english-repeat-prompts button.is-active {
  border-color: #1d6951;
  background: #e9f5ef;
}

.english-repeat-actions {
  margin-top: 12px;
}

.english-repeat-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #d8dfdc;
}

.english-repeat-inline .english-repeat-actions {
  margin-top: 0;
}

.english-repeat-inline button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 13px;
}

.english-repeat-status {
  color: var(--muted);
  font-size: 12px;
}

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

.english-sentence-list article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.english-sentence-list article > p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.english-depth-level {
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.english-depth-level.is-locked {
  opacity: 0.58;
}

.english-depth-heading > span:last-child {
  margin-left: auto;
  color: #66736e;
  font-size: 13px;
}

.english-depth-level > p {
  margin: 8px 0 12px;
}

.english-depth-actions button {
  flex: 1 1 190px;
}

.english-vocabulary-test-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.english-vocabulary-test-grid button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.english-vocabulary-test-grid button.is-passed {
  border-color: #6a9d7e;
  background: #edf7f0;
}

.english-vocabulary-test-grid small {
  color: var(--muted);
}

.english-word-heading,
.english-example-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.english-word-heading > div {
  display: grid;
  gap: 3px;
}

.english-word-heading strong {
  font-size: 19px;
}

.english-word-heading span {
  color: var(--muted);
  font-size: 13px;
}

.english-structure-list {
  display: grid;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.english-structure-list div {
  display: grid;
  grid-template-columns: 74px 1fr;
  border-bottom: 1px solid var(--line);
}

.english-structure-list div:last-child {
  border-bottom: 0;
}

.english-structure-list dt,
.english-structure-list dd {
  margin: 0;
  padding: 9px 11px;
}

.english-structure-list dt {
  font-weight: 700;
  background: #f3f6f5;
}

.english-pattern-list,
.english-example-list {
  display: grid;
  gap: 9px;
}

.english-pattern-list article,
.english-example-list article {
  padding: 10px 12px;
  border-left: 3px solid #39796b;
  background: #f7faf8;
}

.english-pattern-list article > div {
  display: grid;
  gap: 3px;
}

.english-pattern-list article p,
.english-example-list article p {
  margin: 7px 0 0;
}

.english-skill-block blockquote,
.english-passage {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 3px solid #7a4d32;
  background: #faf8f4;
  line-height: 1.75;
}

.english-skill-block ol {
  margin: 8px 0;
  padding-left: 24px;
}

.quiz-audio-prompt,
.question-audio-prompt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  padding: 9px 11px;
  border-left: 3px solid #39796b;
  background: #f2f7f5;
}

.audio-review-script {
  flex: 1 1 260px;
  min-width: 0;
  color: var(--muted);
  line-height: 1.55;
}

.audio-print-instruction {
  display: none;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }

  .graph-panel,
  .knowledge-tree {
    max-height: none;
  }

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

  .top-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .account-box {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .account-status {
    text-align: left;
  }

  .subject-context {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .login-panel,
  .account-menu {
    left: 0;
    right: auto;
    width: min(320px, calc(100vw - 36px));
  }

  .top-nav-actions {
    justify-content: stretch;
  }

  .top-nav-actions button {
    flex: 1;
  }

  .subject-home-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .toolbar,
  .requirement-grid,
  .depth-grid,
  .depth-level-list,
  .practice-tabs,
  .planner-grid,
  .bank-filter-grid,
  .bank-stat-grid,
  .example-grid,
  .guidance-grid,
  .english-vocabulary-grid,
  .english-vocabulary-test-grid,
  .chinese-text-examples,
  .chinese-foundation-grid,
  .chinese-evidence-levels,
  .chinese-context-grid,
  .chinese-background-list,
  .chinese-language-grid,
  .chinese-thought-list,
  .admin-create-account,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .chinese-foundation-grid > div,
  .chinese-foundation-grid > div:nth-child(2n),
  .chinese-foundation-grid > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chinese-foundation-grid > div:last-child {
    border-bottom: 0;
  }

  .chinese-context-grid > div,
  .chinese-context-grid > div:nth-child(2n),
  .chinese-context-grid > div:nth-last-child(-n + 2),
  .chinese-thought-list > div,
  .chinese-thought-list > div:nth-child(2n),
  .chinese-thought-list > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chinese-context-grid > div:last-child,
  .chinese-thought-list > div:last-child {
    border-bottom: 0;
  }

  .chinese-appreciation-meta {
    flex-direction: column;
    gap: 4px;
  }

  .chinese-appreciation-meta strong {
    text-align: left;
  }

  .learning-header {
    display: grid;
  }

  .history-fact-list {
    grid-template-columns: 1fr;
  }

  .history-fact-list div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-fact-list div:last-child {
    border-bottom: 0;
  }

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

  .answer-form,
  .practice-panel-header {
    grid-template-columns: 1fr;
  }

  .practice-panel-header {
    display: grid;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  :root {
    --ink: #111;
    --muted: #444;
    --line: #bbb;
  }

  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .print-preview,
  .print-preview *,
  body.print-task-preview .task-preview-box.is-printing,
  body.print-task-preview .task-preview-box.is-printing *,
  body.print-quiz .quiz-shell.is-printing,
  body.print-quiz .quiz-shell.is-printing *,
  body.print-learning .detail,
  body.print-learning .detail * {
    visibility: visible;
  }

  .print-preview,
  body.print-task-preview .task-preview-box.is-printing,
  body.print-quiz .quiz-shell.is-printing {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  body.print-learning .detail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .print-actions,
  .print-preview button,
  body.print-task-preview button,
  body.print-quiz button,
  body.print-learning button,
  body.print-learning .ai-result,
  body.print-learning .action-row {
    display: none !important;
  }

  .print-preview .panel-header {
    border-bottom: 1px solid #999;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .print-preview .generated-question {
    border: 1px solid #aaa;
    margin-bottom: 10px;
    background: #fff;
  }

  .question-audio-prompt {
    border: 1px solid #aaa;
    background: #fff;
  }

  .question-audio-prompt .english-speak-button {
    display: none !important;
  }

  .audio-print-instruction {
    display: inline;
  }

  .media-figure img {
    max-height: 320px;
    border-color: #999;
  }

  .tag {
    border: 1px solid #aaa;
    color: #111;
    background: #fff;
  }
}
