/* ============================================================
   道田代理商培训 SaaS 系统 v1.0 — 设计系统
   ============================================================ */
:root {
  --primary: #2d6a4f;
  --primary-light: #40916c;
  --primary-dark: #1b4332;
  --accent: #e67e22;
  --accent-light: #f0a04b;

  --bg: #f5f7f5;
  --surface: #ffffff;
  --border: #e0e5e0;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.06), 0 4px 6px rgba(0,0,0,.04);

  --l1-color: #10b981;
  --l2-color: #3b82f6;
  --l3-color: #e67e22;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   布局
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--primary-dark);
  color: #fff;
  padding: 20px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 12px;
}
.sidebar-logo h1 { font-size: 20px; font-weight: 700; }
.sidebar-logo span { font-size: 12px; opacity: .6; }

.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section { font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,.4); padding: 16px 20px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: transparent; border: 0;
  padding: 10px 20px; cursor: pointer;
  font-size: 14px; color: rgba(255,255,255,.7);
  transition: all .15s; border-left: 3px solid transparent;
  font-family: inherit; text-align: left;
}
.nav-item:focus-visible { outline: 2px solid rgba(255,255,255,.75); outline-offset: -4px; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--accent); }
.nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-user {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13px;
}
.sidebar-user .name { font-weight: 600; }
.sidebar-user .level { opacity: .6; font-size: 12px; }

.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 0;
  min-height: 100vh;
}

/* ============================================================
   顶部栏
   ============================================================ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.topbar .badge {
  padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}

/* ============================================================
   通用组件
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 { font-size: 16px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; border: none;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.action-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-l1 { background: #d1fae5; color: #065f46; }
.badge-l2 { background: #dbeafe; color: #1e40af; }
.badge-l3 { background: #fef3c7; color: #92400e; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-accent { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-muted { background: #f1f5f9; color: #475569; }
.highlight-row { background: #f0faf5 !important; }
.rule-grid { display: grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; font-size: 13px; color: var(--text-secondary); }
.growth-event { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.growth-event:last-child { border-bottom: none; }
.growth-event strong { font-size: 14px; }
.growth-event p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 进度条 */
.progress-bar {
  height: 8px; background: var(--border); border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 4px; transition: width .3s;
  background: var(--primary);
}
.progress-fill.l1 { background: var(--l1-color); }
.progress-fill.l2 { background: var(--l2-color); }
.progress-fill.l3 { background: var(--l3-color); }

/* 统计卡片 */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg); font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: var(--bg); }

/* 标签页 */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg); padding: 4px; border-radius: var(--radius); }
.tab {
  padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-secondary); transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* 课程卡片 */
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.course-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; cursor: pointer;
  transition: all .15s; border-left: 4px solid transparent;
}
.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.course-card.l1 { border-left-color: var(--l1-color); }
.course-card.l2 { border-left-color: var(--l2-color); }
.course-card.l3 { border-left-color: var(--l3-color); }
.course-card .cc-code { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.course-card .cc-title { font-size: 15px; font-weight: 600; margin: 6px 0; }
.course-card .cc-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.course-card .cc-footer { display: flex; align-items: center; justify-content: space-between; }
.course-card .cc-completed { color: var(--success); font-size: 12px; }
.course-card.done { background: #f0fdf4; border-left-color: var(--success); }
.course-card.done .cc-title { color: #15803d; }

/* 阶段横幅 / 锁定卡（L1/L2/L3 共用） */
.camp-banner {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.camp-banner strong { color: var(--primary); font-size: 16px; }
.camp-banner .muted { color: var(--text-muted); font-size: 13px; }

.locked-card {
  text-align: center; padding: 56px 24px; margin: 20px 0;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-secondary);
}
.locked-card h3 { margin: 12px 0 8px; color: var(--l3-color); font-size: 18px; }
.locked-card p { font-size: 14px; max-width: 520px; margin: 0 auto; line-height: 1.7; }
.locked-card p.muted { margin-top: 10px; font-size: 13px; }

/* 能力学院目录（L2） */
.academy-block {
  --aca: var(--primary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.academy-head {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--aca);
  background: #f3f6f4; /* 兜底 */
  background: color-mix(in srgb, var(--aca) 8%, var(--surface));
}
.academy-head .aca-icon { font-size: 22px; line-height: 1; }
.academy-head .aca-name { font-size: 17px; font-weight: 700; color: var(--aca); }
.academy-head .aca-meta { margin-left: auto; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.academy-head .aca-meta b { color: var(--aca); }

.academy-body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; padding: 18px;
}
.column-block {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 12px 14px;
}
.column-head {
  display: flex; align-items: center; gap: 8px; margin: 2px 2px 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.column-head .col-count {
  margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-muted);
}
.column-progress { height: 5px; background: var(--border); border-radius: 3px; margin: 0 2px 12px; overflow: hidden; }
.column-progress > i { display: block; height: 100%; background: var(--aca); border-radius: 3px; transition: width .3s; }
.column-courses {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px;
}
.column-courses .course-card { padding: 14px; }
.column-courses .course-card .cc-desc { margin-bottom: 8px; }

/* 课程分类（统一应用于 L1/L2/L3） */
.cat-block {
  --aca: var(--primary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.cat-head {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--aca);
  background: #f3f6f4; background: color-mix(in srgb, var(--aca) 8%, var(--surface));
}
.cat-head .aca-icon { font-size: 22px; line-height: 1; }
.cat-head .aca-name { font-size: 17px; font-weight: 700; color: var(--aca); }
.cat-head .aca-meta { margin-left: auto; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.cat-head .aca-meta b { color: var(--aca); }
.cat-body { padding: 18px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text-secondary); }
.form-hint { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: #fef3c7; color: #92400e; font-size: 13px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: border .15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,.1); }
select.form-input { appearance: none; }

/* 登录页 */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}
.login-card {
  background: var(--surface); border-radius: 16px; padding: 36px;
  width: 380px; box-shadow: var(--shadow-lg);
}
.login-card h2 { text-align: center; margin-bottom: 4px; color: var(--primary); }
.login-card .sub { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.login-hint {
  margin-top: 16px; padding: 10px; background: var(--bg);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary);
}

/* 内容区 */
.content-section { padding: 24px 28px; }
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 22px; font-weight: 700; }
.page-header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* 课程详情页 */
.course-detail .cd-header {
  padding: 28px; background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: var(--radius);
}
.course-detail .cd-header h2 { font-size: 22px; }
.course-detail .cd-body { padding: 20px 0; }
.course-detail .section-title {
  font-size: 15px; font-weight: 600; color: var(--primary);
  margin: 20px 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--primary);
}

/* 测验 */
.quiz-question {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.quiz-question .qq-num { font-size: 12px; color: var(--text-muted); }
.quiz-question .qq-text { font-size: 15px; font-weight: 500; margin: 8px 0 14px; }
.quiz-option {
  display: block; width: 100%; padding: 10px 14px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; text-align: left; background: var(--surface);
  transition: all .15s;
}
.quiz-option:hover { border-color: var(--primary); background: #f0faf5; }
.quiz-option.selected { border-color: var(--primary); background: #e8f5ee; }
.quiz-option.correct { border-color: var(--success); background: #d1fae5; }
.quiz-option.wrong { border-color: var(--danger); background: #fee2e2; }
.quiz-progress { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quiz-timer { color: var(--danger); font-size: 13px; font-weight: 600; }
.quiz-timer #quiz-time-left { font-size: 15px; }
.quiz-option.multi.selected { border-color: var(--primary); background: #e8f5ee; }
.quiz-explain {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-secondary); font-size: 13px;
}
.quiz-explain p { margin-top: 4px; }
.quiz-result {
  text-align: center; padding: 30px;
}
.quiz-result .score { font-size: 48px; font-weight: 700; color: var(--primary); }
.quiz-result .passed { color: var(--success); font-size: 18px; font-weight: 600; }
.quiz-result .failed { color: var(--danger); font-size: 18px; font-weight: 600; }

/* 路径导航 */
.path-nav {
  display: flex; gap: 0; margin-bottom: 24px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.path-step {
  flex: 1; padding: 16px 20px; text-align: center;
  cursor: pointer; transition: all .15s; position: relative;
  border-right: 1px solid var(--border);
}
.path-step:last-child { border-right: none; }
.path-step:hover { background: var(--bg); }
.path-step.active { background: var(--primary); color: #fff; }
.path-step.active .ps-label { color: rgba(255,255,255,.7); }
.path-step .ps-num { font-size: 12px; font-weight: 600; opacity: .6; }
.path-step .ps-title { font-size: 16px; font-weight: 700; margin: 4px 0; }
.path-step .ps-label { font-size: 12px; color: var(--text-muted); }

/* 最近学习 */
.today-task {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.today-task .task-icon { font-size: 20px; }
.today-task .task-info { flex: 1; }
.today-task .task-title { font-weight: 500; font-size: 14px; }
.today-task .task-meta { font-size: 12px; color: var(--text-muted); }

/* 通知提示 */
.toast {
  position: fixed; top: 16px; right: 16px; z-index: 999;
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-lg);
  font-size: 14px; animation: slideIn .3s;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 24px;
  width: 480px; max-width: 90vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-wide { width: 760px; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
textarea.form-input { resize: vertical; font-family: inherit; line-height: 1.6; }
.muted, small { color: var(--text-muted); }
.empty-state.small { padding: 22px 12px; }

.learn-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.learn-tabs .tab { border: none; background: var(--bg); }
.learn-panel { font-size: 14px; color: var(--text-secondary); }
.learn-panel h3 { color: var(--primary); font-size: 15px; margin: 18px 0 8px; }
.skill-bars label { display:block; margin: 14px 0 5px; font-size: 13px; color: var(--text-secondary); }

/* 响应式 */
@media (max-width: 768px) {
  .app-layout { display: block; padding-bottom: 76px; }
  .sidebar {
    width: 100%; height: auto; top: auto; bottom: 0; left: 0; right: 0;
    padding: 0; display: block; box-shadow: 0 -8px 20px rgba(0,0,0,.08);
  }
  .sidebar-logo, .sidebar-user { display: none; }
  .sidebar-nav {
    display: flex; flex-direction: row; overflow-x: auto; padding: 8px;
    gap: 6px; -webkit-overflow-scrolling: touch;
  }
  .nav-item {
    flex: 0 0 auto; width: auto; min-width: 84px; min-height: 44px;
    justify-content: center; padding: 10px 12px; border-left: 0;
    border-bottom: 3px solid transparent; border-radius: var(--radius-sm);
    font-size: 13px; text-align: center;
  }
  .nav-item.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-user { display: none; }
  .main-content { margin-left: 0; }
  .content-section { padding: 18px 14px; }
  .page-header h2 { font-size: 20px; }
  .course-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { width: 90vw; }
  .form-grid { grid-template-columns: 1fr; }
  .today-task { align-items: flex-start; flex-wrap: wrap; }
  .card-header { align-items: flex-start; gap: 10px; flex-direction: column; }
  .path-nav { overflow-x: auto; }
  .path-step { min-width: 120px; }
}

/* ===== 课程内容块（图文 / 视频 / 第三方视频）===== */
.course-content-blocks { display: flex; flex-direction: column; gap: 18px; margin: 10px 0 4px; }
.course-content-block { background: #f0f4f1; border: 1px solid #e3e8e5; border-radius: 10px; padding: 14px 16px; }
.cb-title-h { font-size: 15px; color: var(--primary); margin: 0 0 8px; }
.rich-html { font-size: 14px; line-height: 1.75; color: var(--text-secondary); word-break: break-word; }
.rich-html p { margin: 0 0 10px; }
.rich-html img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; }
.rich-html a { color: var(--primary-light); }
.rich-html table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.rich-html th, .rich-html td { border: 1px solid #e3e8e5; padding: 6px 8px; }
.rich-html pre { background: #1b2330; color: #e6edf3; padding: 12px; border-radius: 8px; overflow: auto; }
.rich-html code { background: rgba(45,106,79,.1); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 10px; overflow: hidden; margin: 6px 0; }
.video-embed video, .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== 课程信息弹窗内的「编辑内容」入口卡片 ===== */
.ccb-entry { display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; padding: 16px; border: 1px solid #e3e8e5; border-radius: 12px; background: linear-gradient(135deg, #f3faf6, #ffffff); }
.ccb-entry-icon { font-size: 30px; line-height: 1; }
.ccb-entry-text { flex: 1; }
.ccb-entry-text strong { color: var(--primary); }
.ccb-entry-text p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.6; }

/* ===== 全屏所见即所得内容编辑器（三栏）===== */
.ce-overlay { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: flex; flex-direction: column; }
.ce-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e3e8e5; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.ce-top-left, .ce-top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ce-course { font-size: 14px; color: var(--text-secondary); margin-left: 4px; }
.ce-dirty { font-size: 12px; color: #c2410c; }
.ce-body { flex: 1; display: grid; grid-template-columns: 280px 1fr 1fr; min-height: 0; }
.ce-col { overflow-y: auto; padding: 16px; }
.ce-left { border-right: 1px solid #e3e8e5; background: #fbfdfc; }
.ce-right { border-left: 1px solid #e3e8e5; background: #fbfdfc; }
.ce-preview-head { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }

/* 左栏：内容块列表 */
.ce-block { display: flex; align-items: center; gap: 8px; padding: 10px 10px; margin-bottom: 8px; border: 1px solid #e3e8e5; border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ce-block:hover { border-color: var(--primary); }
.ce-block.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(45,106,79,.18); background: #f1faf5; }
.ce-block.ce-drag-over { border-style: dashed; border-color: var(--primary); }
.ce-grip { color: #b8c2bd; cursor: grab; font-size: 14px; }
.ce-bicon { font-size: 13px; white-space: nowrap; }
.ce-btitle { flex: 1; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-bact { display: flex; gap: 3px; }
.ce-empty { color: var(--text-muted); font-size: 13px; line-height: 1.7; padding: 20px 4px; }

/* 中栏：编辑区 */
.ce-edit-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ce-block-title { font-weight: 600; }
.ce-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid #e3e8e5; border-radius: 8px; background: #fff; position: sticky; top: 0; z-index: 2; }
.ce-toolbar button { min-width: 34px; min-height: 32px; padding: 4px 8px; border: 1px solid #e3e8e5; border-radius: 6px; background: #fff; color: var(--text-secondary); cursor: pointer; font-size: 13px; line-height: 1; }
.ce-toolbar button:hover { background: #f1faf5; border-color: var(--primary); }
.ce-sep { width: 1px; align-self: stretch; background: #e3e8e5; margin: 0 2px; }
.ce-rich { min-height: 320px; padding: 14px 16px; border: 1px solid #e3e8e5; border-radius: 10px; background: #fff; font-size: 15px; line-height: 1.8; color: var(--text-secondary); outline: none; overflow-y: auto; }
.ce-rich:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,.12); }
.ce-rich:empty:before { content: attr(data-placeholder); color: #aab4ae; }
.ce-field { display: block; font-size: 13px; color: var(--text-secondary); margin: 10px 0; }
.ce-field span { display: block; margin-bottom: 6px; font-weight: 600; }
.ce-field input[type=file] { width: 100%; font-size: 13px; }
.ce-or { text-align: center; color: var(--text-muted); font-size: 12px; margin: 12px 0; }
.ce-hint { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-top: 8px; }
.ce-embed-prev { margin-top: 12px; }

/* 右栏：实时预览 */
.ce-preview .course-content-block { margin-bottom: 18px; }
.cb-title-h { font-size: 15px; color: var(--primary); margin: 0 0 6px; }

@media (max-width: 980px) {
  .ce-body { grid-template-columns: 1fr; }
  .ce-left, .ce-right { border: 0; border-bottom: 1px solid #e3e8e5; max-height: 220px; }
  .ce-toolbar { position: static; }
}
.btn-xs { padding: 3px 9px; font-size: 12px; min-height: 28px; }

/* ===== 标准讲稿编辑器：wangEditor 富文本（合并原「课程内容」块编辑器）===== */
.we-wrap { margin: 6px 0 2px; border: 1px solid #e3e8e5; border-radius: 10px; overflow: hidden; background: #fff; }
.we-toolbar { border-bottom: 1px solid #e3e8e5; background: #fafcfb; }
.we-editor { min-height: 260px; max-height: 480px; overflow-y: auto; }
.we-editor .w-e-text { min-height: 240px; }
/* 富文本渲染区：视频 / 第三方 iframe 响应式 */
.rich-html video, .rich-html iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 10px; margin: 8px 0; background: #000; }
.course-content-rich { margin: 4px 0 10px; }


/* ===== 课程评价 / 评分 ===== */
.stars { display: inline-flex; gap: 2px; }
.stars .star { color: #d4d9d6; font-size: 22px; line-height: 1; transition: color .12s; }
.stars .star.on { color: #f5a623; }
.stars:not(.static) .star { cursor: pointer; }
.stars:not(.static) .star:hover { color: #f7b94e; }
.rating-card { margin-top: 4px; }
.rating-row { display: flex; align-items: center; gap: 14px; margin: 8px 0; flex-wrap: wrap; }
.rating-label { min-width: 96px; }
.rating-label strong { display: block; font-size: 14px; }
.rating-label small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 2px; max-width: 260px; }
.rating-num { margin-left: 2px; font-weight: 600; color: var(--text-secondary); }
.rating-row.weak { background: rgba(239, 68, 68, .08); border-radius: 8px; padding: 8px 10px; }
.rating-row.weak .weak-tag { color: var(--danger); }
.rating-form { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 6px 0 14px; background: var(--bg-muted, #f7f9f8); }
.rating-form h4 { margin: 0 0 8px; }
.rating-cmt { margin-top: 10px; }
.rating-cmt label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.rating-summary { margin-top: 6px; }
.rating-summary h4 { margin: 0 0 4px; }
.rating-comments { margin-top: 12px; }
.rating-cmt-item { border-top: 1px solid var(--border); padding: 10px 0; }
.rating-cmt-item p { margin: 4px 0; font-size: 14px; }
.rating-cmt-item .cmt-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.rating-cmt-item .muted { font-size: 12px; }
