/* 首页：一个需求输入框 + 四个平级入口 + 更轻的复习；上课：接着学 + 课程列表 */

.home { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; padding: 0 clamp(20px, 5vw, 64px) 24px; }
.home-top { height: 68px; flex: none; display: flex; align-items: center; justify-content: space-between; max-width: 1120px; width: 100%; margin: 0 auto; }
.home-top-actions { display: flex; gap: 4px; }
.home-top-actions .icon-btn { color: var(--muted-on-env); }
.home-stage { position: relative; flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; padding-top: clamp(16px, 13vh, 132px); padding-bottom: 28px; }
.home-stage > * { flex-shrink: 0; }
.home-title { font: var(--t-display); letter-spacing: -.01em; margin: 0 0 22px 4px; }
.home-ask { position: relative; z-index: 2; }
.home-note { margin: 12px 4px 0; font: var(--t-caption); color: var(--muted-on-env); min-height: 20px; }
.home-note[data-tone="error"] { color: var(--danger); }

.home-entries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.entry {
  --h: 196px; position: relative; min-height: var(--h); text-align: left; padding: 22px 22px 18px; white-space: normal;
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--sh-paper);
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; overflow: hidden; font: var(--t-body);
}
.entry:active { transform: scale(.985); background: var(--paper); }
@media (hover: hover) and (pointer: fine) { .entry:not(:disabled):hover { background: var(--paper); box-shadow: var(--sh-paper-hover); } .entry:hover .go { transform: translateX(3px); } }
.entry-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--ink); background: var(--env); flex: none; }
.entry-icon .icon { width: 24px; height: 24px; stroke-width: 1.55; }
.entry-title { font: 600 20px/1.4 var(--font); margin-top: 18px; }
.entry-desc { color: var(--muted); font: var(--t-control); line-height: 1.6; margin-top: 4px; }
.entry-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: var(--t-caption); }
.entry-foot .go { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--control); color: var(--ink); transition: transform 260ms var(--ease-out); }
.entry-foot .go .icon { width: 16px; height: 16px; stroke-width: 1.9; }
.entry[data-pending="true"] .entry-icon { color: var(--muted); }
.entry[data-pending="true"] .entry-title { color: var(--ink-2); }
.pending-tag { display: inline-flex; align-items: center; gap: 6px; }
.pending-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); }

.home-foot { display: flex; margin-top: 18px; }
.review-link { min-height: 40px; padding: 0 14px 0 10px; margin-left: -4px; border-radius: 12px; background: transparent; color: var(--muted-on-env); }
.review-link .icon { width: 18px; height: 18px; }
.review-link .pending-tag { margin-left: 4px; font: var(--t-caption); }
@media (hover: hover) and (pointer: fine) { .review-link:not(:disabled):hover { background: var(--control-hover); color: var(--ink); } }

/* 筹备中入口：原位长出一张预告卡 */
.peek { position: absolute; z-index: 5; background: var(--float); border-radius: var(--r-card); box-shadow: var(--sh-float); padding: 18px 18px 16px 20px; }
.peek-head { display: flex; align-items: center; gap: 12px; }
.peek-head strong { font: 600 19px/1.4 var(--font); }
.peek-head .icon-btn { margin-left: auto; margin-right: -8px; width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
.peek-lines { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 10px; }
.peek-lines li { display: flex; align-items: center; gap: 12px; font: var(--t-body); color: var(--ink-2); }
.peek-lines .icon { color: var(--muted); }

@media (max-width: 900px) {
  .home-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry { --h: 168px; }
}
@media (max-width: 560px) {
  .home { padding: 0 16px 20px; }
  .home-title { font-size: 27px; margin-bottom: 16px; }
  .home-entries { gap: 12px; margin-top: 22px; }
  .entry { --h: 150px; padding: 16px; }
  .entry-title { font-size: 18px; margin-top: 12px; }
  .entry-desc { font-size: 13px; }
}
@media (max-height: 720px) and (min-width: 901px) {
  .entry { --h: 168px; }
  .home-entries { margin-top: 22px; }
  .home-stage { padding-top: clamp(12px, 8vh, 80px); }
}

/* ---------- 上课：课程页 ---------- */
.courses { position: absolute; inset: 0; display: flex; padding: 12px 12px 12px 0; }
@media (max-width: 560px) { .courses { padding: 8px; } }
.courses-paper { position: relative; flex: 1; min-width: 0; background: var(--paper); border-radius: var(--r-paper); box-shadow: var(--sh-paper); display: flex; flex-direction: column; overflow: hidden; }
.courses-head { min-height: 72px; flex: none; display: flex; align-items: center; gap: 16px; padding: 12px 20px 8px 28px; flex-wrap: wrap; }
.courses-head h1 { font: var(--t-title); margin: 0; }
.courses-head .spacer { flex: 1; }
.subjects { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--control); gap: 2px; }
.subjects button { min-height: 36px; height: 36px; padding: 0 14px; border-radius: 9px; background: transparent; color: var(--ink-2); }
.subjects button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--sh-touch); }
.subjects button[aria-pressed="true"][data-subject] { background: var(--subject-tint, var(--paper)); color: var(--subject, var(--ink)); }
.courses-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 28px 32px; }
.courses-cap { font: var(--t-caption); color: var(--muted); margin: 18px 0 10px; }
.courses-cap:first-child { margin-top: 6px; }
.continue {
  width: 100%; min-height: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; text-align: left; white-space: normal;
  padding: 20px 22px; border-radius: var(--r-card); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line), var(--sh-touch); font: var(--t-body);
}
.continue:active { transform: scale(.99); background: var(--paper); }
@media (hover: hover) and (pointer: fine) { .continue:not(:disabled):hover { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-paper); } }
.continue h2 { font: 600 19px/1.4 var(--font); margin: 0 0 6px; }
.continue .meta { display: flex; gap: 14px; align-items: center; color: var(--ink-2); font: var(--t-control); flex-wrap: wrap; }
.continue .bar { width: 160px; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.continue .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.continue .go { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.continue .go .icon { width: 20px; height: 20px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.course {
  position: relative; text-align: left; padding: 16px 18px; min-height: 124px; border-radius: 18px; background: var(--paper); white-space: normal;
  box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; font: var(--t-body);
}
.course:active { transform: scale(.985); background: var(--paper); }
@media (hover: hover) and (pointer: fine) { .course:not(:disabled):hover { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-touch); } }
.course .subj { font: var(--t-caption); color: var(--muted); }
.course h3 { font: 600 16px/1.45 var(--font); margin: 0; }
.course .desc { font: var(--t-caption); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course .state { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font: var(--t-caption); color: var(--ink-2); }
.course .state .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.course .state[data-s="doing"] .dot { background: var(--accent); }
.course[aria-current="true"] { box-shadow: inset 0 0 0 1.5px var(--accent-ring); }
.courses-empty { color: var(--muted); font: var(--t-body); padding: 24px 0; }
.course-error { margin: 0 0 12px; }

@media (max-width: 900px) {
  .courses-head { padding: 14px 16px 6px; gap: 10px; }
  .courses-head .subjects { order: 3; width: 100%; overflow-x: auto; }
  .courses-body { padding: 4px 16px 24px; }
  .continue .bar { width: 100px; }
}

#homeworkView { overflow-y: auto; }
