/* =========================================================
   课程售卖网站 —— 公共样式
   ========================================================= */

/* ---- 基础重置 ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background: #f5f6fa;
  padding-top: 66px; /* 给固定导航条让出空间 */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
/* 取消所有输入框右下角的放大缩小拖拽功能 */
textarea { resize: none; }

/* Vue 编译完成前先隐藏，避免刷新时闪出 {{ }} 模板语法 */
[v-cloak] { display: none !important; }

/* ---- 颜色主题 ---- */
:root {
  --primary: #4f6ef7;
  --primary-dark: #3b5bdb;
  --text: #1f2937;
  --text-gray: #6b7280;
  --border: #e5e7eb;
}

/* =========================================================
   导航条
   ========================================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 66px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  z-index: 100;
}
.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 66px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 34px;
}
/* logo */
.logo { display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 23px;
  color: var(--primary);
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6);
  color: #fff; font-size: 18px;
}
/* 导航链接 */
.nav-links { display: flex; align-items: center; gap: 8px; flex: 1; }
.nav-links li { position: relative; }
.nav-link {
  display: block; padding: 9px 17px; border-radius: 8px;
  color: var(--text); font-size: 16px; cursor: pointer;
}
.nav-link:hover { background: #f3f4f6; }
.nav-link.active { color: var(--primary); font-weight: bold; }
/* 下拉菜单（课程分类） */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 130px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  padding: 6px 0;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 9px 18px; font-size: 15px; color: var(--text); }
.dropdown-menu li a:hover { background: #f3f4f6; color: var(--primary); }

/* 右侧用户区域 */
.user-area { position: relative; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-menu { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.user-name { font-size: 15px; color: var(--text); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6);
  color: #fff; font-size: 16px; font-weight: bold; flex-shrink: 0;
}
.avatar.big { width: 44px; height: 44px; font-size: 18px; }
/* 用户下拉面板 */
.user-dropdown {
  position: absolute; top: 110%; right: 0; width: 220px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12); overflow: hidden;
}
.user-dropdown-header { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.user-dropdown-header .name { font-weight: bold; }
.user-dropdown-header .sub { font-size: 12px; color: var(--text-gray); margin-top: 2px; }
.user-dropdown-item { display: block; padding: 11px 16px; font-size: 14px; color: #ef4444; cursor: pointer; }
.user-dropdown-item:hover { background: #fef2f2; }

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-block; padding: 9px 20px; border-radius: 8px; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: #eef2ff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

/* =========================================================
   轮播图
   ========================================================= */
.carousel { max-width: 1440px; margin: 20px auto; position: relative; border-radius: 14px; overflow: hidden; }
/* 轨道：横向排列所有轮播页，通过 transform 平移实现滑动动画 */
.carousel-track {
  display: flex; width: 100%;
  transition: transform .6s ease;
  will-change: transform;
}
.carousel-track.no-transition { transition: none; } /* 最后一张跳回第一张时不走动画 */
.carousel-slide {
  flex: 0 0 100%; width: 100%;
  height: 320px; display: flex; align-items: center; padding: 0 70px; color: #fff;
  position: relative;
}
.carousel-slide .slide-title { font-size: 34px; font-weight: bold; margin-bottom: 12px; }
.carousel-slide .slide-desc { font-size: 16px; opacity: .9; max-width: 460px; }
.carousel-slide .slide-btn { margin-top: 20px; display: inline-block; padding: 10px 24px; background: #fff; color: var(--primary); border-radius: 20px; font-weight: bold; }
.carousel-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.carousel-dots span { width: 24px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.5); cursor: pointer; }
.carousel-dots span.on { background: #fff; }

/* =========================================================
   通用区块
   ========================================================= */
.container { max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.section { padding: 28px 0; }
.section-title { font-size: 22px; font-weight: bold; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.section-title .more { font-size: 14px; color: var(--text-gray); font-weight: normal; }

/* =========================================================
   课程卡片
   ========================================================= */
.course-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

/* 首页：按分类分块 */
.category-block {
  background: #fff; border-radius: 12px;
  padding: 18px 20px 22px; margin-bottom: 22px;
}
.category-block-title {
  font-size: 18px; font-weight: bold; line-height: 1.2;
  padding-left: 10px; margin-bottom: 16px;
  border-left: 4px solid var(--primary);
}
[data-theme="dark"] .category-block { background: #1e293b; }
.course-card {
  background: #fff; border-radius: 12px; overflow: hidden; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: transform .18s, box-shadow .18s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.1); }
.course-cover { height: 140px; display: flex; align-items: flex-end; padding: 14px; color: #fff; }
.course-body { padding: 14px 16px 16px; }
.course-title { font-size: 16px; font-weight: bold; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-gray); margin-bottom: 12px; }
.course-meta .badge { background: #eef2ff; color: var(--primary); padding: 2px 8px; border-radius: 4px; }
/* 课程名称 + 发布时间同一行，时间在最右边 */
.course-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.course-title-row .course-title { margin-bottom: 0; flex: 1; min-width: 0; }
.course-date { font-size: 12px; color: #9ca3af; white-space: nowrap; flex-shrink: 0; }
.course-foot { display: flex; align-items: center; justify-content: space-between; }
.course-price { color: #f97316; font-weight: bold; font-size: 16px; }
.course-price.free { color: #22c55e; }

/* 封面渐变色（根据课程 id 取模，让封面颜色丰富一点） */
.cover-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.cover-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.cover-3 { background: linear-gradient(135deg, #4facfe, #00c6fb); }
.cover-4 { background: linear-gradient(135deg, #43e97b, #38bdf8); }
.cover-5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.cover-6 { background: linear-gradient(135deg, #30cfd0, #330867); }
.cover-7 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.cover-8 { background: linear-gradient(135deg, #ff9a9e, #fad0c4); }

/* 进度条（观看进度通用） */
.progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.progress-bar .progress-inner { height: 100%; background: var(--primary); border-radius: 3px; }

/* =========================================================
   登录 / 注册卡片
   ========================================================= */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 120px); }
.auth-card { width: 400px; background: #fff; border-radius: 14px; padding: 40px; box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.auth-card h2 { text-align: center; margin-bottom: 8px; }
.auth-card .auth-sub { text-align: center; color: var(--text-gray); font-size: 14px; margin-bottom: 26px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.form-tip { margin-top: 14px; text-align: center; font-size: 14px; color: var(--text-gray); }
.form-tip a { color: var(--primary); }

/* ---- 登录方式切换 / 验证码输入行 ---- */
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; text-align: center; padding: 10px 0; font-size: 15px;
  cursor: pointer; color: var(--text-gray);
}
.auth-tab.on { color: var(--primary); font-weight: bold; box-shadow: inset 0 -2px 0 var(--primary); }

.field-hint { font-size: 12px; color: #9ca3af; margin-top: 5px; }

/* ---- 按钮加载中的转圈图标 ---- */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -2px; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .75; cursor: not-allowed; }

.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-btn { white-space: nowrap; padding: 0 14px; }
.code-btn:disabled { opacity: .6; cursor: not-allowed; }

/* =========================================================
   课程详情页
   ========================================================= */
.course-detail { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 24px 0; }
.player-wrap { background: #000; border-radius: 12px; overflow: hidden; position: relative; }
.player {
  /* 标准 16:9 比例：高度随宽度自动计算，画面不变形 */
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative;
}
.player .play-btn {
  width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 30px; cursor: pointer;
}
.player .player-tip { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.75); }
.course-info { background: #fff; border-radius: 12px; padding: 22px; }
.course-info h1 { font-size: 24px; margin-bottom: 12px; }
.course-info .info-meta { display: flex; gap: 16px; color: var(--text-gray); font-size: 14px; margin-bottom: 14px; }
.course-info .info-desc { color: var(--text-gray); line-height: 1.7; margin-bottom: 16px; }
.course-info .info-price { font-size: 26px; color: #f97316; font-weight: bold; }

/* 剧集列表 */
.episode-item {
  padding: 12px 14px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.episode-item:hover { background: #f3f4f6; }
.episode-item.active { background: #eef2ff; color: var(--primary); }
.episode-item .ep-no { width: 26px; height: 26px; border-radius: 6px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.episode-item.active .ep-no { background: var(--primary); color: #fff; }
.episode-item .ep-title { flex: 1; font-size: 14px; }
.episode-item .ep-duration { font-size: 12px; color: var(--text-gray); }

/* 剧集标签：试看 / 锁定 */
.ep-badge {
  font-size: 11px; padding: 1px 6px; border-radius: 4px; flex-shrink: 0;
}
.ep-badge.free { color: #16a34a; background: #dcfce7; }
.ep-badge.lock { color: #9ca3af; background: transparent; font-size: 12px; }
[data-theme="dark"] .ep-badge.free { color: #4ade80; background: #14532d; }

/* 锁定弹窗里的小提示 */
.lock-sub { font-size: 13px; color: #fde68a; margin-bottom: 10px; }

/* =========================================================
   后台管理
   ========================================================= */
.admin-layout { display: flex; gap: 24px; padding: 24px 0; }
.admin-sidebar { width: 200px; flex-shrink: 0; }
.admin-sidebar .side-menu { background: #fff; border-radius: 12px; padding: 8px; }
.admin-sidebar .side-item { padding: 12px 16px; border-radius: 8px; cursor: pointer; font-size: 15px; margin-bottom: 2px; }
.admin-sidebar .side-item:hover { background: #f3f4f6; }
.admin-sidebar .side-item.active { background: #eef2ff; color: var(--primary); font-weight: bold; }
.admin-main { flex: 1; min-width: 0; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  /* 鼠标悬停时轻微放大 */
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover {
  transform: scale(1.045);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
/* 卡片可点击 + 选中状态（不要边框，用底色 + 阴影区分） */
.stat-card { cursor: pointer; }
.stat-card.active {
  background: #eef2ff;
  box-shadow: 0 6px 18px rgba(79,110,247,.28);
}
[data-theme="dark"] .stat-card.active {
  background: #243244;
  box-shadow: 0 6px 18px rgba(124,147,255,.35);
}
.stat-card .stat-value { font-size: 30px; font-weight: bold; color: var(--primary); }
.stat-card .stat-label { font-size: 14px; color: var(--text-gray); margin-top: 4px; }

/* 面板标题右侧的小字 */
.panel-sub { font-size: 13px; color: var(--text-gray); }

/* 面板标题右侧的工具区（排序下拉等） */
.head-tools { display: flex; align-items: center; gap: 12px; }

/* 导航栏头像旁的等级徽标 */
.user-level {
  font-size: 11px; font-weight: bold; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  padding: 1px 7px; border-radius: 9px;
}

/* VIP 会员角色文字 */
.role-vip { color: #f59e0b; font-weight: bold; }

/* 用户下拉菜单里的普通链接（账号管理） */
.user-dropdown-link {
  display: block; padding: 11px 16px; font-size: 14px;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.user-dropdown-link:hover { background: #f3f4f6; }
[data-theme="dark"] .user-dropdown-link:hover { background: #334155; }

/* 账号管理页 */
.account-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-name { font-size: 18px; font-weight: bold; }
.profile-sub { font-size: 13px; color: var(--text-gray); margin-top: 4px; }
.info-list { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.info-list > div { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.info-list span { color: var(--text-gray); }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr; } }

/* 数据趋势图容器 */
.trend-wrap { height: 300px; position: relative; }

/* 轮播图管理 */
.banner-bg-preview { display: inline-block; width: 56px; height: 26px; border-radius: 6px; vertical-align: middle; }
.banner-preview {
  height: 80px; border-radius: 10px; color: #fff; font-weight: bold;
  display: flex; align-items: center; padding: 14px; margin-top: 8px;
}

/* 剧集拖拽中的行 */
tr.dragging { opacity: .5; }

/* 上架 / 下架开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px;
  cursor: pointer; transition: background .2s;
}
.switch .slider:before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s;
}
.switch input:checked + .slider { background: #22c55e; }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* 学习记录：课程 / 集 合并显示 */
.course-cell-title { font-size: 14px; }
.course-cell-sub { font-size: 12px; color: var(--text-gray); margin-top: 3px; }

/* 学习记录：观看进度条 */
.watch-progress {
  height: 7px; width: 140px; background: #e5e7eb;
  border-radius: 4px; overflow: hidden;
}
.watch-progress-inner { height: 100%; background: var(--primary); border-radius: 4px; }
.watch-time { font-size: 12px; color: var(--text-gray); margin-top: 4px; }
[data-theme="dark"] .watch-progress { background: #334155; }

/* 订单管理：筛选栏 + 状态徽标 */
.order-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.order-search {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; width: 220px; font-family: inherit; background: #fff; color: var(--text);
}
.order-search:focus { outline: none; border-color: var(--primary); }
.status-badge { font-size: 12px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.status-pending { color: #b45309; background: #fef3c7; }
.status-paid { color: #16a34a; background: #dcfce7; }
.status-cancelled { color: #6b7280; background: #f3f4f6; }
[data-theme="dark"] .order-search { background: #0f172a; color: #e5e7eb; border-color: #334155; }
[data-theme="dark"] .status-pending { color: #fcd34d; background: #4a3410; }
[data-theme="dark"] .status-paid { color: #4ade80; background: #14532d; }
[data-theme="dark"] .status-cancelled { color: #9ca3af; background: #334155; }

/* 用户等级徽标 */
.level-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff; font-size: 12px; font-weight: bold;
}

/* 表格横向滚动容器（列多的统计表用） */
.table-wrap { overflow-x: auto; }
.table-wrap .table { min-width: 900px; }

/* ---- 分页控件 ---- */
.pager {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.pager-info { margin-right: auto; font-size: 13px; color: var(--text-gray); }
.page-size {
  height: 32px; padding: 0 8px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.page-size:focus { outline: none; border-color: var(--primary); }
[data-theme="dark"] .page-size { background: #1e293b; color: #e5e7eb; }
.page-btn {
  min-width: 34px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); background: #fff; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: var(--text);
  transition: background .15s, border-color .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
[data-theme="dark"] .page-btn { background: #1e293b; color: #e5e7eb; }
[data-theme="dark"] .page-btn.on { background: var(--primary); color: #fff; }
[data-theme="dark"] .stat-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.55); }

/* 面板 */
.panel { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 24px; }
.panel .panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel .panel-head h3 { font-size: 17px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f3f4f6; }
.table th { color: var(--text-gray); font-weight: normal; background: #fafafa; }
.table tr:hover td { background: #f9fafb; }
.table .op-link { color: var(--primary); cursor: pointer; margin-right: 10px; }
.table .op-link.danger { color: #ef4444; }

/* 空状态 */
.empty { text-align: center; color: var(--text-gray); padding: 40px 0; font-size: 14px; }

/* =========================================================
   弹窗
   ========================================================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal { width: 520px; max-width: 90vw; background: #fff; border-radius: 14px; padding: 26px; max-height: 90vh; overflow-y: auto; }
.modal.modal-lg { width: 780px; }
.modal h3 { margin-bottom: 20px; }

/* =========================================================
   页脚
   ========================================================= */
.footer { text-align: center; padding: 30px; color: var(--text-gray); font-size: 13px; }

/* 提示消息 */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 14px; z-index: 300;
}

/* ---- 筛选栏（分类标签 + 搜索框） ---- */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 16px; border-radius: 20px; background: #fff; font-size: 14px;
  cursor: pointer; border: 1px solid var(--border); transition: all .15s;
}
.filter-tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- 付费课程锁定 / VIP 横幅 / 收银台 ---- */
.lock-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.lock-icon { font-size: 40px; }
.lock-title { font-size: 20px; font-weight: bold; }
.lock-price { color: #f97316; font-size: 22px; font-weight: bold; margin: 4px 0 10px; }
.lock-vip { color: #fde68a; font-size: 14px; text-decoration: underline; cursor: pointer; }

.vip-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px; border-radius: 14px; margin-top: 20px;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6); color: #fff;
}
.vip-banner .vip-title { font-size: 20px; font-weight: bold; }
.vip-banner .vip-sub { font-size: 14px; opacity: .9; margin-top: 6px; }

.vip-options { display: flex; gap: 16px; }
.vip-option {
  flex: 1; border: 2px solid var(--border); border-radius: 12px; padding: 18px;
  text-align: center; cursor: pointer; transition: all .15s;
}
.vip-option:hover { border-color: var(--primary); }
.vip-option .vo-name { font-size: 18px; font-weight: bold; }
.vip-option .vo-days { font-size: 13px; color: var(--text-gray); margin: 4px 0; }
.vip-option .vo-price { font-size: 22px; color: #f97316; font-weight: bold; }

.pay-title { font-size: 16px; color: var(--text-gray); margin: 12px 0; }
.pay-amount { font-size: 34px; font-weight: bold; color: #f97316; margin-bottom: 12px; }
.pay-tip { font-size: 13px; color: #9ca3af; }

/* ---- 我的学习（观看记录列表） ---- */
.history-item {
  display: flex; align-items: center; gap: 18px; padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}
.history-item:last-child { border-bottom: none; }
.course-cover.small { width: 180px; height: 100px; border-radius: 10px; flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-title { font-size: 17px; font-weight: bold; margin-bottom: 6px; }
.history-sub { font-size: 13px; color: var(--text-gray); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.history-sub .badge { background: #eef2ff; color: var(--primary); padding: 2px 8px; border-radius: 4px; }
.history-time { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* ---- 导航条搜索框 + 下拉 ---- */
.nav-search { position: relative; }
.nav-search-input {
  width: 290px; padding: 9px 18px; border: 1px solid var(--border);
  border-radius: 22px; font-size: 15px; outline: none; font-family: inherit;
}
.nav-search-input:focus { border-color: var(--primary); }
.search-panel {
  position: absolute; top: 110%; right: 0; width: 320px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 12px; z-index: 200;
}
.sp-section { margin-bottom: 14px; }
.sp-section:last-child { margin-bottom: 0; }
.sp-title { font-size: 13px; color: var(--text-gray); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.sp-clear { color: var(--text-gray); cursor: pointer; font-size: 12px; }
.sp-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tag { padding: 4px 12px; background: #f3f4f6; border-radius: 14px; font-size: 13px; cursor: pointer; }
.sp-tag:hover { background: #eef2ff; color: var(--primary); }
.sp-course { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sp-course:hover { background: #f3f4f6; }
.sp-course-title { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-course-meta { font-size: 12px; color: var(--text-gray); flex-shrink: 0; margin-left: 10px; }
.sp-empty { text-align: center; color: var(--text-gray); padding: 20px 0; font-size: 13px; }

/* =========================================================
   播放器控制条（进度条 + 时间 + 全屏按钮）
   ========================================================= */
.player-column { min-width: 0; }
.player-controls {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: transparent; /* 透明：和播放器容器的黑色背景融为一体 */
  transition: opacity .3s; /* 自动隐藏时淡出 */
}
/* 鼠标不动一段时间后隐藏控制条 */
.player-controls.hidden { opacity: 0; pointer-events: none; }
/* 进度条：按住鼠标左右拖动即可跳转 */
.pc-progress { flex: 1; position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; user-select: none; }
.pc-progress::before {
  content: ''; position: absolute; left: 0; right: 0; height: 6px;
  background: #374151; /* 进度条底槽（未播放部分）恢复为灰色 */
  border-radius: 3px;
}
.pc-progress-fill {
  position: absolute; left: 0; height: 6px; background: var(--primary); border-radius: 3px;
  transition: width .1s linear; /* 配合 100ms 的定时器，让填充平滑移动 */
}
.pc-progress-thumb {
  position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transform: translateX(-50%); box-shadow: 0 0 0 2px var(--primary);
  transition: left .1s linear; /* 圆点平滑移动 */
}
.pc-time { color: #d1d5db; font-size: 13px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pc-btn {
  background: transparent; border: 1px solid #4b5563; color: #e5e7eb;
  border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.pc-btn:hover { background: #1f2937; border-color: #6b7280; }

/* 圆形「后退 10 秒」按钮 */
.pc-round {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid #4b5563; background: transparent; color: #e5e7eb;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.pc-round:hover { background: #1f2937; border-color: #6b7280; }

/* 倍速按钮 + 悬停菜单 */
.pc-speed { position: relative; flex-shrink: 0; }
.speed-menu {
  /* 注意：bottom 用 100% 紧贴按钮，中间不能留空隙，
     否则鼠标从按钮移到菜单的途中会丢失 :hover，菜单就消失了 */
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: #1f2937; border-radius: 8px; padding: 6px 0; min-width: 74px;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.pc-speed:hover .speed-menu { display: block; }
.speed-item {
  padding: 6px 14px; font-size: 13px; color: #e5e7eb; text-align: center;
  cursor: pointer; white-space: nowrap;
}
.speed-item:hover { background: #374151; }
.speed-item.on { color: var(--primary); font-weight: bold; }

/* 全屏时：整块容器铺满屏幕，播放器占满剩余高度，
   控制条固定在下方 —— 不会悬浮在画面上 */
.player-wrap:fullscreen {
  display: flex; flex-direction: column; width: 100%; height: 100%;
  border-radius: 0; background: #000;
}
.player-wrap:fullscreen .player { flex: 1; height: auto; aspect-ratio: auto; }
.player-wrap:fullscreen .player-controls { flex-shrink: 0; padding: 16px 24px; }

/* =========================================================
   弹幕
   ========================================================= */
.danmaku-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.danmaku-item {
  position: absolute; left: 100%; white-space: nowrap; color: #fff;
  font-size: 15px; font-weight: 500; text-shadow: 0 1px 3px rgba(0,0,0,.9);
  animation: danmaku-move 14s linear forwards; /* 速度调慢：14 秒飘过一屏 */
}
@keyframes danmaku-move {
  from { left: 100%; }
  to   { left: -100%; }
}

/* 真实视频播放元素 */
.video-el {
  width: 100%; height: 100%; display: block;
  object-fit: contain; background: #000;
}

/* 上传提示文字 */
.upload-tip { font-size: 12px; color: #6b7280; margin-top: 6px; }
.upload-tip.ok { color: #22c55e; }

/* 拖动进度条时，画面上显示的时间 */
.drag-time {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.65); color: #fff; padding: 10px 22px;
  border-radius: 10px; font-size: 26px; font-weight: bold;
  font-variant-numeric: tabular-nums; pointer-events: none; z-index: 5;
}

/* 弹幕输入框 */
.danmaku-send { display: flex; gap: 10px; margin-top: 12px; }
.danmaku-send input {
  flex: 1; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
.danmaku-send input:focus { outline: none; border-color: var(--primary); }

/* =========================================================
   右侧面板：课程目录 / 评论 切换
   ========================================================= */
.side-panel {
  background: #fff; border-radius: 12px; display: flex; flex-direction: column;
  max-height: 640px; overflow: hidden;
}
.side-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.side-tab {
  flex: 1; text-align: center; padding: 13px 0; font-size: 14px;
  cursor: pointer; color: var(--text-gray);
}
.side-tab.on { color: var(--primary); font-weight: bold; box-shadow: inset 0 -2px 0 var(--primary); }
.side-body { padding: 12px; overflow-y: auto; flex: 1; }

/* 评论 */
.comment-form { margin-bottom: 16px; }
.comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; resize: none;
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); }
.comment-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.comment-login-tip { font-size: 12px; color: #9ca3af; margin-right: auto; }
.comment-item { padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.comment-item:last-child { border-bottom: none; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.avatar.small { width: 26px; height: 26px; font-size: 12px; }
.comment-head b { font-size: 14px; }
.comment-time { font-size: 12px; color: #9ca3af; margin-left: auto; }
.comment-content { font-size: 14px; line-height: 1.6; color: #374151; word-break: break-word; }
.comment-edited { font-size: 12px; color: #f59e0b; margin-top: 4px; }

/* ---- 评论回复 ---- */
.reply-list { margin-top: 8px; padding: 8px 10px; background: #f9fafb; border-radius: 8px; }
.reply-item { font-size: 13px; line-height: 1.7; color: #4b5563; word-break: break-word; }
.reply-user { color: var(--primary); font-weight: bold; }
.reply-target { color: #6b7280; }
.reply-target b { color: var(--primary); }
.reply-text { color: #4b5563; }
.reply-link { font-size: 12px; color: var(--primary); cursor: pointer; margin-left: 8px; }
.reply-link:hover { text-decoration: underline; }
.reply-bar { margin-top: 6px; text-align: right; }
.reply-form { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.reply-form input {
  flex: 1; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit;
}
.reply-form input:focus { outline: none; border-color: var(--primary); }
.reply-to-tip { font-size: 12px; color: var(--primary); flex-shrink: 0; }


/* =========================================================
   白天 / 夜间模式
   ========================================================= */

/* 导航栏右侧的模式切换按钮 */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: #f3f4f6; }

/* 登录/注册页的浮动按钮 */
.theme-toggle-fixed {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  background: #fff;
}
[data-theme="dark"] .theme-toggle-fixed { background: #1e293b; }

/* ---------------- 夜间主题 ---------------- */
[data-theme="dark"] {
  --primary: #7c93ff;
  --primary-dark: #6b7ff0;
  --text: #e5e7eb;
  --text-gray: #9ca3af;
  --border: #334155;
}

[data-theme="dark"] body {
  background: #0f172a;
  color: #e5e7eb;
}

/* 导航栏 */
[data-theme="dark"] .navbar {
  background: #1e293b;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .nav-link { color: #e5e7eb; }
[data-theme="dark"] .nav-link:hover { background: #334155; }
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .user-dropdown,
[data-theme="dark"] .search-panel {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .dropdown-menu li a { color: #e5e7eb; }
[data-theme="dark"] .dropdown-menu li a:hover { background: #334155; }
[data-theme="dark"] .user-dropdown-header { border-color: #334155; }
[data-theme="dark"] .user-dropdown-item:hover { background: #3f1d1d; }
[data-theme="dark"] .theme-toggle:hover { background: #334155; }

/* 卡片 / 面板 */
[data-theme="dark"] .course-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .course-info,
[data-theme="dark"] .side-panel,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .modal,
[data-theme="dark"] .admin-sidebar .side-menu {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* 筛选 / 标签 */
[data-theme="dark"] .filter-tab {
  background: #1e293b;
  border-color: #334155;
  color: #e5e7eb;
}
[data-theme="dark"] .filter-tab.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme="dark"] .course-meta .badge,
[data-theme="dark"] .history-sub .badge {
  background: #1e3a5f;
  color: #a8beff;
}

/* 输入框 */
[data-theme="dark"] .nav-search-input,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .comment-form textarea,
[data-theme="dark"] .reply-form input,
[data-theme="dark"] .danmaku-send input {
  background: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #64748b; }

/* 按钮 */
[data-theme="dark"] .btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
[data-theme="dark"] .btn-outline:hover { background: #1e3a5f; }

/* 列表 / 表格 */
[data-theme="dark"] .episode-item:hover,
[data-theme="dark"] .side-item:hover,
[data-theme="dark"] .sp-course:hover { background: #334155; }
[data-theme="dark"] .episode-item.active,
[data-theme="dark"] .side-item.active { background: #1e3a5f; }
[data-theme="dark"] .ep-no { background: #334155; }
[data-theme="dark"] .side-tabs { border-color: #334155; }
[data-theme="dark"] .table th {
  background: #0f172a;
  color: #9ca3af;
}
[data-theme="dark"] .table td { border-color: #334155; }
[data-theme="dark"] .table tr:hover td { background: #243244; }

/* 其他细节 */
[data-theme="dark"] .progress-bar { background: #334155; }
[data-theme="dark"] .history-item,
[data-theme="dark"] .comment-item { border-color: #334155; }
[data-theme="dark"] .reply-list { background: #0f172a; }
[data-theme="dark"] .reply-item,
[data-theme="dark"] .reply-text { color: #cbd5e1; }
[data-theme="dark"] .comment-content { color: #cbd5e1; }
[data-theme="dark"] .course-info .info-desc { color: #9ca3af; }
[data-theme="dark"] .sp-tag { background: #334155; color: #e5e7eb; }
[data-theme="dark"] .sp-tag:hover { background: #1e3a5f; }
[data-theme="dark"] .upload-tip { color: #9ca3af; }
[data-theme="dark"] .footer { color: #64748b; }
[data-theme="dark"] .empty { color: #94a3b8; }

/* =========================================================
   分类编辑：拖动排序网格（B 站收藏夹排序样式）
   ========================================================= */
.sort-hint { font-size: 12px; color: var(--text-gray); margin: 10px 0 12px; }
.sort-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-height: 44vh; overflow-y: auto; padding: 2px 4px 2px 2px;
}
.sort-card {
  position: relative; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--border);
  cursor: grab; user-select: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.sort-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.sort-card:active { cursor: grabbing; }
.sort-card.dragging { opacity: .45; }

.sort-cover { height: 88px; display: flex; align-items: flex-end; padding: 8px; }
.sort-title {
  color: #fff; font-size: 12px; font-weight: bold; line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sort-no {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px;
  padding: 1px 7px; border-radius: 9px;
}
.modal-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.modal-actions .btn { min-width: 110px; }

[data-theme="dark"] .sort-card { background: #1e293b; border-color: #334155; }
