/* 当前界面的唯一样式表。 */
.site-footer {
  margin-top: 32px;
  padding: 16px 0;
  text-align: center;
  font-size: 14px;
}
.footer-bubble { position: relative; width: min(100%, 460px); margin: 0 auto; }
.footer-bubble img { display: block; width: 100%; height: auto; }
.image-frame { position: relative; min-width: 0; }
.image-frame > img { display: block; width: 100%; height: auto; opacity: 0; }
.image-frame[data-image-state="ready"] > img { opacity: 1; }
.image-loading, .image-retry { position: absolute; inset: 0; margin: auto; width: fit-content; height: fit-content; max-width: 100%; text-align: center; color: var(--muted); font-size: .85rem; }
.image-frame:not([data-image-state="loading"]) > .image-loading { display: none; }
.site-footer a { position: absolute; left: 20%; right: 9%; top: 41%; height: 33%; display: flex; align-items: center; justify-content: center; color: #fff7e7; font-size: clamp(12px, 3.3vw, 14px); white-space: nowrap; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

:root {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.7;
  color-scheme: light;
  /* 麦浪青野：米白底色、草木绿操作、暖黄点缀。 */
  --canvas: #f1ece0;
  --surface: #fffcf5;
  --text: #283623;
  --muted: #606853;
  --line: #dad5c5;
  --line-strong: #8b987c;
  --primary: #117c0d;
  --primary-hover: #0d620a;
  --primary-ink: #285323;
  --on-primary: #fffdf4;
  --soft: #edf2e3;
  --focus: #117c0d;
  --accent: #fac75e;
  --accent-soft: #fff0cb;
  --accent-ink: #715019;
  --accent-line: #e3c580;
  --success: #285d24;
  --success-bg: #e6f0db;
  --success-line: #91b47a;
  --danger: #9d3d32;
  --danger-bg: #fbe9e2;
  --danger-line: #d5a195;
  --shadow: rgb(54 66 33 / 10%);
  --backdrop: rgb(33 47 24 / 45%);
}

.nav-icon {
  width: 19px;
  height: 19px;
  vertical-align: -4px;
  margin-right: 6px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0px;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  color: inherit;
  padding: 9px 16px;
  min-height: 44px;
  font-weight: 600;
  line-height: 1.5;
}

button:hover:not(:disabled) {
  background: var(--soft);
  border-color: var(--line-strong);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.press-feedback { transform: scale(1); transition: transform 90ms ease-out; }
.press-feedback.is-pressed { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  .press-feedback { transition: none; }
  .press-feedback.is-pressed { transform: none; }
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.text-button {
  background: transparent;
  border: 0px;
  color: var(--primary);
  padding: 7px 9px;
  font-size: 0.875rem;
}

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: var(--focus) solid 3px;
  outline-offset: 3px;
}

a {
  color: var(--primary);
}

h1, h2, h3 {
  line-height: 1.4;
  margin: 0px 0px 10px;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0.5em 0px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

[hidden] {
  display: none !important;
}

.shell {
  margin: auto;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--canvas);
}

.tab-indicator {
  position: absolute;
  left: 0;
  bottom: 5px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
  pointer-events: none;
  transition: transform 220ms ease-out, width 220ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .tab-indicator { transition: none; }
}

.tabs button {
  border: 0px;
  background: transparent;
  color: var(--muted);
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title p {
  color: var(--muted);
  margin: 0px;
  font-size: 0.9375rem;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 24px;
  min-width: 0px;
}

.card h3 {
  font-size: 1.2rem;
  margin: 8px 0px;
}

.badge {
  font-size: 0.875rem;
  background: var(--soft);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--muted);
}

.empty {
  padding: 35px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

details {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 12px 16px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
}

details p, details li {
  font-size: 0.9375rem;
}

.practice-layout {
  display: grid;
  grid-template-columns: 210px minmax(0px, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  position: sticky;
  top: 16px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin: 0;
}

.q-nav {
  padding: 0;
  font-size: 0.875rem;
  min-width: 0px;
  min-height: 0;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-nav[aria-current="step"] {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.q-nav.correct, .q-nav.correct:hover:not(:disabled) {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-line);
}

.q-nav.wrong, .q-nav.wrong:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-line);
}

.question-panel {
  min-width: 0px;
}

.question {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.question-meta .favorite {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.favorite svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.favorite[aria-pressed="true"] svg { fill: var(--accent); stroke: #b48116; }

.stem {
  font-size: 1.0625rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.stem p:first-child {
  margin-top: 0px;
}

fieldset {
  border: 0px;
  padding: 0px;
  margin: 20px 0px;
  min-width: 0px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 9px;
  min-height: 51px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.option:has(input:checked) {
  border: 2px solid var(--primary);
  padding: 11px 13px;
  background: var(--soft);
}

.option:has(input:disabled) {
  cursor: default;
}

.option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--primary);
  margin: 5px 0px 0px;
}

.option-key {
  font-weight: 700;
}

.option-text {
  min-width: 0px;
}

.feedback {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 22px;
}

.result {
  border: 1px solid;
  border-radius: 9px;
  padding: 12px 15px;
  margin-bottom: 14px;
}

.result.good {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-line);
}

.result.bad {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-line);
}

.result p {
  margin: 3px 0px;
}

.explanation {
  margin-bottom: 14px;
}

.explanation h3 {
  font-size: 1rem;
  margin-top: 15px;
}

.bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 18px;
}

.completion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--soft);
  border-radius: 9px;
  padding: 13px 16px;
  margin: 15px 0px;
}

.formula {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  padding: 6px 0px;
}

.formula math {
  flex: 0 0 auto;
  font-size: 1.08em;
}

math {
  max-width: 100%;
  font-family: "Cambria Math", "STIX Two Math", serif;
}

math[display="block"] {
  margin: 0.3em 0px;
}

.question ul {
  padding-left: 1.4em;
}

#notice {
  margin-top: 15px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 10px 15px;
  overflow-wrap: anywhere;
  font-size: 0.9375rem;
}

#notice.error {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}

.loading {
  color: var(--muted);
  padding: 40px 0px;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 25px;
  max-width: 480px;
  width: calc(100% - 32px);
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow) 0px 12px 50px;
}

dialog::backdrop {
  background: var(--backdrop);
}

dialog p {
  color: var(--muted);
  margin: 12px 0px 22px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 800px) {
  .shell {
    padding: 0px 20px;
  }


  .practice-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .question {
    padding: 21px;
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 0px 14px;
  }

  .tabs {
    gap: 2px;
  }

  .tabs button {
    font-size: 0.8125rem;
    padding: 8px 10px;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .card {
    padding: 20px;
  }

  .card .row button {
    flex: 1 1 0%;
  }

  .question {
    padding: 18px 15px;
  }

  .question-meta {
    gap: 8px;
  }

  .option {
    padding: 11px 10px;
  }

  .option:has(input:checked) {
    padding: 10px 9px;
  }

  .row {
    gap: 8px;
  }

  .row button {
    font-size: 0.875rem;
  }

  .stem {
    font-size: 1rem;
  }

  .formula math {
    font-size: 1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0px 0px 19px;
  font-size: 0.875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.breadcrumbs button {
  border: 0px;
  background: transparent;
  color: var(--primary);
  min-height: 32px;
  padding: 3px 1px;
  font-weight: 400;
  text-align: left;
}

.breadcrumbs [aria-current="page"] {
  font-weight: 600;
  color: var(--text);
}

.course-card h2 {
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.library-enter {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.chapter-list {
  display: grid;
  gap: 13px;
}
.course-accordions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.course-accordion-heading { margin: 0; }
button.course-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 72px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; font-size: 1.35rem; font-weight: 700; }
.course-toggle > span { min-width: 0; overflow-wrap: anywhere; }
.course-chevron { width: 20px; height: 20px; flex-shrink: 0; fill: var(--primary); transition: transform 200ms ease; }
.is-open > .course-accordion-heading .course-chevron { transform: rotate(180deg); }
.course-chapters { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 200ms ease; }
.is-open > .course-chapters { grid-template-rows: 1fr; visibility: visible; }
.course-chapters-inner { min-height: 0; overflow: hidden; }
.course-chapters .chapter-list { margin: 14px clamp(12px, 2vw, 24px) 0; }
@media (prefers-reduced-motion: reduce) { .course-chevron, .course-chapters { transition: none; } }

.chapter-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.chapter-info {
  min-width: 0px;
  flex: 1 1 0%;
}

.chapter-info h2 {
  font-size: 1.13rem;
  margin: 0px 0px 6px;
  overflow-wrap: anywhere;
}

.chapter-card > button {
  flex: 0 0 auto;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0px, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {

  .knowledge-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .chapter-card {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px;
  }

  .chapter-card > button {
    margin-left: auto;
  }

  .chapter-info {
    flex-basis: 100%;
  }

  .breadcrumbs {
    gap: 7px;
  }
}

.shell {
  max-width: 1400px;
  padding: 0px 40px;
}

.tabs {
  gap: 14px;
  padding-bottom: 15px;
}

.tabs button {
  min-width: 100px;
  padding: 11px 23px;
  font-size: 1rem;
  border-radius: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
}

.tabs button[aria-current="page"] {
  background: transparent;
  color: var(--primary);
}

main {
  padding: 32px 0px 38px;
  min-height: 65vh;
  background: var(--canvas);
  view-transition-name: page-content;
}
::view-transition { pointer-events: none; }
::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(page-content) { animation: none; overflow: clip; }
::view-transition-old(page-content), ::view-transition-new(page-content) { animation-duration: 360ms; animation-timing-function: cubic-bezier(.22,.61,.36,1); animation-fill-mode: both; mix-blend-mode: normal; }
html[data-page-motion="forward"]::view-transition-old(page-content) { animation-name: page-retreat; z-index: 1; }
html[data-page-motion="forward"]::view-transition-new(page-content) { animation-name: page-enter; z-index: 2; box-shadow: -12px 0 28px rgb(0 0 0 / 8%); }
html[data-page-motion="back"]::view-transition-old(page-content) { animation-name: page-leave; z-index: 2; box-shadow: -12px 0 28px rgb(0 0 0 / 8%); }
html[data-page-motion="back"]::view-transition-new(page-content) { animation-name: page-return; z-index: 1; }
@keyframes page-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes page-retreat { from { transform: translateX(0); } to { transform: translateX(-25%); } }
@keyframes page-leave { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes page-return { from { transform: translateX(-25%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(page-content), ::view-transition-new(page-content) { animation: none; } }

.home-page { display: flex; flex-direction: column; gap: 24px; }
.study-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: calc(65vh - 70px); }
.study-placeholder .image-frame { width: min(210px, 50%); }
.study-placeholder > p { margin: 0; text-align: center; color: #000; font-weight: 700; }
.empty-course-meme { display: block; width: min(520px, 100%); height: auto; margin: 24px auto 0; }
.home-card { padding: 25px 29px; background: var(--surface); border-radius: 15px; border: 1px solid var(--line); }
.activities-card h1 { margin: 0; font-size: 1.2rem; line-height: 1.6; }
.activity-empty { display: flex; justify-content: center; padding: 24px 0 12px; }
.activity-empty .image-frame { width: min(260px, 100%); }
.activity-media { display: grid; gap: 20px; max-width: 560px; margin: 20px auto 0; }
.activity-media img { display: block; width: 100%; height: auto; }
.past-activities-card > h2 { margin: 0; font-size: 1.2rem; line-height: 1.6; }
.past-activity-carousel { max-width: 480px; margin: 22px auto 0; }
.past-activity-track { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; justify-items: center; isolation: isolate; overflow: hidden; padding: 12px 0; touch-action: pan-y pinch-zoom; user-select: none; }
.past-activity-slide { grid-area: 1 / 1; width: 84%; min-width: 0; }
.past-previous, .past-next, .past-leaving { z-index: 0; filter: blur(2px); opacity: .55; pointer-events: none; }
.past-previous { transform: translateX(-12%) scale(.92); }
.past-next { transform: translateX(12%) scale(.92); }
.past-current { z-index: 2; }
.past-activity-slide img { display: block; width: 100%; height: auto; border-radius: 10px; }
.past-activity-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.past-activity-controls button { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 22px; font-weight: 700; }
#past-activity-position { font-variant-numeric: tabular-nums; }
.intro-card > p { color: #000; font-size: 1.1rem; font-weight: 500; line-height: 1.9; }

.intro-card h2 {
  color: var(--primary);
  font-size: 1.6rem;
  line-height: 1.5;
  margin: 0 0 18px;
}

.large-text {
  font-size: 18px;
}

.large-text .shell {
  font-size: 1.125rem;
}

.large-text h1 {
  font-size: 2.15rem;
}

.large-text input, .large-text select, .large-text textarea {
  font-size: 1.05rem;
}

.segmented {
  display: flex;
  gap: 5px;
  background: var(--soft);
  border-radius: 10px;
  padding: 5px;
  width: fit-content;
  margin: 0px 0px 22px;
}

.segmented button {
  border: 0px;
  background: transparent;
  min-height: 38px;
  font-size: 0.875rem;
}

.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow) 0px 2px 7px;
}

.empty-symbol {
  display: inline-grid;
  place-items: center;
  width: 65px;
  height: 65px;
  border-radius: 17px;
  background: var(--soft);
  color: var(--muted);
  font-size: 2.1rem;
  margin: 10px 0px 20px;
}

.collection-empty {
  padding: 40px 30px;
  border-style: solid;
  background: var(--surface);
}

.collection-list { display: grid; gap: 20px; }
.collection-courses { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.collection-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 24px); }
button.collection-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; min-width: 0; min-height: clamp(220px, 30vw, 320px); padding: clamp(20px, 4vw, 32px); border: 0; border-radius: 22px; text-align: left; font-size: clamp(26px, 4vw, 36px); font-weight: 750; line-height: 1.3; transition: transform 180ms ease, box-shadow 180ms ease; }
button.collection-tile-wrong, button.collection-tile-wrong:hover { background: #d8bfdc; color: #50345e; }
button.collection-tile-favorite, button.collection-tile-favorite:hover { background: #edc572; color: #5c451b; }
button.collection-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgb(54 66 33 / 10%); }
button.collection-tile:active { transform: scale(.97); }
.collection-tile > svg { width: clamp(76px, 12vw, 116px); height: clamp(76px, 12vw, 116px); margin: 22px 0; fill: none; stroke: #fff9ec; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.collection-tile-favorite > svg { fill: #fff9ec; stroke-width: 2; }
.collection-tile-arrow { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #fff9ec; font-size: 18px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { button.collection-tile { transition: none; } button.collection-tile:hover, button.collection-tile:active { transform: none; } }
.collection-number { font-size: 1rem; font-weight: 700; color: var(--text); }
.collection-options .option { cursor: default; }
.collection-options .option-key { flex-shrink: 0; white-space: nowrap; }
.collection-question > .explanation { margin: 20px 0; }

.startup-diagnostics {
  max-width: 42rem;
  margin: 1.5rem auto 0;
  text-align: left;
}
.startup-diagnostics pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.empty h2 {
  font-size: 1.2rem;
}

.empty p {
  font-size: 0.95rem;
}

.empty button {
  margin-top: 16px;
}

.resource-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.search-field {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  flex: 1 1 0%;
  min-width: 0px;
}

.search-field > span {
  font-size: 1.5rem;
  color: var(--muted);
  line-height: 1;
}

.search-field input {
  border: 0px;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0px;
  font-style: inherit;
  font-variant: inherit;
  font-weight: inherit;
  font-stretch: inherit;
  line-height: inherit;
  font-family: inherit;
  font-optical-sizing: inherit;
  font-size-adjust: inherit;
  font-kerning: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-language-override: inherit;
  font-size: 0.9rem;
  color: inherit;
}

select, input[type="text"], input[type="email"], input[type="password"], input:not([type]), textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--surface);
  color: inherit;
  max-width: 100%;
}

select {
  min-height: 44px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0px, 1fr));
  gap: 19px;
}

.material-preview { max-width: 1100px; margin: 0 auto; }
.material-preview-heading { display: grid; gap: 16px; margin-bottom: 20px; }
.material-preview-heading > button { justify-self: start; }
.material-preview-heading h1 { font-size: 1.4rem; overflow-wrap: anywhere; }
.material-preview-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.material-preview-toolbar span { flex: 1; text-align: center; white-space: nowrap; }
.material-preview-frame { overflow: auto; max-height: 78vh; background: #fff; border: 1px solid var(--line); }
.material-preview-frame img { display: block; width: 100%; height: auto; }
.material-preview-frame img[hidden] { display: none; }
#preview-error { padding: 24px; }

.material-icon {
  display: grid;
  place-items: center;
  height: 62px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.type-pdf {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent-line);
}

.type-ppt, .type-pptx {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent-line);
}

.material-card h2 {
  font-size: 1.1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin: 10px 0px 15px;
  min-height: 3.2em;
}

.material-card .row {
  margin-top: 17px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 41px;
  line-height: 1.5;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--line);
  padding: 8px 13px;
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.button-link.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.button-link:hover {
  filter: brightness(0.96);
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.field-label input, .field-label select, .field-label textarea {
  width: 100%;
  min-width: 0px;
}


.checkbox-label {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 19px 0px;
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.feedback-card textarea {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  min-height: 180px;
  resize: vertical;
}

.feedback-card form { margin-top: 0; }
.feedback-card fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.feedback-status { margin: 20px 0 0; overflow-wrap: anywhere; }
.feedback-status.error { color: var(--danger); }

@media (max-width: 1150px) {
  .shell {
    padding: 0px 28px;
  }

  .material-grid {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }
}

@media (max-width: 900px) {

  .resource-toolbar {
    flex-wrap: wrap;
  }

  .resource-toolbar .search-field {
    flex-basis: 100%;
  }

  .resource-toolbar > .primary {
    margin-left: auto;
  }

}

@media (max-width: 600px) {
  .material-preview-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-preview-toolbar span { grid-column: 1 / -1; grid-row: 1; }
  .material-preview-toolbar button { padding: 9px 6px; font-size: 0.9rem; }
  .shell {
    padding: 0px 16px;
  }

  .home-card {
    padding: 22px;
  }

  .material-grid {
    grid-template-columns: 1fr;
  }

  .large-text h1 {
    font-size: 1.8rem;
  }
}

.material-icon {
  width: 72px;
}

.search-field:focus-within {
  outline: var(--focus) solid 3px;
  outline-offset: 2px;
}

select:focus-visible {
  outline: var(--focus) solid 3px;
  outline-offset: 2px;
}

.resource-title {
  margin-bottom: 22px;
}

.resource-toolbar-simple {
  display: block;
  margin-bottom: 28px;
}

.resource-toolbar-simple .search-field {
  width: 100%;
  max-width: none;
}

.resource-folder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0px, 1fr));
  gap: 20px;
}

.resource-folder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 14px;
  min-width: 0px;
  min-height: 212px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  white-space: normal;
}

.resource-folder:hover {
  background: var(--soft);
  border-color: var(--line-strong);
}

.folder-icon {
  width: 60px;
  height: 50px;
  fill: var(--accent);
  stroke: var(--accent-ink);
  stroke-width: 2;
  stroke-linejoin: round;
}

.folder-name {
  font-size: 1.2rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.resource-breadcrumbs {
  margin-bottom: 24px;
}

.resource-folder:focus-visible {
  outline: var(--focus) solid 3px;
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .resource-folder-grid {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }
}

@media (max-width: 520px) {
  .resource-folder-grid {
    grid-template-columns: 1fr;
  }
}

.profile-page {
  max-width: 760px;
  margin: 0px auto 28px;
}

.personal-summary {
  text-align: center;
  padding: 8px 0px 18px;
}

.avatar-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0px;
  min-height: 0px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
}

.avatar-button > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-button > svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
}

.avatar-edit {
  position: absolute;
  right: 0px;
  bottom: 0px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.8rem;
  line-height: 1;
}

.personal-summary h1 {
  font-size: 1.6rem;
  line-height: 1.4;
  margin: 14px 0px 1px;
  overflow-wrap: anywhere;
}

.profile-info-link {
  font-size: 0.8125rem;
  color: var(--muted);
  min-height: 32px;
}

.personal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0px, 1fr));
  margin-top: 18px;
}

.personal-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.personal-stats > div + div::before {
  content: "";
  position: absolute;
  left: 0px;
  top: 9px;
  width: 1px;
  height: 36px;
  background: var(--line);
}

.personal-stats strong {
  font-size: 1.8rem;
  line-height: 1.4;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.personal-stats span {
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-menu {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.profile-menu > button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  background: transparent;
  border: 0px;
  border-radius: 0px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.profile-menu > button + button {
  border-top: 1px solid var(--line);
}

.profile-menu > button:hover {
  background: var(--soft);
}

.profile-menu svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.menu-chevron {
  margin-left: auto;
  color: var(--line);
  font-size: 1.6rem;
  line-height: 1;
}

.profile-subpage-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 8px 0px 24px;
}

.profile-subpage-heading h1 {
  font-size: 1.6rem;
  margin: 0px;
}

.profile-subpage .card {
  padding: 28px;
}

.profile-subpage .field-label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  margin-bottom: 22px;
}

.profile-subpage .field-label > input, .profile-subpage .field-label > textarea {
  width: 100%;
}

.profile-subpage form {
  margin-top: 0px;
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.profile-avatar-editor p {
  margin: 2px 0px;
}

.profile-avatar-editor .text-button {
  padding-left: 0px;
  padding-right: 15px;
}

.profile-info-card form > p {
  margin-bottom: 22px;
}

@media (max-width: 600px) {
  .profile-menu > button {
    padding: 18px 20px;
  }

  .personal-summary h1 {
    font-size: 1.4rem;
  }

  .personal-stats strong {
    font-size: 1.55rem;
  }
}

.large-text .personal-summary h1 {
  font-size: 1.75rem;
}

.large-text .profile-menu > button {
  font-size: 1.125rem;
}

.update-entry + .update-entry {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}
.update-entry h2 { margin: 0 0 12px; font-size: 1rem; }
.update-entry ul {
  margin: 0;
  padding-left: 1.25em;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.update-entry li + li { margin-top: 6px; }

.account-card { max-width: 480px; margin: 0 auto; }
.account-title { font-size: 1.6rem; margin: 0 0 24px; }
.account-tabs { margin-bottom: 24px; }
.account-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.account-card button[type=submit] { width: 100%; }
.account-card input { min-width: 0; }
#account-status { color: var(--danger); margin: 16px 0 0; overflow-wrap: anywhere; }
.account-info-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.account-info-row strong { min-width: 0; overflow-wrap: anywhere; }
#account-name { font-size: 1.5rem; margin: 16px 0 4px; overflow-wrap: anywhere; }


.learning-mode > .shell > .tabs { display: none; }
.learning-mode > .shell { max-width: 1200px; }
.learning-mode main { padding-top: 24px; }
.learning-heading { margin-bottom: 28px; }
button.square-back, button.chapter-enter { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; border-radius: 9px; color: #fff; font-size: 24px; font-weight: 800; }
.learning-heading > .square-back { margin-bottom: 16px; }
.learning-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.learning-title-row h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .practice-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .learning-heading { margin-bottom: 20px; }
  .learning-title-row h1 { font-size: 1.5rem; }
}

.shell > .tabs { padding-top: 20px; }

@media (max-width: 760px) {
  .tabs { gap: 5px; display: grid; grid-template-columns: repeat(5, minmax(0px, 1fr)); }
  .tabs button { min-width: 0; padding: 9px 2px; font-size: .85rem; gap: 4px; }
  .tabs .nav-icon { width: 14px; height: 14px; margin-right: 0; flex-shrink: 0; }
}

@media (max-width: 360px) {
  .tabs { gap: 2px; }
  .tabs button { padding: 9px 1px; font-size: .75rem; gap: 2px; }
}

.knowledge-card h2 { font-size: 1.35rem; margin: 0 0 8px; }
.knowledge-dot { display: inline-block; width: 9px; height: 9px; margin-left: 10px; border-radius: 50%; vertical-align: middle; background: var(--danger); }
.knowledge-dot.complete { background: var(--primary); }

.submit-slot { width: 104px; min-height: 48px; margin: 16px 0; }
button.submit-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 104px; height: 48px; min-width: 0; padding: 0; vertical-align: top; }
button.submit-button:not(.ready) { width: 48px; border-radius: 50%; opacity: 1; cursor: default; }
.submit-button.pending, .submit-button.submit-fresh { animation: submit-contract 220ms ease-out var(--submit-contract-delay, 0ms) both; }
button.submit-button.correct { background: var(--primary); border-color: var(--primary); }
button.submit-button.wrong { background: var(--danger); border-color: var(--danger); }
.submit-symbol { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.submit-symbol path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.submit-fresh .submit-symbol path { animation: submit-draw 300ms ease-out var(--submit-result-delay, 0ms) both; }
.submit-spinner { width: 18px; height: 18px; border: 2px solid #ffffff66; border-top-color: currentColor; border-radius: 50%; animation: submit-wait 900ms linear infinite; }
.submit-particles { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; fill: var(--primary); animation: submit-burst 480ms ease-out calc(var(--submit-result-delay, 0ms) + 120ms) both; }
.submit-button.wrong.submit-fresh { animation: submit-contract 220ms ease-out var(--submit-contract-delay, 0ms) both, submit-error-pulse 400ms ease-out calc(var(--submit-result-delay, 0ms) + 300ms) 2 both; }
@keyframes submit-error-pulse { 0%, 100% { transform: scale(1); } 38% { transform: scale(1.08); } 74% { transform: scale(.99); } }
@keyframes submit-contract { from { width: 104px; border-radius: 9px; } to { width: 48px; border-radius: 24px; } }
@keyframes submit-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes submit-wait { to { transform: rotate(360deg); } }
@keyframes submit-burst { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: .8; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.8); } }
@media (prefers-reduced-motion: reduce) {
  .submit-button.pending, .submit-button.submit-fresh, .submit-button.wrong.submit-fresh, .submit-fresh .submit-symbol path, .submit-spinner { animation: none; }
  .submit-particles { display: none; }
}
