:root {
  color-scheme: light;
  --ink: #1d1811;
  --ink-soft: #30271d;
  --gold: #b88a3b;
  --gold-deep: #91651f;
  --gold-pale: #f2e7d4;
  --canvas: #f4f0e8;
  --paper: #fffdf8;
  --muted: #756d62;
  --line: #e4dacb;
  --line-strong: #d4c5b0;
  --danger: #a23c31;
  --success: #357354;
  --shadow: 0 8px 24px rgba(44, 33, 20, 0.07);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(184, 138, 59, 0.26);
  outline-offset: 2px;
}

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

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fffaf0;
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  width: min(1500px, 100%);
  min-height: 78px;
  margin: 0 auto;
  padding: 0 clamp(22px, 3.4vw, 54px);
  display: grid;
  grid-template-columns: minmax(250px, auto) 1fr auto;
  align-items: stretch;
  gap: clamp(20px, 4vw, 58px);
}

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

.brand-lockup strong {
  display: block;
  font-family: "STSong", "Songti SC", serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand-lockup small {
  display: none;
  margin-top: 2px;
  color: #d8cdbd;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  stroke-width: 1.45;
}

.desktop-primary {
  display: flex;
  align-items: stretch;
}

.desktop-primary button {
  min-width: 142px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #e6ded2;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.desktop-primary button:hover,
.desktop-primary button.active {
  color: #f0c477;
  background: rgba(255, 255, 255, 0.025);
  border-bottom-color: #d6a551;
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}

.desktop-identity {
  max-width: 245px;
  color: #cfc3b3;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-link,
.logout-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  color: #f4ede3;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.header-link:hover,
.header-link.active,
.logout-button:hover {
  color: #e4bd73;
}

#account {
  max-width: 180px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fffaf0;
  background: #2b241c;
  font-size: 12px;
}

.app-main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 40px clamp(22px, 3.4vw, 54px) 72px;
}

.welcome-row,
.page-heading {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.welcome-row h1,
.page-heading h1 {
  margin: 0 0 4px;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: 0.025em;
}

.welcome-row p,
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.frontier-panel {
  margin-bottom: 22px;
  padding: 24px 26px 26px;
  border: 1px solid rgba(145, 104, 42, 0.24);
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdf8 0%, #f7f0e3 100%);
  box-shadow: var(--shadow);
}

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

.frontier-heading > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.frontier-heading span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.frontier-heading h2,
.frontier-heading p {
  margin: 0;
}

.frontier-heading h2 {
  font-family: "STSong", "Songti SC", serif;
  font-size: 25px;
}

.frontier-heading p {
  color: var(--muted);
  font-size: 12px;
}

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

.frontier-card {
  min-width: 0;
  min-height: 150px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(123, 91, 46, 0.18);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.frontier-card:hover {
  transform: translateY(-2px);
  border-color: rgba(166, 118, 48, 0.5);
  box-shadow: 0 10px 24px rgba(78, 56, 27, 0.1);
}

.frontier-card-label {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #7a5522;
  background: #f4e4c5;
  font-size: 11px;
  font-weight: 700;
}

.frontier-card strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frontier-card small {
  min-height: 38px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.frontier-card footer {
  margin-top: 6px;
  padding-top: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #806b4e;
  font-size: 11px;
}

.frontier-card footer svg {
  width: 16px;
  height: 16px;
}

.home-main,
.home-aside {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.today-panel,
.pathway-panel,
.quick-panel,
.knowledge-tool,
.ask-panel,
.assignment-panel,
.records-panel,
.manager-table {
  padding: 26px;
}

.today-panel > h2,
.quick-panel > h2,
.section-heading h2,
.assignment-panel h2,
.records-panel h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
}

.today-summary {
  margin: 26px 0 23px;
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
}

.summary-number,
.summary-time {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}

.summary-number strong {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
}

.summary-number span,
.summary-time span {
  font-size: 16px;
}

.summary-time {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.summary-time svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.5;
}

.summary-time strong {
  font-size: 24px;
}

.progress-block small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee6da;
}

.progress-track span {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.35s ease;
}

.progress-0 { width: 0; }
.progress-10 { width: 10%; }
.progress-20 { width: 20%; }
.progress-30 { width: 30%; }
.progress-40 { width: 40%; }
.progress-50 { width: 50%; }
.progress-60 { width: 60%; }
.progress-70 { width: 70%; }
.progress-80 { width: 80%; }
.progress-90 { width: 90%; }
.progress-100 { width: 100%; }

.primary-button,
.outline-button {
  min-height: 46px;
  padding: 11px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  border: 1px solid var(--ink);
  color: #fffaf0;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(29, 24, 17, 0.16);
}

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

.primary-button svg,
.outline-button svg,
.knowledge-entry-title svg {
  width: 17px;
  height: 17px;
}

.outline-button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  color: var(--gold-deep);
  background: transparent;
}

.outline-button:hover {
  background: #fbf5e9;
}

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

.task-row {
  min-height: 78px;
  padding: 13px 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefa;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.task-row:hover,
.task-row.is-highlighted {
  border-color: #d3aa64;
  box-shadow: 0 7px 18px rgba(80, 58, 28, 0.08);
}

.task-row.is-highlighted {
  transform: translateY(-2px);
}

.task-row.is-done {
  background: #faf8f3;
}

.task-icon,
.quick-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--gold-deep);
  background: #f5ecdd;
}

.task-icon svg,
.quick-icon svg {
  width: 23px;
  height: 23px;
}

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

.task-title-line {
  display: flex;
  align-items: center;
  gap: 18px;
}

.task-row h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.task-row p {
  max-width: 60em;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row small {
  display: none;
}

.task-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.task-duration svg {
  width: 15px;
  height: 15px;
}

.task-complete,
.submitted-state {
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

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

.review-button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.review-button:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}

.back-button {
  min-height: 38px;
  margin-bottom: 14px;
  padding: 5px 0;
  border: 0;
  color: var(--gold-deep);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.lesson-hero,
.lesson-content,
.lesson-complete-bar {
  max-width: 1120px;
  margin-bottom: 18px;
}

.lesson-hero {
  padding: 30px;
}

.lesson-heading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.lesson-heading small {
  color: var(--gold-deep);
  font-weight: 700;
}

.lesson-heading h1 {
  margin: 4px 0 7px;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.25;
}

.lesson-heading p {
  margin: 0;
  color: var(--muted);
}

.lesson-meta {
  margin-top: 24px;
  padding-top: 17px;
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.lesson-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lesson-meta svg {
  width: 16px;
  height: 16px;
}

.lesson-content {
  padding: 28px 30px;
}

.lesson-material {
  padding: 21px 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
}

.lesson-material > span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 18px;
}

.lesson-material small,
.lesson-material footer {
  color: var(--muted);
  font-size: 12px;
}

.lesson-material h3 {
  margin: 4px 0 8px;
  font-size: 18px;
}

.lesson-material p {
  margin: 0 0 11px;
  color: #4f473e;
  line-height: 1.8;
}

.lesson-complete-bar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.lesson-complete-bar div {
  display: grid;
}

.lesson-complete-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.pathway {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pathway::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gold);
}

.pathway button {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.path-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-deep);
  background: var(--paper);
  box-shadow: 0 0 0 6px var(--paper);
  transition: color 0.16s ease, background 0.16s ease;
}

.pathway button:hover .path-icon {
  color: #fff;
  background: var(--gold);
}

.path-icon svg {
  width: 26px;
  height: 26px;
}

.pathway small {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.pathway strong {
  margin: 3px 0;
  font-size: 14px;
  line-height: 1.35;
}

.pathway em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.5;
}

.quick-panel {
  display: grid;
  gap: 8px;
}

.quick-panel > h2 {
  margin-bottom: 8px;
}

.quick-panel > button {
  width: 100%;
  min-height: 68px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  cursor: pointer;
  text-align: left;
}

.quick-panel > button:hover {
  border-color: var(--line-strong);
  background: #fbf7f0;
}

.quick-panel button > span:nth-child(2) {
  min-width: 0;
  display: grid;
}

.quick-panel strong {
  font-size: 14px;
}

.quick-panel small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-panel > button > svg {
  width: 18px;
  height: 18px;
}

.knowledge-entry {
  min-height: 208px;
  padding: 27px;
  border-radius: 16px;
  color: #fffaf0;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(33, 26, 18, 0.15);
}

.knowledge-entry-title {
  width: 100%;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  color: #f0c477;
  background: transparent;
  cursor: pointer;
  font-size: 21px;
  font-weight: 700;
}

.knowledge-entry p {
  margin: 10px 0 24px;
  color: #d4cabd;
  font-size: 13px;
}

.knowledge-search-fake {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 8px;
  color: #a39a8f;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.knowledge-search-fake svg {
  color: var(--ink);
}

.page-heading {
  margin-bottom: 26px;
}

.page-heading h1 {
  font-size: clamp(32px, 3vw, 42px);
}

.knowledge-tool,
.knowledge-directory,
.ask-panel,
.assignment-panel {
  max-width: 1120px;
  margin-bottom: 20px;
}

.directory-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.directory-group {
  padding: 18px 2px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.directory-group header,
.directory-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.directory-group header span,
.directory-result-heading span {
  color: var(--muted);
  font-size: 12px;
}

.directory-group header {
  align-self: start;
  display: grid;
  justify-content: start;
  gap: 7px;
}

.directory-group header strong {
  font-size: 16px;
}

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

.directory-children button {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.directory-children button:hover,
.directory-children button.active {
  border-color: var(--gold);
  color: #70471f;
  background: #fbf3e6;
}

.directory-children small {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #f1ede7;
}

.directory-result-heading {
  padding: 20px 0 8px;
}

.directory-result {
  padding-left: 8px;
  padding-right: 8px;
}

.knowledge-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-field {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
}

.search-field svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.knowledge-results {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.knowledge-result {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.knowledge-result:first-child {
  border-top: 0;
}

.knowledge-result h3 {
  margin: 3px 0;
  font-size: 17px;
}

.knowledge-result small,
.knowledge-result footer,
.source-row {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-result p {
  margin: 8px 0;
  line-height: 1.7;
}

.quiz-source {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

textarea {
  width: 100%;
  min-height: 132px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

textarea::placeholder,
input::placeholder {
  color: #a39a8f;
}

.form-actions {
  margin-top: 13px;
  display: flex;
  justify-content: flex-end;
}

.answer-box {
  margin-top: 18px;
  padding: 17px;
  border-left: 4px solid var(--gold);
  border-radius: 7px;
  background: #faf2e4;
}

.answer-box.success {
  border-left-color: var(--success);
  background: #edf6f0;
}

.answer-box.warning {
  border-left-color: #bc7a26;
}

.answer-box p {
  margin: 6px 0 0;
  line-height: 1.7;
}

.feedback-next {
  min-height: 42px;
  margin-top: 14px;
  padding: 8px 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.feedback-next:hover {
  background: #3b3024;
}

.feedback-next svg {
  width: 16px;
  height: 16px;
}

.quiz-finished {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.challenge-layout,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.62fr) minmax(0, 1.8fr);
  gap: 20px;
  align-items: start;
}

.challenge-nav {
  padding: 10px;
}

.challenge-nav button {
  width: 100%;
  min-height: 68px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.challenge-nav button span {
  grid-row: 1 / 3;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 18px;
}

.challenge-nav button strong {
  color: var(--ink);
}

.challenge-nav button small {
  font-size: 11px;
}

.challenge-nav button.active {
  background: var(--gold-pale);
}

.quiz-panel {
  min-height: 350px;
  padding: 30px;
}

.section-label {
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 700;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.quiz-meta small {
  color: var(--muted);
  font-size: 12px;
}

.quiz-panel h2 {
  max-width: 35em;
  margin: 10px 0 24px;
  font-size: 21px;
}

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

.options button {
  width: 100%;
  min-height: 52px;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  cursor: pointer;
  text-align: left;
}

.options button:hover {
  border-color: var(--gold);
  background: #fcf7ed;
}

.options button span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-deep);
  font-family: Georgia, serif;
}

.status-strip {
  margin-top: 20px;
  padding: 18px 22px;
}

.status-strip div {
  display: flex;
  gap: 15px;
}

.status-strip span {
  color: var(--muted);
}

.assignment-heading {
  display: flex;
  align-items: center;
  gap: 15px;
}

.assignment-heading small {
  color: var(--gold-deep);
  font-weight: 700;
}

.assignment-heading h2 {
  margin-top: 2px;
}

.assignment-instruction {
  margin: 22px 0;
  padding: 17px;
  border-radius: 9px;
  color: #51483d;
  background: #f7f2e9;
  line-height: 1.75;
}

.assignment-panel label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.profile-card {
  padding: 28px;
  text-align: center;
}

.profile-avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-family: "STSong", "Songti SC", serif;
  font-size: 30px;
}

.profile-card h2 {
  margin: 0;
}

.profile-card > p {
  margin: 5px 0 22px;
  color: var(--muted);
}

.profile-card dl {
  margin: 0;
  text-align: left;
}

.profile-card dl div {
  padding: 11px 0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
}

.profile-card dt {
  color: var(--muted);
}

.profile-card dd {
  margin: 0;
  font-weight: 700;
}

.profile-logout-button,
.profile-admin-button {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.profile-logout-button:hover,
.profile-admin-button:hover {
  border-color: var(--gold);
  background: #fbf7f0;
}

.record-list {
  display: grid;
}

.record-list > div {
  padding: 15px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.record-state {
  color: #94632d;
  font-size: 12px;
  font-weight: 700;
}

.record-state.done {
  color: var(--success);
}

.record-list small {
  color: var(--muted);
}

.manager-row {
  min-height: 62px;
  padding: 12px 8px;
  display: grid;
  grid-template-columns: 1fr 0.6fr 1.3fr;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.manager-head {
  min-height: 44px;
  border-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.manager-row strong small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.empty-row,
.loading-row,
.error-state {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.error-state {
  color: var(--danger);
}

.form-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 4px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.mobile-nav {
  display: none;
}

@media (max-width: 1120px) {
  .desktop-identity {
    display: none;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 20px;
  }

  .desktop-primary button {
    min-width: 118px;
    padding: 0 15px;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-aside {
    grid-template-columns: 1fr 1fr;
  }

  .today-summary {
    grid-template-columns: auto auto 1fr;
  }

  .today-summary .primary-button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .app-header {
    position: relative;
  }

  .header-inner {
    min-height: 104px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-lockup strong {
    font-size: 20px;
  }

  .brand-lockup small {
    display: block;
  }

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

  .desktop-primary,
  .header-link,
  .desktop-identity,
  #account,
  .logout-button {
    display: none !important;
  }

  .header-actions::after {
    content: "";
    width: 38px;
    height: 38px;
    display: block;
    border: 2px solid #fffaf0;
    border-radius: 50%;
    background:
      radial-gradient(circle at 50% 37%, transparent 0 5px, #fffaf0 5.5px 6.8px, transparent 7px),
      radial-gradient(ellipse at 50% 92%, transparent 0 10px, #fffaf0 10.5px 12px, transparent 12.5px);
  }

  .app-main {
    padding: 30px 16px 28px;
  }

  .welcome-row,
  .page-heading {
    margin: 0 5px 22px;
  }

  .welcome-row h1,
  .page-heading h1 {
    font-size: clamp(30px, 9vw, 40px);
  }

  .welcome-row p,
  .page-heading p {
    font-size: 15px;
  }

  .home-layout,
  .home-main,
  .home-aside {
    display: grid;
    grid-template-columns: 1fr;
  }

  .frontier-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

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

  .today-panel,
  .pathway-panel,
  .quick-panel,
  .knowledge-directory,
  .knowledge-tool,
  .ask-panel,
  .assignment-panel,
  .records-panel,
  .manager-table,
  .quiz-panel {
    padding: 20px;
    border-radius: 15px;
  }

  .directory-groups {
    grid-template-columns: 1fr;
  }

  .directory-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .directory-group header {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

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

  .today-summary {
    margin-top: 22px;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .summary-number strong {
    font-size: 40px;
  }

  .summary-number span,
  .summary-time span {
    font-size: 14px;
  }

  .summary-time {
    padding-left: 20px;
  }

  .summary-time svg {
    width: 27px;
    height: 27px;
  }

  .summary-time strong {
    font-size: 21px;
  }

  .progress-block,
  .today-summary .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .task-row {
    min-height: 94px;
    padding: 13px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
  }

  .task-title-line {
    display: block;
  }

  .task-row h3 {
    font-size: 14px;
  }

  .task-row p {
    display: none;
  }

  .task-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
  }

  .task-duration {
    margin-top: 3px;
  }

  .task-row .outline-button {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .task-row .outline-button svg {
    display: none;
  }

  .task-done-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .lesson-hero,
  .lesson-content {
    padding: 20px;
  }

  .lesson-heading {
    gap: 12px;
  }

  .lesson-heading h1 {
    font-size: 27px;
  }

  .lesson-meta {
    flex-wrap: wrap;
    gap: 8px 18px;
  }

  .lesson-material {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .lesson-complete-bar {
    padding: 18px;
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-complete-bar .primary-button {
    width: 100%;
  }

  .pathway-panel {
    overflow: hidden;
  }

  .pathway {
    margin: 0 -7px;
    gap: 3px;
  }

  .pathway::before {
    left: 12%;
    right: 12%;
  }

  .pathway button {
    padding: 0 2px;
  }

  .path-icon {
    width: 50px;
    height: 50px;
  }

  .pathway strong {
    font-size: 12px;
  }

  .pathway em {
    display: none;
  }

  .quick-panel {
    order: 1;
  }

  .knowledge-entry {
    order: 2;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    min-height: 72px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #f2eadf;
    background: var(--ink);
    box-shadow: 0 -10px 25px rgba(29, 24, 17, 0.14);
  }

  .mobile-nav button {
    min-height: 58px;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 0;
    color: #efe7dc;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
  }

  .mobile-nav button.active {
    color: #e2af56;
    font-weight: 700;
  }

  .mobile-nav-icon {
    width: 23px;
    height: 23px;
    stroke-width: 1.75;
  }

  .knowledge-search-row,
  .challenge-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

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

  .challenge-nav button {
    min-height: 64px;
  }

  .status-strip div {
    display: grid;
    gap: 3px;
  }

  .record-list > div {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .record-list small {
    grid-column: 2;
  }

  .manager-row {
    grid-template-columns: 1fr auto;
  }

  .manager-row > :last-child,
  .manager-head > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 460px) {
  .header-inner {
    min-height: 96px;
    padding: 16px;
  }

  .brand-lockup strong {
    font-size: 18px;
  }

  .header-actions::after {
    width: 35px;
    height: 35px;
  }

  .app-main {
    padding-inline: 10px;
  }

  .directory-children {
    grid-template-columns: minmax(0, 1fr);
  }

  .today-panel,
  .pathway-panel,
  .quick-panel,
  .knowledge-tool,
  .ask-panel,
  .assignment-panel,
  .records-panel,
  .manager-table,
  .quiz-panel {
    padding: 17px;
  }

  .today-panel > h2,
  .quick-panel > h2,
  .section-heading h2,
  .assignment-panel h2,
  .records-panel h2 {
    font-size: 19px;
  }

  .task-icon,
  .quick-icon {
    width: 40px;
    height: 40px;
  }

  .path-icon {
    width: 44px;
    height: 44px;
    box-shadow: 0 0 0 4px var(--paper);
  }

  .path-icon svg {
    width: 22px;
    height: 22px;
  }

  .pathway strong {
    font-size: 11px;
  }

  .quick-panel > button {
    min-height: 64px;
  }

  .knowledge-entry {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.submission-form {
  display: grid;
  gap: 16px;
}

.submission-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.submission-form input,
.submission-form select,
.submission-form textarea,
.media-upload-row input {
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.submission-form textarea { min-height: 130px; resize: vertical; }
.media-upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.media-upload-row input { flex: 1 1 300px; }
.text-button { margin-left: 12px; padding: 0; border: 0; color: var(--gold-dark); background: transparent; cursor: pointer; font-weight: 700; }
.knowledge-detail { padding: clamp(22px,4vw,48px); }
.knowledge-detail header { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.knowledge-detail header h1 { margin: 8px 0; font-family: Georgia,"Songti SC",serif; font-size: clamp(28px,4vw,42px); }
.knowledge-detail header p,.knowledge-detail header small { color: var(--muted); }
.knowledge-body { padding: 28px 0; color: var(--ink-soft); font-size: 16px; line-height: 1.9; }
.knowledge-media { display: grid; gap: 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.knowledge-media h2 { margin: 0; }
.knowledge-media figure { margin: 0; display: grid; gap: 8px; }
.knowledge-media img,.knowledge-media video { width: min(100%,900px); max-height: 580px; border-radius: 10px; background: #15120e; object-fit: contain; }
.knowledge-media figcaption { color: var(--muted); font-size: 13px; }
.media-link { width: fit-content; text-decoration: none; }
.scenario-panel > label { display: block; margin: 20px 0 8px; font-weight: 700; }
.scenario-customer { padding: 18px 20px; border-left: 4px solid var(--gold); border-radius: 8px; background: #f8f1e4; }
.scenario-customer strong { color: var(--gold-dark); }
.scenario-customer p { margin: 7px 0 0; }
.wrong-answer-row { grid-template-columns: auto minmax(220px,1fr) auto; align-items: center; }
.wrong-answer-row small { grid-column: 2; }
.ability-panel { grid-column: 1 / -1; }
.ability-list { display: grid; gap: 14px; }
.ability-list > div { display: grid; grid-template-columns: minmax(120px,220px) minmax(120px,1fr) 56px; align-items: center; gap: 14px; }
.ability-track { height: 8px; overflow: hidden; border-radius: 99px; background: #eee5d6; }
.ability-track i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.ability-0 { width: 0; }.ability-10 { width: 10%; }.ability-20 { width: 20%; }.ability-30 { width: 30%; }.ability-40 { width: 40%; }.ability-50 { width: 50%; }.ability-60 { width: 60%; }.ability-70 { width: 70%; }.ability-80 { width: 80%; }.ability-90 { width: 90%; }.ability-100 { width: 100%; }

@media (max-width: 640px) {
  .wrong-answer-row { grid-template-columns: auto 1fr; }
  .wrong-answer-row .outline-button { grid-column: 1 / -1; }
  .ability-list > div { grid-template-columns: 1fr auto; }
  .ability-track { grid-column: 1 / -1; grid-row: 2; }
}
