/* ============================================================
   Knowledge Index — tab toggle, book grids, section groupings
   ============================================================ */

/* ── View Toggle (单册 / 系列讲义 / 手记 tabs) ─────────────── */
.view-toggle {
  display: flex;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-4);
}
.view-toggle button {
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2) 0;
  padding-left: 14px;
  position: relative;
  transition: color 0.2s ease;
}
.view-toggle button:hover {
  color: var(--ink);
}
.view-toggle button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background 0.2s ease;
}
.view-toggle button.active {
  color: var(--ink);
}
.view-toggle button.active::before {
  background: var(--ink);
}

/* ── Tab panels ────────────────────────────────────────────── */
.view-single,
.view-series,
.view-notes {
  animation: fadeIn 0.25s ease;
}
.view-single.hidden,
.view-series.hidden,
.view-notes.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Notes grid (手记 tab) ─────────────────────────────────── */
.notes-grid {
  grid-template-columns: repeat(2, 1fr);
}
.notes-all-link {
  display: inline-block;
  margin-top: var(--space-5);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.notes-all-link:hover {
  color: var(--ink);
}

/* ── Book groupings (单册 tab: 独立阅读 / 课程教材) ────────── */
.standalone-section {
  margin-top: var(--space-8);
}
.standalone-section .section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.standalone-section--divided {
  padding-top: var(--space-8);
  border-top: 1px solid var(--line);
}

.section-note {
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-5);
  max-width: 640px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }
}
