/* =====================================================
 * OPC PWA · 学员端样式（手机优先 ≥375px，桌面 ≥768px 自适应）
 * v31m · 顶级美学对齐 design-tokens V3.0 / V3.1
 * 复用令牌：--navy-900 / --gold-500 / --shadow-* / --r-* / --s* / --font-sans
 * 保留全部旧 class 钩子，逻辑层（app.js）零改动
 * ===================================================== */

/* 本地别名 bridge（design-tokens.css 已定义，这里兜底以防个别页面漏链 tokens） */
:root {
  --navy: #0E1B2E;
  --navy2: #16273f;
  --gold: #C9A24B;
  --gold2: #e0bd6f;
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #e3e8ef;
  --muted: #6b7686;
  --ok: #2e9e6b;
  --warn: #d98a2b;
  --bad: #d9534f;
  --info: #2e6bd9;
  --shadow: 0 2px 10px rgba(14, 27, 46, 0.08);
  --shadow-lg: 0 8px 30px rgba(14, 27, 46, 0.15);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif);
  background: var(--bg, #f5f7fa);
  color: var(--navy, #0E1B2E);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: calc(78px + var(--safe-bottom));  /* 给底部 nav 留位 */
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }

/* ===== 微动效（优先复用 design-tokens 的 keyframes，缺失则本地兜底） ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ============== 顶部 header（藏青渐变 + 金色发丝边 + 真实 logo） ============== */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(201,162,75,.16) 0%, transparent 42%),
    linear-gradient(135deg, var(--navy-900, #0E1B2E) 0%, var(--navy-800, #16273D) 100%);
  color: #fff;
  padding: calc(12px + var(--safe-top)) 16px 14px;
  box-shadow: 0 6px 24px rgba(14, 27, 46, .22);
  border-bottom: 1px solid rgba(201, 162, 75, .22);
}
.app-header .row { display: flex; align-items: center; gap: 12px; }
.app-header .logo {
  width: 40px; height: 40px; border-radius: 11px; overflow: hidden; flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 1px rgba(201,162,75,.45);
  background: var(--navy-800, #16273f);
  display: flex; align-items: center; justify-content: center;
}
.app-header .logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-header h1 { font-size: 17px; font-weight: 800; letter-spacing: -.2px; line-height: 1.2; }
.app-header .sub { font-size: 11px; opacity: .82; margin-top: 2px; color: rgba(201,162,75,.92); }
.app-header .picker { margin-top: 10px; display: flex; gap: 8px; width: 100%; }
.app-header .picker select {
  flex: 1; padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #fff;
  font-size: 12px; font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.app-header .picker select option { color: var(--navy); background: #fff; }

/* ============== Main ============== */
main { padding: 16px 16px 8px; }
.page-title { font-size: 21px; font-weight: 800; margin: 8px 0 2px; letter-spacing: -.3px; color: var(--navy-900, #0E1B2E); }
.page-sub { color: var(--muted, #6b7686); font-size: 13px; margin: 0 0 14px; }

/* 卡片（统一圆角 + 柔和分层阴影 + 入场微动效） */
.card {
  background: var(--card, #fff);
  border: 1px solid var(--line, #e3e8ef);
  border-radius: var(--r16, 16px);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  margin-bottom: 14px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  animation: fadeInUp .5s var(--ease) both;
}
.card:hover { box-shadow: 0 10px 24px -6px rgba(15,23,42,.12); }
.card h2 {
  margin: 0 0 12px;
  font-size: 15px; font-weight: 800;
  color: var(--navy-900, #0E1B2E);
  text-transform: none; letter-spacing: 0;
  line-height: 1.3;
}

/* ============== 分色条标题组件（UI 优化：模块语义化锚定，主风格不变） ============== */
.section-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.section-bar .sb-bar { width: 4px; height: 16px; border-radius: 2px; flex: 0 0 auto; background: var(--gold-500, #C9A24B); }
.section-bar .sb-ico { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 13px; background: rgba(201,162,75,.16); color: #856429; }
.section-bar .sb-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; color: var(--navy-900, #0E1B2E); line-height: 1.3; }
.section-bar .sb-sub { font-size: 11px; font-weight: 600; color: var(--muted, #6b7686); margin-left: 6px; white-space: nowrap; }
.section-bar .sb-tag { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.section-bar.gold    .sb-bar { background: var(--gold-500, #C9A24B); }
.section-bar.gold    .sb-ico { background: rgba(201,162,75,.16); color: #856429; }
.section-bar.info    .sb-bar { background: var(--info, #2E6BD9); }
.section-bar.info    .sb-ico { background: rgba(46,107,217,.14); color: var(--info, #2E6BD9); }
.section-bar.navy    .sb-bar { background: var(--navy-900, #0E1B2E); }
.section-bar.navy    .sb-ico { background: rgba(14,27,46,.10); color: var(--navy-900, #0E1B2E); }
.section-bar.success .sb-bar { background: var(--ok, #2E9E6B); }
.section-bar.success .sb-ico { background: rgba(46,158,107,.14); color: var(--ok, #2E9E6B); }
.section-bar .sb-tag.gold    { background: rgba(201,162,75,.16); color: #856429; }
.section-bar .sb-tag.success { background: rgba(46,158,107,.18); color: #1d6b48; }

/* ============== Hero 卡片文字层级（UI 优化：明确 greet/name/meta 字号） ============== */
.hero-card { display: flex; align-items: center; gap: 14px; }
.hero-card .ring-wrap { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-card .ring-cap { position: static; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--muted, #6b7686); letter-spacing: .3px; }
.hero-card .greet { font-size: 12px; color: var(--muted, #6b7686); font-weight: 600; }
.hero-card .name { font-size: 18px; font-weight: 800; color: var(--navy-900, #0E1B2E); margin: 2px 0 6px; line-height: 1.25; }
.hero-card .meta { font-size: 12px; color: var(--slate-600, #475569); line-height: 1.7; }
.hero-card .meta b { color: var(--navy-900, #0E1B2E); }
.card h3 { font-size: 15px; font-weight: 800; color: var(--navy-900, #0E1B2E); margin: 0 0 6px; }

/* ============== Tab bar 底部导航（金激活 + 柔和浮层） ============== */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--line, #e3e8ef);
  z-index: 45; padding-bottom: var(--safe-bottom);
  box-shadow: 0 -6px 24px rgba(14,27,46,.08);
}
.tab-bar a {
  flex: 1; padding: 9px 0 7px; text-align: center; font-size: 11px;
  color: var(--muted, #6b7686); font-weight: 600;
  position: relative; transition: color .18s var(--ease);
}
.tab-bar a .ti { display: block; font-size: 20px; line-height: 1.1; margin-bottom: 2px; transition: transform .18s var(--ease); }
.tab-bar a.active { color: var(--navy-900, #0E1B2E); }
.tab-bar a.active .ti { transform: translateY(-1px) scale(1.06); }
.tab-bar a.active::before {
  content: ""; display: block; width: 26px; height: 3px;
  background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  border-radius: 2px; margin: -6px auto 4px;
  box-shadow: 0 2px 8px rgba(201,162,75,.5);
}

/* ============== User chip（右上角，玻璃胶囊） ============== */
.user-chip {
  position: fixed; top: calc(10px + var(--safe-top)); right: 12px; z-index: 46;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.22);
  padding: 4px 10px 4px 4px; border-radius: 24px;
  color: #fff; font-size: 12px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(14,27,46,.18);
}
.user-chip .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  color: var(--navy-900, #0E1B2E);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px;
}
.user-chip-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--card, #fff); color: var(--navy, #0E1B2E);
  border: 1px solid var(--line, #e3e8ef); border-radius: 12px;
  padding: 8px; min-width: 168px; box-shadow: var(--shadow-lg, 0 8px 30px rgba(14,27,46,.15));
  display: none;
}
.user-chip-menu.open { display: block; animation: popIn .18s var(--ease) both; }
.user-chip-menu a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--navy, #0E1B2E); font-size: 13px; }
.user-chip-menu a:hover { background: var(--bg, #f5f7fa); }

/* ============== Desktop nav (≥768) ============== */
body.lg .app-header { position: relative; }
body.lg .user-chip { top: 16px; }
body.lg .tab-bar { display: none; }
body.lg .desktop-nav { display: flex; }
.desktop-nav {
  display: none; position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line, #e3e8ef); padding: 10px 18px; gap: 6px;
}
.desktop-nav a {
  padding: 8px 16px; border-radius: 10px; font-size: 13px;
  font-weight: 600; color: var(--muted, #6b7686); cursor: pointer;
  transition: all .18s var(--ease);
}
.desktop-nav a:hover { background: var(--slate-100, #F1F5F9); color: var(--navy-900, #0E1B2E); }
.desktop-nav a.active {
  background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  color: var(--navy-900, #0E1B2E);
  box-shadow: 0 4px 14px rgba(201,162,75,.32);
}
/* ============== PC 全屏布局（body.lg）：左侧竖排导航 + 右侧内容 ============== */
/* v1.5.61：参考导师端 cockpit 侧栏（分组标题 + 竖排 nav-item + active 藏青底金字）。
   全部规则挂 body.lg（≥1024 或 ?desktop=1）→ 移动端底部 tab-bar 完全不受影响。 */
body.lg { padding-bottom: 0; }
body.lg #root { max-width: none; padding: 0; }
body.lg .app-header {
  margin-left: var(--pc-nav-w, 236px);
  padding-left: 40px; padding-right: 40px;
  position: sticky; top: 0; z-index: 40;
}
body.lg .desktop-nav {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
  width: var(--pc-nav-w, 236px); max-width: none;
  padding: 18px 14px; overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line, #e3e8ef); border-bottom: none;
  box-shadow: 2px 0 14px rgba(14,27,46,.05);
}
body.lg .desktop-nav .dn-title {
  font-size: 11px; font-weight: 700; color: var(--slate-500, #94a3b8);
  letter-spacing: 1px; padding: 0 10px 10px;
}
body.lg .desktop-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; font-size: 14px;
  color: var(--slate-700, #334155); font-weight: 600;
}
body.lg .desktop-nav a .ico { width: 18px; text-align: center; opacity: .75; font-size: 15px; }
body.lg .desktop-nav a:hover { background: var(--slate-100, #F1F5F9); color: var(--navy-900, #0E1B2E); }
body.lg .desktop-nav a.active {
  background: var(--navy-900, #0E1B2E); color: #fff; box-shadow: none;
}
body.lg .desktop-nav a.active .ico { color: var(--gold-500, #C9A24B); opacity: 1; }
/* v1.5.61：只命中 #root 的直接子 main。
   注意：renderHeader() 已输出一层 <main>，各页面又拼一层 <main>（嵌套），
   若用 body.lg main 会把 margin-left/padding 叠加到嵌套层，内容被挤窄。 */
body.lg #root > main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  max-width: none;
  margin: 0 0 0 var(--pc-nav-w, 236px);
  padding: 28px 40px 64px;
  align-items: start;
}
body.lg .pc-hide { display: none !important; }   /* 资料库：PC 首页不展示，已在学习中心 */
body.lg main .card { margin-bottom: 0; }
body.lg .hero-card { gap: 40px; padding: 26px 30px; }
body.lg .coach-fab { right: 28px; bottom: 28px; }

/* 今日任务：PC 全宽下五个真实节点横向铺开（每节点一列） */
body.lg #today .card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
body.lg #today .section-bar,
body.lg #today .seen-tip { grid-column: 1 / -1; }
body.lg #today .task-item {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 16px;
}
body.lg #today .task-item .stat { margin-top: auto; }
body.lg #today .btn-primary { grid-column: 1 / -1; }
@media (min-width: 768px) and (max-width: 1180px) {
  body.lg #today .card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 结业进度：PC 底部显示条（进度条 + 状态文案） */
.pc-only { display: none; }
body.lg .pc-only { display: flex; }
/* 结业进度条：移动端竖向 / PC 横向（统一结构，移动端同步显示） */
.cert-bar { display: flex; flex-direction: column; gap: 8px; }
.cert-bar-label { font-size: 14px; font-weight: 800; color: var(--navy-900, #0E1B2E); }
.cert-track { height: 10px; border-radius: 999px; background: #e3e8ef; overflow: hidden; }
.cert-fill { height: 100%; border-radius: 999px; background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334)); transition: width .4s var(--ease); }
.cert-bar-val { font-size: 12px; color: var(--slate-600, #475569); }
body.lg .cert-card { padding: 16px 26px; }
body.lg .cert-bar { flex-direction: row; align-items: center; gap: 18px; }
body.lg .cert-bar-label { font-weight: 500; }
body.lg .cert-track { flex: 1; }
body.lg .cert-bar-val { white-space: nowrap; }
body.lg .cert-card > .row,
body.lg .cert-card > .empty { display: none; }

/* ============== FAB（学员端 AI 教练悬浮） ============== */
.coach-fab {
  position: fixed; right: 18px; bottom: calc(86px + var(--safe-bottom));
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  color: var(--navy-900, #0E1B2E); display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(201, 162, 75, .45); cursor: pointer; z-index: 44;
  border: 2px solid rgba(255,255,255,.9);
  transition: transform .2s var(--ease);
}
.coach-fab:active { transform: scale(.94); }

/* ============== CHAT V3（DeepSeek 真打） ============== */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 420px; }
.chat-stream {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; overflow-y: auto; padding: 14px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  border-radius: 14px; border: 1px solid var(--line, #e3e8ef);
}
.bubble {
  max-width: 88%; padding: 12px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.6; word-wrap: break-word;
  position: relative; box-shadow: 0 1px 2px rgba(14,27,46,.05);
  animation: popIn .22s var(--ease) both;
}
.bubble.me {
  background: linear-gradient(135deg, var(--gold-500, #C9A24B) 0%, var(--gold-600, #A68334) 100%);
  color: var(--navy-900, #0E1B2E); margin-left: auto; border-bottom-right-radius: 4px;
}
.bubble.ai {
  background: #fff; color: var(--navy-900, #0E1B2E);
  border: 1px solid var(--line, #e3e8ef); border-bottom-left-radius: 4px;
  border-left: 3px solid var(--gold-500, #C9A24B);
}
.bubble.ai strong { color: var(--navy-900, #0E1B2E); font-weight: 700; }
.bubble.ai code { background: rgba(14,27,46,.06); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--navy2, #16273f); }

.llm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; padding: 2px 8px;
  background: rgba(46, 107, 217, .12); color: var(--info, #2e6bd9);
  border-radius: 8px; font-weight: 700; margin-left: 6px; vertical-align: middle;
}
.llm-badge.error { background: rgba(217, 83, 79, .12); color: var(--bad, #d9534f); }
.llm-badge .latency { color: var(--muted, #6b7686); font-weight: 500; }

.rag-sources { margin-top: 10px; border-top: 1px dashed var(--line, #e3e8ef); padding-top: 8px; }
.rag-sources .src-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--muted, #6b7686);
  cursor: pointer; user-select: none; margin-bottom: 4px;
}
.rag-sources .src-title::before { content: "📎"; font-size: 11px; }
.rag-sources .src-title .count {
  background: var(--gold-500, #C9A24B); color: var(--navy-900, #0E1B2E);
  padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 800;
}
.rag-sources .src-title .toggle { margin-left: auto; color: var(--muted, #6b7686); transition: transform .2s; }
.rag-sources.open .src-title .toggle { transform: rotate(180deg); }
.rag-sources .src-list { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.rag-sources.open .src-list { max-height: 600px; overflow-y: auto; }
.rag-sources .src-item {
  background: var(--bg, #f5f7fa); border-left: 2px solid var(--gold-500, #C9A24B);
  padding: 8px 10px; margin-bottom: 6px; border-radius: 6px; font-size: 12px; line-height: 1.55;
}
.rag-sources .src-item .src-label {
  display: inline-block; background: var(--navy-900, #0E1B2E); color: var(--gold-500, #C9A24B);
  font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-bottom: 4px; font-weight: 700;
}
.rag-sources .src-item .src-text { color: var(--navy-900, #0E1B2E); font-weight: 400; }

.bubble .src {
  display: block; font-size: 11px; color: var(--muted, #6b7686);
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line, #e3e8ef);
}

.chat-input { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }
.chat-input input {
  flex: 1; padding: 12px 16px; border: 1.5px solid var(--line, #e3e8ef);
  border-radius: 24px; font-size: 15px; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.chat-input input:focus { border-color: var(--gold-500, #C9A24B); box-shadow: 0 0 0 4px rgba(201,162,75,.14); }
.chat-input button {
  padding: 0 22px; border: none; border-radius: 24px;
  background: linear-gradient(135deg, var(--navy-900, #0E1B2E) 0%, var(--navy-800, #16273D) 100%);
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: transform .15s;
}
.chat-input button:hover:not(:disabled) { transform: scale(1.04); }
.chat-input button:disabled { opacity: .5; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--line, #e3e8ef); background: #fff;
  border-radius: 18px; padding: 7px 12px; font-size: 12px; cursor: pointer;
  color: var(--navy-900, #0E1B2E); transition: all .15s;
}
.chips button:hover { border-color: var(--gold-500, #C9A24B); background: #fffbf0; transform: translateY(-1px); }

.history-trigger {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.2); color: #fff;
  border: 1px solid rgba(255,255,255,.3); padding: 4px 10px; border-radius: 16px;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.history-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 88%; max-width: 340px;
  background: var(--card, #fff); z-index: 60; transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 30px rgba(0,0,0,.2); display: flex; flex-direction: column;
}
.history-drawer.open { transform: translateX(0); }
.history-drawer .head {
  background: linear-gradient(135deg, var(--navy-900, #0E1B2E), var(--navy-800, #16273D));
  color: var(--gold-500, #C9A24B); padding: 18px 16px 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.history-drawer .close { cursor: pointer; font-size: 20px; }
.history-drawer .body { flex: 1; overflow-y: auto; padding: 10px; }
.history-drawer .item {
  padding: 10px 12px; border-radius: 10px; background: var(--bg, #f5f7fa);
  margin-bottom: 8px; cursor: pointer; font-size: 13px;
}
.history-drawer .item:hover { background: #e8eef5; }
.history-drawer .item .q { font-weight: 700; color: var(--navy-900, #0E1B2E); margin-bottom: 4px; }
.history-drawer .item .a {
  color: var(--muted, #6b7686); font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.history-drawer .empty { text-align: center; color: var(--muted, #6b7686); padding: 40px 0; }
.history-drawer .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 55; display: none; }
.history-drawer.open + .backdrop { display: block; }

.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span {
  width: 6px; height: 6px; background: var(--gold-500, #C9A24B); border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  background: var(--gold-500, #C9A24B); vertical-align: -2px; border-radius: 1px;
  box-shadow: 0 0 6px rgba(201, 162, 75, .55); animation: caretBlink .85s steps(1, end) infinite;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.caret-done { animation: none; opacity: 0; transition: opacity .25s ease; }

/* ============== V5 主动 push 角标 + 模态框 ============== */
.push-bell {
  position: relative; margin-left: auto;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px; padding: 6px 10px 6px 12px; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: all .2s ease; color: #fff; font-size: 13px; font-weight: 700;
}
.push-bell:hover { background: rgba(201, 162, 75, .25); border-color: var(--gold-500, #C9A24B); }
.push-bell .bell-icon { font-size: 16px; }
.push-bell .bell-count {
  background: #ff4757; color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px;
  border-radius: 10px; min-width: 18px; text-align: center; box-shadow: 0 0 0 2px rgba(14, 27, 46, 1);
}
.push-bell.bell-pulse { animation: bellShake .5s ease-in-out 3; }
@keyframes bellShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-15deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }

.push-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.push-modal-mask { position: absolute; inset: 0; background: rgba(14, 27, 46, .55); backdrop-filter: blur(6px); animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.push-modal-card {
  position: relative; width: 100%; max-width: 480px; max-height: 80vh;
  background: linear-gradient(180deg, #fff 0%, #fdfaf2 100%); border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(14, 27, 46, .25); display: flex; flex-direction: column;
  animation: slideUp .35s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--safe-bottom);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.push-modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line, #e3e8ef); font-size: 14px; font-weight: 800; color: var(--navy-900, #0E1B2E);
}
.push-modal-head::before {
  content: ""; display: inline-block; width: 3px; height: 14px;
  background: linear-gradient(180deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  margin-right: 8px; border-radius: 2px;
}
.push-modal-close { background: var(--bg, #f5f7fa); border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 14px; cursor: pointer; color: var(--muted, #6b7686); display: flex; align-items: center; justify-content: center; }
.push-modal-body { flex: 1; overflow-y: auto; padding: 18px 18px 12px; font-size: 14px; line-height: 1.85; color: var(--navy-900, #0E1B2E); }
.push-streaming { white-space: pre-wrap; word-break: break-word; }
.push-modal-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line, #e3e8ef); display: flex; justify-content: flex-end; }
.push-modal-read {
  background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  color: var(--navy-900, #0E1B2E); border: none; border-radius: 999px; padding: 10px 24px;
  font-size: 13px; font-weight: 800; letter-spacing: .5px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(201, 162, 75, .35); transition: transform .15s ease;
}
.push-modal-read:hover { transform: translateY(-1px); }
.push-modal-read:active { transform: translateY(0); }

/* ============== V3 学员档案 Banner + Pill ============== */
.ctx-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fff 0%, rgba(201,162,75,.10) 100%);
  border: 1.5px solid var(--gold-500, #C9A24B); border-radius: 14px; padding: 12px 14px;
  margin: 8px 0 12px; box-shadow: 0 2px 12px rgba(201,162,75,.18);
}
.ctx-banner-icon { font-size: 28px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 2px 4px rgba(201,162,75,.3)); }
.ctx-banner-content { flex: 1; min-width: 0; }
.ctx-banner-title { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--navy2, #16273f); text-transform: uppercase; margin-bottom: 4px; }
.ctx-banner-sub { font-size: 13px; color: var(--navy, #0E1B2E); font-weight: 600; line-height: 1.5; }
.ctx-banner-sub b { color: var(--gold-600, #A68334); font-weight: 800; }

.ctx-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line, #e3e8ef); }
.ctx-pill { display: inline-flex; align-items: center; background: var(--navy-900, #0E1B2E); color: var(--gold-500, #C9A24B); font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 10px; letter-spacing: .4px; }
.ctx-pill-gold { background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334)); color: var(--navy-900, #0E1B2E); }
.ctx-pill-blue { background: #2E6BD9; color: #fff; }
.ctx-pill-ok { background: var(--ok, #2e9e6b); color: #fff; }
.ctx-meta { font-size: 10px; color: var(--muted, #6b7686); font-weight: 500; margin-left: 4px; }

/* ============== 证书 ============== */
.cert-card {
  background: linear-gradient(135deg, #fff 0%, #fcf9f1 100%);
  border: 2px solid var(--gold-500, #C9A24B); border-radius: 16px; padding: 22px 18px;
  text-align: center; position: relative; box-shadow: 0 10px 30px rgba(201,162,75,.18); margin-bottom: 14px;
}
.cert-card::before, .cert-card::after { content: ""; position: absolute; width: 24px; height: 24px; border: 2px solid var(--gold-500, #C9A24B); }
.cert-card::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.cert-card::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.cert-name { font-size: 22px; font-weight: 800; color: var(--navy-900, #0E1B2E); margin: 12px 0 6px; }
.cert-meta { font-size: 12px; color: var(--muted, #6b7686); margin-bottom: 12px; }
.cert-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.cert-stats .stat { padding: 8px 6px; background: var(--bg, #f5f7fa); border-radius: 8px; }
.cert-stats .num { font-size: 18px; font-weight: 800; color: var(--gold-600, #A68334); }
.cert-stats .lbl { font-size: 10px; color: var(--muted, #6b7686); }

/* ============== 进度环（藏青底 + 金色环 + 光晕） ============== */
.progress-ring { position: relative; width: 140px; height: 140px; margin: 0 auto; filter: drop-shadow(0 6px 16px rgba(14,27,46,.12)); }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 10; }
.progress-ring .track { stroke: rgba(14,27,46,.07); }
.progress-ring .bar {
  stroke: url(#goldGrad); stroke: var(--gold-500, #C9A24B); stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(201,162,75,.45));
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
}
.progress-ring .num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: var(--navy-900, #0E1B2E); flex-direction: column; line-height: 1;
}
.progress-ring .pct { font-size: 11px; color: var(--muted, #6b7686); margin-top: 4px; font-weight: 600; letter-spacing: 1px; }

/* ============== 任务（首页今日任务卡） ============== */
.task-day {
  background: var(--card, #fff); border: 1px solid var(--line, #e3e8ef); border-radius: 12px;
  padding: 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.task-day:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14,27,46,.08); }
.task-day .day-no {
  flex: 0 0 50px; text-align: center; background: linear-gradient(135deg, var(--navy-900, #0E1B2E), var(--navy-800, #16273D));
  color: var(--gold-500, #C9A24B); border-radius: 10px; padding: 8px 6px;
}
.task-day .day-no .n { font-size: 18px; font-weight: 800; line-height: 1; }
.task-day .day-no .lbl { font-size: 9px; opacity: .8; margin-top: 2px; }
.task-day .info { flex: 1; }
.task-day .info h3 { margin: 0; font-size: 14px; font-weight: 700; }
.task-day .info p { margin: 4px 0 0; font-size: 12px; color: var(--muted, #6b7686); }
.task-day .status { flex: 0 0 auto; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.task-day .status.done { background: rgba(46,158,107,.15); color: var(--ok, #2e9e6b); }
.task-day .status.doing { background: rgba(217,138,43,.15); color: var(--warn, #d98a2b); }
.task-day .status.todo { background: var(--bg, #f5f7fa); color: var(--muted, #6b7686); }

/* ============== 工具 ============== */
.spacer { height: 80px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--gold-500, #C9A24B); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 40px 0; color: var(--muted, #6b7686); }

/* 4 节点 timeline */
.timeline { display: flex; justify-content: space-between; position: relative; margin: 20px 0; }
.timeline::before { content: ""; position: absolute; top: 12px; left: 6%; right: 6%; height: 2px; background: var(--line, #e3e8ef); z-index: 0; }
.timeline .node { position: relative; z-index: 1; text-align: center; flex: 1; }
.timeline .node .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--card, #fff); border: 2px solid var(--line, #e3e8ef); margin: 0 auto 6px; }
.timeline .node.done .dot { background: var(--ok, #2e9e6b); border-color: var(--ok, #2e9e6b); box-shadow: 0 0 0 4px rgba(46,158,107,.18); }
.timeline .node.doing .dot { background: var(--gold-500, #C9A24B); border-color: var(--gold-500, #C9A24B); box-shadow: 0 0 0 4px rgba(201,162,75,.18); }
.timeline .node .name { font-size: 11px; font-weight: 700; }
.timeline .node .n { font-size: 9px; color: var(--muted, #6b7686); }

/* =====================================================================
 * v31e · 28 天任务流（/m/tasks.html）
 * ===================================================================== */
.tl-list { display: flex; flex-direction: column; gap: 10px; }
.tl-day {
  background: var(--card, #fff); border: 1px solid var(--line, #e5e9f0); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 1px 3px rgba(14,27,46,.05);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  animation: fadeInUp .5s var(--ease) both;
}
.tl-day:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -6px rgba(14,27,46,.12); }
.tl-day.today { border-color: var(--gold-500, #C9A24B); box-shadow: 0 6px 20px rgba(201,162,75,.2); }
.tl-day.done { opacity: .85; }
.tl-day .dh { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--navy-900, #0E1B2E); margin-bottom: 6px; }
.tl-day .badge { background: var(--gold-500, #C9A24B); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.tl-day .pill { border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 600; }
.tl-day .pill.done { background: rgba(46,158,107,.12); color: var(--ok, #2E9E6B); }
.tl-day .pill.pending { background: rgba(201,162,75,.16); color: var(--gold-600, #A98434); }
.tl-day .gate-line { margin-top: 8px; font-size: 12px; color: var(--muted, #7c8aa0); }

.daily-card {
  background: var(--card, #fff); border: 1px solid var(--line, #e5e9f0); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 2px 10px rgba(14,27,46,.06);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.daily-card.today { border-color: var(--gold-500, #C9A24B); box-shadow: 0 6px 22px rgba(201,162,75,.22); }
.daily-card .dcard-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px dashed var(--line, #e5e9f0); }
.daily-card .dcard-day { font-weight: 800; font-size: 14px; color: var(--navy-900, #0E1B2E); background: linear-gradient(135deg, rgba(201,162,75,.2), rgba(201,162,75,.08)); border-radius: 8px; padding: 2px 9px; }
.daily-card .badge { background: var(--gold-500, #C9A24B); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.daily-card .dcard-theme { font-weight: 700; font-size: 14.5px; color: var(--navy-900, #0E1B2E); margin-left: 2px; line-height: 1.35; }
.dcard-row { padding: 7px 0; border-bottom: 1px solid rgba(14,27,46,.04); }
.dcard-row:last-of-type { border-bottom: none; }
.dcard-label { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; color: var(--gold-600, #A98434); margin-bottom: 2px; }
.dcard-val { font-size: 13px; line-height: 1.55; color: var(--slate-700, #334); }
.dcard-row.q .dcard-val { color: var(--info, #2e6bd9); font-weight: 600; }
.dcard-row.ok .dcard-label { color: var(--ok, #2E9E6B); }
.dcard-row.bad .dcard-val { color: var(--bad, #d9534f); }
.dcard-row.bad .dcard-label { color: var(--bad, #d9534f); }
.dcard-row.video .dcard-label { color: #7a3fb5; }
.dcard-row.tip .dcard-label { color: var(--gold-600, #A98434); }
.daily-card .gate-line { margin-top: 8px; font-size: 12px; color: var(--muted, #7c8aa0); }

.task-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(14,27,46,.05); }
.task-item:last-child { border-bottom: 0; }
.task-item .ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px; background: rgba(14,27,46,.06);
}
.task-item .ico.study { background: rgba(46,107,217,.12); }
.task-item .ico.practice { background: rgba(201,162,75,.16); }
.task-item .ico.real { background: rgba(46,158,107,.12); }
.task-item .ico.roleplay { background: rgba(155,89,182,.12); }
.task-item .ico.theme      { background: rgba(46,107,217,.12); }
.task-item .ico.question   { background: rgba(201,162,75,.16); }
.task-item .ico.success    { background: rgba(46,158,107,.12); }
.task-item .ico.redline    { background: rgba(217,76,76,.12); }
.task-item .ico.video_task { background: rgba(155,89,182,.14); }
.task-item .ttl { font-size: 14px; font-weight: 600; color: var(--slate-700, #334); line-height: 1.55; }
.task-item .ttl .ttl-cn { color: var(--gold-500, #C9A24B); font-weight: 700; }
.task-item .ttl .ttl-full { color: var(--slate-700, #334); word-break: break-word; }
.task-item .desc { font-size: 12.5px; color: var(--muted, #7c8aa0); margin-top: 2px; }

/* v31s-r5: pill-btn 可点击标记已看按钮 */
.pill-btn {
  display: inline-block; padding: 5px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.pill-btn.pending { background: rgba(201,162,75,.14); color: #8a6a1f; border-color: rgba(201,162,75,.3); }
.pill-btn.pending:hover { background: rgba(201,162,75,.24); }
.pill-btn.done { background: rgba(46,158,107,.14); color: #1d6b48; border-color: rgba(46,158,107,.3); cursor: default; }
.pill-btn:disabled { opacity: .6; cursor: wait; }
.task-item.done .info .ttl .ttl-full { color: #1d6b48; }

/* v31s-r5: seen-tip 提示条 */
.seen-tip { font-size: 12px; color: var(--muted, #7c8aa0); background: rgba(201,162,75,.08); border-left: 3px solid rgba(201,162,75,.5); padding: 8px 10px; border-radius: 6px; margin-bottom: 8px; line-height: 1.55; }

/* ---- PC / 平板大屏（≥768px）：去手机外壳，铺满大屏 ---- */
@media (min-width: 768px) {
  .phone-wrap { display: block; padding-bottom: 0; }
  .iphone {
    width: auto; max-width: none; height: auto; min-height: 100vh;
    background: transparent; border-radius: 0; padding: 0; box-shadow: none;
  }
  .iphone-notch { display: none; }
  .iphone-screen { display: block; width: 100%; height: auto; min-height: 100vh; border-radius: 0; overflow: visible; }
  .app-header { position: relative; }
  body.lg .app-header { position: relative; }

  #root { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 40px 48px; }
  body[data-page="tasks"] main { max-width: none; }
  .page-title { font-size: 30px; letter-spacing: -.5px; }
  .page-sub { font-size: 14px; margin-bottom: 20px; }
  .app-header h1 { font-size: 22px; }
  .app-header .sub { font-size: 13px; }
  .app-header .picker { margin-top: 0; margin-left: auto; width: auto; }
  .app-header .row { flex-wrap: wrap; }
  .app-header select { font-size: 13px; padding: 7px 12px; }
  .desktop-nav { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

  .tl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
  .tl-day { padding: 16px 18px; border-radius: 16px; }
  .tl-day .dh { font-size: 16px; margin-bottom: 10px; }
  .task-item .ttl { font-size: 14px; }
  .task-item .desc { font-size: 12.5px; }
  .tl-day.today { transform: translateY(-2px); }

  .daily-card { padding: 18px 20px; border-radius: 18px; }
  .daily-card .dcard-theme { font-size: 16px; }
  .daily-card .dcard-day { font-size: 15px; }
  .dcard-val { font-size: 13.5px; }
  .daily-card.today { transform: translateY(-2px); }

  .tabbar { display: none; }
}

/* ============== v31g：打卡 / 逐项已看 / 每日心得 ============== */
.prog-wrap { background: #fff; border-radius: 14px; padding: 12px 14px; margin: 12px 14px 4px; box-shadow: var(--shadow, 0 2px 10px rgba(14,27,46,.08)); }
.prog-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--navy, #0E1B2E); margin-bottom: 7px; }
.prog-meta b { color: var(--gold-600, #A68334); font-size: 15px; }
.prog-track { height: 8px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334)); border-radius: 6px; transition: width .4s; }

.cta-row { padding: 14px; }
.btn-ghost { display: block; text-align: center; padding: 12px; border: 1px solid var(--line, #e3e8ef); border-radius: 12px; color: var(--navy-900, #0E1B2E); font-size: 14px; background: #fff; transition: all .15s; }
.btn-ghost:hover { border-color: var(--gold-500, #C9A24B); color: var(--gold-600, #A68334); }

.checkin-cta {
  background: linear-gradient(135deg, #fff, #fff8ec); border: 1px solid var(--gold-500, #C9A24B);
  border-radius: 16px; padding: 18px 16px; margin: 12px 14px; text-align: center;
  box-shadow: 0 6px 20px rgba(201,162,75,.16);
}
.cta-day { font-size: 13px; color: var(--gold-600, #A68334); font-weight: 700; }
.cta-title { font-size: 18px; font-weight: 800; margin: 4px 0; color: var(--navy-900, #0E1B2E); }
.cta-sub { font-size: 12.5px; color: var(--muted, #6b7686); margin-bottom: 14px; }

.btn-primary {
  display: inline-block; width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-500, #C9A24B), var(--gold-600, #A68334));
  color: var(--navy-900, #0E1B2E); font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 14px rgba(201,162,75,.32); transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,162,75,.42); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: default; box-shadow: none; }

.daily-card.today { margin: 12px 14px; }
.seen-tip { background: #fff7e6; border: 1px solid #ffe1a8; color: #8a5a00; font-size: 12.5px; padding: 9px 11px; border-radius: 10px; margin: 10px 0; }
.seen-list, #seenList { display: flex; flex-direction: column; gap: 9px; }
.seen-card {
  background: #fff; border: 1px solid var(--line, #e3e8ef); border-left: 4px solid var(--line, #e3e8ef);
  border-radius: 12px; padding: 11px 13px; cursor: pointer; transition: all .18s; position: relative;
}
.seen-card .sc-label { font-size: 12.5px; font-weight: 700; color: var(--navy-900, #0E1B2E); margin-bottom: 3px; }
.seen-card .sc-val { font-size: 13px; color: #33405a; line-height: 1.55; }
.seen-card .sc-flag { position: absolute; top: 11px; right: 12px; font-size: 11px; color: var(--muted, #6b7686); background: #f0f2f6; padding: 2px 8px; border-radius: 20px; }
.seen-card.theme { border-left-color: var(--navy-900, #0E1B2E); }
.seen-card.q { border-left-color: var(--info, #2e6bd9); }
.seen-card.ok { border-left-color: var(--ok, #2e9e6b); }
.seen-card.bad { border-left-color: var(--bad, #d9534f); }
.seen-card.video { border-left-color: #7a3fb5; }
.seen-card.tip { border-left-color: var(--gold-500, #C9A24B); }
.seen-card:hover { box-shadow: var(--shadow, 0 2px 10px rgba(14,27,46,.08)); transform: translateY(-1px); }
.seen-card.seen { background: #f3fbf6; border-color: var(--ok, #2e9e6b); border-left-color: var(--ok, #2e9e6b); }
.seen-card.seen .sc-flag { color: #fff; background: var(--ok, #2e9e6b); }
.seen-card.loading { opacity: .6; }
.seen-progress { margin-top: 10px; font-size: 12.5px; color: var(--muted, #6b7686); text-align: center; }
.seen-progress.full { color: var(--ok, #2e9e6b); font-weight: 700; }

.reflection-form { background: #fff; border-radius: 16px; padding: 14px 14px 16px; margin: 12px 14px; box-shadow: var(--shadow, 0 2px 10px rgba(14,27,46,.08)); }
.rf-title { font-size: 13.5px; font-weight: 700; color: var(--navy-900, #0E1B2E); margin-bottom: 10px; }
.reflection-form label { display: block; font-size: 12px; color: var(--muted, #6b7686); margin: 8px 0 4px; }
.reflection-form textarea { width: 100%; border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 9px 10px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.reflection-form .btn-primary { margin-top: 12px; }
.rf-hint { font-size: 12px; color: var(--muted, #6b7686); margin-top: 8px; text-align: center; }
.rf-hint.bad { color: var(--bad, #d9534f); }
.reflection-done { background: #f3fbf6; border: 1px solid var(--ok, #2e9e6b); border-radius: 16px; padding: 14px; margin: 12px 14px; }
.rd-title { font-size: 13.5px; font-weight: 700; color: var(--ok, #2e9e6b); margin-bottom: 8px; }
.rd-row { font-size: 13px; color: #33405a; margin: 4px 0; line-height: 1.5; }

.done-banner { background: linear-gradient(135deg, var(--navy-900, #0E1B2E), var(--navy-800, #16273D)); color: #fff; border-radius: 18px; padding: 26px 18px; margin: 14px; text-align: center; box-shadow: 0 10px 30px rgba(14,27,46,.2); }
.done-emoji { font-size: 40px; }
.done-title { font-size: 19px; font-weight: 800; margin: 6px 0; }
.done-sub { font-size: 13px; opacity: .85; }

.hist-title { font-size: 13px; font-weight: 700; color: var(--navy-900, #0E1B2E); margin: 18px 14px 8px; }
.hist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 14px; }
.hist-item { background: #fff; border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 9px 10px; transition: transform .15s, box-shadow .15s; }
.hist-item:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(14,27,46,.08); }
.hi-day { font-size: 12px; color: var(--gold-600, #A68334); font-weight: 700; }
.hi-theme { font-size: 12.5px; color: var(--navy-900, #0E1B2E); margin: 2px 0; line-height: 1.4; }
.hi-meta { font-size: 11px; color: var(--muted, #6b7686); }

/* ===== 焦点环（无障碍 · 金色 2px） ===== */
*:focus-visible { outline: 2px solid var(--gold-500, #C9A24B); outline-offset: 2px; }

/* =====================================================
 * v31s-r10: 修复学员首页不完整显示
 * 1) 进度环（App.progressRing）缺 .ring-bg/.ring-fg 样式导致黑块
 * 2) 移动端 .iphone-screen overflow:hidden + 固定高宽比造成内容截断
 * 3) 移动端标题区过窄被压成竖排
 * ===================================================== */
.ring { display: block; flex: 0 0 auto; }
.ring-bg { fill: none; stroke: var(--line, #e3e8ef); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--gold-500, #C9A24B); stroke-width: 8; stroke-linecap: round; }

@media (max-width: 767px) {
  /* 允许手机框内部滚动，避免 hero+打卡+资料库+5任务+结业 被一刀切 */
  .iphone-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* 小屏 header 换行，防止 logo+标题+租户选择器挤压导致中文竖排 */
  .app-header .row { flex-wrap: wrap; }
  .app-header .row > .logo + div { flex: 1; min-width: 0; }
  .app-header h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-header .picker { width: 100%; margin-top: 8px; }
  .app-header .picker select { flex: 1; }
}


/* v1.5.57 · 今日总结（每日 23:00 前提交「卡点 + 收获」） */
.summary-card label { display: block; font-size: 12px; color: var(--muted, #6b7686); margin: 8px 0 4px; }
.summary-card textarea { width: 100%; border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 9px 10px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.summary-card .btn-primary { margin-top: 12px; }
.sum-tip { font-size: 12px; color: var(--muted, #6b7686); margin: -4px 0 8px; line-height: 1.6; }
.summary-card.late .sum-tip { color: var(--bad, #d9534f); font-weight: 600; }
.sum-lock { font-size: 13px; color: var(--muted, #6b7686); line-height: 1.7; }
.sum-row { font-size: 13px; line-height: 1.7; color: #33405a; margin-bottom: 4px; word-break: break-word; }
.sum-row b { color: var(--navy-900, #0E1B2E); }
.sum-sync { margin-top: 8px; font-size: 12px; color: var(--ok, #2E9E6B); }
.sum-edit { margin-top: 10px; background: transparent; border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 7px 14px; font-size: 12px; color: var(--muted, #6b7686); cursor: pointer; }
.sum-msg { font-size: 12px; color: var(--muted, #6b7686); margin-top: 8px; text-align: center; }
.sum-msg.bad { color: var(--bad, #d9534f); }
.section-bar.danger .sb-bar { background: var(--bad, #d9534f); }
.section-bar.danger .sb-ico { background: rgba(217, 83, 79, .14); color: var(--bad, #d9534f); }
.section-bar .sb-tag.danger { background: rgba(217, 83, 79, .14); color: #a02825; }
.section-bar .sb-tag.warn { background: rgba(201, 162, 75, .18); color: #856429; }
.section-bar .sb-tag.info { background: rgba(46, 107, 217, .14); color: var(--info, #2E6BD9); }

/* v1.5.59 导师私信：导航未读红点 + 首页消息卡 */
.tab-bar a .ti { position: relative; }
.desktop-nav a { position: relative; }
.chat-badge {
  position: absolute; top: -3px; right: -7px; min-width: 15px; height: 15px; padding: 0 4px;
  box-sizing: border-box; border-radius: 8px; background: #E24B4A; color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; font-weight: 700;
  box-shadow: 0 0 0 2px var(--surface, #fff);
}
.chat-badge[hidden] { display: none; }
.summary-card.unread { border-color: rgba(226, 75, 74, .45); background: #FFF8F8; }
.summary-card.unread:hover { border-color: #E24B4A; }
.summary-card.read { opacity: .96; }