/* 首页 */
/* 2026-11-01 首页列表滚动：页面固定一屏、本身不滚动；专题、考点精讲、按教材的列表只在自身区域内上下滚动，右侧地球与页脚始终在原位 */
html:has(body.home) { height: 100%; overflow: hidden; }
body.home { height: 100%; overflow: hidden; background: radial-gradient(90% 80% at 72% 48%, #0c1b33 0%, #070f1e 48%, #050b16 100%); }
.home-wrap { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; max-width: 1680px; margin: 0 auto; padding: 0 56px; }
.home-top { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.home-top-note { font-size: 13px; color: var(--muted); }
.home-main { display: grid; grid-template-columns: minmax(520px, 0.9fr) 1.1fr; grid-template-rows: minmax(0, 1fr); align-items: center; gap: 24px; min-height: 0; }

.intro { grid-area: 1 / 1; position: relative; z-index: 2; padding: 12px 0 24px; display: flex; flex-direction: column; max-height: 100%; min-height: 0; box-sizing: border-box; }
.wordmark { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(52px, 5.2vw, 84px); line-height: 1.08; letter-spacing: 0.06em; }
/* 英文字标（Cormorant Garamond Italic 500，只进首页字体）：中文标题与简介之间的总间距不变，
   英文行的“上边距 + 行高（1em）”等于原来的 30.2 / 23.1 / 20 像素（原为 14 + 16.2、8 + 15.1、6 + 14），各档只在这段空间里分配 */
.wordmark-en { display: block; margin-top: 8.2px; font-family: 'STDisplay', var(--serif); font-style: italic; font-weight: 500; font-size: 22px; line-height: 1; letter-spacing: 0.015em; color: var(--muted); }
.intro-text { max-width: 30em; margin: 20px 0 22px; font-size: 16px; line-height: 1.9; color: var(--text-2); }

.topics { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 640px; }
/* 专题与考点精讲两个列表叠在同一格里，切换时版面高度不变 */
.home-lists { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); flex: 0 1 auto; min-height: 0; max-width: 640px; }
.home-lists > nav { grid-area: 1 / 1; align-self: start; max-height: 100%; min-height: 0; transition: opacity 0.25s; }
/* 列表放不下时在自身区域内滚动：细而半透明的滚动条（悬停稍明显），下面还有内容时底部轻微渐隐（main.js 加 can-more） */
.home-lists > nav.topics { overflow-y: auto; overscroll-behavior: contain; }
.home-lists > nav.topics, .tb-books, .tb-sections { scrollbar-width: thin; scrollbar-color: rgba(160, 195, 230, 0.16) transparent; transition: opacity 0.25s, scrollbar-color 0.2s; }
.home-lists > nav.topics:hover, .tb-books:hover, .tb-sections:hover { scrollbar-color: rgba(160, 195, 230, 0.34) transparent; }
.home-lists .can-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), rgba(0, 0, 0, 0.25)); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), rgba(0, 0, 0, 0.25)); }
.home-lists > nav.is-off { visibility: hidden; opacity: 0; pointer-events: none; }
/* “专题 | 考点精讲”切换（样式同专题页的分段控件） */
.home-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 640px; margin-bottom: 12px; }
.home-tabs { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.home-tabs button { border: 0; background: none; height: 32px; padding: 0 18px; border-radius: 999px; color: var(--muted); font-size: 14px; white-space: nowrap; transition: color 0.2s, background 0.25s; }
.home-tabs button:hover { color: var(--text); }
.home-tabs button.on { background: var(--text); color: var(--ink); font-weight: 600; }
/* 专题与考点精讲每一行同一种样式（2026-10-23 局部修改：去掉“最新内容突出显示”）：序号、名称、一行简介、右侧“开始演示”；
   鼠标移上去时简介原位换成模块按钮（两者叠在同一格里，行高不变） */
.topic { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 4px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
/* 分组的小字分隔（人文地理）：不改各行的样式 */
.t-group { padding: 12px 4px 4px 4px; font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); border-bottom: 1px solid var(--line); }
.topic.is-open { cursor: pointer; }
.t-no { font-family: var(--num); font-size: 12px; color: var(--faint); letter-spacing: 0.04em; }
.t-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-name { align-self: flex-start; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.3; white-space: nowrap; color: var(--text-2); text-decoration: none; }
.topic.is-open .t-name { color: var(--text); }
.t-line { display: grid; height: 21px; min-width: 0; }
.t-desc, .t-mods { grid-area: 1 / 1; align-self: center; min-width: 0; transition: opacity 0.18s, visibility 0.18s; }
.t-desc { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-mods { display: flex; gap: 6px; overflow: hidden; opacity: 0; visibility: hidden; }
.topic.is-open:hover .t-desc, .topic.is-open:focus-within .t-desc { opacity: 0; visibility: hidden; }
.topic.is-open:hover .t-mods, .topic.is-open:focus-within .t-mods { opacity: 1; visibility: visible; }
.t-mods a { flex: 0 1 auto; min-width: 0; height: 21px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; line-height: 19px; color: var(--text-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color 0.2s, color 0.2s; }
.t-mods a:hover { color: var(--text); border-color: rgba(242, 196, 109, 0.5); }
.t-soon { font-size: 12px; color: var(--faint); }
/* 已上线专题的“开始演示”按钮：统一用阳光金实心按钮（首页按钮是“阳光金只用于太阳与白昼”的例外，用户确认） */
.t-go { display: inline-flex; align-items: center; height: 34px; padding: 0 18px; border-radius: 999px; background: var(--sun); color: #1a1205; font-size: 14px; font-weight: 600; text-decoration: none; transition: background 0.2s, transform 0.2s; }
.topic.is-open:hover .t-go { background: #f7d48d; transform: translateX(2px); }
.topic.is-open:hover .t-name { color: #fff; }

/* 全站搜索框（样式在 base.css）：在标签右侧，结果列表浮在下方 */
.home-search { position: relative; flex: 0 1 260px; min-width: 180px; }
.home-search .search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 72px)); max-height: min(60vh, 520px); }

/* 按教材：铺满左右两栏（地球淡出），左列书与章，右侧所选章的各节；高度与专题列表相同，内容多时页内滚动 */
body[data-tab="textbook"] .intro { grid-column: 1 / 3; }
body[data-tab="textbook"] .home-lists { max-width: none; }
body.ready[data-tab="textbook"] .globe { opacity: 0.22; }
body[data-tab="textbook"] .globe-caption { visibility: hidden; }
.home-lists > nav.textbook { position: absolute; inset: 0; align-self: stretch; display: grid; grid-template-columns: 250px 1fr; grid-template-rows: minmax(0, 1fr); border-top: 1px solid var(--line); background: rgba(6, 13, 26, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tb-books { overflow-y: auto; padding: 8px 12px 12px 0; border-right: 1px solid var(--line); }
.tb-book + .tb-book { margin-top: 6px; }
.tb-book-name { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 7px 4px; color: var(--text-2); font-family: var(--serif); font-weight: 600; font-size: 15px; text-align: left; }
.tb-book-name::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-2px, -1px); transition: transform 0.2s; }
.tb-book.is-folded .tb-book-name::before { transform: rotate(-45deg); }
.tb-book.is-folded .tb-chapters { display: none; }
.tb-book-name:hover { color: var(--text); }
.tb-chapter { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 8px 5px 16px; border-radius: var(--r-sm); color: var(--muted); font-size: 13.5px; text-align: left; transition: background 0.2s, color 0.2s; }
.tb-chapter:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tb-chapter.on { color: var(--text); background: var(--sky-soft); }
.tb-ch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-count { flex: none; font-family: var(--num); font-size: 11.5px; color: var(--faint); }
.tb-count.is-none { font-family: var(--sans); font-size: 11px; }
.tb-sections { overflow-y: auto; padding: 10px 4px 14px 22px; }
.tb-ch-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 2px 0 10px; }
.tb-ch-title b { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--text); }
.tb-ch-title span { font-size: 12.5px; color: var(--faint); }
.tb-sec { display: grid; grid-template-columns: minmax(150px, 0.34fr) 1fr; gap: 12px; align-items: start; padding: 9px 8px; border-top: 1px solid var(--line); border-radius: var(--r-sm); transition: background 0.6s; }
.tb-sec.is-hit { background: var(--sky-soft); }
.tb-sec-name { font-size: 14px; line-height: 1.6; color: var(--text); padding-top: 2px; }
.tb-sec-no { display: block; font-size: 12px; color: var(--faint); }
.tb-items { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; line-height: 1.45; text-decoration: none; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.tb-kind { font-family: var(--num); font-size: 11px; white-space: nowrap; }
.tb-item.is-topic { color: var(--text-2); border: 1px solid var(--line-2); }
.tb-item.is-topic .tb-kind { color: var(--faint); }
.tb-item.is-topic:hover { color: var(--text); border-color: rgba(160, 195, 230, 0.5); }
.tb-item.is-exam { color: var(--text-2); border: 1px solid transparent; background: var(--sky-soft); }
.tb-item.is-exam .tb-kind { color: var(--sky); }
.tb-item.is-exam:hover { color: var(--text); border-color: rgba(143, 195, 227, 0.45); }
.tb-none { padding: 4px 0; font-size: 13px; color: var(--faint); }

/* 课时路线（第三期 32）：标签与搜索框一行右端的“预设路线 / 我的路线”（只在“按教材”时显示）、每节的“上这一节”、两个视图 */
.tb-lessons { display: none; align-items: center; gap: 6px; margin-left: auto; }
body[data-tab="textbook"] .tb-lessons { display: flex; }
body[data-tab="textbook"] .home-bar { max-width: none; justify-content: flex-start; }
.tb-lessons-name { margin-right: 2px; font-size: 12.5px; color: var(--faint); }
.tb-lesson-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; text-decoration: none; transition: border-color 0.2s, background 0.2s, color 0.2s; white-space: nowrap; }
.tb-lesson-tab:hover { color: var(--text); border-color: rgba(160, 195, 230, 0.45); }
.tb-lesson-tab.on { color: var(--text); background: var(--sky-soft); border-color: rgba(143, 195, 227, 0.45); }
.tb-lesson-tab .tb-count:empty { display: none; }
/* [41-0-01] 题库入口：各个标签下都在这一行最右端 */
.home-bank { flex: none; }
body[data-tab="textbook"] .home-bank { margin-left: 4px; }
body:not([data-tab="textbook"]) .home-search { margin-left: auto; }
.tb-lesson { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.6; color: var(--sky); text-decoration: none; border: 1px solid rgba(143, 195, 227, 0.35); transition: background 0.2s, border-color 0.2s; }
.tb-lesson::before { content: ''; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.tb-lesson:hover { background: var(--sky-soft); border-color: rgba(143, 195, 227, 0.6); }
.tb-sec-name .tb-lesson { display: flex; width: fit-content; max-width: 100%; }
.lr-head { align-items: center; }
.lr-head-tools { display: flex; gap: 6px; margin-left: auto; }
.lr-head .btn, .lr-acts .btn, .lr-pacts .btn { text-decoration: none; }
.lr-empty { padding: 18px 2px; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.lr-empty p { margin: 0 0 6px; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 4px; font: 500 12px/18px var(--num); text-align: center; color: var(--text); background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12); }
.lr-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.lr-list { display: flex; flex-direction: column; gap: 2px; }
.lr-route { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; color: var(--text-2); }
.lr-route:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.lr-route.on { background: var(--sky-soft); color: var(--text); }
.lr-route-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.5; }
.lr-route-meta { font-size: 11.5px; color: var(--faint); }
.lr-editor { min-width: 0; }
.lr-title, .lr-sec, .lr-min, .lr-ptitle, .lr-pnote { border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; outline: 0; transition: border-color 0.2s, background 0.2s; }
.lr-title:hover, .lr-ptitle:hover, .lr-pnote:hover, .lr-sec:hover, .lr-min:hover { border-color: var(--line-2); }
.lr-title:focus, .lr-ptitle:focus, .lr-pnote:focus, .lr-sec:focus, .lr-min:focus { border-color: rgba(143, 195, 227, 0.55); background: rgba(255, 255, 255, 0.04); }
.lr-title { width: 100%; padding: 2px 8px; margin-left: -8px; font-family: var(--serif); font-weight: 600; font-size: 19px; }
.lr-meta { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px -8px; font-size: 13px; color: var(--muted); }
.lr-sec { max-width: 360px; padding: 3px 6px; color: var(--text-2); font-size: 13px; }
.lr-sec option { background: #0f1d33; }
.lr-min { width: 64px; padding: 3px 6px; color: var(--text-2); font-size: 13px; font-family: var(--num); }
.lr-unit { color: var(--faint); }
.lr-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lr-acts .lr-play, .lr-preset .lr-play { color: var(--sky); border-color: rgba(143, 195, 227, 0.45); }
.lr-acts .lr-play::before { content: ''; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.lr-danger:hover { color: var(--warm); border-color: rgba(232, 149, 107, 0.5); }
.lr-pages { list-style: none; margin: 12px 0 0; padding: 0; }
.lr-page { display: grid; grid-template-columns: 16px 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 4px; border-top: 1px solid var(--line); border-radius: var(--r-sm); }
.lr-page.is-drag { opacity: 0.45; }
.lr-page.is-over { background: var(--sky-soft); }
.lr-handle { display: flex; padding-top: 7px; color: var(--faint); cursor: grab; user-select: none; }
.lr-handle:hover { color: var(--text-2); }
.lr-pno { width: 24px; height: 24px; margin-top: 3px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--num); background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.lr-pmain { display: flex; flex-direction: column; min-width: 0; }
.lr-ptitle { padding: 2px 6px; margin-left: -6px; font-size: 14.5px; }
.lr-pkind { padding: 0 0 2px; font-size: 12px; color: var(--muted); }
.lr-pnote { resize: vertical; min-height: 26px; padding: 2px 6px; margin-left: -6px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.lr-pnote::placeholder, .lr-ptitle::placeholder, .lr-min::placeholder { color: var(--faint); }
.lr-pacts { display: flex; gap: 4px; padding-top: 2px; opacity: 0.55; transition: opacity 0.2s; }
.lr-page:hover .lr-pacts, .lr-page:focus-within .lr-pacts { opacity: 1; }
.lr-pacts .btn { height: 26px; padding: 0 9px; font-size: 12px; }
.lr-pacts .btn.icon { width: 26px; padding: 0; }
.lr-pacts .btn:disabled { opacity: 0.35; cursor: default; }
.lr-tip, .lr-note-empty { font-size: 13px; color: var(--faint); }
.lr-preset { grid-template-columns: minmax(170px, 0.3fr) 1fr; }
.lr-preset .tb-sec-name { font-family: var(--serif); font-weight: 600; font-size: 15px; }
.lr-preset .tb-sec-no { font-family: var(--sans); font-weight: 400; }
.lr-preset-pages { margin: 2px 0 6px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.lr-preset-meta { margin-right: 4px; font-size: 12px; color: var(--faint); }
.home-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; padding: 8px 16px; border-radius: 999px; font-size: 13px; white-space: nowrap; background: rgba(6, 13, 26, 0.94); box-shadow: inset 0 0 0 1px rgba(143, 195, 227, 0.45), 0 12px 32px rgba(0, 0, 0, 0.4); }

.hero-globe { grid-area: 1 / 2; position: relative; height: min(76vh, 820px); min-height: 520px; }
.globe { position: absolute; inset: -6% -10% -6% -4%; opacity: 0; transition: opacity 1.4s ease 0.15s; cursor: grab; }
.globe:active { cursor: grabbing; }
body.ready .globe { opacity: 1; }
.globe canvas { display: block; }
.globe.no-gl { display: none; }
.globe-caption { position: absolute; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; pointer-events: none; text-shadow: 0 1px 8px rgba(3, 7, 15, 0.9), 0 0 2px rgba(3, 7, 15, 0.8); }
.globe-caption b { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--text); }
.globe-caption span { font-family: var(--num); font-size: 12.5px; color: var(--muted); }

.home-foot { display: flex; justify-content: center; align-items: baseline; white-space: nowrap; padding: 20px 0 26px; font-size: 12px; line-height: 1.6; color: var(--faint); }
.home-foot > * + *::before { content: '·'; margin: 0 9px; font-family: var(--num); color: var(--faint); }
.home-foot a { color: inherit; text-decoration: none; transition: color 0.2s; }
.home-foot a:hover { color: var(--muted); }
.home-foot .foot-beian { display: inline; }
.foot-copy, .foot-ver { font-family: var(--num); }
.foot-ver:empty { display: none; }

/* 较矮的屏（教室投影 720、768 高，常见笔记本 900 高）：收紧纵向间距，十一个专题一屏放下（2026-10-29 专题 11 验收时再收紧一档） */
@media (max-height: 920px) {
  .home-top { height: 64px; }
  .home-bar { margin-bottom: 10px; }
  .home-tabs button { height: 30px; }
  .search-box { height: 32px; }
  .intro { padding: 4px 0 12px; }
  .wordmark { font-size: clamp(44px, 4.4vw, 64px); }
  .wordmark-en { margin-top: 3.1px; font-size: 20px; }
  .intro-text { margin: 16px 0 22px; font-size: 15px; line-height: 1.8; }
  .topic { padding: 2px 4px; }
  .t-name { font-size: 17px; line-height: 1.2; }
  .t-line { height: 21px; }
  .t-go { height: 32px; padding: 0 17px; }
  .hero-globe { min-height: 440px; }
  .home-foot { padding: 12px 0 16px; }
}
/* 更矮的屏（720、768 高）：十一个专题与页脚仍一屏放下 */
@media (max-height: 800px) {
  .home-top { height: 52px; }
  .home-bar { margin-bottom: 6px; }
  .home-tabs button { height: 28px; padding: 0 16px; font-size: 13px; }
  .home-search .search-box { height: 30px; }
  .tb-sec { padding: 6px 8px; }
  .tb-books { padding-top: 4px; padding-bottom: 6px; }
  .tb-book + .tb-book { margin-top: 0; }
  .tb-book-name { padding: 4px 4px; font-size: 14.5px; }
  .tb-chapter { padding: 2px 8px 2px 16px; font-size: 13px; }
  .tb-item { padding: 3px 10px; font-size: 12.5px; }
  .wordmark { font-size: 40px; }
  .wordmark-en { margin-top: 3px; font-size: 17px; }
  .intro-text { margin: 8px 0 10px; font-size: 14px; line-height: 1.75; }
  .topic { padding: 2px 4px; }
  .t-body { gap: 0; }
  .t-name { font-size: 16px; line-height: 1.2; }
  .t-line { height: 19px; }
  .t-desc { font-size: 12.5px; }
  .t-mods a { height: 18px; line-height: 16px; padding: 0 9px; font-size: 12px; }
  .t-go { height: 28px; padding: 0 15px; font-size: 13px; }
  .home-foot { padding: 6px 0 10px; }
}
/* 720 高（1280×720 等）：十一个专题与页脚一屏放下 */
@media (max-height: 740px) {
  .topic { padding: 1px 4px; }
  .t-name { font-size: 15.5px; }
  .t-line { height: 18px; }
}
@media (max-width: 1280px) {
  .home-wrap { padding: 0 36px; }
  .home-main { grid-template-columns: minmax(480px, 1fr) 0.9fr; }
  .home-lists > nav.textbook { grid-template-columns: 220px 1fr; }
  .home-tabs button { padding: 0 14px; }
}
