/* 注：颜色 token 由 css/skin.css 提供（必须先加载）
   这里只保留非颜色变量与模块特定 token */
:root {
  --study-bg: var(--bg);
  --study-card-radius: 12px;
  --study-shadow: 0 1px 2px var(--shadow-soft), 0 14px 34px var(--base-glow);
  --study-border: var(--border);
  --study-text-muted: var(--text-mid);
  --top-nav-line: var(--base-glow);
}

/* ===== Top navigation ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background:
    linear-gradient(90deg, var(--top-nav-bg) 0%, var(--top-nav-bg-mid) 54%, var(--top-nav-bg) 100%),
    var(--text);
  border-bottom: 1px solid var(--top-nav-line);
  box-shadow: 0 10px 28px var(--base-glow);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
}

.brand-mark {
  font-size: 22px;
  color: var(--base);
  text-shadow: 0 0 14px var(--base-glow);
}

.brand-name {
  font-size: 16px;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  /* overflow 必须 visible，否则 .nav-dropdown 的绝对定位子菜单会被裁掉 */
  overflow: visible;
}

.nav-link {
  color: var(--top-nav-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--top-nav-hover);
  color: #fff;
}

.nav-link.active {
  background: var(--base-gradient);
  color: #fff;
  box-shadow: 0 0 0 1px var(--top-nav-line-soft), 0 8px 22px var(--base-glow);
}

.nav-link.muted {
  color: var(--text-soft);
  pointer-events: none;
}

/* ===== Nav: 每日复盘 count badge ===== */
.nav-link-recap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-recap-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55);
  animation: navRecapDotPulse 1.8s ease-out infinite;
  flex: 0 0 auto;
}

@keyframes navRecapDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.nav-recap-count[hidden] {
  display: none;
}

/* ===== Nav: 「更多」下拉菜单 ===== */
.nav-dropdown {
  position: relative;
  flex-shrink: 0;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.nav-dropdown-toggle .caret {
  transition: transform 0.15s;
}
.nav-dropdown.open .nav-dropdown-toggle .caret {
  transform: rotate(180deg);
}
.nav-dropdown-toggle.active {
  background: var(--base-gradient);
  color: #fff;
  box-shadow: 0 0 0 1px var(--top-nav-line-soft), 0 8px 22px var(--base-glow);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--surface, #1a2332);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  z-index: 200;
}
.nav-dropdown-menu[hidden] {
  display: none;
}
.nav-dropdown-menu li {
  margin: 0;
  padding: 0;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--top-nav-text, #cfd8e3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.12s;
}
.nav-dropdown-item:hover {
  background: var(--top-nav-hover, rgba(255,255,255,0.08));
  color: #fff;
}
.nav-dropdown-item.active {
  background: var(--base-gradient, linear-gradient(135deg,#1e88ff,#00bcd4));
  color: #fff;
}

/* ===== 首页金句轮播（通知栏下方） ===== */
.quote-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  height: 56px;
  margin: 8px auto 4px;
  padding: 0 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
}
.quote-carousel-viewport {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  height: 56px;
  overflow: hidden;
}
.quote-carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.quote-carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 8px;
  cursor: pointer;
}
.quote-carousel-content {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text, #e8eef5);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quote-carousel-content::before { content: '"'; color: var(--base, #1e88ff); margin-right: 2px; }
.quote-carousel-content::after  { content: '"'; color: var(--base, #1e88ff); margin-left: 2px; }
.quote-carousel-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft, #8a98aa);
}
.quote-carousel-arrow {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.quote-carousel-arrow:hover {
  background: #e2e8f0;
  color: #1e88ff;
  border-color: #1e88ff;
}
.quote-carousel-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.quote-carousel-dots {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.quote-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border, rgba(255,255,255,0.15));
  transition: all 0.15s;
}
.quote-carousel-dot.active {
  background: var(--base, #1e88ff);
  width: 16px;
  border-radius: 3px;
}
.quote-carousel-empty {
  font-size: 13px;
  color: var(--text-muted, #8a98aa);
  text-align: center;
  padding: 8px;
}

/* ===== 首页 feed 轮播（金句 + 通知融合） ===== */
.feed-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  height: 64px;
  margin: 12px auto 12px;
  padding: 0 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
}
.feed-carousel:focus { outline: none; }

.feed-viewport {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  height: 64px;
  overflow: hidden;
}

.feed-track {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.feed-slide {
  flex: 0 0 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  cursor: pointer;
  position: relative;
}

.feed-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.type-quote    { background: var(--base-soft);  color: var(--base-text); }
.type-recap    { background: var(--base-soft);  color: var(--base-text); }
.type-analysis { background: var(--accent-soft); color: var(--accent-text); }
.type-biyang   { background: var(--accent-soft); color: var(--accent-text); }
.type-ai       { background: var(--base-soft);  color: var(--base-text); }

.feed-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.feed-content {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text, #e8eef5);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-content::before { content: '"'; color: var(--base, #1e88ff); margin-right: 2px; }
.feed-content::after  { content: '"'; color: var(--base, #1e88ff); margin-left: 2px; }
/* 金句外加双引号不太自然，对金句类型用普通样式 */
.feed-slide[data-type="quote"] .feed-content::before,
.feed-slide[data-type="quote"] .feed-content::after { content: none; }

.feed-meta {
  font-size: 11px;
  color: var(--text-soft, #8a98aa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-action {
  flex: 0 0 auto;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--base, #1e88ff);
  background: var(--base-soft, #e3f2fd);
  border: 1px solid var(--base, #1e88ff);
  border-radius: 14px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s, color 0.15s;
  pointer-events: none;
  white-space: nowrap;
}
.feed-slide:hover .feed-action,
.feed-slide:focus-within .feed-action {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.feed-action:hover {
  background: var(--base, #1e88ff);
  color: #fff;
}

.feed-arrow {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.feed-arrow:hover {
  background: #e2e8f0;
  color: #1e88ff;
  border-color: #1e88ff;
}
.feed-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.feed-dots {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.feed-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border, rgba(0,0,0,0.15));
  cursor: pointer;
  transition: all 0.18s;
}
.feed-dot.active {
  background: var(--base, #1e88ff);
  width: 14px;
  border-radius: 3px;
}

@media (max-width: 768px) {
  .feed-carousel { height: 60px; }
  .feed-viewport { height: 60px; }
  .feed-content  { font-size: 12px; }
  .feed-meta     { font-size: 10px; }
  .feed-arrow    { width: 28px; height: 28px; }
  .feed-action   { padding: 3px 9px; font-size: 11px; }
}
@media (max-width: 480px) {
  .feed-meta { display: none; }
  .feed-dots { display: none; }
}

.site-footer {
  width: 100%;
  max-width: 1280px;
  margin: 48px auto 0;
  padding: 0 20px 28px;
  color: var(--study-text-muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--base);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ===== Sections ===== */
.page-section {
  padding-top: 24px;
}

.study-section {
  padding-top: 32px;
}

/* ===== Hero ===== */
.study-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, var(--bg) 0%, #ffffff 60%);
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 28px;
}

.mascot-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--study-green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.study-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: 1px;
}

.study-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--study-green-deep);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 22px;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--down-glow);
}

.study-cta .arrow {
  font-size: 18px;
  line-height: 1;
}

.study-cta:hover {
  background: #14471c;
}

/* ===== Split hero card ===== */
.study-split-hero {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: 16px;
  overflow: hidden;
  margin: 24px 0 0;
  box-shadow: var(--study-shadow);
}

.study-split-left {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bg) 0%, #ffffff 70%);
  transition: filter 0.15s;
}

.study-split-left:not(.active) {
  filter: opacity(0.55);
}

.study-split-left:hover {
  filter: opacity(1);
}

.study-split-vline {
  width: 1px;
  background: var(--study-border);
  flex-shrink: 0;
}

.study-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 20px 28px;
  cursor: pointer;
  transition: background 0.15s, filter 0.15s;
}

.study-split-right:not(.active) {
  filter: opacity(0.55);
}

.study-split-right:hover {
  background: var(--base-soft);
  filter: opacity(1);
}

.study-split-right.active {
  background: var(--base-soft);
  filter: opacity(1);
}

.split-quote-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff0f0;
  border: 1px solid var(--base-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.split-quote-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--up);
  letter-spacing: 0.5px;
}

.split-quote-action {
  font-size: 13px;
  color: var(--up);
  opacity: 0.8;
  cursor: pointer;
}

.split-quote-action:hover {
  opacity: 1;
  text-decoration: underline;
}

.study-top-panel {
  padding-top: 8px;
}

/* ===== Blocks ===== */
.study-block {
  margin: 32px 0;
}

.study-block-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

.study-tabs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--study-border);
  padding-bottom: 8px;
}

.study-tab {
  background: none;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-mid);
  padding: 6px 4px;
  position: relative;
}

.study-tab .cnt {
  color: var(--text-soft);
  margin-left: 2px;
}

.study-tab.active {
  color: var(--study-green-deep);
  font-weight: 700;
}

.study-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 2px;
  background: var(--study-green-deep);
  border-radius: 1px;
}

/* ===== Cards ===== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.course-card {
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: var(--study-card-radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--study-shadow);
  border-color: #d6e6da;
}

.course-card .course-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 44px;
}

.course-card .course-summary {
  font-size: 12px;
  color: var(--study-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.course-card .course-progress {
  font-size: 12px;
  color: var(--study-green-deep);
  margin-top: auto;
  font-weight: 600;
}

.course-card .course-cover {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 12px;
}

.course-card .course-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 8px;
}

.course-card.processing {
  position: relative;
  overflow: hidden;
}

.course-card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--modal-overlay, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===== More section ===== */
.more-section {
  margin-top: 56px;
  border-top: 1px solid var(--study-border);
  padding-top: 32px;
  padding-bottom: 32px;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.more-card {
  background: #fff;
  border: 1px dashed var(--study-border);
  border-radius: var(--study-card-radius);
  padding: 18px;
  color: var(--study-text-muted);
}

.more-card.disabled {
  opacity: 0.85;
}

.more-emoji {
  font-size: 28px;
  margin-bottom: 8px;
}

.more-title {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 4px;
}

.more-desc {
  font-size: 12px;
}

/* ===== Upload modal ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  width: min(720px, 92vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-mid);
}

.upload-drop {
  background: linear-gradient(180deg, var(--bg), #ffffff);
  border: 1px dashed #c2dfc8;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
}

.upload-illust {
  font-size: 36px;
  margin-bottom: 8px;
}

.upload-tip-main {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-tip-sub {
  font-size: 12px;
  color: var(--study-text-muted);
  margin-bottom: 12px;
}

.upload-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--study-border);
  padding: 8px 16px;
  border-radius: 22px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.upload-pill:hover {
  border-color: var(--study-green);
  color: var(--study-green-deep);
}

.upload-pill[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.upload-list-title {
  margin: 18px 0 6px;
  color: var(--study-text-muted);
  font-size: 14px;
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 20px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--study-green-soft);
  border: 1px solid #d6e6da;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.upload-row .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-row .size {
  color: var(--study-text-muted);
  font-size: 12px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
}

.modal-hint {
  font-size: 12px;
  color: #f59e0b;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: 22px;
  padding: 8px 22px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.btn-primary-dark {
  background: var(--study-green-deep);
  border: 0;
  border-radius: 22px;
  padding: 8px 22px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
}

.btn-primary-dark:disabled {
  background: var(--text-soft);
  cursor: not-allowed;
}

/* ===== Course detail page ===== */
.course-page {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 0.55fr;
  gap: 16px;
  margin-top: 16px;
  min-height: calc(100vh - 140px);
  transition: grid-template-columns 0.25s ease;
}

.course-page.right-collapsed {
  grid-template-columns: 1.4fr 1.6fr 44px;
}

.course-page .panel {
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.course-page .panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* mind map (left) */
.mindmap-panel {
  position: relative;
}

.mindmap-toolbar {
  display: inline-flex;
  gap: 6px;
}

.mm-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--study-border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.mm-btn:hover {
  border-color: var(--study-green);
  color: var(--study-green-deep);
}

.mindmap-wrap {
  flex: 1;
  width: 100%;
  min-height: 460px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  position: relative;
}

.mindmap-hint {
  margin-top: 6px;
  text-align: center;
  color: var(--text-soft);
  font-size: 11px;
}

.mindmap-wrap svg {
  display: block;
  font-family: inherit;
  width: 100%;
  height: 100%;
}

.mindmap-node-rect {
  fill: #fff;
  stroke: #cbd5e1;
  rx: 6;
  ry: 6;
}

.mindmap-node-rect.root {
  fill: #1b5e20;
  stroke: #1b5e20;
}

.mindmap-node-rect.current {
  stroke: #2e7d32;
  stroke-width: 2;
  fill: #e8f5e9;
}

.mindmap-node-text {
  font-size: 12px;
  fill: var(--text);
}

.mindmap-node-text.root {
  fill: #fff;
  font-weight: 700;
}

.mindmap-edge {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 1.2;
}

/* center panel: course intro + study mode */
.center-panel {
  overflow: auto;
}

.center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.center-header .panel-title {
  font-size: 17px;
  flex: 1;
  margin: 0;
}

.study-mode-btn {
  background: var(--study-green-deep);
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.study-mode-btn:hover {
  background: #14471c;
}

/* study mode view */
.study-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.study-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--study-green-soft);
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

.study-idx {
  font-weight: 700;
  color: var(--study-green-deep);
  flex-shrink: 0;
}

.study-crumb {
  color: var(--study-text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-exit {
  background: transparent;
  color: var(--study-green-deep);
  border: 1px solid #c2dfc8;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
}

.study-exit:hover {
  background: #fff;
}

.study-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}

.study-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--study-green-deep);
}

.study-paragraph {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-mid);
  white-space: pre-wrap;
}

.study-paragraph-emph {
  color: var(--study-green-deep);
  font-weight: 600;
  background: var(--study-green-soft);
  padding: 10px 12px;
  border-radius: 8px;
}

.study-children {
  padding-left: 18px;
  line-height: 1.85;
}

.study-children .study-child-sum {
  color: var(--study-text-muted);
  font-size: 13px;
}

.study-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--study-border);
}

.study-nav .btn-ghost,
.study-nav .btn-primary-dark {
  flex: 1;
  max-width: 200px;
}

.study-nav .btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* right panel: collapsible */
.right-panel {
  position: relative;
  overflow: hidden;
}

.right-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--study-border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-toggle:hover {
  border-color: var(--study-green);
  color: var(--study-green-deep);
}

.right-content {
  padding-right: 28px;
}

.right-collapsed-label {
  display: none;
}

.course-page.right-collapsed .right-panel {
  padding: 16px 4px;
}

.course-page.right-collapsed .right-content {
  display: none;
}

.course-page.right-collapsed .right-collapsed-label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  color: var(--study-text-muted);
  font-size: 12px;
  letter-spacing: 4px;
  margin-top: 36px;
  text-align: center;
}

.course-page.right-collapsed .right-toggle {
  right: 50%;
  transform: translateX(50%);
}

.material-preview {
  margin-top: 12px;
  text-align: center;
  font-size: 36px;
  background: var(--bg);
  border-radius: 8px;
  padding: 24px;
  color: #cbd5e1;
}

/* recommend strip */
.recommend-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.recommend-strip .rec-card {
  background: linear-gradient(135deg, #fef3c7, #fce7f3);
  border-radius: 8px;
  padding: 16px;
  font-weight: 700;
  color: #7c2d12;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
}

/* knowledge card detail */
.card-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--study-border);
  margin-bottom: 16px;
}

.card-tab {
  background: none;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mid);
  padding: 8px 4px;
  cursor: pointer;
  position: relative;
}

.card-tab.active {
  color: var(--study-green-deep);
}

.card-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--study-green-deep);
  border-radius: 1px;
}

.card-tab .beta {
  font-size: 10px;
  color: #fff;
  background: #f59e0b;
  border-radius: 6px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.card-section {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.card-section h4 {
  font-size: 14px;
  margin: 16px 0 8px;
  color: var(--text);
}

.stage-block {
  background: #f3f7ff;
  border: 1px solid var(--base-soft);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.stage-tag {
  display: inline-block;
  background: var(--base-soft);
  color: var(--base-text);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.stage-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.stage-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.next-step-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.next-step-btn {
  background: var(--text);
  color: #fff;
  border: 0;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.flash-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

.flash-card-img {
  width: 100%;
  max-width: 720px;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.flash-card-body {
  text-align: center;
  margin-top: 12px;
  color: var(--text);
  font-size: 14px;
}

.flash-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.flash-nav button {
  border: 1px solid var(--study-border);
  background: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.flash-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* quiz */
.quiz-wrap {
  max-width: 720px;
  margin: 32px auto;
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: 12px;
  padding: 24px;
}

.quiz-progress {
  font-size: 14px;
  color: var(--study-text-muted);
  margin-bottom: 12px;
}

.quiz-stem {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.quiz-related {
  font-size: 12px;
  color: var(--study-text-muted);
  margin-bottom: 16px;
}

.quiz-related .chip {
  display: inline-block;
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 4px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-option {
  border: 1px solid var(--study-border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-option:hover {
  border-color: var(--study-green);
}

.quiz-option.selected {
  border-color: var(--study-green-deep);
  background: var(--study-green-soft);
}

.quiz-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
}

.quiz-option.wrong {
  border-color: var(--up);
  background: #fef2f2;
}

.quiz-option .key {
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}

.quiz-option .tick {
  margin-left: auto;
  color: #10b981;
  font-weight: 700;
}

.quiz-feedback {
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #065f46;
  margin-top: 12px;
}

.quiz-feedback.wrong {
  border-color: var(--base-border);
  background: #fef2f2;
  color: #991b1b;
}

.quiz-feedback strong {
  color: var(--study-green-deep);
}

.quiz-feedback.wrong strong {
  color: var(--up);
}

.quiz-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.quiz-actions .btn-primary-dark {
  min-width: 160px;
}

/* node learning page */
.node-page {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  margin-top: 16px;
}

.node-content {
  padding: 24px;
}

.node-content .breadcrumb {
  font-size: 12px;
  color: var(--study-text-muted);
  margin-bottom: 8px;
}

.node-content h2 {
  font-size: 22px;
  margin: 0 0 12px;
}

.node-content .section-head {
  font-weight: 700;
  margin: 16px 0 6px;
}

.knowledge-card-entry {
  background: #fffbeb;
  border: 1px dashed #fde68a;
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
  text-align: center;
}

.knowledge-card-entry .doc-ico {
  font-size: 28px;
  margin-bottom: 8px;
}

.entry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
}

.entry-pill.gen {
  background: #fde68a;
  color: #92400e;
}

/* common page chrome */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.toolbar-back {
  background: #fff;
  border: 1px solid var(--study-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.toolbar-title {
  font-size: 14px;
  color: var(--study-text-muted);
}

.toolbar-title b {
  color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .course-page,
  .course-page.right-collapsed {
    grid-template-columns: 1fr;
  }
  .right-panel .right-toggle {
    display: none;
  }
  .course-page.right-collapsed .right-content {
    display: block;
  }
  .node-page {
    grid-template-columns: 1fr;
  }
  .mindmap-wrap {
    min-height: 360px;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 10px 12px;
    gap: 12px;
  }
  .brand-name {
    font-size: 14px;
  }
  .nav-links {
    gap: 10px;
  }
  .nav-link {
    font-size: 12px;
    padding: 4px 6px;
  }
  .site-footer {
    margin-top: 28px;
    padding: 0 12px 24px;
    line-height: 1.7;
  }
  .study-hero {
    padding: 16px;
    gap: 16px;
  }
  .mascot-circle {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }
  .study-hero-title {
    font-size: 18px;
  }
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .course-card {
    padding: 12px;
    min-height: 180px;
  }
  .more-grid {
    grid-template-columns: 1fr 1fr;
  }
  .recommend-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .course-grid {
    grid-template-columns: 1fr;
  }
  .more-grid {
    grid-template-columns: 1fr;
  }
  .study-tabs {
    gap: 12px;
    font-size: 13px;
  }
}
