:root {
  --forest: #315436;
  --forest-deep: #25452b;
  --leaf: #617d45;
  --leaf-soft: #edf2e7;
  --purple: #7245bd;
  --purple-deep: #563095;
  --purple-soft: #f2ebff;
  --ink: #3b291f;
  --muted: #776556;
  --paper: #fffdf7;
  --paper-warm: #fff7d7;
  --canvas: #f3eee3;
  --line: #e6d6b6;
  --line-strong: #d9ba75;
  --sun: #f2cf77;
  --shadow-soft: 0 14px 32px rgba(87, 66, 37, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body.learning-page {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.learning-page a { color: var(--forest); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 10; padding: 12px 16px; background: #fff; }
.skip-link:focus { top: 12px; }
.learning-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.learning-header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 8px; }
.learning-brand { display: flex; align-items: center; gap: 11px; color: var(--forest-deep); font-size: 0.95rem; font-weight: 800; text-decoration: none; }
.learning-brand img { border-radius: 12px; box-shadow: 0 4px 12px rgba(65, 50, 24, 0.1); }
.learning-header nav { display: flex; gap: 20px; font-size: 0.92rem; font-weight: 700; }
.learning-header nav a { color: var(--forest-deep); text-decoration: none; }

.learning-index {
  padding: clamp(28px, 4.4vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(189, 160, 105, 0.42);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.learning-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 370px); gap: clamp(26px, 4vw, 48px); align-items: center; }
.learning-intro__copy { min-width: 0; }
.learning-kicker { margin: 0 0 13px; color: var(--purple); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.22em; }
.learning-intro h1,
.learning-section-heading h2,
.more-learning h2,
.library-trust h2 {
  color: var(--forest-deep);
  font-family: Georgia, "Songti SC", "STSong", serif;
}
.learning-intro h1 { margin: 0; font-size: clamp(2.2rem, 3.55vw, 2.72rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.045em; white-space: nowrap; }
.learning-intro__copy > p:not(.learning-kicker) { max-width: 670px; margin: 15px 0 12px; color: var(--muted); font-size: 1rem; line-height: 1.72; }
.learning-intro__copy > strong { display: block; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.dictionary-search { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; padding: 18px 16px 14px; border: 1px dashed var(--line-strong); border-radius: 20px; background: rgba(255, 253, 247, 0.88); }
.dictionary-search__icon,
.learning-category__icon,
.learning-route__icon { display: grid; place-items: center; flex: 0 0 auto; color: var(--purple-deep); border: 1px solid #ead397; border-radius: 50%; background: #fff8dd; }
.dictionary-search__icon { width: 44px; height: 44px; grid-row: span 2; }
.learning-icon { width: 24px; height: 24px; }
.dictionary-search h2 { margin: 1px 0 6px; color: var(--purple-deep); font-family: Georgia, "Songti SC", serif; font-size: 1.16rem; line-height: 1.2; }
.dictionary-search p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.dictionary-search > a { display: flex; min-height: 46px; grid-column: 1 / -1; align-items: center; justify-content: center; gap: 10px; margin-top: 13px; border-radius: 12px; background: var(--purple); box-shadow: 0 4px 0 var(--purple-deep); color: #fff; font-size: 0.92rem; font-weight: 800; text-decoration: none; }
body.learning-page .dictionary-search > a { color: #fff; }
.dictionary-search > a:hover { background: #6638ad; }
.dictionary-search > a .learning-icon { width: 19px; height: 19px; }

.learning-library { padding-top: 30px; scroll-margin-top: 18px; }
.learning-category-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.learning-category { display: flex; min-width: 0; min-height: 80px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 18px; background: var(--paper-warm); color: var(--forest-deep); cursor: pointer; text-align: left; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.learning-category:hover { transform: translateY(-2px); box-shadow: 0 9px 18px rgba(115, 81, 35, 0.1); }
.learning-category.is-active { border: 2px solid var(--purple); box-shadow: 0 7px 16px rgba(91, 53, 148, 0.16); }
.learning-category__icon { width: 46px; height: 46px; }
.learning-category > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.learning-category strong { overflow: hidden; font-family: Georgia, "Songti SC", serif; font-size: 1.02rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.learning-category small { color: var(--muted); font-size: 0.73rem; font-weight: 700; }
.learning-category-panel { padding-top: 31px; }
.learning-section-heading { display: flex; min-height: 58px; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 13px; }
.learning-section-heading h2 { margin: 0 0 5px; font-size: clamp(1.9rem, 3.2vw, 2.45rem); line-height: 1; }
.learning-section-heading p { margin: 0; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.browse-all { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; border: 0; background: none; color: var(--purple-deep); cursor: pointer; font-size: 0.86rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.browse-all .learning-icon { width: 18px; height: 18px; }
.learning-term-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.learning-term-card { position: relative; display: grid; min-width: 0; min-height: 160px; grid-template-columns: 128px minmax(0, 1fr) 28px; gap: 12px; align-items: center; padding: 9px 10px 9px 9px; overflow: hidden; border: 1px solid #e6ca87; border-radius: 20px; background-color: #fff7cf; background-image: radial-gradient(circle at 12% 20%, rgba(255,255,255,.7), transparent 21%), radial-gradient(circle at 80% 10%, rgba(242,207,119,.16), transparent 30%); color: var(--ink); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.learning-term-card:hover { transform: translateY(-2px); border-color: #d7ac52; box-shadow: 0 10px 22px rgba(111, 77, 31, 0.13); }
.learning-category-panel:not(.show-all) .learning-term-card.is-extra { display: none; }
.term-card__media { display: block; width: 128px; height: 140px; padding: 6px; border: 1px solid #debf80; border-radius: 15px; background: rgba(255,255,255,.7); box-shadow: 0 4px 10px rgba(81, 58, 31, 0.1); }
.term-card__media img { display: block; width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.term-card__placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 8px; border-radius: 10px; background: #f2ead1; color: var(--purple-deep); }
.term-card__placeholder em { color: var(--muted); font-size: 0.75rem; font-style: normal; }
.term-card__content { display: flex; min-width: 0; align-self: stretch; justify-content: center; flex-direction: column; }
.term-card__kind { margin-bottom: 3px; color: var(--purple); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.13em; }
.term-card__content > strong { overflow: hidden; color: var(--forest-deep); font-family: Georgia, "Songti SC", serif; font-size: 1.42rem; line-height: 1.08; text-overflow: ellipsis; white-space: nowrap; }
.term-card__pronunciation { margin-top: 2px; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.term-card__definition,
.term-card__translation { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
.term-card__definition { margin-top: 6px; color: #543c2d; font-size: 0.76rem; line-height: 1.35; -webkit-line-clamp: 1; }
.term-card__translation { margin-top: 3px; color: var(--muted); font-size: 0.69rem; line-height: 1.35; -webkit-line-clamp: 1; }
.term-card__meta { display: flex; align-items: center; gap: 5px; margin-top: 7px; overflow: hidden; color: var(--muted); font-size: 0.64rem; font-weight: 700; white-space: nowrap; }
.term-meta { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; }
.term-meta--chip { padding: 2px 7px; border: 1px dashed rgba(118, 91, 51, 0.32); border-radius: 999px; background: rgba(255,255,255,.45); }
.term-meta:first-child { border-color: #abc6d9; background: #e9f5ff; color: #355675; }
.term-meta .learning-icon { width: 14px; height: 14px; }
.term-card__arrow { color: var(--forest-deep); }
.term-card__arrow .learning-icon { width: 23px; height: 23px; }
.learning-empty { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; min-height: 150px; padding: 26px; border: 1px dashed var(--line-strong); border-radius: 20px; background: #fff9e6; }
.learning-empty > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple-deep); }
.learning-empty h3 { margin: 0 0 5px; color: var(--forest-deep); font-family: Georgia, "Songti SC", serif; font-size: 1.25rem; }
.learning-empty p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.learning-empty a { font-size: 0.84rem; font-weight: 800; }

.more-learning { padding-top: 38px; }
.more-learning > h2 { margin: 0 0 15px; font-size: clamp(2rem, 3.4vw, 2.55rem); line-height: 1.1; }
.learning-routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 253, 247, 0.7); }
.learning-routes button { display: grid; min-width: 0; min-height: 118px; grid-template-columns: 48px minmax(0, 1fr) 24px; gap: 12px; align-items: center; padding: 18px 16px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.learning-routes button:last-child { border-right: 0; }
.learning-routes button:hover { background: #fff9e7; }
.learning-route__icon { width: 48px; height: 48px; }
.learning-routes button > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.learning-routes strong { color: var(--forest-deep); font-family: Georgia, "Songti SC", serif; font-size: 1rem; }
.learning-routes small { margin-top: 3px; color: var(--muted); font-size: 0.7rem; font-weight: 800; }
.learning-routes em { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 0.68rem; font-style: normal; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.learning-routes button > .learning-icon { width: 21px; height: 21px; color: var(--purple); }
.library-trust { margin-top: 24px; padding: 25px 24px; border: 1px dashed var(--line-strong); border-radius: 20px; background: var(--leaf-soft); }
.library-trust h2 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.4rem); line-height: 1.1; }
.library-trust p { margin: 13px 0 15px; color: var(--ink); font-size: 0.84rem; line-height: 1.68; }
.library-trust div { display: flex; flex-wrap: wrap; gap: 18px; }
.library-trust a { color: var(--ink); font-size: 0.8rem; font-weight: 800; }

/* Public detail pages keep the production forest-card structure. */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; padding: 20px 0 28px; color: var(--muted); font-size: 0.9rem; }
.term-group, .related { padding: 54px 0 10px; }
.section-heading p { margin: 0 0 10px; color: var(--leaf); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.section-heading h2, .related h2 { margin: 0 0 24px; color: var(--forest-deep); font: 700 clamp(1.8rem, 4vw, 3rem)/1.15 Georgia, "Songti SC", serif; }
.term-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.term-link { display: grid; min-height: 100px; grid-template-columns: 82px minmax(90px, 0.45fr) 1fr; gap: 16px; align-items: center; padding: 18px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.term-link:nth-child(odd) { border-right: 1px solid var(--line); }
.term-link:hover, .term-link:focus-visible { background: var(--paper); }
.term-kind { color: var(--leaf); font-size: 0.76rem; font-weight: 750; }
.term-link strong { font-size: 1.25rem; }
.term-link > span:last-child { color: var(--muted); line-height: 1.55; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); gap: clamp(32px, 7vw, 84px); padding: clamp(30px, 6vw, 72px); border: 1px solid var(--line); border-radius: 34px; background: var(--paper); }
.entry-copy h1 { margin: 0; color: var(--forest-deep); font: 800 clamp(3.5rem, 9vw, 7.5rem)/1 Georgia, "Songti SC", serif; letter-spacing: -0.05em; }
.entry-pronunciation { color: var(--leaf); font-size: 1.2rem; }
.direct-answer { margin: 30px 0; padding-left: 20px; border-left: 5px solid var(--sun); font-size: 1.35rem; font-weight: 650; line-height: 1.7; }
.entry-copy section { margin-top: 38px; }
.entry-copy h2 { font: 700 1.65rem Georgia, "Songti SC", serif; }
.definition-list { padding-left: 1.4em; line-height: 1.8; }
.example { padding: 16px 0; border-top: 1px solid var(--line); }
.example p { margin: 5px 0; line-height: 1.6; }
.pronunciation { color: var(--muted); }
.entry-layout figure { position: sticky; top: 22px; align-self: start; margin: 0; }
.entry-layout figure img { display: block; width: 100%; height: auto; border-radius: 26px; background: var(--leaf-soft); }
.entry-layout figcaption { padding-top: 10px; color: var(--muted); font-size: 0.82rem; }
.source-note { margin-top: 40px; padding: 16px 18px; border-radius: 14px; background: var(--leaf-soft); }
.source-note p { margin: 5px 0 0; color: var(--muted); }
.continue-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-top: 24px; padding: 32px; border-radius: 24px; background: #dfe9c8; }
.continue-card h2 { margin: 0; font: 700 clamp(1.6rem, 4vw, 2.5rem) Georgia, serif; }
.continue-card > a { display: inline-flex; min-height: 48px; align-items: center; padding: 0 20px; border-radius: 999px; background: var(--forest); color: #fff; font-weight: 750; text-decoration: none; }
body.learning-page .continue-card > a { color: #fff; }
.learning-footer { margin-top: 26px; padding: 24px 8px 46px; color: var(--muted); font-size: 0.82rem; }
.learning-footer p { line-height: 1.6; }
audio { width: min(100%, 420px); }
*:focus-visible { outline: 3px solid #b76514; outline-offset: 4px; }

@media (max-width: 960px) {
  .learning-intro { grid-template-columns: 1fr; }
  .learning-intro h1 { white-space: normal; }
  .dictionary-search { max-width: none; }
  .learning-category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-routes { grid-template-columns: 1fr; }
  .learning-routes button { border-right: 0; border-bottom: 1px solid var(--line); }
  .learning-routes button:last-child { border-bottom: 0; }
}

@media (max-width: 760px) {
  .learning-shell { width: min(100% - 20px, 640px); }
  .learning-header { align-items: center; padding-inline: 4px; }
  .learning-brand span { font-size: 0.82rem; }
  .learning-header nav { flex-direction: column; gap: 4px; text-align: right; }
  .learning-index { padding: 25px 18px; border-radius: 21px; }
  .learning-intro h1 { font-size: clamp(2rem, 9vw, 2.65rem); line-height: 1.12; }
  .learning-category { min-height: 74px; padding: 10px; }
  .learning-category__icon { width: 42px; height: 42px; }
  .learning-term-grid { grid-template-columns: 1fr; }
  .learning-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .browse-all { align-self: flex-end; margin-top: -35px; }
  .learning-term-card { min-height: 150px; grid-template-columns: 116px minmax(0, 1fr) 24px; }
  .term-card__media { width: 116px; height: 130px; }
  .learning-empty { grid-template-columns: auto 1fr; }
  .learning-empty a { grid-column: 2; }
  .term-list { grid-template-columns: 1fr; }
  .term-link { grid-template-columns: 70px 1fr; }
  .term-link:nth-child(odd) { border-right: 0; }
  .term-link > span:last-child { grid-column: 2; }
  .entry-layout { grid-template-columns: 1fr; padding: 28px 22px; }
  .entry-layout figure { position: static; grid-row: 1; }
  .continue-card { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .learning-shell { width: calc(100% - 14px); }
  .learning-header { min-height: 64px; }
  .learning-brand img { width: 38px; height: 38px; }
  .learning-header nav { font-size: 0.76rem; }
  .learning-index { padding: 22px 13px; border-radius: 18px; }
  .learning-intro h1 { font-size: 2.08rem; }
  .learning-intro__copy > p:not(.learning-kicker), .learning-intro__copy > strong { font-size: 0.9rem; }
  .dictionary-search { grid-template-columns: 40px 1fr; padding: 14px 12px 12px; }
  .dictionary-search__icon { width: 40px; height: 40px; }
  .learning-category-list { gap: 8px; }
  .learning-category { gap: 8px; min-height: 68px; padding: 8px; border-radius: 15px; }
  .learning-category__icon { width: 36px; height: 36px; }
  .learning-category__icon .learning-icon { width: 20px; height: 20px; }
  .learning-category strong { font-size: 0.88rem; }
  .learning-category small { font-size: 0.64rem; }
  .learning-category-panel { padding-top: 24px; }
  .learning-term-card { min-height: 136px; grid-template-columns: 94px minmax(0, 1fr) 20px; gap: 9px; padding: 7px; border-radius: 16px; }
  .term-card__media { width: 94px; height: 120px; padding: 4px; border-radius: 12px; }
  .term-card__content > strong { font-size: 1.18rem; }
  .term-card__definition { margin-top: 4px; }
  .term-card__meta { gap: 3px; margin-top: 5px; }
  .term-meta--chip { padding: 1px 5px; }
  .term-meta:nth-last-child(-n+2) { display: none; }
  .more-learning { padding-top: 31px; }
  .learning-routes button { grid-template-columns: 44px minmax(0, 1fr) 20px; min-height: 104px; padding: 15px 12px; }
  .learning-route__icon { width: 44px; height: 44px; }
  .library-trust { padding: 21px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .learning-category, .learning-term-card { transition: none; }
}
