/* ════════════════════════════════════════════════════════════
   课程统一结构（国旗 / 数学 / 英语）：课程 › 板块 › 单元 › 练习
   · 板块首页：cs-head 标题行 + cs-stats 进度概览 + （可选标签）+ cs-units 单元卡片
   · 练习页：pb 顶栏（返回板块、单元名、进度、右侧设置）
   模板宏在 templates/partials/course.html，渲染卡片的小工具在 static/js/course-ui.js
   ════════════════════════════════════════════════════════════ */
.cs-main { display: flex; flex-direction: column; gap: 18px; }
.cs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.cs-crumb { font-size: 0.78rem; color: #5B6B7C; font-weight: 600; }
.cs-crumb a { color: #5B6B7C; text-decoration: none; }
.cs-crumb a:hover { color: var(--blue); }
.cs-title-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.cs-title-row .page-title { margin: 0; }
.cs-course { color: #8795A3; }
.cs-sep { color: #C6CDD6; margin: 0 8px; }
.cs-intro { margin: 6px 0 0; font-size: 0.85rem; color: #5B6B7C; }
.cs-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 进度概览：深色卡片、白字，一张普通圆角卡；颜色只留在标签前的小点上 */
.cs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cs-stat { background: var(--dark); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: #fff; display: block; }
a.cs-stat:hover { background: #3A5068; }
.cs-stat-l { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: rgba(255,255,255,.72); font-weight: 700; }
.cs-stat-l::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--blue)); flex-shrink: 0; }
.cs-stat-v { font-size: 1.6rem; font-weight: 900; margin-top: 2px; line-height: 1.2; color: #fff; }
.cs-stat-s { font-size: 0.75rem; color: rgba(255,255,255,.6); margin-top: 2px; }

/* 单元卡片 */
.cs-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cs-unit { background: #fff; border: 2px solid transparent; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 168px; box-sizing: border-box; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; color: var(--dark); transition: border-color .15s, transform .15s; }
.cs-unit:hover { border-color: var(--dark); transform: translateY(-2px); }
.cs-unit.disabled { opacity: .55; pointer-events: none; }
.cs-ico.pix { background: #F5F7FA; border: 2px solid #E3E8EF; }
.cs-ico.pix svg { width: 30px; height: 30px; image-rendering: pixelated; }
.cs-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; color: #fff; background: var(--c); }
.cs-unit-name { font-size: 1rem; font-weight: 900; }
.cs-unit-desc { font-size: 0.78rem; color: #5B6B7C; margin-top: 3px; line-height: 1.5; }
.cs-track { margin-top: auto; height: 6px; border-radius: 99px; background: #EEF1F6; overflow: hidden; }
.cs-track i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.cs-foot { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: #8795A3; }
.cs-go { font-weight: 800; color: var(--c); }
/* 大卡片（国旗按大洲）：像素地图图标 + 一排这个洲的国旗 */
.cs-units.big { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.cs-units.big .cs-ico { width: 52px; height: 52px; border-radius: 14px; }
.cs-units.big .cs-ico.pix svg { width: 38px; height: 38px; }
.cs-unit-top { display: flex; align-items: center; gap: 12px; }
.cs-unit-count { font-size: 0.8rem; color: #5B6B7C; margin-top: 2px; }
.cs-unit-count b { font-size: 1.05rem; color: var(--dark); margin-right: 2px; }
.cs-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 5px; }
.cs-thumbs img, .cs-thumbs .more { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(44,62,80,.15); background: #F5F7FA; display: block; }
.cs-thumbs img.done { box-shadow: 0 0 0 2px var(--success); }
/* 国旗缩略图统一灰色，卡片不那么花；答对的描绿边；鼠标移到卡片上再显出原色 */
/* 国旗缩略图：一行 12 面、最多两行（最后一格「+N」）；没学会的灰色，会了的点亮（原色 + 绿边） */
.cs-units.big .cs-thumbs { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.cs-thumbs img { filter: grayscale(1); opacity: .45; transition: filter .2s, opacity .2s; }
.cs-thumbs img.done { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--success), 0 0 6px rgba(46,184,114,.6); }
.cs-thumbs .more { display: grid; place-items: center; font-size: 0.66rem; font-weight: 800; color: #5B6B7C; box-shadow: none; background: #EEF1F6; }
.cs-empty { color: #5B6B7C; font-size: 0.9rem; padding: 20px 0; }

/* 练习页顶栏：三门课同一个 */
.pb { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); margin-bottom: 14px; }
.pb-back { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 2px solid #E3E8EF; background: #fff; font: inherit; font-size: 0.82rem; font-weight: 800; color: var(--dark); text-decoration: none; white-space: nowrap; }
.pb-back:hover { border-color: var(--dark); }
.pb-back svg { width: 16px; height: 16px; }
.pb-name { display: flex; flex-direction: column; line-height: 1.25; }
.pb-name b { font-size: 1rem; }
.pb-name span { font-size: 0.72rem; color: #8795A3; }
.pb-track { flex: 1; min-width: 120px; height: 8px; border-radius: 99px; background: #EEF1F6; overflow: hidden; }
.pb-track i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .3s; }
.pb-label { font-size: 0.82rem; font-weight: 800; white-space: nowrap; }
.pb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) { .pb-track { order: 9; flex-basis: 100%; } }

/* 侧边栏：数学年级的二级图标（跟其他二级图标一样用灰色，不用彩色） */
.sidebar-grade-mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 18px; border-radius: 4px; background: #A0A6B0; color: #fff; font-size: 0.68rem; font-weight: 900; }
.sidebar-subitem.active .sidebar-grade-mark { background: var(--blue); }
