:root {
  color-scheme: light;
  --ink: #25332d;
  --muted: #697870;
  --line: #e3e9e3;
  --paper: #ffffff;
  --canvas: #f4f6f2;
  --green: #33705c;
  --green-soft: #e7f1eb;
  --blue: #547b95;
  --blue-soft: #eaf1f5;
  --gold: #a87a35;
  --gold-soft: #f7f0df;
  --rose: #ae6b62;
  --shadow: 0 8px 24px rgb(37 51 45 / 5%);
  font-family: 'Microsoft YaHei UI', 'Noto Sans SC', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid #8cb8a5; outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.layout { min-height: 100vh; }
.main-toolbar { display: flex; width: min(100%, 1050px); justify-content: flex-end; margin: 0 auto 13px; }
.language-switch { display: inline-flex; flex: 0 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.language-option { min-height: 29px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.language-option.active { background: var(--green); color: white; font-weight: 600; }
.welcome-screen, .error-screen, .loading-screen { position: relative; }
.welcome-screen > .language-switch, .error-screen > .language-switch, .loading-screen > .language-switch { position: absolute; z-index: 2; top: 20px; right: 20px; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 30px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--green); color: white; font-size: 18px; font-weight: 700; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.brand-caption { margin-top: 3px; color: var(--muted); font-size: 11px; }
.nav-label { padding: 0 12px 9px; color: #89958e; font-size: 10px; font-weight: 700; }
.nav-list { display: grid; gap: 5px; }
.nav-button { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #5f6e66; cursor: pointer; text-align: left; }
.nav-button:hover { background: #f0f4f0; }
.nav-button.active { background: var(--green-soft); color: #285844; font-weight: 600; }
.nav-icon { display: grid; width: 21px; place-items: center; font-size: 16px; }
.sidebar-bottom { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-bottom strong { display: block; color: var(--ink); font-size: 13px; }
.main { min-height: 100vh; margin-left: 248px; padding: 37px clamp(24px, 5vw, 72px) 72px; }
.content { width: min(100%, 1050px); margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); font-weight: 700; letter-spacing: 0; }
h2 { margin: 0; font-size: 19px; letter-spacing: 0; }
h3 { margin: 0; font-size: 15px; letter-spacing: 0; }
.subheading { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.profile-chip { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 13px; }
.avatar { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #e5eee8; color: var(--green); font-size: 12px; font-weight: 700; }
.section { margin-top: 25px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(240px, .85fr); gap: 16px; }
.panel, .topic-card, .subject-card { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.panel { padding: 21px; }
.welcome-panel { position: relative; overflow: hidden; min-height: 195px; background: #eaf2ec; }
.welcome-panel::after { position: absolute; right: -20px; bottom: -72px; width: 215px; height: 180px; border: 1px solid rgb(51 112 92 / 15%); border-radius: 50%; content: ''; }
.welcome-panel::before { position: absolute; right: 37px; bottom: -110px; width: 175px; height: 175px; border: 1px solid rgb(51 112 92 / 14%); border-radius: 50%; content: ''; }
.welcome-copy { position: relative; z-index: 1; max-width: 460px; }
.welcome-copy .eyebrow { color: #3c785f; }
.welcome-copy h2 { font-size: 23px; }
.welcome-copy p { max-width: 400px; margin: 9px 0 0; color: #53685d; font-size: 13px; line-height: 1.7; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 23px; }
.metric { padding-top: 13px; border-top: 1px solid rgb(51 112 92 / 18%); }
.metric strong { display: block; font-size: 22px; }
.metric span { color: #61746a; font-size: 11px; }
.small-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.small-panel-title span { color: var(--muted); font-size: 11px; }
.recommend-list { display: grid; gap: 10px; margin-top: 17px; }
.recommend-item { display: grid; grid-template-columns: 28px 1fr auto; align-items: start; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid #eef1ed; }
.recommend-item:last-child { padding-bottom: 0; border-bottom: 0; }
.number-pill { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: #edf3ef; color: var(--green); font-size: 12px; font-weight: 700; }
.recommend-title { font-size: 13px; font-weight: 600; line-height: 1.45; }
.recommend-item > div { min-width: 0; overflow-wrap: anywhere; }
.recommend-meta { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.text-button, .link-button { padding: 0; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 600; }
.text-button:hover, .link-button:hover { text-decoration: underline; }
.subject-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.subject-card { display: flex; min-height: 88px; flex-direction: column; justify-content: space-between; padding: 14px; box-shadow: none; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.subject-card:hover { transform: translateY(-2px); border-color: #b7cfc0; }
.subject-card.primary { border-top: 3px solid var(--green); }
.subject-card.secondary { border-top: 3px solid #b5c5cc; }
.subject-card strong { font-size: 13px; }
.subject-card span { color: var(--muted); font-size: 11px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input { width: min(100%, 280px); min-height: 41px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 3px 0 10px; }
.filter-button { flex: 0 0 auto; min-height: 35px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: white; color: #5f6e66; cursor: pointer; font-size: 12px; }
.filter-button.active { border-color: var(--green); background: var(--green); color: white; }
.map-domain { margin-top: 19px; }
.domain-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.domain-heading h3 { font-size: 16px; }
.domain-heading p { max-width: 560px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.count-label { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.topic-card { display: flex; min-width: 0; align-items: flex-start; gap: 11px; padding: 13px; box-shadow: none; cursor: pointer; text-align: left; }
.topic-card:hover { border-color: #b7cfc0; background: #fcfdfb; }
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 5px; border-radius: 50%; background: #d4dbd6; }
.status-dot.learning { background: #d6ae57; }
.status-dot.mastered { background: #4f9873; }
.topic-card strong { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.topic-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.more-button { display: block; margin: 11px auto 0; padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green); cursor: pointer; font-size: 12px; }
.detail-back { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 19px; padding: 0; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 13px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .75fr); align-items: start; gap: 15px; }
.detail-main { display: grid; gap: 14px; }
.detail-title-card { padding: 24px; }
.detail-title-card h1 { margin: 7px 0 0; font-size: 27px; line-height: 1.35; }
.detail-title-card h1, .detail-copy, .evidence-list li, .relation-name, .relation-note { overflow-wrap: anywhere; }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.tag { padding: 5px 9px; border-radius: 999px; background: #edf3ef; color: #527261; font-size: 11px; }
.detail-copy { margin: 11px 0 0; color: #526158; font-size: 14px; line-height: 1.8; white-space: pre-line; }
.evidence-list { display: grid; gap: 9px; margin: 13px 0 0; padding: 0; list-style: none; }
.evidence-list li { display: flex; gap: 9px; color: #526158; font-size: 13px; line-height: 1.6; }
.evidence-list li::before { color: var(--green); content: '✓'; font-weight: 700; }
.status-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 17px; }
.status-button { min-height: 38px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #66746c; cursor: pointer; font-size: 11px; }
.status-button.active[data-status="learning"] { border-color: #d8bf83; background: var(--gold-soft); color: #856125; }
.status-button.active[data-status="mastered"] { border-color: #9fc2ac; background: var(--green-soft); color: #35694e; }
.status-button.active[data-status="not_started"] { border-color: #c6d0c9; background: #f1f4f1; }
.side-stack { display: grid; gap: 14px; }
.relation-list { display: grid; gap: 8px; margin-top: 13px; }
.relation-item { display: flex; width: 100%; align-items: flex-start; gap: 9px; padding: 9px 0; border: 0; border-bottom: 1px solid #eef1ed; background: transparent; cursor: pointer; text-align: left; }
.relation-item:last-child { border-bottom: 0; }
.relation-symbol { flex: 0 0 15px; font-size: 12px; }
.relation-symbol.mastered { color: #4f9873; }
.relation-symbol.learning { color: #b28738; }
.relation-symbol.not_started { color: #aeb8b1; }
.relation-name { display: block; font-size: 12px; line-height: 1.5; }
.relation-note { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.empty-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.goal-list, .record-list { display: grid; gap: 10px; }
.goal-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.goal-item.done { background: #f6faf7; }
.goal-subject { margin-bottom: 4px; color: var(--green); font-size: 10px; font-weight: 700; }
.goal-name { font-size: 14px; font-weight: 600; line-height: 1.5; }
.goal-objective { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.goal-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.button { min-height: 35px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; font-size: 11px; }
.button.primary { border-color: var(--green); background: var(--green); color: white; }
.button.danger { color: var(--rose); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.record-panel { min-height: 160px; }
.record-panel h3 { display: flex; align-items: center; gap: 8px; }
.record-panel h3 span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b9c1bc; }
.record-panel.learning h3 span { background: #d6ae57; }
.record-panel.mastered h3 span { background: #4f9873; }
.record-entry { padding: 10px 0; border-bottom: 1px solid #eef1ed; }
.record-entry:last-child { border-bottom: 0; }
.record-entry button { padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 12px; font-weight: 600; line-height: 1.5; }
.record-entry small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e8d7a8; border-radius: 8px; background: #fcf8ea; color: #745b27; font-size: 12px; line-height: 1.6; }
.error-panel { max-width: 580px; margin: 16vh auto; padding: 30px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: center; }
.error-panel h1 { font-size: 23px; }
.error-panel p { margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.welcome-screen { display: grid; min-height: 100vh; place-items: center; padding: 22px; background: radial-gradient(ellipse at 85% 15%, #e4eee8 0, transparent 31%), var(--canvas); }
.welcome-card { width: min(100%, 470px); padding: 34px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.welcome-card .brand { padding: 0 0 27px; }
.welcome-card h1 { font-size: 25px; }
.welcome-card > p { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.form-field { display: grid; gap: 7px; margin-top: 15px; }
.form-field label { font-size: 12px; font-weight: 600; }
.form-field input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; }
.welcome-card .button { width: 100%; min-height: 44px; margin-top: 22px; font-size: 13px; }
.loading-state { display: grid; min-height: 100vh; place-items: center; color: var(--muted); font-size: 14px; }
.mobile-nav { display: none; }
.loading-screen { display: grid; min-height: 100vh; place-items: center; }

@media (max-width: 1050px) {
  .sidebar { width: 215px; }
  .main { margin-left: 215px; padding-right: 28px; padding-left: 28px; }
  .subject-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .record-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { margin: 0; padding: 23px 16px 96px; }
  .main-toolbar { margin-bottom: 12px; }
  .page-heading { align-items: flex-start; margin-bottom: 21px; }
  .page-heading .profile-chip { margin-top: 2px; }
  h1 { font-size: 26px; }
  .overview-grid, .detail-layout { grid-template-columns: 1fr; }
  .overview-grid { gap: 11px; }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .subject-card { min-height: 78px; padding: 12px; }
  .topic-list { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 96%); }
  .mobile-nav .nav-button { min-height: 53px; flex-direction: column; justify-content: center; gap: 3px; padding: 3px 0; font-size: 10px; }
  .mobile-nav .nav-icon { font-size: 15px; }
  .welcome-panel { min-height: 181px; }
  .panel { padding: 17px; }
  .detail-title-card { padding: 19px; }
  .detail-title-card h1 { font-size: 23px; }
  .goal-item { grid-template-columns: 1fr; }
  .goal-actions { justify-content: flex-start; }
  .page-heading .toolbar { width: 100%; }
  .page-heading:has(.toolbar) { align-items: flex-start; flex-direction: column; }
  .search-input { width: 100%; }
}

@media (max-width: 390px) {
  .main { padding-right: 12px; padding-left: 12px; }
  .profile-chip { padding: 6px 8px; font-size: 11px; }
  .avatar { width: 23px; height: 23px; }
  .welcome-card { padding: 24px 20px; }
  .status-control { gap: 4px; }
  .status-button { font-size: 10px; }
  .language-option { padding-right: 8px; padding-left: 8px; }
}