/* 淡雅的首页；学习页继续使用原有的窄屏布局。 */
body.home-active { max-width: none; background: #f7f6f0; }
.home-view { height: 100%; overflow-y: auto; overflow-x: hidden; background: radial-gradient(ellipse at 78% 22%, #edf0e5 0, transparent 45%), #f7f6f0; color: #414c46; -webkit-overflow-scrolling: touch; }
.home-shell { max-width: 1160px; margin: auto; padding: max(25px, env(safe-area-inset-top)) 48px max(24px, env(safe-area-inset-bottom)); }
.home-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.home-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #45534b; font-size: 21px; font-weight: 750; }
.home-brand small { display: block; font-size: 9px; letter-spacing: 2.4px; color: #8b9389; margin-top: 3px; font-weight: 500; }
.home-brand-icon { position: relative; display: grid; place-items: center; width: 45px; height: 45px; border-radius: 15px; background: #e4eadb; color: #788569; font-size: 24px; transform: rotate(-7deg); }
.home-brand-icon span { position: absolute; top: -7px; right: -6px; font-size: 16px; color: #c7aa74; }
.home-header-note { font-size: 12px; letter-spacing: 1px; color: #818b7a; }
.home-header-star { font-size: 31px; color: #c3cbb2; }
.home-hero { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; min-height: 505px; gap: 18px; padding: 25px 0 15px; }
.home-copy { z-index: 1; }
.home-kicker { font-size: 11px; letter-spacing: 1px; color: #83927a; display: inline-flex; align-items: center; gap: 7px; margin-bottom: 25px; }
.home-kicker > span { font-size: 17px; color: #adbc97; }
.home-copy h1 { font-size: clamp(42px, 4.8vw, 64px); line-height: 1.36; letter-spacing: 3px; font-weight: 750; color: #3e4c42; }
.home-title-world { position: relative; color: #869772; white-space: nowrap; }
.home-title-world svg { position: absolute; bottom: -8px; left: 0; width: 100%; height: 13px; fill: none; stroke: #d7c299; stroke-width: 4; stroke-linecap: round; }
.home-description { margin-top: 25px; font-size: 14px; line-height: 2; color: #758070; }
.home-start { display: inline-flex; align-items: center; gap: 32px; margin-top: 28px; padding: 16px 23px; min-height: 53px; border-radius: 17px; background: #8e9f7e; color: white; text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: 0 6px 14px #7a8d6e1a; transition: background .2s, transform .2s; }
.home-start:hover { background: #7d906c; transform: translateY(-2px); }
.home-start > span { font-size: 20px; }
.home-reassurance { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; font-size: 10px; color: #989f94; }
.home-reassurance > span { display: flex; align-items: center; gap: 5px; }
.home-dot { width: 6px; height: 6px; border-radius: 50%; }
.home-dot.mint { background: #b8c8b0; }.home-dot.peach { background: #dfbfa9; }.home-dot.lilac { background: #c6bdd6; }
.home-illustration { position: relative; height: 460px; min-width: 0; }
.home-scene { position: absolute; inset: 0 -25px; }
#homeCanvas { display: block; width: 100%; height: 100%; position: relative; opacity: 0; transition: opacity .5s; touch-action: pan-y; }
.scene-ready #homeCanvas { opacity: 1; }
.home-scene-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; perspective: 750px; }
.scene-ready .home-scene-fallback { visibility: hidden; }
.fallback-card { position: absolute; border: 6px solid #fff; border-radius: 23px; box-shadow: 10px 18px 26px #56634814, inset 0 0 0 1px #cad3bf; }
.fallback-letter { width: 145px; height: 180px; background: #e6e0ef; color: #afa0c1; padding-top: 35px; text-align: center; font-size: 58px; transform: translate(-115px,-55px) rotate(-18deg) rotateY(-12deg); }
.fallback-card small { display: block; font-size: 10px; font-weight: 400; margin-top: 12px; color: #86927d; }
.fallback-apple { width: 170px; height: 220px; background: #f2f4e8; text-align: center; transform: rotate(9deg) rotateY(-15deg); }
.fallback-apple > span { display: block; font-size: 68px; margin-top: 23px; }.fallback-apple strong { font-size: 26px; color: #6f855b; }
.fallback-hello { width: 120px; height: 150px; background: #f3e5d8; color: #b39274; text-align: center; font-size: 21px; padding-top: 22px; transform: translate(118px,65px) rotate(21deg); }
.fallback-hello > span { display: block; font-size: 42px; margin-top: 15px; }
.home-scene-label { position: absolute; bottom: 23px; left: 50%; transform: translateX(-50%) rotate(-3deg); white-space: nowrap; padding: 11px 17px; border: 1px solid #e5e5d8; border-radius: 25px; background: #ffffffe6; color: #89947d; font-size: 11px; box-shadow: 0 4px 15px #5c674607; pointer-events: none; }
.home-scene-label i { color: #c8b98e; font-style: normal; margin-right: 7px; }
.home-scene-hint { position: absolute; bottom: 1px; width: 100%; text-align: center; font-size: 9px; color: #a4ac9b; pointer-events: none; }
.home-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 5px; }
.home-path { position: relative; display: flex; align-items: center; gap: 19px; min-height: 140px; padding: 26px; text-decoration: none; border-radius: 25px; border: 1px solid #e4e8db; background: #eff2e8; color: #53634e; transition: transform .2s, box-shadow .2s; }
.home-path.path-letters { background: #f0edf4; border-color: #e6e1ed; color: #766b87; }
.home-path:hover { transform: translateY(-4px); box-shadow: 0 10px 20px #606b4910; }
.home-path-icon { flex: none; display: grid; place-items: center; width: 65px; height: 70px; border-radius: 19px; background: #ffffffb3; box-shadow: 3px 5px 0 #d9e0ce; font-size: 35px; color: #a2b08d; transform: rotate(-7deg); }
.path-letters .home-path-icon { font-size: 26px; color: #b0a0c5; box-shadow: 3px 5px 0 #e1dbe9; transform: rotate(7deg); }
.home-path-copy { min-width: 0; }.home-path-copy small { color: #a0aa94; font-size: 10px; }.path-letters small { color: #aca0b9; }
.home-path-copy h2 { font-size: 20px; font-weight: 650; margin: 6px 0; letter-spacing: 1px; }
.home-path-copy p { color: #78856e; font-size: 12px; line-height: 1.7; }.path-letters p { color: #897e97; }
.home-path-arrow { margin-left: auto; align-self: flex-start; font-size: 21px; color: #a5b394; }
.path-letters .home-path-arrow { color: #b9adca; }
.home-footer { display: flex; justify-content: space-between; margin-top: 33px; padding-top: 20px; border-top: 1px solid #e7e8de; font-size: 10px; color: #a0a697; letter-spacing: 1px; }
.home-library-back { display: grid; place-items: center; height: 36px; width: 36px; border-radius: 12px; background: white; color: #718966; font-size: 27px; text-decoration: none; }
.home-view a:focus-visible { outline: 3px solid #a3b88f; outline-offset: 5px; }
@media (max-width: 900px) { .home-shell { padding-inline: 32px; }.home-hero { min-height: clamp(465px, 58vh, 660px); }.home-copy h1 { font-size: 48px; }.home-illustration { height: 440px; }.home-path { padding: 23px 18px; gap: 15px; }.home-path-icon { width: 54px; height: 60px; }.home-path-arrow { display: none; } }
@media (max-width: 650px) {
  .home-shell { padding: max(19px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); }
  .home-header-note { display: none; }.home-brand { font-size: 18px; gap: 10px; }.home-brand-icon { width: 39px; height: 39px; font-size: 21px; }
  .home-header-star { font-size: 26px; }
  .home-hero { display: flex; flex-direction: column; min-height: 0; gap: 0; padding-top: 32px; padding-bottom: 20px; }
  .home-copy { text-align: center; width: 100%; }.home-kicker { margin-bottom: 15px; font-size: 10px; letter-spacing: .3px; }
  .home-copy h1 { font-size: clamp(37px, 10.6vw, 52px); letter-spacing: 2px; line-height: 1.3; }
  .home-description { font-size: 13px; margin-top: 18px; line-height: 1.9; }
  .home-start { margin-top: 20px; font-size: 13px; padding: 13px 22px; min-height: 47px; gap: 27px; }
  .home-reassurance { justify-content: center; margin-top: 16px; gap: 12px; font-size: 9px; }
  .home-illustration { width: 100%; height: clamp(275px, 82vw, 350px); margin-top: 5px; }
  .home-scene { inset: -15px -20px 0; }.home-scene-label { bottom: 20px; font-size: 10px; padding: 9px 13px; }.home-scene-hint { bottom: 0; font-size: 9px; }
  .home-paths { grid-template-columns: 1fr; gap: 12px; margin-top: 0; }
  .home-path { min-height: 115px; padding: 20px; border-radius: 22px; gap: 18px; }.home-path-icon { width: 55px; height: 59px; font-size: 32px; }
  .home-path-copy h2 { font-size: 18px; margin: 5px 0; }.home-path-copy p { font-size: 11px; }.home-path-copy small { font-size: 10px; }.home-path-arrow { display: block; font-size: 18px; }
  .home-footer { margin-top: 25px; padding-top: 17px; font-size: 9px; letter-spacing: 0; }
}
@media (prefers-reduced-motion: reduce) { .home-view *, .home-view *::before, .home-view *::after { transition: none !important; } }

/* 3D lives inside the existing library and alphabet homes, never a separate route. */
.home-view .home-shell { width: 100%; max-width: 1000px; padding-inline: 32px; }
.home-view .home-hero { min-height: 0; padding: 15px 0; grid-template-columns: 1fr 1fr; }
.home-view .home-copy h1 { font-size: clamp(28px, 3.5vw, 42px); letter-spacing: 1px; }
.home-view .home-title-world { display: block; margin-top: 6px; }
.home-view .home-kicker { margin-bottom: 15px; }
.home-view .home-description { margin-top: 15px; }
.home-view .home-illustration { height: 330px; }
.home-view .home-scene-label { bottom: 12px; }
.home-view .home-scene-hint { bottom: -8px; }
.home-view .library-main { padding: 20px 0 0; overflow: visible; }
.home-view .alphabet-entry { color: #746785; background: #ede8f2; border: 1px solid #ded5e7; box-shadow: 0 5px 0 #ded6e7; margin-bottom: 28px; }
.home-view .alphabet-entry-icon { background: #faf8fc; box-shadow: 3px 4px 0 #d7cbe3; transform: rotate(-7deg); }
.home-view .grade-card { border-color: #e2e7d9; box-shadow: 0 5px 0 #e0e5d7; }
body.alphabet-page { max-width: 820px; height: auto; min-height: 100dvh; overflow: auto; background: #f7f6f0; --brand: #8e7aa4; --brand-soft: #eee8f4; --bg: #f7f6f0; --muted: #8d8995; --line: #e9e4ed; --shadow: 0 6px 20px #65597009; }
.alphabet-hero { display: grid; grid-template-columns: 1fr 1.25fr; align-items: center; position: relative; min-height: 240px; margin: 0 20px 18px; border: 1px solid #e8e1ed; border-radius: 24px; padding: 25px; background: radial-gradient(ellipse at 80% 40%, #e7e3ef, transparent 65%), #f0edf4; }
.alphabet-hero h2 { font-size: 26px; color: #70617f; }
.alphabet-hero p { margin-top: 12px; color: #95889e; font-size: 13px; }
.alphabet-hero .home-kicker { font-size: 9px; color: #a092ad; margin-bottom: 12px; }
.alphabet-hero .home-scene { position: relative; inset: auto; height: 210px; min-width: 0; }
.alphabet-hero .home-scene-hint { bottom: 9px; }
.alphabet-page .alphabet-main { overflow: visible; }
.alphabet-page:has(.quiz-progress) .alphabet-hero { display: none; }
@media (max-width: 650px) {
  .home-view .home-shell { padding-inline: 20px; }
  .home-view .home-hero { display: flex; flex-direction: column; padding-top: 20px; gap: 0; }
  .home-view .home-copy { text-align: center; }
  .home-view .home-copy h1 { font-size: 25px; }
  .home-view .home-title-world { display: inline; }
  .home-view .home-kicker { font-size: 9px; line-height: 1.6; margin-bottom: 12px; }
  .home-view .home-description { font-size: 11px; }
  .home-view .home-reassurance { gap: 12px; justify-content: center; }
  .home-view .home-illustration { height: 230px; width: 100%; margin: 0; }
  .home-view .home-scene { inset: -5px -15px; }
  .home-view .home-scene-label { display: none; }
  .home-view .home-scene-hint { font-size: 8px; bottom: 0; }
  .alphabet-hero { min-height: 185px; padding: 15px; margin-bottom: 14px; }
  .alphabet-hero h2 { font-size: 21px; }
  .alphabet-hero p { font-size: 11px; line-height: 1.8; }
  .alphabet-hero .home-scene { height: 165px; }
}

/* The entry tiles themselves are the 3D scene; DOM keeps every link accessible. */
.home-view .home-shell { max-width: 860px; margin: 0 auto; padding-top: max(30px, env(safe-area-inset-top)); }
.home-view .home-header { justify-content: center; padding: 4px 0 26px; }
.wordcard-title { text-decoration: none; color: #606e60; }
.wordcard-title h1 { font-size: 26px; letter-spacing: 5px; font-weight: 650; }
.home-view .library-main { position: relative; padding: 10px 0 28px; isolation: isolate; overflow: visible; }
.home-view .home-shell > main { position: relative; isolation: isolate; }
.entry-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.home-view .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 22px; }
.home-view .alphabet-entry { border-radius: 25px; min-height: 116px; padding: 24px; margin-bottom: 32px; }
.home-view .alphabet-entry-icon { width: 62px; height: 62px; font-size: 29px; }
.home-view .grade-card { min-height: 175px; border-radius: 25px; padding: 25px 16px; gap: 13px; }
.home-view .grade-icon { width: 58px; height: 58px; border-radius: 18px; background: #edf0e7; color: #8f9c7f; box-shadow: 3px 4px 0 #e0e6d6; }
.home-view .grade-name { color: #4f5b4c; font-size: 19px; }
.home-view .grade-sub { color: #92998b; font-size: 13px; }
.home-view .grade-card.locked { opacity: 1; background: #f5f5ef; color: #929789; }
.home-view .grade-card.locked .grade-name { color: #94998b; }
.home-view .grade-card.locked .grade-icon { color: #b3bca6; background: #edf0e7; }
.home-view .grade-card.locked .grade-sub { color: #a8ad9f; }
.home-view .lib-hint { margin: 16px 0 23px; color: #92998b; }
.home-view .entry-3d-ready .alphabet-entry, .home-view .entry-3d-ready .grade-card, .home-view .entry-3d-ready .grade-card.locked, .home-view .entry-3d-ready .unit-card { background: transparent; border-color: transparent; box-shadow: none; }
.home-view .grade-card, .home-view .alphabet-entry, .home-view .unit-card { position: relative; transform-style: preserve-3d; touch-action: pan-y; transition: transform .22s ease; }
.home-view .grade-card:not(.locked):hover .grade-icon { transform: translateY(-3px) rotate(-5deg); }
.home-view .alphabet-entry:hover .alphabet-entry-icon { transform: rotate(-12deg) translateY(-3px); }
.home-view .grade-icon, .home-view .alphabet-entry-icon { transition: transform .22s ease; }
.home-view .grade-card:active, .home-view .unit-card:active { transform: translateY(3px); }
.home-view button:focus-visible { outline: 3px solid #a3b88f; outline-offset: 6px; }
@media (max-width: 650px) {
  .home-view .home-shell { padding-inline: 22px; }
  .wordcard-title h1 { font-size: 23px; letter-spacing: 4px; }
  .home-view .home-header { padding-bottom: 22px; }
  .home-view .alphabet-entry { padding: 18px; gap: 12px; min-height: 108px; }
  .home-view .alphabet-entry strong { font-size: 18px; }
  .home-view .alphabet-entry small { font-size: 11px; }
  .home-view .alphabet-entry-arrow { font-size: 12px; }
  .home-view .alphabet-entry-icon { width: 52px; height: 56px; font-size: 26px; }
  .home-view .lib-grid { gap: 22px 17px; }
  .home-view .grade-card { min-height: 168px; padding: 23px 12px; }
  .home-view .grade-name { font-size: 18px; }
}

.integrated-illustration { position: relative; height: 285px; max-width: 520px; margin: -20px auto 5px; }
.home-view .integrated-illustration .home-scene { inset: 0; }
.alphabet-hero { display: block; padding: 0; background: transparent; border: 0; }
.alphabet-hero .home-scene { height: 230px; }
.home-view .entry-3d-ready .grade-card, .home-view .entry-3d-ready .alphabet-entry, .home-view .entry-3d-ready .unit-card { transition: none; }
.home-view .lib-grid { gap: 30px 22px; }
@media (max-width: 650px) {
  .integrated-illustration { height: 235px; margin-top: -20px; }
  .home-view .lib-grid { gap: 28px 17px; }
  .alphabet-hero .home-scene { height: 200px; }
}
