/* ============================================================
   AI 课堂 · 浅色版 v2（2026-11-08 重写）
   原则：
   1) 只覆盖配色/层级，不动布局与业务逻辑；
   2) 全站收敛为「单主色（蓝 #a85b08）+ 中性灰阶 + 三个功能色」，
      不再让青/紫/粉三色乱入（原 --cyan/--purple/--pink 全部映射到同色系）；
   3) 任何文字的对比度 ≥ 4.5:1，正文 ≥ 7:1（WCAG AA/AAA）；
   4) 深色主题沿用 4 个 themes/*.css 原生霓虹深空，本文件完全不参与。
   真源：本文件即线上 /opt/portal/ai/ai-light.css，勿在其他文件里改浅色。
   ============================================================ */

/* ---------- 0. 基准 ---------- */
html.dm-shell-on > body { box-sizing: border-box; height: 100vh; height: 100dvh; }

html[data-dm-theme="light"] body {
  background: #fdf6ea !important;
  color: #2f2417 !important;
}
html[data-dm-theme="light"] .bg-grid { opacity: .26 }
html[data-dm-theme="light"] .bg-glow { opacity: .22 }
html[data-dm-theme="light"] #particles { opacity: .16 }

/* ---------- 1. shell chrome（侧栏 / 顶栏 / 首页卡片） ---------- */
html[data-dm-theme="light"] #sidebar {
  background: rgba(255,255,255,.96) !important;
  border-right: 1px solid rgba(122,80,30,.12) !important;
}
html[data-dm-theme="light"] .side-head,
html[data-dm-theme="light"] .side-foot,
html[data-dm-theme="light"] .content-bar {
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(122,80,30,.10) !important;
}
html[data-dm-theme="light"] .side-sub,
html[data-dm-theme="light"] .nav-caption,
html[data-dm-theme="light"] .tt-count,
html[data-dm-theme="light"] .crumb { color: #6b5638 !important; }
html[data-dm-theme="light"] .side-title { -webkit-text-fill-color: #a85b08; }

html[data-dm-theme="light"] .theme-tab {
  background: rgba(168,91,8,.06) !important;
  border-color: rgba(122,80,30,.14) !important;
  color: #6b5638 !important;
}
html[data-dm-theme="light"] .theme-tab.active {
  background: rgba(168,91,8,.12) !important;
  color: #a85b08 !important;
  box-shadow: inset 0 0 0 1px rgba(168,91,8,.34) !important;
}
html[data-dm-theme="light"] .nav-btn,
html[data-dm-theme="light"] .icon-btn,
html[data-dm-theme="light"] .side-home-btn {
  background: rgba(168,91,8,.06) !important;
  border-color: rgba(122,80,30,.14) !important;
  color: #2f2417 !important;
}
html[data-dm-theme="light"] #sideNav a,
html[data-dm-theme="light"] .nav-item { color: #2f2417 !important; }
html[data-dm-theme="light"] #navSearch {
  background: #fff !important;
  border-color: rgba(122,80,30,.18) !important;
  color: #2f2417 !important;
}
html[data-dm-theme="light"] #loader { background: #fdf6ea !important; color: #2f2417 !important; }

/* 课程目录：序号 / 状态 / 未解锁态（原来 #93a4cf 只有 2.48:1） */
html[data-dm-theme="light"] .l-num { color: #8a7358 !important; }
html[data-dm-theme="light"] .lesson-item.active .l-num { color: #a85b08 !important; }
html[data-dm-theme="light"] .lesson-item.done .l-num { color: #177a43 !important; }
html[data-dm-theme="light"] .l-state { color: #8a7358 !important; }
html[data-dm-theme="light"] .lesson-item.done .l-state { color: #177a43 !important; }
html[data-dm-theme="light"] .lesson-item { color: #5f4c34 !important; }
html[data-dm-theme="light"] .lesson-item.active {
  background: rgba(168,91,8,.10) !important;
  color: #8a4a06 !important;
  box-shadow: inset 0 0 0 1px rgba(168,91,8,.26) !important;
}
html[data-dm-theme="light"] .lesson-item:hover { background: rgba(168,91,8,.06) !important; }

/* 首页课程卡（hub 版式）：浅色走奶油纸面 */
html[data-dm-theme="light"] .course-card {
  background: #fffefb !important;
  border-color: rgba(122,80,30,.14) !important;
  box-shadow: 0 8px 24px rgba(122,80,30,.07) !important;
}
html[data-dm-theme="light"] .course-card:hover,
html[data-dm-theme="light"] .course-card[open] {
  border-color: rgba(168,91,8,.42) !important;
  box-shadow: 0 14px 34px rgba(168,91,8,.14) !important;
}
html[data-dm-theme="light"] .cc-name { color: #2f2417 !important; }
html[data-dm-theme="light"] .cc-name small { color: #8a7358 !important; }
html[data-dm-theme="light"] .cc-desc { color: #5f4c34 !important; }
html[data-dm-theme="light"] .cc-caret { color: #8a7358 !important; }
html[data-dm-theme="light"] .cc-ico { border-color: rgba(122,80,30,.16) !important; }
html[data-dm-theme="light"] .cc-count { border-color: rgba(122,80,30,.16) !important; }
html[data-dm-theme="light"] .cc-bar { background: #f0e2c8 !important; }
html[data-dm-theme="light"] .cc-lesson { color: #5f4c34 !important; }
html[data-dm-theme="light"] .cc-lesson:hover { color: #2f2417 !important; }
html[data-dm-theme="light"] .cc-lesson.done { color: #2f2417 !important; }
html[data-dm-theme="light"] .cc-lesson .n { color: #8a7358 !important; }
html[data-dm-theme="light"] .cc-lessons { scrollbar-color: var(--c) #f0e2c8 !important; }
html[data-dm-theme="light"] .cc-lessons::-webkit-scrollbar-track { background: #f0e2c8 !important; }
html[data-dm-theme="light"] .home-stat { color: #5f4c34 !important; }
html[data-dm-theme="light"] .home-stat b { color: #a85b08 !important; }
/* 浅色下把每张卡的主题色压深（chip/标签/进度条/CTA 共用 var(--c/--cbg)），保证奶油底上对比达标 */
html[data-dm-theme="light"] .course-grid > *:nth-child(1) { --c: #1f8a6a !important; --cbg: rgba(31,138,106,.12) !important; }
html[data-dm-theme="light"] .course-grid > *:nth-child(2) { --c: #a85b08 !important; --cbg: rgba(168,91,8,.10) !important; }
html[data-dm-theme="light"] .course-grid > *:nth-child(3) { --c: #d4546b !important; --cbg: rgba(212,84,107,.10) !important; }
html[data-dm-theme="light"] .course-grid > *:nth-child(4) { --c: #9a5a10 !important; --cbg: rgba(154,90,16,.10) !important; }

/* ---------- 2. 四主题色板重映射（关键：一次性收敛青/紫/粉） ---------- */
html[data-dm-theme="light"] #app[data-tk] {
  --bg: #fdf6ea;          --bg2: #ffffff;
  --panel: rgba(255,255,255,.94); --panel-solid: #ffffff;
  --line: rgba(122,80,30,.13);

  /* 原来分别是 青/紫/粉/青绿/琥珀，浅色下统一到同色系 */
  --cyan: #a85b08;        --purple: #c77b1e;      --pink: #a85b08;
  --lime: #177a43;        --gold: #8a5a00;
  --c1: #a85b08;          --c2: #c77b1e;
  --c1deep: #8a4a06;      --c2deep: #c77b1e;
  --accent: #a85b08;

  --text: #2f2417;        --muted: #6b5638;
  --grad: linear-gradient(110deg, #a85b08, #c77b1e 55%, #a85b08);
  --grad-soft: linear-gradient(135deg, rgba(168,91,8,.10), rgba(168,91,8,.04));
  --shadow: 0 14px 38px rgba(122,80,30,.10);
  --ink: #2f2417;         --paper: #ffffff;
  --blue: #a85b08;        --green: #177a43;       --orange: #a25900;
  --yellow: #8a5a00;      --pink-ink: #a8327a;
}

/* ---------- 3. 卡片 / 面板 ---------- */
html[data-dm-theme="light"] #app[data-tk] {
  background: #fdf6ea !important;
  color: #2f2417 !important;
}
html[data-dm-theme="light"] #app[data-tk] :is(.block,.card,.panel,.box,.quiz,.demo-box,.lesson-card,.lab-card,.step,.note,.tip) {
  background: #ffffff !important;
  color: #2f2417 !important;
  border-color: rgba(122,80,30,.12) !important;
  box-shadow: 0 8px 24px rgba(122,80,30,.06) !important;
}
html[data-dm-theme="light"] #app[data-tk] h1,
html[data-dm-theme="light"] #app[data-tk] h2,
html[data-dm-theme="light"] #app[data-tk] h3,
html[data-dm-theme="light"] #app[data-tk] h4 { color: #2f2417 !important; }

/* 主题 CSS 里写死的深蓝大面板 */
html[data-dm-theme="light"] #app[data-tk] :where(
  .wrap,.lesson,.block,.block-body,.card,.hero,.lesson-hero,.panel,.box,.section,
  .demo,.video-wrap,.video-frame,.vf-cover,.vf-anim,.video-tip,.quiz-q,.quiz-inner,
  .tm-card,.mis,.solver,.merge-log,.pb-out,.rag-left,.demo-readout,
  .kbd,.vsel,.vc-item,.pb-f,.term-card,.stage,.note,.tip,.course-card,.lab-card
) {
  background: #ffffff !important;
  background-image: none !important;
  color: #2f2417 !important;
  border-color: rgba(122,80,30,.12) !important;
  box-shadow: 0 8px 22px rgba(122,80,30,.06) !important;
}

/* 正文/次级文字：只在浅底容器里生效，避免把深底白字打黑 */
html[data-dm-theme="light"] #app[data-tk] :is(.block,.card,.panel,.box,.lesson,.lesson-hero,.wrap,.section,.demo,.demo-box,.lab-card,.quiz,.quiz-inner,.note,.tip,.stage) :where(p,li,small,label,td,th) {
  color: #5f4c34 !important;
}
html[data-dm-theme="light"] #app[data-tk] .muted,
html[data-dm-theme="light"] #app[data-tk] .sub { color: #6b5638 !important; }

/* ---------- 4. 「机器在想什么」伪代码面板：浅色代码皮肤 ---------- */
html[data-dm-theme="light"] #app[data-tk] .code-wrap {
  background: #fffdf6 !important;
  background-image: none !important;
  border: 1px solid #ecdfc4 !important;
  border-radius: 12px !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 4px 14px rgba(122,80,30,.06) !important;
}
html[data-dm-theme="light"] #app[data-tk] .code-head {
  background: #f3e6cc !important;
  background-image: none !important;
  border-bottom: 1px solid #ecdfc4 !important;
  color: #5f4c34 !important;
  font-weight: 700 !important;
  letter-spacing: .2px;
}
html[data-dm-theme="light"] #app[data-tk] .code-head span,
html[data-dm-theme="light"] #app[data-tk] .code-head b { color: #403322 !important; }
html[data-dm-theme="light"] #app[data-tk] .code-pre,
html[data-dm-theme="light"] #app[data-tk] .code-pop .code-pre {
  background: transparent !important;
  background-image: none !important;
  color: #403322 !important;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace !important;
  font-size: 13px !important;
  line-height: 1.72 !important;
  tab-size: 4;
}

/* ---------- 5. 按钮：mini-btn / ln-btn / seg-b ---------- */
html[data-dm-theme="light"] #app[data-tk] .mini-btn {
  background: #a85b08 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid #8a4a06 !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 6px rgba(168,91,8,.22) !important;
}
html[data-dm-theme="light"] #app[data-tk] .mini-btn:hover { background: #8a4a06 !important; }
html[data-dm-theme="light"] #app[data-tk] .mini-btn.alt {
  background: #ffffff !important;
  color: #a85b08 !important;
  border: 1px solid rgba(168,91,8,.48) !important;
}
html[data-dm-theme="light"] #app[data-tk] .ln-btn {
  background: #ffffff !important;
  background-image: none !important;
  color: #403322 !important;
  border: 1px solid rgba(122,80,30,.16) !important;
  border-radius: 12px !important;
}
html[data-dm-theme="light"] #app[data-tk] .ln-btn.primary {
  background: #a85b08 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid #8a4a06 !important;
  box-shadow: 0 6px 18px rgba(168,91,8,.22) !important;
}
html[data-dm-theme="light"] #app[data-tk] .ln-btn:hover { border-color: rgba(168,91,8,.50) !important; }
html[data-dm-theme="light"] #app[data-tk] .seg-b {
  background: #ffffff !important;
  border-color: rgba(122,80,30,.16) !important;
  color: #5f4c34 !important;
}
html[data-dm-theme="light"] #app[data-tk] .seg-b.on {
  background: #a85b08 !important;
  border-color: #8a4a06 !important;
  color: #ffffff !important;
}

/* ---------- 6. 视频封面占位（原来白字白底 = 1:1） ---------- */
html[data-dm-theme="light"] #app[data-tk] .vf-cover { background: #f8f1e0 !important; }
html[data-dm-theme="light"] #app[data-tk] .vf-label {
  color: #5f4c34 !important;
  text-shadow: none !important;
}
html[data-dm-theme="light"] #app[data-tk] .video-frame[data-ready="1"] .vf-label { color: #177a43 !important; }
html[data-dm-theme="light"] #app[data-tk] .video-frame[data-ready="0"] .vf-label { color: #6b5638 !important; }
html[data-dm-theme="light"] #app[data-tk] .vf-anim { background: rgba(168,91,8,.06) !important; border-color: rgba(168,91,8,.20) !important; }

/* ---------- 7. 演示区：readout / prog / note / tag ---------- */
html[data-dm-theme="light"] #app[data-tk] .demo-readout { color: #403322 !important; }
html[data-dm-theme="light"] #app[data-tk] .demo-prog {
  color: #6b5638 !important;
  background: #fdf6ea !important;
  border: 1px solid rgba(122,80,30,.12) !important;
}
html[data-dm-theme="light"] #app[data-tk] .demo-prog.ok { color: #177a43 !important; background: #eaf6ef !important; border-color: rgba(23,122,67,.34) !important; }
html[data-dm-theme="light"] #app[data-tk] .demo-note {
  background: #f8f1e0 !important;
  color: #5f4c34 !important;
  border-left: 3px solid #a85b08 !important;
}
html[data-dm-theme="light"] #app[data-tk] .demo-tip {
  background: #fffdf6 !important;
  border: 1px dashed rgba(138,90,0,.42) !important;
  color: #6b4700 !important;
}
html[data-dm-theme="light"] #app[data-tk] .find-scene { background: #f8f1e0 !important; }
html[data-dm-theme="light"] #app[data-tk] .find-orb {
  background: #ffffff !important;
  border-color: rgba(122,80,30,.14) !important;
}
html[data-dm-theme="light"] #app[data-tk] .find-hot .tag {
  background: #8a4a06 !important;
  color: #ffffff !important;
}
html[data-dm-theme="light"] #app[data-tk] .find-hot.found .tag { background: #177a43 !important; }
html[data-dm-theme="light"] #app[data-tk] .pill {
  background: #ffffff !important;
  border-color: rgba(122,80,30,.14) !important;
  color: #5f4c34 !important;
}
html[data-dm-theme="light"] #app[data-tk] .pill b { color: #a85b08 !important; }

/* ---------- 8. 测验 / 选项 ---------- */
html[data-dm-theme="light"] #app[data-tk] .opt {
  background: #ffffff !important;
  border-color: rgba(122,80,30,.14) !important;
  color: #5f4c34 !important;
}
html[data-dm-theme="light"] #app[data-tk] .opt:hover { border-color: rgba(168,91,8,.46) !important; background: #fff8e8 !important; }
html[data-dm-theme="light"] #app[data-tk] .opt.disabled { opacity: .92; }
html[data-dm-theme="light"] #app[data-tk] .qq-note { color: #6b5638 !important; }
html[data-dm-theme="light"] #app[data-tk] .qq-explain {
  background: #f8f1e0 !important;
  color: #5f4c34 !important;
  border-left: 3px solid #a85b08 !important;
}

/* ---------- 9. 深色画布保留深色（JS 用亮色线条绘制） ---------- */
html[data-dm-theme="light"] #app[data-tk] .demo-canvas,
html[data-dm-theme="light"] #app[data-tk] canvas.demo-canvas {
  background: #0d1526 !important;
  border: 1px solid rgba(122,80,30,.28) !important;
  border-radius: 12px !important;
}

/* ---------- 10. 收尾：加载文案 / 进度圆环 / 正文行宽 / 视频封面 ---------- */
html[data-dm-theme="light"] #loader span,
html[data-dm-theme="light"] #loader .loader-core { color: #6b5638 !important; }
html[data-dm-theme="light"] .prog-txt,
html[data-dm-theme="light"] .prog-txt span { color: #6b5638 !important; }

/* 长段落限宽：原 1066px / 15.5px ≈ 70 字一行，收到 44 字左右更易读 */
html[data-dm-theme="light"] #app[data-tk] .block > p,
html[data-dm-theme="light"] #app[data-tk] .block-body > p,
html[data-dm-theme="light"] #app[data-tk] .lesson > p {
  max-width: 46em;
  color: #5f4c34 !important;
  line-height: 1.85 !important;
}

/* 视频封面：白底 + 品牌蓝渐变描边 + 圆形播放键，避免「一大块空白」 */
html[data-dm-theme="light"] #app[data-tk] .video-frame {
  background:
    radial-gradient(120% 90% at 50% 40%, #ffffff 0%, #f8f1e0 62%, #e8eefa 100%) !important;
  border: 1px solid rgba(122,80,30,.12) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 10px 26px rgba(122,80,30,.07) !important;
  overflow: hidden;
}
html[data-dm-theme="light"] #app[data-tk] .video-frame .play {
  background: #a85b08 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 26px rgba(168,91,8,.32) !important;
  border: 3px solid rgba(255,255,255,.92) !important;
}
html[data-dm-theme="light"] #app[data-tk] .video-frame .vf-anim {
  background: transparent !important;
  opacity: .92;
}


/* ---------- 11. 首页头图：浅色用压深的芒果渐变，避免旧浅蓝低对比 ---------- */
html[data-dm-theme="light"] .home-head p{ color:#5f4c34 !important; }
html[data-dm-theme="light"] .home-head h1{
  background:linear-gradient(96deg,#a85b08,#d4546b 68%) !important;
  -webkit-background-clip:text !important; background-clip:text !important;
  color:transparent !important;
}
