/* 亮色主题：只在 <html data-theme="light"> 时生效，深色保持原样 */
html[data-theme="light"] {
  --bg: #eef2f8;
  --bg2: #e4eaf3;
  --card: #ffffff;
  --card2: #f5f8fc;
  --text: #1b2433;
  --muted: #5f6f86;
  --line: rgba(35, 60, 100, .16);
  --accent: #2563eb;
  --accent2: #0e7490;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --gold: #a16207;
  --silver: #64748b;
  --shadow: 0 4px 16px rgba(30, 50, 80, .08);
}

html[data-theme="light"] body { background: var(--bg); color: var(--text); }
html[data-theme="light"] .frame-top { background: rgba(255, 255, 255, .92); }
html[data-theme="light"] .frame-nav { background: rgba(255, 255, 255, .96); }
html[data-theme="light"] .ft-avatar {
  background: radial-gradient(circle at 35% 30%, rgba(37, 99, 235, .26), rgba(231, 238, 250, .95));
  border-color: rgba(37, 99, 235, .45);
  color: #1e3a8a;
}
html[data-theme="light"] .fn-ico { background: #94a3b8; }
html[data-theme="light"] .fn-item.on .fn-ico { box-shadow: none; }
html[data-theme="light"] .map-node.is-lock { opacity: .78; }
html[data-theme="light"] .card { box-shadow: 0 3px 14px rgba(30, 50, 80, .07); }

/* 状态色：浅底 + 深字 */
html[data-theme="light"] .notice { background: #fff7e6; border-color: #f0c97a; color: #8a5a12; }
html[data-theme="light"] .rv-pd,
html[data-theme="light"] .rs-pending,
html[data-theme="light"] .t-priv,
html[data-theme="light"] .w-pending { background: #fff3d6; color: #8a5a12; }
html[data-theme="light"] .rv-ok,
html[data-theme="light"] .rs-approved,
html[data-theme="light"] .w-red { background: #e6f7ee; color: #116b3d; }
html[data-theme="light"] .rv-no,
html[data-theme="light"] .rs-rejected,
html[data-theme="light"] .w-bad { background: #fdecec; color: #9b1c1c; }
html[data-theme="light"] .rs-delivered,
html[data-theme="light"] .t-item { background: #e8f1ff; color: #1d4f9c; }
html[data-theme="light"] .t-skin { background: #f1ecff; color: #5b3fa8; }
html[data-theme="light"] .rs-probation { background: #f1ecff; color: #5b3fa8; }
html[data-theme="light"] .w-black { background: #e6eaf1; color: #55657c; }

html[data-theme="light"] .btn-ok { background: #e7f7ee; border-color: #9fd9b6; color: #116b3d; }
html[data-theme="light"] .btn-no { background: #fdecec; border-color: #f2b8b8; color: #9b1c1c; }
html[data-theme="light"] .btn-ghost { background: var(--card2); border-color: var(--line); color: var(--text); }

/* 日历：五档颜色沿用深色定义（f-black 仍是黑），只把普通格子换浅底 */
html[data-theme="light"] .cal-cell:not(.f-rainbow):not(.f-gold):not(.f-silver):not(.f-red):not(.f-black):not(.leave) { background: var(--card); }
html[data-theme="light"] .cal-cell.f-silver .d,
html[data-theme="light"] .cal-cell.f-silver .s { color: #1f2a3a; }
html[data-theme="light"] .cal-cell.leave {
  background: linear-gradient(160deg, #f3ecff, #e6d9ff);
  border-color: #cdb9ef;
  color: #4b2b7a;
}
html[data-theme="light"] .cal-cell.leave .d { color: #3f2368; }
html[data-theme="light"] .cal-cell.leave .s { color: #6b4b9a; }

/* 任务 / 进度 / 个人页 */
html[data-theme="light"] .task-check { border-color: #b9c6d8; }
html[data-theme="light"] .pf-exp-bar { background: #e3e9f2; }
html[data-theme="light"] .prog-bar { background: #e3e9f2; }
html[data-theme="light"] .ach-entry-main b { color: var(--text); }
html[data-theme="light"] .ach-entry-main span { color: var(--muted); }
html[data-theme="light"] .ach-entry-arrow { color: #8895a8; }

/* 连续达成弹层 */
html[data-theme="light"] .sp-mask { background: rgba(20, 30, 45, .45); }
html[data-theme="light"] .sp-card {
  background: linear-gradient(165deg, #ffffff, #f2f7ff);
  border-color: #dbe4f0;
}
html[data-theme="light"] .sp-title { color: #8a5a12; }
html[data-theme="light"] .sp-sub { color: var(--muted); }
html[data-theme="light"] .sp-bonus,
html[data-theme="light"] .sp-tag { color: #8a5a12; }
html[data-theme="light"] .sk-days,
html[data-theme="light"] .sk-meta,
html[data-theme="light"] .st-pt { color: var(--muted); }

/* ============ 职业页 ============ */
html[data-theme="light"] .career-hero {
  background: #e9eff8;
  border-color: var(--line);
}
html[data-theme="light"] .career-hero .cs-bg {
  filter: grayscale(.35) brightness(1.5) contrast(.9);
  opacity: .35;
}
/* 暗角跟随亮色主题，否则深字压深底看不清 */
html[data-theme="light"] .career-hero .cs-vig {
  background: radial-gradient(118% 86% at 50% 26%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .45) 70%, rgba(255, 255, 255, .8) 100%);
}
html[data-theme="light"] .career-hero .cs-dust,
html[data-theme="light"] .career-hero .cs-stars { opacity: 0; }
html[data-theme="light"] .career-hero .cs-title { color: #1b2433; }
html[data-theme="light"] .career-hero .cs-sub { color: #5f6f86; }
html[data-theme="light"] .career-hero.is-probation .cs-title { color: #4b3a7a; }
html[data-theme="light"] .career-hero.is-probation .cs-sub { color: #6b5a92; }
html[data-theme="light"] .career-hero.is-probation .cs-sprite { filter: grayscale(.75) brightness(.75) contrast(.9); }

html[data-theme="light"] .career-map-hint { color: #5f6f86; }
html[data-theme="light"] .career-map {
  background: linear-gradient(180deg, #f7fafd, #eaf0f8);
  border-color: #dbe4f0;
}
html[data-theme="light"] .map-col {
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .5));
  border-color: #e0e8f2;
}
html[data-theme="light"] .mn-orb { background: #ffffff; border-color: #d6e0ee; }
html[data-theme="light"] .mn-name { color: #334155; }
html[data-theme="light"] .map-node.is-cur .mn-name { color: #0f172a; }
html[data-theme="light"] .mn-pre { color: #5f6f86; border-color: #dbe4f0; border-style: solid; }
html[data-theme="light"] .mn-pre.ok { color: #0f7a46; border-color: #9ed8b8; background: #e9f9ef; }
html[data-theme="light"] .mn-ready { color: #fff; }
html[data-theme="light"] .mn-ready.is-lock { background: #e7ecf3; color: #5f6f86; border-color: #c9d3e0; }

/* ---- 2026-11-08 岔路图亮色修复 ----
   原来 .cb-* 全是写死的深色（白字压在 rgba(255,255,255,.04) 半透明底上，白卡一铺就是白底白字）。
   现在 career.css 里这些已经改走变量，这里再把变量按亮色重定义，并把几处「必须写死语义色」的地方补上。
   卡片底：#ffffff / #f1f5fb（中间那层 --card2），职业名 #1b2433 —— 对比度约 14:1。 */
html[data-theme="light"] .career-branches {
  --cb-card: #f1f5fb;
  --cb-card-on: #ffffff;
  --cb-line: #d7e1ee;
  --cb-text: #1b2433;
  --cb-muted: #55657c;
}
html[data-theme="light"] .cb-head b { color: #1b2433; }
html[data-theme="light"] .cb-head { color: #55657c; }
html[data-theme="light"] .cb-line {
  background: linear-gradient(180deg, #ffffff, #f4f8fd);
  border-color: #dde6f1;
  box-shadow: 0 2px 10px rgba(30, 50, 80, .06);
}
html[data-theme="light"] .cb-line-h b { color: #1b2433; }
html[data-theme="light"] .cb-forktag { background: #fff3d6; color: #8a5a12; border-color: #eccf94; }
html[data-theme="light"] .cb-singletag { background: #eef2f8; color: #55657c; border-color: #dde6f1; }
html[data-theme="light"] .cb-end { color: #55657c; border-color: #cdd8e6; background: #f7fafd; }
html[data-theme="light"] .cb-arrow { color: #8895a8; }
html[data-theme="light"] .bx-orb {
  background: radial-gradient(circle at 35% 30%, #ffffff, #e9eff8);
  border-color: #d3dded;
}
html[data-theme="light"] .bx-badge { background: #ffffff; }
html[data-theme="light"] .bx-name { color: #1b2433; }
html[data-theme="light"] .bx-node.is-on .bx-name { color: #0f172a; }
html[data-theme="light"] .bx-real { color: #55657c; }
/* 分支卡：浅底 + 圆角 + 描边（原来只有一条红竖线）+ 深字 */
html[data-theme="light"] .cb-branch {
  background: #f1f5fb;
  border-color: #cfdae9;
  border-left-width: 3px;
  border-left-color: var(--cc);
  box-shadow: 0 1px 4px rgba(30, 50, 80, .07);
}
html[data-theme="light"] .cb-branch.is-on { background: #ffffff; }
html[data-theme="light"] .cb-branch.is-ok { border-color: #7fcf9f; border-left-color: var(--cc); }
html[data-theme="light"] .cb-b-main b { color: #1b2433; }
html[data-theme="light"] .cb-b-main i { color: #55657c; }
html[data-theme="light"] .cb-b-cond { color: #4a5a70; }
html[data-theme="light"] .cb-b-cond em { color: #b91c1c; }
html[data-theme="light"] .cb-branch.is-ok .cb-b-cond em { color: #15803d; }
html[data-theme="light"] .cb-fork-node { color: #3a2a00; }

/* 门槛条：说明文字偏淡 → 换深灰；锁/开两态用浅底深字 */
html[data-theme="light"] .career-gate span,
html[data-theme="light"] .career-gate .cg-d { color: #4a5a70; }
html[data-theme="light"] .career-gate.is-lock { background: #fff7e6; border-color: #f0c97a; }
html[data-theme="light"] .career-gate.is-lock b { color: #8a5a12; }
html[data-theme="light"] .career-gate.is-open { background: #e9f9ef; border-color: #9ed8b8; }
html[data-theme="light"] .career-gate.is-open b { color: #0f7a46; }
html[data-theme="light"] .cg-bar { background: #e3e9f2; }
html[data-theme="light"] .cg-go { background: #fff3d6; border-color: #e3bd7c; color: #8a5a12; }

/* 起点列 */
html[data-theme="light"] .map-col.is-base { border-color: #c3cede; }
html[data-theme="light"] .map-node.is-base .mn-orb {
  background: radial-gradient(circle at 35% 30%, #ffffff, #e4ebf5);
  border-color: #b9c6d8;
}
html[data-theme="light"] .map-node.is-base .mn-name { color: #1b2433; }
html[data-theme="light"] .map-node.is-probation .mn-orb { background: #eef2f8; border-color: #c9d3e0; }
html[data-theme="light"] .map-node.is-probation .mn-name { color: #8a93a3; }
html[data-theme="light"] .map-node.is-probation .cv-badge {
  background: #e7ecf3; border-color: #c9d3e0; color: #5f6f86;
}
html[data-theme="light"] .mc-avatar {
  background: radial-gradient(circle at 35% 30%, #ffffff, #e8eef7);
  border-color: #d6e0ee;
}
html[data-theme="light"] .mc-name { color: #1b2433; }
html[data-theme="light"] .mc-sub { color: #5f6f86; }
html[data-theme="light"] .career-mystery { color: #7b8aa1; }
html[data-theme="light"] .career-pending { background: #fff7e6; color: #8a5a12; }
html[data-theme="light"] .career-pending.is-probation { background: #f1ecff; color: #5b3fa8; }

/* 职业弹层 */
html[data-theme="light"] .cm-mask { background: rgba(20, 30, 45, .45); }
html[data-theme="light"] .cm-card { background: #ffffff; border-top-color: #e2e9f3; }
html[data-theme="light"] .cm-t b { color: #1b2433; }
html[data-theme="light"] .cm-t span { color: #5f6f86; }
html[data-theme="light"] .cm-close { color: #5f6f86; }
html[data-theme="light"] .cm-intro { color: #475569; }
html[data-theme="light"] .cm-cond { border-bottom-color: #e8eef6; }
html[data-theme="light"] .cm-cond .nm { color: #334155; }
html[data-theme="light"] .cm-cond .vv { color: #5f6f86; }
html[data-theme="light"] .cm-lock,
html[data-theme="light"] .cm-free { color: #5f6f86; }
html[data-theme="light"] .cm-prog { color: #5f6f86; }

/* 已解锁 / 职业路线卡 */
html[data-theme="light"] .career-route { background: linear-gradient(180deg, #ffffff, #f2f7fd); border-color: #e0e8f2; }
html[data-theme="light"] .cr-head b { color: #1b2433; }
html[data-theme="light"] .cr-tip { color: #7b8aa1; }
html[data-theme="light"] .cc-f { color: #1b2433; }
html[data-theme="light"] .cc-r { color: #5f6f86; }
html[data-theme="light"] .cc-intro { color: #5f6f86; }
html[data-theme="light"] .cc-tag.lock { background: #eef2f8; color: #5f6f86; }
html[data-theme="light"] .cc-req { color: #7b8aa1; }
html[data-theme="light"] .career-hint { color: #5f6f86; }
html[data-theme="light"] .cl-head b { color: #1b2433; }

/* ============ 成就徽章 ============ */
html[data-theme="light"] .ach-head-l b { color: #1b2433; }
html[data-theme="light"] .ach-sub { color: #5f6f86; }
html[data-theme="light"] .ach-sub b { color: #334155; }
html[data-theme="light"] .ach-count { color: #5f6f86; }
html[data-theme="light"] .ach-count b { color: #a16207; }
html[data-theme="light"] .ach-card { background: #ffffff; }
html[data-theme="light"] .ach-card.has-frame { background: #ffffff; }
html[data-theme="light"] .ach-card.has-frame.r-t5 { background: #ffffff; }
html[data-theme="light"] .ach-frame {
  filter: drop-shadow(0 3px 5px rgba(30, 50, 80, .28));
}
html[data-theme="light"] .ach-card.off .ach-frame {
  filter: grayscale(1) brightness(.75) drop-shadow(0 2px 3px rgba(30, 50, 80, .22));
}
html[data-theme="light"] .ach-name { color: #1b2433; }
html[data-theme="light"] .ach-real { color: #5f6f86; }
html[data-theme="light"] .ach-date { color: #7b8aa1; }
html[data-theme="light"] .ach-q { color: rgba(40, 55, 75, .5); text-shadow: none; }
html[data-theme="light"] .ach-rare {
  background: #f1f5fb;
  border-color: #dbe4f0;
  color: #475569;
}
html[data-theme="light"] .r-t4 .ach-rare { color: #8a5a12; }
html[data-theme="light"] .r-t5 .ach-rare { color: #7a3d6b; }
html[data-theme="light"] .r-hidden .ach-rare { color: #8a2b56; }
html[data-theme="light"] .ach-card.on.r-t1 { box-shadow: 0 0 10px -4px rgba(90, 110, 140, .45); }
html[data-theme="light"] .ach-card.on.r-t2 { box-shadow: 0 0 12px -3px rgba(76, 154, 255, .4); }
html[data-theme="light"] .ach-card.on.r-t3 { box-shadow: 0 0 12px -3px rgba(176, 108, 255, .35); }
html[data-theme="light"] .ach-card.on.r-t4 { box-shadow: 0 0 14px -3px rgba(242, 193, 78, .45); }
html[data-theme="light"] .ach-card.on.r-hidden { box-shadow: 0 0 12px -3px rgba(185, 60, 125, .35); }
html[data-theme="light"] .ach-group { color: #8a4b6b; }
html[data-theme="light"] .ach-mystery { color: #7b8aa1; }

/* ============ 外观开关 ============ */
.theme-switch { display: flex; gap: 8px; }
.theme-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font-size: 13px; cursor: pointer;
}
.theme-btn.on {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.theme-hint { font-size: 11px; color: var(--muted); margin-top: 8px; }
