:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-sidebar: #0f0f18;
  --bg-input: #16162a;
  --border-color: #2a2a4a;
  --border-light: #3a3a5a;
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #686888;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --neon-blue: #00d4ff;
  --neon-green: #00ff88;
  --neon-purple: #b366ff;
  --neon-orange: #ff8800;
  --neon-pink: #ff0080;
  --neon-yellow: #ffd700;
  --danger: #ff4757;
  --success: #2ed573;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --transition: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes confetti { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(-40px) rotate(360deg); opacity: 0; } }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.95); } 100% { transform: scale(1); opacity: 1; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 5px var(--accent-glow); } 50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(108,92,231,0.1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes progressGlow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }

.header {
  background: var(--bg-secondary);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
  animation: slideUp 0.4s ease;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  animation: bounceIn 0.6s ease;
}

.logo-icon svg { width: 44px; height: 44px; border-radius: var(--radius); }

.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--text-primary), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-sub { font-size: 0.7rem; color: var(--text-secondary); }

.header-actions {
  flex: 1;
  max-width: 540px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--neon-purple); color: var(--neon-purple); animation: wiggle 0.4s ease; }

.search-box { flex: 1; position: relative; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-box input::placeholder { color: var(--text-secondary); }

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  padding: 4px 8px;
  transition: color var(--transition);
}

.search-clear:hover { color: var(--danger); }

.header-stats {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  animation: fadeIn 0.6s ease 0.3s both;
}

.header-stats span { color: var(--neon-blue); font-weight: 700; }

.section-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.4s ease 0.1s both;
}

.section-nav::-webkit-scrollbar { height: 0; }

.nav-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn svg { opacity: 0.6; transition: opacity var(--transition); }
.nav-btn:hover { color: var(--text-primary); }
.nav-btn:hover svg { opacity: 1; }

.nav-btn.active {
  color: var(--neon-blue);
  border-bottom-color: var(--neon-blue);
}

.nav-btn.active svg { opacity: 1; color: var(--neon-blue); }

.main-layout {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h, 110px));
  animation: fadeIn 0.5s ease 0.2s both;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 16px;
  overflow-y: scroll;
  max-height: calc(100vh - var(--header-h, 110px));
  position: sticky;
  top: var(--header-h, 110px);
  animation: slideInLeft 0.5s ease 0.3s both;
  scrollbar-width: thin;
}

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

.sidebar-header h3 { font-size: 1rem; color: var(--text-primary); }

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 90;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.sidebar-toggle:hover { transform: scale(1.1); }
.sidebar-toggle svg { width: 24px; height: 24px; color: #fff; }

.btn-small {
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-small:hover { border-color: var(--accent); color: var(--text-primary); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

.filter-group { margin-bottom: 16px; }
.filter-group-hidden { display: none; }

.tag-filter.filter-search-hidden,
.tag-filter.zero-count-hidden { display: none !important; }

.filter-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-arrow {
  font-size: 0.6rem;
  transition: transform 0.3s ease;
  cursor: pointer;
  padding: 2px 4px;
}

.toggle-arrow.collapsed { transform: rotate(-90deg); }

.filter-list { display: flex; flex-wrap: wrap; gap: 4px; transition: all 0.3s ease; }
.filter-list.collapsed { display: none; }

.learning-path {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.path-btn {
  flex: 1;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.path-btn svg { flex-shrink: 0; }

.path-btn:hover, .path-btn.active {
  border-color: var(--neon-green);
  color: var(--neon-green);
  background: rgba(0, 255, 136, 0.08);
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag-filter:hover { border-color: var(--accent); color: var(--text-primary); transform: translateY(-1px); }

.tag-filter.zero-count { opacity: 0.35; }
.tag-filter.zero-count:hover { opacity: 0.6; }

.tag-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: bounceIn 0.3s ease;
}

.tag-filter .tag-count {
  background: rgba(255,255,255,0.15);
  padding: 0 5px;
  border-radius: 8px;
  font-size: 0.65rem;
}

.progress-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.progress-trophy {
  text-align: center;
  margin-bottom: 8px;
}

.progress-trophy svg { width: 48px; height: 48px; }

.progress-bar-container {
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
  margin: 8px 0;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--neon-blue), var(--neon-green));
  background-size: 200% 100%;
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  position: relative;
  animation: shimmer 3s linear infinite;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s linear infinite;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.content {
  flex: 1;
  padding: 20px 24px;
  min-width: 0;
}

.content-header { margin-bottom: 16px; }

.course-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 12px;
}

.course-search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}

.course-search-bar input::placeholder { color: var(--text-muted); }

.course-search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.seen-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.seen-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.seen-filter-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.seen-filter-btn:hover {
  border-color: var(--neon-blue);
  color: var(--text-primary);
}

.seen-filter-btn.active {
  background: var(--neon-blue);
  border-color: var(--neon-blue);
  color: #fff;
}

.seen-filter-btn.active svg {
  color: #fff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.breadcrumb-item { cursor: pointer; transition: color var(--transition); }
.breadcrumb-item:hover { color: var(--neon-blue); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-muted); }

.results-info { font-size: 0.8rem; color: var(--text-secondary); }

.course-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(108,92,231,0.04) 50%, transparent 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 12px;
  background: var(--border-color);
  border-radius: 6px;
  margin-bottom: 10px;
  opacity: 0.4;
}

.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w30 { width: 30%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.h20 { height: 20px; margin-bottom: 14px; }
.skeleton-line.h16 { height: 16px; }

.skeleton-flex {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-color);
  opacity: 0.3;
  flex-shrink: 0;
}

.skeleton-tags {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.skeleton-tag {
  height: 20px;
  width: 60px;
  background: var(--border-color);
  border-radius: 10px;
  opacity: 0.3;
}

.skeleton-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.skeleton-lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.skeleton-lesson-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(108,92,231,0.04) 50%, transparent 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-hidden { display: none !important; }

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 1;
  animation: fadeIn 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}


.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--neon-blue));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.course-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(108,92,231,0.05), transparent);
  transition: left 0.6s ease;
}

.course-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.25);
  cursor: pointer;
}

.course-card:hover::before { opacity: 1; }
.course-card:hover::after { left: 100%; }

.course-card-left {
  flex-shrink: 0;
  text-align: center;
  min-width: 48px;
}

.course-card-icon { font-size: 1.6rem; margin-bottom: 4px; }

.course-card-section {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.course-card-center {
  flex: 1;
  min-width: 0;
}

.course-card-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--text-muted);
}

.course-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.course-card-summary {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.lesson-count {
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--neon-blue);
  font-weight: 600;
}

.course-progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.course-progress-text {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-align: right;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.course-tag {
  padding: 2px 6px;
  background: rgba(108, 92, 231, 0.15);
  border-radius: 8px;
  font-size: 0.65rem;
  color: var(--accent-light);
  transition: background var(--transition);
}

.course-card:hover .course-tag { background: rgba(108, 92, 231, 0.25); }

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.lesson-course-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  opacity: 0.7;
}

.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  animation: fadeIn 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lesson-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.2);
  transform: translateY(-2px);
}

.lesson-card.is-read {
  border-left: 3px solid var(--success);
}

.lesson-read-badge {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.lesson-read-badge.read {
  background: rgba(46, 213, 115, 0.12);
  color: var(--success);
}

.lesson-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.lesson-tag-count, .lesson-kp-count, .lesson-has-transcript {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 8px;
}

.lesson-open-hint {
  margin-left: auto;
  color: var(--accent);
  opacity: 0.5;
  transition: opacity var(--transition);
}

.lesson-card:hover .lesson-open-hint {
  opacity: 1;
}

.lesson-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.lesson-number {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.lesson-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
}

.lesson-read-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-read-btn:hover { border-color: var(--success); color: var(--success); transform: scale(1.15); }
.lesson-read-btn.read { background: var(--success); border-color: var(--success); color: #fff; animation: pulse 0.4s ease; }

.lesson-summary {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.lesson-tag {
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lesson-tag:hover { transform: translateY(-1px); filter: brightness(1.4); }
.lesson-tag.process { background: rgba(0, 212, 255, 0.12); color: var(--neon-blue); }
.lesson-tag.step { background: rgba(0, 255, 136, 0.12); color: var(--neon-green); }
.lesson-tag.technique { background: rgba(179, 102, 255, 0.12); color: var(--neon-purple); }
.lesson-tag.topic { background: rgba(255, 136, 0, 0.12); color: var(--neon-orange); }

.lesson-expand-btn {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.lesson-expand-btn:hover { color: var(--text-primary); }

.lesson-details {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-details.open {
  max-height: 600px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  overflow-y: auto;
}

.lesson-details h4 {
  font-size: 0.78rem;
  color: var(--neon-blue);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lesson-details ul { list-style: none; margin-bottom: 12px; }

.lesson-details li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 14px;
  position: relative;
  opacity: 0;
  animation: slideUp 0.3s ease forwards;
}

.lesson-details.open li:nth-child(1) { animation-delay: 0.05s; }
.lesson-details.open li:nth-child(2) { animation-delay: 0.1s; }
.lesson-details.open li:nth-child(3) { animation-delay: 0.15s; }
.lesson-details.open li:nth-child(4) { animation-delay: 0.2s; }
.lesson-details.open li:nth-child(5) { animation-delay: 0.25s; }

.lesson-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.lesson-transcript-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.lesson-transcript-btn:hover { border-color: var(--accent); color: var(--text-primary); }

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
  backdrop-filter: blur(0px);
  transition: all 0.3s ease;
}

.modal-overlay.open {
  display: flex;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  position: relative;
  animation: scaleIn 0.3s ease;
}

.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.4rem;
  z-index: 10;
  margin: 12px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); transform: rotate(90deg); }

.modal-content { padding: 20px 24px 24px; }

.modal-content h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-right: 48px;
}

/* Modal - Paginated Lesson View */
.modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.modal-top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-read-status {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-muted);
}

.modal-read-status.is-read {
  background: rgba(46, 213, 115, 0.12);
  color: var(--success);
}

.modal-section-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-top-btns {
  display: flex;
  gap: 8px;
}

.modal-btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.modal-btn:disabled { cursor: default; opacity: 0.5; }

.mark-complete-btn {
  background: rgba(46, 213, 115, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.mark-complete-btn:hover:not(:disabled) {
  background: rgba(46, 213, 115, 0.2);
  box-shadow: 0 0 12px rgba(46, 213, 115, 0.2);
}

.mark-complete-btn.completed {
  background: var(--success);
  color: #fff;
  opacity: 1;
}

.mark-complete-btn.completed:disabled { opacity: 1; }

.mark-unread-btn {
  background: rgba(255, 71, 87, 0.08);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.mark-unread-btn:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 71, 87, 0.12);
}

.mark-unread-btn.unread-active { opacity: 0.4; }

.modal-hero {
  text-align: center;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-lesson-title {
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  line-height: 1.3;
  margin-bottom: 14px !important;
  padding-right: 48px;
}

.modal-lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}

.modal-lesson-tags .lesson-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.72rem;
}

.modal-lesson-tags .lesson-tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.modal-lesson-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 0;
}

.modal-tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-tab-btn:hover { color: var(--text-primary); }

.modal-tab-btn.active {
  color: var(--neon-blue);
  border-bottom-color: var(--neon-blue);
}

.modal-tab-content {
  display: none;
  padding: 20px 0;
}

.modal-tab-content.active { display: block; animation: fadeIn 0.25s ease; }

.modal-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.modal-overview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.modal-overview-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-overview-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.modal-overview-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-kp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-kp-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  opacity: 0;
  animation: slideUp 0.3s ease forwards;
}

.modal-kp-item.takeaway { border-left: 3px solid var(--neon-green); }

.modal-kp-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-kp-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 255, 136, 0.12);
  color: var(--neon-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-kp-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-top: 3px;
}

.modal-transcript-load-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
}

.modal-transcript-load-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 16px var(--accent-glow);
}

.modal-transcript-body { }

.modal-bottom-bar {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

.modal-scroll-sentinel { height: 1px; width: 100%; }

.transcript-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: 'Consolas', 'Courier New', monospace;
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius);
  max-height: 60vh;
  overflow-y: auto;
}

.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.loading.hidden { opacity: 0; pointer-events: none; transform: scale(1.05); }

.loading-svg { width: 120px; height: 120px; animation: float 3s ease-in-out infinite; }

.empty-state {
  text-align: center;
  padding: 40px 20px 60px;
  animation: fadeIn 0.5s ease;
}

.empty-svg {
  width: 200px;
  height: 160px;
  margin-bottom: 16px;
  animation: float 4s ease-in-out infinite;
}

.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 0.85rem; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
  animation: slideInLeft 0.3s ease;
}

.back-btn:hover { border-color: var(--accent); color: var(--text-primary); }

.sort-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.sort-btn {
  padding: 5px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition);
}

.sort-btn:hover, .sort-btn.active { border-color: var(--accent); color: var(--accent-light); }

.confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  animation: confetti 1s ease forwards;
}

.filter-search-box {
  position: relative;
  margin-bottom: 12px;
}

.filter-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.filter-search-box input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
  transition: all var(--transition);
}

.filter-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.filter-search-box input::placeholder {
  color: var(--text-muted);
}

.course-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  animation: fadeIn 0.3s ease;
}

.course-actions-bar .back-btn { margin-bottom: 0; }

.course-actions-bar .sort-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
}

.course-actions-bar .results-info-inline {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.course-actions-bar .results-info-inline {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.active-filters-bar {
  margin-bottom: 16px;
  animation: slideUp 0.3s ease;
}

.active-filters-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  flex-wrap: wrap;
}

.active-filters-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.active-filters-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  animation: bounceIn 0.3s ease;
}

.active-filter-pill.process { background: rgba(0, 212, 255, 0.12); color: var(--neon-blue); }
.active-filter-pill.step { background: rgba(0, 255, 136, 0.12); color: var(--neon-green); }
.active-filter-pill.technique { background: rgba(179, 102, 255, 0.12); color: var(--neon-purple); }
.active-filter-pill.topic { background: rgba(255, 136, 0, 0.12); color: var(--neon-orange); }

.active-filter-remove {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.active-filter-remove:hover { opacity: 1; }

.active-filters-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.active-filters-clear:hover { color: var(--danger); }

.inline-tags-bar {
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
}

.inline-tags-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.inline-tags-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.inline-tags-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
  transition: color var(--transition);
}

.inline-tags-clear:hover { color: var(--danger); }

.inline-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 120px;
  overflow-y: auto;
}

.inline-tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.inline-tag-filter:hover { transform: translateY(-1px); filter: brightness(1.2); }
.inline-tag-filter.process { border-color: rgba(0,212,255,0.3); color: var(--neon-blue); }
.inline-tag-filter.step { border-color: rgba(0,255,136,0.3); color: var(--neon-green); }
.inline-tag-filter.technique { border-color: rgba(179,102,255,0.3); color: var(--neon-purple); }
.inline-tag-filter.topic { border-color: rgba(255,136,0,0.3); color: var(--neon-orange); }

.inline-tag-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.inline-tag-count {
  background: rgba(255,255,255,0.12);
  padding: 0 5px;
  border-radius: 8px;
  font-size: 0.6rem;
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 0;
    z-index: 150;
    max-height: 100vh;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .lesson-grid { grid-template-columns: 1fr; }
  .header-stats { display: none; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; padding: 8px 0; }
  .header-actions { max-width: 100%; order: 3; flex-basis: 100%; }
  .search-box { flex: 1; }
  .content { padding: 12px; }
  .course-grid { grid-template-columns: 1fr; }
  .nav-btn { padding: 8px 12px; font-size: 0.8rem; }
  .lesson-grid { grid-template-columns: 1fr; }
}

/* === REPORTS === */

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

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.report-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.15);
}

.report-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-card-icon svg {
  width: 28px;
  height: 28px;
}

.report-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.report-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.report-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.report-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.report-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.report-card-meta svg {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}

.report-card-tag {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* report detail inside modal */

.report-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.report-detail-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.report-detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.report-detail-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.report-body h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--neon-blue);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.report-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-body h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.report-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neon-purple);
  margin: 20px 0 8px;
}

.report-body p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 8px 0 12px;
  font-size: 0.9rem;
}

.report-body ul, .report-body ol {
  margin: 8px 0 12px 20px;
  color: var(--text-secondary);
}

.report-body li {
  margin: 4px 0;
  line-height: 1.6;
  font-size: 0.88rem;
}

.report-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

.report-body em {
  color: var(--neon-blue);
}

.report-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  margin: 12px 0;
  background: rgba(108,92,231,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.report-body blockquote p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.88rem;
  font-style: italic;
}

.report-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.82rem;
}

.report-body th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}

.report-body td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: top;
}

.report-body tr:hover td {
  background: rgba(108,92,231,0.04);
}

.report-body code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--neon-green);
  font-family: 'Consolas', monospace;
}

.report-body pre {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border-color);
}

.report-body pre code {
  background: none;
  padding: 0;
  color: var(--neon-green);
}

.report-body .checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
}

.report-body .checkbox-item input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--accent);
}

.report-body a {
  color: var(--neon-blue);
  text-decoration: none;
}

.report-body a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .report-grid { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: 1fr; }

  .course-card {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    text-align: center;
  }

  .course-card-left {
    min-width: 0;
    text-align: center;
  }

  .course-card-icon { font-size: 1.4rem; margin-bottom: 0; }
  .course-card-section { font-size: 0.6rem; }

  .course-card-center { width: 100%; text-align: left; }

  .course-card-right {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 6px;
  }

  .course-card-title { font-size: 0.9rem; margin-bottom: 4px; }
  .course-card-summary { font-size: 0.72rem; -webkit-line-clamp: 2; margin-bottom: 6px; line-height: 1.4; }
  .course-progress-bar { margin-top: 6px; }
  .course-progress-text { font-size: 0.62rem; }
  .course-tags { flex-wrap: wrap; }
  .course-tag { font-size: 0.58rem; padding: 2px 5px; }

  .lesson-card { padding: 12px; }
  .lesson-card-header { gap: 4px; }
  .lesson-card-title { font-size: 0.85rem; }
  .lesson-summary { font-size: 0.72rem; -webkit-line-clamp: 2; }
  .lesson-tags { flex-wrap: wrap; }
  .lesson-tag { font-size: 0.58rem; padding: 2px 5px; }
  .lesson-card-footer { font-size: 0.62rem; gap: 6px; }

  .report-card { padding: 16px; gap: 8px; }
  .report-card-top { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
  .report-card-title { font-size: 0.9rem; }
  .report-card-subtitle { font-size: 0.72rem; -webkit-line-clamp: 2; }
  .report-card-footer { justify-content: center; }

  .modal-overlay.open {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    max-width: 100%;
    animation: slideUpSheet 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-overflow-scrolling: touch;
  }

  .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    float: none;
    z-index: 10;
  }

  .modal::before {
    content: "";
    position: sticky;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 10px auto 0;
    z-index: 11;
    flex-shrink: 0;
  }

  .modal-content {
    padding-top: 8px;
  }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
