:root {
  color-scheme: light;
  --bg: #edf1f6;
  --panel: #ffffff;
  --soft: #f6f8fb;
  --text: #172033;
  --muted: #667085;
  --line: #d7dee9;
  --accent: #2856b6;
  --accent_soft: #e8efff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); }
button, input { font: inherit; }

.homework_index {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.index_pane { min-width: 0; padding: 0 22px 48px; }
.long_term_pane { border-right: 1px solid var(--line); }
.daily_pane { background: var(--panel); }
.pane_header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0 -22px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  padding: 20px 22px 16px;
  backdrop-filter: blur(10px);
}
.long_term_pane .pane_header { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .12em; }
h1 { margin: 0; color: #143777; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; }
.total_badge { align-self: center; border-radius: 999px; background: var(--accent_soft); color: var(--accent); padding: 5px 10px; font-size: 12px; font-weight: 800; }
.tree_search {
  grid-column: 1 / -1;
  width: 100%; height: 38px; border: 1px solid #c9d2df; border-radius: 8px;
  background: #fff; color: var(--text); padding: 7px 10px; outline: none;
}
.tree_search:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent_soft); }
.view_switch { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.view_switch button { border: 1px solid #c9d2df; border-radius: 7px; background: #fff; color: var(--muted); padding: 7px 10px; cursor: pointer; }
.view_switch button.is_active { border-color: var(--accent); background: var(--accent_soft); color: var(--accent); font-weight: 800; }

.tree_root { display: grid; gap: 9px; }
.daily_view { display: none; }
.daily_view.is_active { display: grid; }
.tree_branch { border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .66); overflow: clip; }
.daily_pane .tree_branch { background: var(--soft); }
.tree_branch summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; cursor: pointer; font-weight: 760; list-style-position: inside; }
.tree_branch summary:hover { background: var(--accent_soft); color: #173d91; }
.tree_branch summary b { border-radius: 999px; background: #fff; color: var(--muted); padding: 2px 7px; font-size: 11px; }
.tree_children { display: grid; gap: 6px; border-top: 1px solid var(--line); padding: 8px; }
.tree_group { border-radius: 7px; background: #fff; }
.tree_group summary { padding: 8px 10px; color: #3d5177; font-size: 13px; }
.resource_link { display: flex; align-items: center; gap: 9px; min-width: 0; border: 1px solid transparent; border-radius: 7px; color: var(--text); padding: 7px 8px; text-decoration: none; }
.resource_link:hover { border-color: #a7bbe4; background: var(--accent_soft); }
.resource_type { flex: 0 0 auto; width: 46px; border-radius: 5px; background: #edf1f6; color: #475467; padding: 3px 4px; font-size: 9px; font-weight: 850; text-align: center; }
.resource_type_html { background: #e8efff; color: #17499e; }
.resource_type_md { background: #f0eaff; color: #6241a6; }
.resource_type_pdf { background: #fff0ee; color: #a3342a; }
.resource_type_image { background: #ecf8f0; color: #247142; }
.resource_text { display: grid; min-width: 0; }
.resource_text strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.resource_text small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.other_pages { display: grid; gap: 6px; margin-top: 18px; }
.other_pages h2 { margin: 0 0 3px; color: #29416f; font-size: 15px; }
.empty_state { color: var(--muted); font-size: 13px; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .homework_index { grid-template-columns: 1fr; }
  .long_term_pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane_header { position: static; }
}
