:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --primary-color: #3b82f6;
  --success-color: #22c55e;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --gradient-start: #a855f7;
  --gradient-end: #3b82f6;
  --accent-bg: rgba(59, 130, 246, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --navbar-bg: rgba(255, 255, 255, 0.85);
  --navbar-bg-scrolled: rgba(255, 255, 255, 0.95);
  --navbar-shadow: rgba(0, 0, 0, 0.05);
  --blob-opacity: 0.3;
}

/* 深色模式 */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --border-color: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-color: #60a5fa;
  --success-color: #4ade80;
  --error-color: #f87171;
  --warning-color: #fbbf24;
  --gradient-start: #c084fc;
  --gradient-end: #60a5fa;
  --accent-bg: rgba(96, 165, 250, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --navbar-bg: rgba(15, 23, 42, 0.85);
  --navbar-bg-scrolled: rgba(15, 23, 42, 0.95);
  --navbar-shadow: rgba(0, 0, 0, 0.3);
  --blob-opacity: 0.15;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; }

body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  filter: blur(80px);
  opacity: var(--blob-opacity);
}

body::before {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  top: -200px;
  right: -100px;
}

body::after {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--gradient-end), #06b6d4);
  bottom: -150px;
  left: -100px;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slideGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: var(--navbar-bg-scrolled);
  box-shadow: 0 2px 20px var(--navbar-shadow);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.navbar-links { display: flex; gap: 24px; list-style: none; }

.navbar-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-links a:hover { color: var(--primary-color); }

.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.navbar-links a:hover::after { width: 100%; }

.btn {
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover { border-color: var(--primary-color); color: var(--primary-color); background: rgba(59, 130, 246, 0.05); }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  transition: left 0.5s ease;
}

.card:hover::before { left: 100%; }

.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
}

.feature-icon.video { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }
.feature-icon.script { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.feature-icon.vocab { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.feature-icon.mode { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }

.feature-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }

.feature-list { list-style: none; padding: 0; }

.feature-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  flex-shrink: 0;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.video-thumbnail {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.video-thumbnail .play-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.video-thumbnail:hover .play-icon { transform: scale(1.1); background: white; }
.video-thumbnail .play-icon i { color: var(--primary-color); font-size: 24px; margin-left: 4px; }

/* 课程状态徽标：含视频 / 字幕练习 */
.course-status {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  letter-spacing: 0.2px;
  z-index: 2;
}

/* 空状态提示（课程准备中 / 无内容） */
.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  line-height: 1.8;
  font-size: 14px;
}

.empty-hint i { font-size: 40px; margin-bottom: 12px; display: block; color: var(--text-muted); }
.empty-hint a { color: var(--primary-color); text-decoration: none; }
.empty-hint a:hover { text-decoration: underline; }

.video-info { padding: 20px; }
.video-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }

.video-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.video-meta span { display: flex; align-items: center; gap: 4px; }

.video-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.video-tag {
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.footer {
  background: var(--bg-card);
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes clickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.btn:active {
  transform: scale(0.97) !important;
  transition: transform 0.1s ease;
}

.btn-primary:active {
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3) !important;
}

.btn-secondary:active {
  background: rgba(59, 130, 246, 0.1) !important;
}

.btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.navbar-links a:active {
  transform: scale(0.95);
}

.navbar-links a.active {
  color: var(--primary-color);
  font-weight: 600;
}

.navbar-links a.active::after {
  width: 100%;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
}

.card:active,
.feature-card:active,
.video-card:active {
  transform: translateY(-2px) scale(0.98);
  transition: transform 0.15s ease;
}

.video-thumbnail:active .play-icon {
  transform: scale(0.9);
  background: var(--primary-color);
}

.video-thumbnail:active .play-icon i {
  color: white;
}

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

.ripple-effect.dark {
  background: rgba(0, 0, 0, 0.15);
}

.click-scale {
  animation: clickPulse 0.3s ease;
}

.focus-ring:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 8px;
}

.toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 14px 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2000;
  animation: slideRight 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.toast-notification.success { border-left-color: var(--success-color); }
.toast-notification.error { border-left-color: var(--error-color); }
.toast-notification.warning { border-left-color: var(--warning-color); }

.toast-notification i { font-size: 18px; }
.toast-notification.success i { color: var(--success-color); }
.toast-notification.error i { color: var(--error-color); }
.toast-notification.warning i { color: var(--warning-color); }
.toast-notification.info i { color: var(--primary-color); }

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .navbar-inner { justify-content: space-between; }
  .hamburger { display: flex !important; }
  .toast-notification {
    left: 20px;
    right: 20px;
    top: auto;
    bottom: 20px;
    animation: slideRight 0.3s ease;
  }
}

/* 移动端汉堡菜单 */
.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.hamburger:hover { border-color: var(--primary-color); color: var(--primary-color); }
.hamburger:active { transform: scale(0.9); transition: transform 0.1s; }

.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--navbar-bg-scrolled);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 999;
  padding: 16px 24px;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s ease;
}
.mobile-menu a:hover, .mobile-menu a.active {
  background: var(--accent-bg);
  color: var(--primary-color);
}

/* 深色模式切换按钮 */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.9);
  transition: transform 0.1s ease;
}

.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: block; }

[data-theme="dark"] .theme-toggle .fa-sun { display: block; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ========== 统一点击反馈升级 ========== */
/* 去除移动端默认的高亮色块，用自定义水波纹替代 */
* { -webkit-tap-highlight-color: transparent; }

/* 点击水波纹（由 js/theme.js 动态创建） */
.tap-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: scale(0);
  will-change: transform, opacity;
}

@keyframes tapRipple {
  0%   { transform: scale(0); opacity: 0.7; }
  60%  { transform: scale(2.4); opacity: 0.45; }
  100% { transform: scale(3); opacity: 0; }
}

/* 按压回弹弹簧：按下→压缩→轻微反弹→还原 */
.press-active { animation: pressSpring 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.24); }

@keyframes pressSpring {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.96); }
  70%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* 压制默认生硬缩放，让按压更贴合 */
.btn:active,
.ctrl-btn:active,
.hamburger:active,
.theme-toggle:active { transform: translateY(1px); }

/* 轻量化可点击控件：统一丝滑的悬停微动效 */
.mode-btn,
.video-tab,
.filter-btn,
.control-btn,
.action-btn,
.ctrl-btn,
.mini-btn {
  transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.08),
              background 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

@media (hover: hover) {
  .mode-btn:hover,
  .video-tab:hover,
  .filter-btn:hover,
  .action-btn:hover,
  .mini-btn:hover { transform: translateY(-1px); }

  .ctrl-btn:hover { transform: scale(1.08); }
}

/* ========== 悬停视觉反馈统一增强 ========== */
/* 所有可点击区域统一手型，避免拖动时选中文本 */
a, button, .btn, .subtitle-item, .script-item, .video-card,
.feature-card, .category-card, .level-card, .mode-btn, .video-tab { cursor: pointer; }

/* 链接：悬停出现下划线、颜色加深 */
.footer a,
.nav-link,
.footer-links a { text-decoration: none; transition: color 0.2s ease; }
.footer a:hover,
.nav-link:hover { color: var(--primary-color); text-decoration: underline; text-underline-offset: 4px; }

/* 页脚链接组（来源/隐私/管理员入口等） */
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--primary-color); text-decoration: underline; text-underline-offset: 4px; }
.footer-links a[style*="text-muted"] { opacity: 0.8; }

/* 按钮：统一柔和的上浮曲线 + 悬停光晕，提升"可点击"手感 */
.btn { transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.08),
              box-shadow 0.22s ease, background 0.22s ease, color 0.2s ease, border-color 0.2s ease; }
.btn:hover { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), var(--shadow-md); }
.btn-primary:hover { filter: brightness(1.08) saturate(1.1); }

/* 字幕行 / 讲义行等交互列表项：丝滑上浮 + 阴影，避免生硬跳变 */
.subtitle-item:hover,
.script-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }