/* ============================================================
 * theme_dark_modules.css —— 夜间模式（theme-dark）业务模块覆盖层
 *
 * 背景：chess-user 的夜间 token（--bg-card / --text-primary 等）已在
 *       css/theme_vars.css 就位，但大量业务模块把卡片底色写死为
 *       #fff / white / 浅灰，导致夜间模式下整页泛白。
 *
 * 策略：不动任何业务模块源码（87 个模块，且本地副本领先生产，
 *       直接改源码会产生冲突），改为在 theme_vars.css 之后追加本覆盖层，
 *       用 .theme-dark 前缀 + !important 精确压过写死的浅色底。
 *       选择器全部取自生产真实类名（已逐一核对，无臆测）。
 *
 * 评估依据：2026-11-09 夜间模式适配评估（87 模块全量运行时取证）
 *           报告 D:\docs\2026-11-09-夜间模式适配评估.md
 *
 * 生效范围：仅 body.theme-dark 时生效，白天模式零影响。
 * 维护：本文件在 css/theme_vars.css 之后加载（index.php 内 link）。
 *       后续新增模块白底问题一律追加到对应分节，勿散落各模块源码。
 * ============================================================ */

/* ============================================================
 * 分节 1 —— 页面根容器（整页白底）
 * 对应问题：P0-1 theme_index / theme_practice、P0-2 opening 系 5 模块
 * ============================================================ */

/* modules/theme_index.php:19  .theme-index-page { background:#fff; min-height:100vh } */
.theme-dark .theme-index-page {
    background: var(--bg-primary, #1a1a2e) !important;
    color: var(--text-primary, #e0e0e0);
}
/* modules/theme_index.php:213  .tab-content { background:#f8f9fa } */
.theme-dark .theme-index-page .tab-content {
    background: var(--bg-primary, #1a1a2e) !important;
}
/* :103 .tab-nav（分类切换条） */
.theme-dark .theme-index-page .tab-nav {
    background: var(--bg-primary, #1a1a2e) !important;
}
.theme-dark .theme-index-page .tab-item {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .theme-index-page .tab-item.active {
    background: #667eea !important;
    color: #fff;
}
/* :252 .theme-card { background:#fff } —— 主题卡（此前漏项，实测仍在白） */
.theme-dark .theme-index-page .theme-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
/* :315 .theme-name { color:#333 } —— 深底上不可读 */
.theme-dark .theme-index-page .theme-name {
    color: var(--text-primary, #e0e0e0) !important;
}
/* :325 .theme-count { color:#999 } */
.theme-dark .theme-index-page .theme-count {
    color: var(--text-secondary, #aaaaaa) !important;
}
/* :228 .theme-grid / :223 .theme-list */
.theme-dark .theme-index-page .theme-grid,
.theme-dark .theme-index-page .theme-list {
    background: transparent;
}
.theme-dark .theme-index-page .header-desc,
.theme-dark .theme-index-page .stats-label {
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .theme-index-page .stats-value,
.theme-dark .theme-index-page .header-title {
    color: var(--text-primary, #e0e0e0);
}
/* 骨架屏（theme_index.php:203  .sk-card { background:#fff }） */
.theme-dark .theme-index-page .sk-card {
    background: var(--bg-card, #1f2940) !important;
}
.theme-dark .theme-index-page .sk-icon,
.theme-dark .theme-index-page .sk-text {
    background: var(--bg-elevated, #2a3550) !important;
}
.theme-dark .theme-index-page .empty-text,
.theme-dark .theme-index-page .loading-text {
    color: var(--text-secondary, #aaaaaa);
}

/* css/opening_common.css:24  .opening-module { background:#f5f7fa; height:100vh }
   modules/opening.php:465 同名第二处定义（后加载者胜），两处一并压住 */
.theme-dark .opening-module {
    background: var(--bg-primary, #1a1a2e) !important;
    color: var(--text-primary, #e0e0e0);
}
/* css/opening_common.css:36  .opening-subtabs { background: white } */
.theme-dark .opening-subtabs {
    background: var(--bg-card, #1f2940) !important;
}
/* modules/opening.php:1156  .opening-headbar{background:#fff;border-bottom:1px solid #eee} */
.theme-dark .opening-headbar {
    background: var(--bg-card, #1f2940) !important;
    border-bottom-color: var(--border-color, #333344);
}
/* modules/opening.php:1288  .op-pane{background:#fff} */
.theme-dark .op-pane {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
/* modules/opening.php:723  .op-commentary{background:#f8fafc} */
.theme-dark .op-commentary {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
/* modules/opening.php:744  .moves-history { background:#f7f8fa } */
.theme-dark .moves-history {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
/* modules/opening_stats.php:95  .op-chart-card { background: white } */
.theme-dark .op-chart-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .op-chart-title {
    color: var(--text-primary, #e0e0e0);
}
/* 开局系内部小面板 */
.theme-dark .op-mode-bar,
.theme-dark .op-current-move,
.theme-dark .opening-subtabs .ost-tab,
.theme-dark .op-pane-bar {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
/* modules/opening.php:636  .board-section { background: white } —— 全站通用棋盘容器 */
.theme-dark .board-section {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}

/* ============================================================
 * 分节 2 —— 研习课堂（study_courses）
 * 对应问题：P0-3  44 张课程卡白底，白底占比 47%
 * ============================================================ */

/* modules/study_courses.php:579  .sc-course-card { background:#fff } */
.theme-dark .sc-course-card {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-primary, #e0e0e0);
}
/* 卡片内文字：深底上原 #333/#666/#999/#888 全不可读 */
.theme-dark .sc-course-card .sc-course-title {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .sc-course-card .sc-course-desc {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .sc-course-card .sc-course-sub,
.theme-dark .sc-course-card .sc-course-meta {
    color: var(--text-muted, #85858b) !important;
}
.theme-dark .sc-course-card .sc-course-by {
    color: var(--text-muted, #85858b) !important;
    border-top-color: var(--border-color, #333344);
}
/* :551  .sc-chip { background:#fff; border:1px solid #e0e4f2; color:#555 } */
.theme-dark .sc-chip {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .sc-chip.active {
    background: #667eea !important;
    border-color: #667eea;
    color: #fff;
}
/* 其余浅色标签（徽章/章节/进度条）统一降饱和到夜间卡片色 */
.theme-dark .sc-tag,
.theme-dark .sc-chapter-order,
.theme-dark .sc-badge-cmt,
.theme-dark .sc-badge-nocmt,
.theme-dark .sc-badge-ply,
.theme-dark .sc-mode-badge.sc-mode-nocmt,
.theme-dark .sc-mode-badge.sc-mode-read,
.theme-dark .sc-intro-header,
.theme-dark .sc-intro-tab,
.theme-dark .sc-io-header,
.theme-dark .sc-chapter-progress .sc-cp-bar,
.theme-dark .sc-progress-bar,
.theme-dark .sc-ctrl-btn,
.theme-dark .sc-back-btn,
.theme-dark .sc-player-header {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .sc-chapter-item,
.theme-dark .sc-chapter-progress,
.theme-dark .sc-board-area,
.theme-dark .sc-progress-area,
.theme-dark .sc-control-bar,
.theme-dark .sc-player-strip,
.theme-dark .sc-moves-section,
.theme-dark .sc-player-info-bar {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .sc-chapter-item.is-done,
.theme-dark .sc-chapter-intro,
.theme-dark .sc-modal-inner,
.theme-dark .sc-intro-panel,
.theme-dark .sc-io-inner,
.theme-dark .sc-moves-header,
.theme-dark .sc-fullgame-btn,
.theme-dark .sc-turn-indicator {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .sc-comment-panel {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}

/* ============================================================
 * 分节 3 —— 经典名局（classic_games）
 * 对应问题：P0-4  卡片白底，白底占比 47%
 * ============================================================ */

/* modules/classic_games.php:326  .game-card { background: white } */
.theme-dark .game-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .game-card .cg-icon {
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .game-card .vs,
.theme-dark .game-card .game-meta {
    color: var(--text-muted, #85858b);
}
/* :754  .cg-search-input { background:#fff } */
.theme-dark .cg-search-input {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .cg-chip {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
.theme-dark .cg-curve-box {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .cg-header h1,
.theme-dark .classic-games-module h1 {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .cg-header p,
.theme-dark .cg-subtitle {
    color: var(--text-secondary, #aaaaaa);
}

/* ============================================================
 * 分节 4 —— 国象习题（puzzle_practice）
 * 对应问题：P1-1  .pp-section 白底 491545px²
 * ============================================================ */

/* modules/puzzle_practice.php:1477  .pp-section{background:#fff} */
.theme-dark .pp-section {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .pp-section-header h3 {
    color: var(--text-primary, #e0e0e0);
}
/* :1471 .pp-stat-card / :1481 .pp-book-card 同为白底 */
.theme-dark .pp-stat-card,
.theme-dark .pp-book-card,
.theme-dark .pp-header,
.theme-dark .pp-book-select,
.theme-dark .pp-board-card,
.theme-dark .pp-select,
.theme-dark .pp-info-card,
.theme-dark .pp-move,
.theme-dark .pp-pager-btn,
.theme-dark .pp-result-box {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .pp-stat-label {
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .pp-stat-value {
    color: var(--accent, #8b95f5);
}
.theme-dark .pp-moves-box,
.theme-dark .pp-btn-secondary,
.theme-dark .pp-answer-btn-topbar,
.theme-dark .pp-topic-item.pending,
.theme-dark .pp-progress-bar {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}

/* ============================================================
 * 分节 5 —— 与电脑下棋（ai_game）
 * 对应问题：P1-2  .ai-card 白底 556808px²
 * ============================================================ */

/* modules/ai_game.php:212  .ai-card{background:#fff} */
.theme-dark .ai-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .ai-card h2,
.theme-dark .ai-card h3 {
    color: var(--text-primary, #e0e0e0);
}
/* ai-stat-num 原 #e0e0e0 压在 rgb(248,249,250) 上（对比度 1.25），换深底后需重配 */
.theme-dark .ai-stat-num {
    color: var(--text-primary, #e0e0e0) !important;
}
/* ai-level-num / ai-level-name 浅绿压白底（对比度 1.74） */
.theme-dark .ai-level-num,
.theme-dark .ai-level-name {
    color: var(--success, #4cc38a) !important;
}
.theme-dark .ai-stats,
.theme-dark .ai-side-panel,
.theme-dark .ai-info-row,
.theme-dark .ai-moves-list,
.theme-dark .ai-captured-row,
.theme-dark .ai-level-recommend,
.theme-dark .ai-fs-toggle,
.theme-dark .ai-board-btn,
.theme-dark .ai-board-btn-hint,
.theme-dark .ai-board-btn-flip,
.theme-dark .ai-board-btn-reset,
.theme-dark .ai-board-btn-copy,
.theme-dark .ai-board-btn-swap,
.theme-dark .ai-board-btn-save,
.theme-dark .ai-board-btn-undo,
.theme-dark .ai-btn-secondary {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .ai-level-btn,
.theme-dark .ai-color-btn,
.theme-dark .ai-style-btn,
.theme-dark .ai-time-btn,
.theme-dark .ai-level-recommend button,
.theme-dark .ai-promo-option,
.theme-dark .ai-chat-bubble {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .ai-promo-popup {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}

/* ============================================================
 * 分节 6 —— 棋盘分析（position_analysis / club_position_analysis）
 * 对应问题：P1-4  模块自建 --card-bg:#ffffff 绕过夜间 token
 * ============================================================ */

/* modules/position_analysis.php:37  .position-analysis-page { --card-bg:#ffffff } */
.theme-dark .position-analysis-page {
    --card-bg: #1f2940;
    --bg-color: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --text-muted: #85858b;
    --border-color: #333344;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .oa-intro-title,
.theme-dark .oa-intro-icon {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .oa-history,
.theme-dark .oa-feature {
    background: var(--card-bg, #1f2940) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .oa-feature {
    color: var(--text-secondary, #aaaaaa);
}
/* :169 .pa-embed-modal / :177 .pa-embed-modal-frame 白底弹窗 */
.theme-dark .pa-embed-modal,
.theme-dark .pa-embed-modal-frame {
    background: var(--card-bg, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .copy-btn,
.theme-dark .position-analysis-page .fen-btn.cancel-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .movetext-actions .save-pgn-btn,
.theme-dark .movetext-actions .save-cw-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}

/* ============================================================
 * 分节 7 —— 棋力自测（selftest）
 * 对应问题：模块自建 --c-card:#fff 绕过夜间 token；登录提示卡白底
 * ============================================================ */

/* modules/selftest.php:65-67  .st-module{ --c-text:#333; --c-card:#fff; ... } */
.theme-dark .st-module {
    --c-text: #e0e0e0;
    --c-muted: #aaaaaa;
    --c-line: #333344;
    --c-bg: #16213e;
    --c-card: #1f2940;
    color: var(--c-text);
}
.theme-dark .st-plan-regen-btn,
.theme-dark .st-tab.active,
.theme-dark .st-theme-list button,
.theme-dark .st-wrong-actions button,
.theme-dark .st-ev,
.theme-dark .st-ev-add,
.theme-dark .st-fb-panel,
.theme-dark .st-step-item.active .st-step-circle {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .st-review-move,
.theme-dark .st-review-fen,
.theme-dark .st-wrong-move-cell,
.theme-dark .st-list-coach,
.theme-dark .st-finding,
.theme-dark .st-today-kpi,
.theme-dark .st-plan-panel,
.theme-dark .st-score-panel,
.theme-dark .st-score-chip,
.theme-dark .st-ev-loss,
.theme-dark .st-cat-bar-bg,
.theme-dark .st-rank-avatar,
.theme-dark .st-step-circle,
.theme-dark .st-step-line {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .st-fb-bubble.coach,
.theme-dark .st-share-banner,
.theme-dark .st-p1chip {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}

/* ============================================================
 * 分节 8 —— 每日一练（daily_practice）
 * 对应问题：P1-5  .dpr-board-col 白底 418702px²
 * ============================================================ */

/* modules/daily_practice.php:327  .dpr-board-col{background:#fff} */
.theme-dark .dpr-board-col {
    background: var(--bg-card, #1f2940) !important;
}
/* :343  .dpr-card{background:#fff;border:1px solid #e5e7eb} */
.theme-dark .dpr-card {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344);
}
/* :310  .dpr-stage{background:#f8f7ff} */
.theme-dark .dpr-stage {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344);
}
.theme-dark .dpr-card-t,
.theme-dark .dpr-title {
    color: var(--text-primary, #e0e0e0) !important;
}
/* :375 .dpr-info-i .v { color:#1f2937 } */
.theme-dark .dpr-info-i .v {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .dpr-card-t small {
    color: var(--text-secondary, #aaaaaa);
}
/* :316 .dpr-stage-chip 白底（原白底白字，对比度 1.06） */
.theme-dark .dpr-stage-chip {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
.theme-dark .dpr-stage-chip.on {
    background: #667eea !important;
    color: #fff;
}
.theme-dark .dpr-intro,
.theme-dark .dpr-promo-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .dpr-btn,
.theme-dark .dpr-track,
.theme-dark .dpr-chip,
.theme-dark .dpr-wd {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}

/* ============================================================
 * 分节 9 —— 开局速查 / 名局书库（opening_ref / ref_books）
 * 对应问题：P1-3  .ref-note 米白底 79328px²
 * 源码：modules/ref_assets/refs.css.php:25 .ref-note{background:#fffdf5}
 * ============================================================ */

/* 源码：modules/ref_assets/refs.css.php —— 全部类名在 .ref-module 作用域下 */
.theme-dark .ref-module .ref-note {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-secondary, #aaaaaa);
}
/* .ref-card / .ref-game-card 均为白底 */
.theme-dark .ref-module .ref-card,
.theme-dark .ref-module .ref-game-card {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .ref-module .ref-card-title {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .ref-module .ref-card-meta,
.theme-dark .ref-module .ref-progress,
.theme-dark .ref-module .ref-progress-text {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .ref-module .ref-intro {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344);
    color: var(--text-secondary, #aaaaaa);
}
/* 两模块 h1/h2 原用 #2c3345，夜间深底对比度 1.35 */
.theme-dark .ref-module {
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .ref-module h1,
.theme-dark .ref-module h2,
.theme-dark .ref-module h3 {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .ref-module .ref-header .sub,
.theme-dark .ref-module p.sub {
    color: var(--text-secondary, #aaaaaa) !important;
}

/* ============================================================
 * 分节 10 —— 登录墙模块的登录卡（游客直接可见）
 * 对应问题：P1-7 user_center / selftest / training_plan
 * ============================================================ */

/* index.php:802  .cu-login-card { background:#fff } */
.theme-dark .cu-login-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .cu-login-card h3 {
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .cu-login-card p,
.theme-dark .cu-login-card li {
    color: var(--text-secondary, #aaaaaa);
}
/* index.php:327  .login-box { background:white } —— 游客被屏蔽模块的独立登录页
   注：该页走 index.php:310 的独立 <head>，不加载本覆盖层，规则暂不生效，
       待后续统一登录页样式时处理。保留规则以便将来 head 合并后自动生效。 */
.theme-dark .login-box {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
/* modules/training_plan.php:96  .wtp-card { background:#fff } */
.theme-dark .wtp-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .wtp-card h2,
.theme-dark .wtp-card h3 {
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .wtp-card p {
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .wtp-tabs a,
.theme-dark .wtp-btn-line,
.theme-dark .wtp-task-check,
.theme-dark .wtp-stage-kpis > span,
.theme-dark .wtp-upg-edit {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .wtp-kpi,
.theme-dark .wtp-bar,
.theme-dark .wtp-chip,
.theme-dark .wtp-role,
.theme-dark .wtp-daytype,
.theme-dark .wtp-verdict,
.theme-dark .wtp-change,
.theme-dark .wtp-ach-icon,
.theme-dark .wtp-stat-chip,
.theme-dark .wtp-trend-svg,
.theme-dark .wtp-upg-stats > div,
.theme-dark .wtp-stage-cell,
.theme-dark .wtp-stage-next,
.theme-dark .wtp-stage-last {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}

/* ============================================================
 * 分节 11 —— 全站侧栏（39 模块覆盖）
 * 对应问题：P1-6 .cu-sidebar-qr
 * 源码：index.php:978-981
 * ============================================================ */

.theme-dark .cu-sidebar-qr {
    background: var(--bg-card, #1f2940) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
/* 二维码是白底 PNG 属正常（扫码需要），加白边与深底区分 */
.theme-dark .cu-sidebar-qr img {
    background: #fff;
    padding: 5px;
    border-radius: 6px;
}
.theme-dark .cu-sidebar-qr-tip {
    color: var(--text-secondary, #aaaaaa) !important;
}
/* index.php:879 .cu-dd-panel { background:#fff }（顶导下拉面板） */
.theme-dark .cu-dd-panel {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
/* index.php:457 .wxa-relay-card { background:#fff }（微信扫码中继卡） */
.theme-dark .wxa-relay-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}

/* ============================================================
 * 分节 12 —— 弹窗（夜间最刺眼项）
 * 对应问题：P2 coordinate_index 白底弹窗
 * 源码：css/cb-modal.css:31 background:#fff
 * ============================================================ */

.theme-dark .cb-modal {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .cb-modal__header {
    border-color: var(--border-color, #333344);
}
.theme-dark .cb-modal__title {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .cb-modal__body,
.theme-dark .cb-modal__footer {
    background: var(--bg-card, #1f2940);
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .cb-modal__body p,
.theme-dark .cb-modal__body li {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .cb-modal__btn--secondary {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
/* 俱乐部 / 学员对局 / 作业详情的共享弹窗 */
.theme-dark .mb-modal,
.theme-dark .coach-modal,
.theme-dark .csg-modal {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}

/* ============================================================
 * 分节 13 —— 俱乐部 / 棋谱库共享 partials
 * 对应问题：48 个登录墙模块的静态评估
 * 源码：modules/club/_partials/css2.php、modules/pgn_library/_partials/css.php
 * 注意：club/_partials/css.php 的 .club-card 已是 var(--bg-card,#fff)，此处只补漏。
 * ============================================================ */

.theme-dark .cp-fen-iframe-wrap {
    background: var(--bg-card, #1f2940) !important;
}
.theme-dark .src-tab:hover {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .quick-chip {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .section-labeled label {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .pgnlib-filter,
.theme-dark .pgnlib-card,
.theme-dark .pgnlib-panel {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .pgnlib-fg input,
.theme-dark .pgnlib-fg select,
.theme-dark .pgnlib-pager button,
.theme-dark .pgnlib-controls button {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
/* 作业详情统计块 */
.theme-dark .atb-stat,
.theme-dark .atb-stat-rate {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
/* 课件编辑迷你按钮 */
.theme-dark .club-btn-mini {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--accent, #8b95f5);
}
/* 我收藏的棋谱 */
.theme-dark .sb-chapter-row,
.theme-dark .studybook-module .sb-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
/* 本局复盘 */
.theme-dark .dpv-card {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
/* 学员做题棋盘区 */
.theme-dark .pcs-board-area {
    background: var(--bg-card, #1f2940) !important;
}

/* ============================================================
 * 分节 14 —— 残余白底批量兜底
 *
 * 上述分节覆盖的是「大面积容器」（整页 / 主卡片 / 弹窗）。
 * 本节处理剩余的中小型白底块：徽章、chip、按钮、空态、次级面板。
 * 多数模块在登录墙后无法运行时目视，故统一按类名前缀成组处理，
 * 判定依据是生产源码里的 background 取值（#fff / white / 浅灰）。
 * ============================================================ */

/* --- 作业详情 / 作业复盘（club/assignment_detail.php） --- */
.theme-dark .atb-row,
.theme-dark .atb-detail,
.theme-dark .atb-col,
.theme-dark .atb-stu,
.theme-dark .atb-foldable,
.theme-dark .ccr-chip,
.theme-dark .ccr-detail,
.theme-dark .ccr-pending-chip,
.theme-dark .otl-group,
.theme-dark .otl-table-mode,
.theme-dark .ad-nav-btn,
.theme-dark .ov-chip,
.theme-dark .ov-bar-track,
.theme-dark .ov-stat-cell {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}

/* --- 学员对局批注（club/coach_student_games.php） --- */
.theme-dark .csg-anno-form,
.theme-dark .csg-anno-item,
.theme-dark .csg-anno-badge,
.theme-dark .csg-controls,
.theme-dark .csg-moves,
.theme-dark .csg-anno-list,
.theme-dark .csg-move-cell,
.theme-dark .csg-board-wrap {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
.theme-dark .csg-anno-badge {
    color: var(--accent, #8b95f5);
}

/* --- 教练工作台（club/coach.php） --- */
.theme-dark .coach-modal,
.theme-dark .invite-modal-body,
.theme-dark .invite-select,
.theme-dark .coach-poster-img-wrap,
.theme-dark .cwh-pop-card,
.theme-dark .cwh-pop-head,
.theme-dark .cwh-pop-close,
.theme-dark .cwh-cal-cell {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
.theme-dark .invite-select {
    background: var(--bg-elevated, #2a3550) !important;
}
.theme-dark .cwh-pop-close {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}

/* --- 课件编辑 / 课件库（club/courseware_*.php） --- */
.theme-dark .ce-san-cell,
.theme-dark .ce-wrong-chip,
.theme-dark .ce-meta-edit,
.theme-dark .cev-replay-tip,
.theme-dark .cev-head,
.theme-dark .cev-x,
.theme-dark .cev-ctrl,
.theme-dark .cwlib-actions,
.theme-dark .cw-btn,
.theme-dark .cwlib-pv-game-grid,
.theme-dark .cwlib-pv-game-item,
.theme-dark .cwlib-pv-pager-btn,
.theme-dark .cwlib-pv-game-info,
.theme-dark .cwlib-pv-moves-box,
.theme-dark .club-btn-mini {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
.theme-dark .ce-meta-edit,
.theme-dark .cw-btn,
.theme-dark .club-btn-mini {
    color: var(--accent, #8b95f5) !important;
}

/* --- 本局复盘（daily_practice_review.php） --- */
.theme-dark .dpv-back,
.theme-dark .dpv-sum-i,
.theme-dark .dpv-dist,
.theme-dark .dpv-nav,
.theme-dark .dpv-demo,
.theme-dark .dpv-note {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}

/* --- 我收藏的棋谱（studybook.php） --- */
.theme-dark .sb-moves-box,
.theme-dark .studybook-tabs,
.theme-dark .sb-tab,
.theme-dark .sb-btn-list {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}

/* --- 棋谱库 / 俱乐部 FEN 框（pgn_library/_partials/css.php、club/_partials/css2.php） --- */
.theme-dark .pgnlib-fen-box,
.theme-dark .pgnlib-note-item,
.theme-dark .cp-fen-readonly {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}

/* --- 其余零散白底 --- */
.theme-dark .feature-icon {
    background: var(--accent-soft, rgba(102, 126, 234, 0.16)) !important;
    color: var(--accent, #8b95f5);
}
.theme-dark .ai-mascot-welcome,
.theme-dark .ai-mw-text {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .ai-kit-btn,
.theme-dark .ai-mascot-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .dpr-pause {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .pgn-divider span {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .pa-save-courseware .pscw-no-club {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .pp-answer-box {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .st-rating-delta,
.theme-dark .st-gate,
.theme-dark .st-option,
.theme-dark .st-option .sel,
.theme-dark .st-option-radio {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
.theme-dark .sc-beta-badge,
.theme-dark .sc-mini-empty,
.theme-dark .sc-move-puzzle {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .tp-hint-used,
.theme-dark .tp-hint-close {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}
.theme-dark .wtp-upg-prob {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
}

/* --- 教练工作台剩余表单/弹窗 --- */
.theme-dark .fb-modal,
.theme-dark .fb-btn,
.theme-dark .ivm-code,
.theme-dark .cwh-badge,
.theme-dark .cwh-input,
.theme-dark .cwh-select,
.theme-dark .cwh-row,
.theme-dark .cwh-cal-nav {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}
.theme-dark .fb-modal {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}

/* --- 棋谱着法/标记 chip（教练端与学员对局共用） --- */
.theme-dark .ply,
.theme-dark .nag,
.theme-dark .cwlib-pv-nag {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa);
    border-color: var(--border-color, #333344);
}

/* --- 深底上的深色文字：容器改深后必须同步提亮，否则不可读 --- */
.theme-dark .atb-foldable summary,
.theme-dark .otl-group summary {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .ref-module .ref-progress-text {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .ref-module .ref-player-bar .rpb-name {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .dpv-sum-i .v {
    color: var(--text-primary, #e0e0e0) !important;
}

/* --- 开局编辑器（opening_personal_editor.php） --- */
.theme-dark .op-editor-form,
.theme-dark .op-editor-head {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-color, #333344);
}
/* --- 开局统计大卡（opening_stats.php:84） --- */
.theme-dark .op-stat-card-big {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
/* --- 研习课堂分类条（study_courses.php:542） --- */
.theme-dark .sc-cat-bar {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344);
}
/* --- 坐标训练说明弹窗（css/coordinate.css:126） --- */
.theme-dark .ct-modal {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .ct-modal-title {
    color: var(--text-primary, #e0e0e0) !important;
}
/* --- 入门游戏标签栏（css/learn.css:121） --- */
.theme-dark .cu-learn-tabs {
    background: var(--bg-card, #1f2940) !important;
}
/* css/learn.css:77 .cu-learn-streak { background:rgba(255,255,255,0.96) } */
.theme-dark .cu-learn-streak {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0);
}
.theme-dark .cu-learn-streak-label {
    color: var(--text-primary, #e0e0e0) !important;
}

/* --- 表单控件（textarea / select / input 等原生控件在深底上仍是白底） --- */
.theme-dark textarea,
.theme-dark input[type="text"],
.theme-dark input[type="search"],
.theme-dark input[type="number"],
.theme-dark input[type="email"],
.theme-dark select {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark textarea::placeholder,
.theme-dark input::placeholder {
    color: var(--text-muted, #85858b) !important;
}

/* --- 开局百科标题（oh-brand 原色 #4a3fb5，深底对比度 1.84） --- */
.theme-dark .oh-brand {
    color: var(--accent, #8b95f5) !important;
}

/* --- 俱乐部欢迎页的三张引导卡 ---
   modules/club/index.php:925-940 用**内联 style** 写死 background:#f8faff，
   内联样式优先级高于普通 CSS 规则，只有 !important 能压住。
   用属性选择器按内联特征定位，避免改业务源码。 */
.theme-dark div[style*="background:#f8faff"] {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark div[style*="color:#999"] {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark div[style*="color:#ccc"] {
    color: var(--text-muted, #85858b) !important;
}
.theme-dark div[style*="color:#92400e"] {
    color: var(--warning, #e0a23c) !important;
}
.theme-dark div[style*="color:#a16207"] {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark div[style*="color:#d97706"] {
    color: var(--text-muted, #85858b) !important;
}

/* ============================================================
 * 分节 16 —— 游客独立登录页（puzzle_records / pgn_manage / my_diagnosis）
 *
 * 该页走 index.php:310 的独立 <head>，不加载 theme_vars.css，
 * 因此 :root 上没有 --bg-card / --text-primary 等 token，
 * var() 的回退值会直接落到夜间色 —— 必须保留 .theme-dark 前缀，
 * 否则浅色态（游客默认）登录卡会变深色，属于白天回归。
 *
 * 游客 body 上带的是 theme-light 类，登录用户走正常分支不经过本页，
 * 所以这里只在真的进入夜间态时才生效，平时保持白底深字不变。
 * ============================================================ */

.theme-dark .login-box {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .login-box h1 {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .login-box p {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .login-box .features h3 {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .login-box .feature-item {
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .login-box .feature-icon {
    background: var(--accent-soft, rgba(102, 126, 234, 0.16)) !important;
    color: var(--accent, #8b95f5) !important;
}

/* ============================================================
 * 分节 15 —— 夜间模式文字提亮（系统性）
 *
 * 生产源码里大量文字色写死为深灰（#333 / #666 / #999 / #1f2937 /
 * #2c3345 / #5a6178 …）。这些在夜间深底上对比度不足 1.4，肉眼不可读；
 * 卡片改深底后更会彻底看不见。
 *
 * 本段把深灰文字统一提亮到夜间语义 token：
 *   --text-primary   标题 / 关键值
 *   --text-secondary 正文
 *   --text-muted     次要 / 计数 / 提示
 *
 * 生成方式：脚本扫描生产 modules/*.php 与 index.php 的 color 声明，
 * 取 RGB 各通道 ≤130 的深灰，按类名语义与原色深浅分三级。
 * 已排除：胜负/错误/成功等状态色、theme_vars.css 已有夜间色的选择器。
 * 白天模式零影响。
 * ============================================================ */

/* ---- primary（49 处） ---- */
.theme-dark .wxa-relay-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-header { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-stat-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-level-group-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-side-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-promo-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-promo-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ai-select-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .cg-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .game-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .speed-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .dpr-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .dpv-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .dpv-step-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .current-opening-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .moves-header { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .op-empty-state-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .op-recent-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .pp-header { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .pp-section-header { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .pp-book-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .st-onboard-card-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sc-header { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sc-course-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sc-chapter-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sc-chapter-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sc-player-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sc-moves-header { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sb-ch-i-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .sb-ch-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .studybook-module .sb-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .tp-hint-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .tp-hint-card-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .btn-text { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .wtp-upg-progress-labels { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .wtp-stage-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .atb-row-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ov-section-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ov-bar-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ov-stat-cell-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .coach-modal-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .invite-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .cwh-row-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .cwh-cal-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .csg-row-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .cwlib-pv-game-grid-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .club-textbook-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ref-module .ref-card-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ref-module .ref-player-bar .rpb-name { color: var(--text-primary, #e0e0e0) !important; }

/* ---- secondary（153 处） ---- */
.theme-dark .login-box { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .features { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .feature-item { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wxa-relay-btn .ghost { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cu-nav-subitem { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cu-login-close { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cu-login-card { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .glp-features { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cu-dd-panel { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cu-dd-item { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-color-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-fs-toggle { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-board-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-btn-secondary { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-move-row { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-promo-icon { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-chat-bubble { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-style-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-swatch .selected { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ai-clock { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .game-players { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cg-board-btn-answer { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .move-white { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .move-black { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cg-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-intro { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-card-t { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-clock { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-stepsrow { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-info-i .v { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-wd .on { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-promo-t { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-back { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-sum-i .v { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-dist-legend { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-sum-text { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-readout { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-nav { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-demo { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-demo-out { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .t-best { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .t-uncertain { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-history-head { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-hitem .d { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpv-hitem .tag { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ost-tab { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .op-commentary .opc-body { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .op-board-btn-answer { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .move-chip .preview { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .rb-white { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .opening-headbar .ost-tab { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .eval-score .left { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .copy-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .position-analysis-page .fen-btn .cancel-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .line-first .line-eval { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pa-save-courseware { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .oa-radar-legend .lg-b { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .oa-res-nums .c-b { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pa-mode-tab { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-book-select { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-btn-secondary { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-move .correct { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-info-card { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-info-value { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-pager-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-pager-info { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-answer-btn-topbar { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-topic-item .pending { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-topic-item .correct { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pp-info-item .pp-info-value { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .st-elo-range-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .st-theme-list { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .st-share-box { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .st-fb-bubble .coach { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-back-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-chapter-item .is-done .sc-chapter-order { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-chapter-progress .sc-cp-text { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-course-progress { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-turn-indicator .white { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-intro-body { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-comment-content { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-progress-info { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-modal-inner .sc-readmode .sc-intro-body { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sc-io-body { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sb-info-value { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sb-moves-box { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .sb-ch-players { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-module { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-tabs { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-kpi { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-field { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-evidence { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-verdict { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-list { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-report { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-stat-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-trend-band { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-upg-cur { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-upg-stats { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-upg-today { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .wtp-upg-today-total { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .atb-stat-pending { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .atb-col { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .atb-stu { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .atb-foldable { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ccr-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ccr-detail { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ccr-table { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ccr-pending-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .otl-summary-pct { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .otl-group { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .otl-table { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .otl-table-mode { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .otl-table-progress { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ad-nav-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ad-nav-progress { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ov-chip { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ov-stat-cell-num { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .coach-modal-close { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .fb-modal { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwh-tab { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwh-day-num { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .csg-move-cell { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .csg-controls { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .csg-anno-item .text { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .csg-anno-form { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .csg-ai-status { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ce-san-cell { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ce-fs-pieces { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .bs-fen { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-import-bar { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-pv-game-item { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-pv-pager-btn { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-pv-pager-info { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-pv-game-info { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-pv-game-info-value { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .cwlib-pv-game-nav-btn .secondary { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .mb-modal-head { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .mb-modal-close { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pgnlib-btn-secondary { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pgnlib-card .res-w { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pgnlib-card .res-b { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pgnlib-info { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .pgnlib-fen-box { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ref-module { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ref-module .ref-progress { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ref-module .ref-progress-text { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ref-module .ref-player-bar .rpb-icon .rpb-white { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ref-module .ref-moves { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ref-module .ref-book-info { color: var(--text-secondary, #aaaaaa) !important; }

/* ---- muted（16 处） ---- */
.theme-dark .wxa-relay-tip { color: var(--text-muted, #85858b) !important; }
.theme-dark .cu-sidebar-qr-tip { color: var(--text-muted, #85858b) !important; }
.theme-dark .ai-time-btn { color: var(--text-muted, #85858b) !important; }
.theme-dark .dpr-sub { color: var(--text-muted, #85858b) !important; }
.theme-dark .dpv-notes-head { color: var(--text-muted, #85858b) !important; }
.theme-dark .dpv-note-san { color: var(--text-muted, #85858b) !important; }
.theme-dark .dpv-note-txt { color: var(--text-muted, #85858b) !important; }
.theme-dark .sc-course-desc { color: var(--text-muted, #85858b) !important; }
.theme-dark .tp-hint-text { color: var(--text-muted, #85858b) !important; }
.theme-dark .atb-foldable-meta { color: var(--text-muted, #85858b) !important; }
.theme-dark .otl-group-meta { color: var(--text-muted, #85858b) !important; }
.theme-dark .cwlib-import-count { color: var(--text-muted, #85858b) !important; }
.theme-dark .club-recommend-meta { color: var(--text-muted, #85858b) !important; }
.theme-dark .pgnlib-note-item { color: var(--text-muted, #85858b) !important; }
.theme-dark .ref-module .ref-player-bar .rpb-meta { color: var(--text-muted, #85858b) !important; }
.theme-dark .ref-module .ref-kbd-hint { color: var(--text-muted, #85858b) !important; }

/* ============================================================
 * 分节 17 —— 夜间可读性补丁（2026-11-09 第二轮）
 * 触发：用户反馈 daily_practice 夜间模式下「灰色/紫色字看不清」。
 *
 * 根因一：分节 15「夜间文字提亮」把标题/数值按 primary/secondary/muted 三档批量降色，
 *        其中 secondary 档（#aaaaaa）用 !important 覆盖了分节 8 的 primary 档，
 *        导致 .dpr-card-t / .dpr-clock / .dpr-info-i .v 全部掉档变灰。
 * 根因二：模块源码里写死的深灰 / 深紫文字（#111827 #334155 #4c1d95 #7c3aed）
 *        在夜间底色（#1f2940 / #2a3550）上对比度只有 1.1~2.1:1，等于消失。
 * 根因三：浅底容器（白卡/浅色 chip）在夜间没压暗，而分节 15 又把里面的文字提亮成
 *        #e0e0e0 → 白底浅字，对比度 1.1~1.3:1，同样看不见。
 *
 * 手法：全部 .theme-dark 前缀 + !important，白天模式零影响。
 * ============================================================ */

/* ---- 17.1 muted 档提亮：--text-muted 全站从未定义，16 处 var() 全落到 #85858b 兜底 ---- */
.theme-dark {
    --text-muted: #a0a0aa;
}
/* position_analysis 自建作用域里的同名变量同步提亮 */
.theme-dark .position-analysis-page {
    --text-muted: #a0a0aa;
}

/* ---- 17.2 每日一练：主要文字回归（把被分节 15 降级的标题/数值提回 --text-primary） ---- */
.theme-dark .dpr-card-t,
.theme-dark .dpr-clock,
.theme-dark .dpr-info-i .v {
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .dpr-card-t small,
.theme-dark .dpr-info-i .v-points-cap,
.theme-dark .dpr-rule,
.theme-dark .dpr-tagrow,
.theme-dark .dpr-week .lb {
    color: var(--text-secondary, #aaaaaa) !important;
}

/* ---- 17.3 每日一练：源码里的深色 / 深紫字逐条改回夜间可读色 ---- */
/* :299 .dpr-sub #6b7280 —— 3.5:1，日期行偏暗 */
.theme-dark .dpr-sub { color: var(--text-secondary, #aaaaaa) !important; }
/* :306 .dpr-intro b #334155 —— 1.18:1，"难度 / 用途 / +50 积分"整块隐形 */
.theme-dark .dpr-intro b { color: var(--text-primary, #e0e0e0) !important; }
/* :312 .dpr-stage-head #4c1d95 —— 1.11:1，"学习阶段"四个字全黑 */
.theme-dark .dpr-stage-head { color: var(--text-primary, #e0e0e0) !important; }
/* :314 .dpr-stage-head span #7c3aed —— 2.14:1，整行阶段说明发暗 */
.theme-dark .dpr-stage-head span { color: #c4b5fd !important; }
/* :320 .dpr-stage-hint #a78bfa —— 4.48:1，擦边不过 */
.theme-dark .dpr-stage-hint { color: #c4b5fd !important; }
/* :340 .dpr-msg #64748b —— 3.04:1，"AI 应：Kb7" 读不清 */
.theme-dark .dpr-msg { color: var(--text-secondary, #aaaaaa) !important; }
/* :354 .dpr-stepsrow b #111827 —— 1.22:1，"已走 N 手"的数字隐形 */
.theme-dark .dpr-stepsrow b { color: var(--text-primary, #e0e0e0) !important; }
/* :348 .dpr-clock.urgent #dc2626 —— 27px 粗体临界 3.0:1，换亮红 */
.theme-dark .dpr-clock.urgent { color: #f87171 !important; }
/* :378 .dpr-info-i .v-points #b45309 —— 2.87:1，积分值压暗 */
.theme-dark .dpr-info-i .v-points { color: #fbbf24 !important; }

/* ---- 17.4 每日一练：浅底块（浅绿/浅黄/浅绿高亮）在夜间仍是亮斑 ---- */
/* :302 .dpr-flag 浅绿底 */
.theme-dark .dpr-flag {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}
/* :391 .dpr-guest 浅黄底 */
.theme-dark .dpr-guest {
    background: rgba(245, 158, 11, 0.14) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.38) !important;
}
/* :389 .dpr-wd.on 浅绿底 */
.theme-dark .dpr-wd.on {
    background: rgba(34, 197, 94, 0.22) !important;
    color: #86efac !important;
    border-color: rgba(34, 197, 94, 0.45) !important;
}
/* :388 .dpr-wd 描边 #e2e8f0 在夜间是刺眼亮框 */
.theme-dark .dpr-wd { border-color: var(--border-color, #333344) !important; }
/* :384 .dpr-week 分隔虚线 #eef2f7 */
.theme-dark .dpr-week { border-top-color: var(--border-color, #333344) !important; }

/* ---- 17.5 每日一练：选中态与主按钮对比度 ---- */
/* :319 .dpr-stage-chip.on 白字压 #667eea = 3.66:1，压深底色 */
.theme-dark .dpr-stage-chip.on {
    background: #4338ca !important;
    color: #fff !important;
}
/* :364 .dpr-btn-primary 找回主按钮蓝色（分节 8 把所有按钮拍平成了灰底） */
.theme-dark .dpr-btn.dpr-btn-primary {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .dpr-btn.dpr-btn-primary:disabled {
    background: var(--bg-elevated, #2a3550) !important;
    color: #9a9aa4 !important;
}
/* :366 .dpr-btn-warn 警告按钮保留橙色语义 */
.theme-dark .dpr-btn.dpr-btn-warn {
    border-color: rgba(217, 119, 6, 0.65) !important;
    color: #fbbf24 !important;
}
/* :318 .dpr-stage-chip:hover 深紫 hover 字在夜间看不见 */
.theme-dark .dpr-stage-chip:hover {
    color: #c4b5fd !important;
    border-color: #7c6cf0 !important;
}

/* ---- 17.6 每日一练：升变弹窗仍是纯白模态框 ---- */
/* :405 .dpr-promo-pop 白底 */
.theme-dark .dpr-promo-pop {
    background: var(--bg-card, #1f2940) !important;
    border: 1px solid var(--border-color, #333344);
    color: var(--text-primary, #e0e0e0) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.theme-dark .dpr-promo-t { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .dpr-promo-btn { border-color: var(--border-color, #333344) !important; }
.theme-dark .dpr-promo-btn small { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dpr-promo-btn:hover { background: #33415f !important; }

/* ---- 17.7 棋盘坐标色：canvas 位图 CSS 管不到，由 JS 读这个变量 ---- */
/* daily-practice.js / daily-practice-review.js 的 coordColor() 读它 */
body.theme-dark {
    --board-coord-color: rgba(226, 232, 240, 0.85);
}

/* ---- 17.8 浏览器默认蓝链接（无 class 的裸 <a>）夜间几乎看不见 ----
   不能加 :not([style])：official_calendar 的返回链接带内联 text-decoration，
   内联只管装饰不管颜色，加了会漏掉它。 */
.theme-dark a[href]:not([class]) {
    color: #93c5fd;
}

/* ---- 17.10 棋谱中心·对局查看器（match_search sub=detail，弹窗 iframe embed=1）----
   用户反馈「右侧区域一大片白色」：
   :508 .ms-moves-box{background:#f8f9fa} 走棋步骤大白块
   :550 .ms-info-value{color:#333} 对局信息的值在深底上 1.15:1 等于隐形
   :433 .ms-moves-hint{background:#f1f5f9} 浅灰 chip */
.theme-dark .ms-moves-box {
    background: var(--bg-secondary, #16213e) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .ms-move { color: var(--text-primary, #e0e0e0); }
.theme-dark .ms-move:hover { background: #33415f !important; }
.theme-dark .ms-move.current {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .ms-move-nag.nag-good { color: #4ade80 !important; }
.theme-dark .ms-move-nag.nag-mistake { color: #f87171 !important; }
.theme-dark .ms-move-nag.nag-brilliant { color: #34d399 !important; }
.theme-dark .ms-move-nag.nag-blunder { color: #fca5a5 !important; }
.theme-dark .ms-move-nag.nag-interesting { color: #c4b5fd !important; }
.theme-dark .ms-info-row { border-bottom-color: var(--border-color, #333344) !important; }
.theme-dark .ms-info-label { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ms-info-value { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ms-detail-card .ms-moves-hint {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
/* :487 .ms-btn-primary 白字压 #667eea = 3.66:1 */
.theme-dark .ms-btn-primary {
    background: #4f46e5 !important;
    color: #fff !important;
}

/* 对局列表页（sub=games） */
.theme-dark .ms-games-title { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ms-round-label { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ms-load-progress { border-bottom-color: var(--border-color, #333344) !important; }
.theme-dark .ms-load-progress .ms-prog-info { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .ms-load-progress .ms-prog-bar { background: var(--bg-elevated, #2a3550) !important; }
.theme-dark .ms-game-row-moves,
.theme-dark .ms-game-row-date { color: var(--text-secondary, #aaaaaa) !important; }
/* 模块自带的 .theme-dark .ms-game-row-result strong 特异性低于 .ms-game-row.res-x strong，压不住 */
.theme-dark .ms-game-row.res-1-0 .ms-game-row-result strong { color: #4ade80 !important; }
.theme-dark .ms-game-row.res-0-1 .ms-game-row-result strong { color: #f87171 !important; }
.theme-dark .ms-game-row.res-draw .ms-game-row-result strong { color: #cbd5e1 !important; }
.theme-dark .ms-load-more-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: #c7d2fe !important;
    border-color: var(--border-color, #333344) !important;
}

/* ---- 17.11 对局弹窗外壳（棋谱中心 / 经典名局 / 大师对局）---- */
.theme-dark .game-player-modal .modal-inner,
.theme-dark .game-modal .modal-inner {
    background: var(--bg-card, #1f2940) !important;
}
/* iframe 默认 #fff：内容加载前会闪一下白 */
.theme-dark .game-player-modal .modal-frame {
    background: var(--bg-primary, #1a1a2e) !important;
}

/* ---- 17.12 大师对局 / 经典名局：棋局弹窗内部（点开才渲染，页面级审计量不到）----
   master_games.php:3375 自带 mg-dark-v1 夜间块，但漏了棋盘区/信息条/控制条/走法条/PGN 区。
   这些类名（.board-area .control-bar .ctrl-btn …）是通用名，必须限定在弹窗根下，不能裸写。 */
.theme-dark .game-modal .board-area,
.theme-dark .game-modal .player-info-bar,
.theme-dark .game-modal .control-bar,
.theme-dark .game-modal .moves-scroll-wrap,
.theme-dark .game-modal .pgn-section,
.theme-dark .game-modal .player-search-bar,
.theme-dark .game-modal .pmg-card,
.theme-dark .game-player-modal .board-area,
.theme-dark .game-player-modal .player-info-bar,
.theme-dark .game-player-modal .control-bar,
.theme-dark .game-player-modal .progress-area,
.theme-dark .game-player-modal .moves-section {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .game-modal .pmg-card:hover { background: #33415f !important; }
.theme-dark .game-player-modal .player-header,
.theme-dark .game-modal .player-header {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .game-player-modal .player-title,
.theme-dark .game-modal .player-title { color: var(--text-primary, #e0e0e0) !important; }

/* 对阵信息 */
.theme-dark .game-modal .elo-tag,
.theme-dark .game-modal .vs-text,
.theme-dark .game-player-modal .vs-text { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .game-modal .result-badge,
.theme-dark .game-player-modal .result-tag {
    background: #4f46e5 !important;
    color: #fff !important;
}

/* 走法条（大师对局） */
.theme-dark .game-modal .move-pill.current {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .game-modal .move-no { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .game-modal .move-pill.current .move-no { color: rgba(255, 255, 255, 0.75) !important; }
.theme-dark .game-modal .move-nag { color: #fb923c !important; }
/* 执黑先手时占位的空格子，原样透明，否则夜间会露出一个「·」 */
.theme-dark .game-modal .move-pill-empty { color: transparent !important; }

/* 走法列表（经典名局） */
.theme-dark .game-player-modal .moves-header {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0) !important;
    border-bottom-color: var(--border-color, #333344) !important;
}
.theme-dark .game-player-modal .moves-toggle,
.theme-dark .game-player-modal .move-num,
.theme-dark .game-player-modal .move-black { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .game-player-modal .move-white { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .game-player-modal .move-item:hover { background: #33415f !important; }
.theme-dark .game-player-modal .move-item.active {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .game-player-modal .move-item.active .move-num,
.theme-dark .game-player-modal .move-item.active .move-white,
.theme-dark .game-player-modal .move-item.active .move-black { color: #fff !important; }

/* 控制条：大师对局按钮本身是实底 #667eea，经典名局是 #f0f0f0 灰底 */
.theme-dark .game-modal .ctrl-btn {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .game-player-modal .ctrl-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .game-player-modal .ctrl-btn:hover { background: #33415f !important; }
.theme-dark .game-modal .play-btn,
.theme-dark .game-player-modal .play-btn {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .game-modal .play-btn.playing,
.theme-dark .game-player-modal .play-btn.playing { background: #c2410c !important; }
.theme-dark .game-player-modal .speed-label { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .game-player-modal .progress-bar { background: var(--bg-elevated, #2a3550) !important; }
.theme-dark .cg-board-btn-answer {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .cg-evalbar-score { color: var(--text-secondary, #aaaaaa) !important; }

/* 对局简介：:696 浅橙渐变底 + #444 字 */
.theme-dark .game-desc-section {
    background: linear-gradient(135deg, #3a3120, #1f2940) !important;
    border-color: #92400e !important;
}
.theme-dark .desc-header { color: #fbbf24 !important; }
.theme-dark .desc-content { color: var(--text-secondary, #aaaaaa) !important; }

/* 大师对局 · PGN 区 / 棋手弹窗 */
.theme-dark .game-modal .mg-copy-btn { border-color: var(--border-color, #333344) !important; }
.theme-dark .game-modal .mg-copy-btn:hover {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .game-modal .player-search-bar input {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .game-modal .pmg-card-meta { color: var(--text-secondary, #aaaaaa) !important; }
/* 分节 15 把胜负徽章的字提亮了，但底色仍是白天的浅绿/浅红/浅黄，优先级压不过 */
.theme-dark .game-modal .pmg-card-result.pmg-win-white {
    background: rgba(76, 175, 80, 0.2) !important;
    color: #86efac !important;
}
.theme-dark .game-modal .pmg-card-result.pmg-win-black {
    background: rgba(198, 40, 40, 0.22) !important;
    color: #fca5a5 !important;
}
.theme-dark .game-modal .pmg-card-result.pmg-draw {
    background: rgba(240, 177, 61, 0.18) !important;
    color: #fcd34d !important;
}

/* ---- 17.13 大师对局 · 对局 tab 的概览卡 ---- */
.theme-dark .mg-overview-section,
.theme-dark .mg-widget { background: var(--bg-card, #1f2940) !important; }
.theme-dark .mg-widget-title,
.theme-dark .mg-top10-name { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .mg-overview-count,
.theme-dark .mg-top10-meta { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .mg-top10-card {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .mg-top10-card:hover { background: #33415f !important; }
.theme-dark .mg-dist-bar,
.theme-dark .mg-elo-track { background: var(--bg-elevated, #2a3550) !important; }
/* 彩色分布条是 JS 内联配色，白天同样偏低；只加字影保证可读，不动数据配色 */
.theme-dark .mg-dist-seg { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65); }
.theme-dark .mg-tab-pane .pagination .page-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-primary, #e0e0e0) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .mg-tab-pane .pagination .page-num { color: #a5b4fc !important; }

/* ---- 17.14 棋谱中心 · 轮次页签 ---- */
/* :182 .ms-round-tab #e8eaf2 浅灰底 */
.theme-dark .ms-round-tab {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .ms-round-tab:hover {
    background: #33415f !important;
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .ms-round-tab.active {
    background: #4f46e5 !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* ---- 17.15 开局速查 · 详情面板 ---- */
/* :1273 .op-tab 白底 / :519 .category-btn 浅灰 / :1252 .opc-toggle 浅紫 */
.theme-dark .op-tab {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .op-tab:hover {
    border-color: #7c8ee8 !important;
    color: var(--text-primary, #e0e0e0) !important;
}
.theme-dark .op-tab.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .category-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .category-btn:hover { background: #33415f !important; }
.theme-dark .category-btn.active {
    background: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .op-commentary .opc-toggle {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #c7d2fe !important;
}
.theme-dark .op-commentary .opc-toggle:hover { background: rgba(99, 102, 241, 0.34) !important; }
.theme-dark .op-commentary .opc-round,
.theme-dark .op-commentary .opc-detail-p { color: var(--text-secondary, #aaaaaa) !important; }
/* :801 .move-chip.preview 浅底虚线；:794 hover 浅蓝 */
.theme-dark .move-chip.preview {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .move-chip.preview:hover {
    background: #33415f !important;
    color: #c7d2fe !important;
}
.theme-dark .move-chip.preview .move-num { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .move-chip:hover { background: #33415f !important; }
.theme-dark .move-chip.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}
.theme-dark .current-opening-eco { background: #4f46e5 !important; color: #fff !important; }

/* ---- 17.16 研习课堂 · 章节 / 播放器 ---- */
/* :711 :633 #5a6fd6 靛蓝字压在深底 2.7~3.2:1 */
.theme-dark .sc-intro-title,
.theme-dark .sc-intro-toggle,
.theme-dark .sc-intro-expand,
.theme-dark .sc-chapter-meta .m-cmt { color: #a5b4fc !important; }
.theme-dark .sc-chapter-meta .m-gb { color: #fdba74 !important; }
.theme-dark .sc-mini-num,
.theme-dark .sc-chap-nav-btn { background: #4f46e5 !important; }
.theme-dark .sc-chapter-item.is-done .sc-mini-num { background: #15803d !important; }

/* ---- 17.17 GIF 制作 / 棋盘分析 · 零散浅底按钮 ---- */
/* gif_maker.php:589 .gif-color-chip 白底 */
.theme-dark .gif-color-chip {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .gif-color-chip.is-on {
    background: rgba(118, 150, 86, 0.28) !important;
    border-color: #769656 !important;
    color: #bef264 !important;
}
/* position_analysis.php:1908 .pa-fs-toggle 浅紫底 */
.theme-dark .pa-fs-toggle:not(.is-on) {
    background: rgba(124, 58, 237, 0.2) !important;
    border-color: rgba(167, 139, 250, 0.5) !important;
    color: #ddd6fe !important;
}
.theme-dark .pa-fs-toggle.pa-save-mypgn-top {
    background: rgba(17, 153, 142, 0.2) !important;
    border-color: rgba(17, 153, 142, 0.6) !important;
    color: #5eead4 !important;
}

/* ---- 17.18 棋盘分析：渐变浅底 ----
   这些块用 background:linear-gradient(…)，background-color 是透明的，
   只看 backgroundColor 的审计完全量不到（白底、低对比都漏）。 */
/* :1850 .pa-mode-tabs 浅灰底：半透明页签压在它上面会被稀释回浅色 */
.theme-dark .pa-mode-tabs {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344) !important;
}
/* 模块标题下的说明行（#888，4.09:1） */
.theme-dark .cu-module-header p { color: var(--text-secondary, #aaaaaa) !important; }
/* :1152 .action-btn 白→浅紫渐变（棋盘下方一排操作键） */
.theme-dark .position-analysis-page .action-btn {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    box-shadow: none !important;
}
.theme-dark .position-analysis-page .action-btn:hover {
    background: #33415f !important;
    border-color: #7c8ee8 !important;
}
.theme-dark .position-analysis-page .action-btn .action-label { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .position-analysis-page .action-btn.active {
    background: #4f46e5 !important;
    border-color: transparent !important;
}
.theme-dark .position-analysis-page .action-btn.active .action-label { color: #fff !important; }
/* :1414 .section-title 浅紫渐变标题条 */
.theme-dark .position-analysis-page .section-title {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
/* :1881-1884 模式页签：彩色浅渐变底；分节 15 的 .pa-mode-tab!important 把字统一压成 #aaa，选中态白字也被吃掉 */
.theme-dark .pa-mode-tab[data-view="analysis"] {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.45) !important;
    color: #93c5fd !important;
}
.theme-dark .pa-mode-tab[data-view="editor"] {
    background: rgba(34, 197, 94, 0.18) !important;
    border-color: rgba(34, 197, 94, 0.42) !important;
    color: #86efac !important;
}
.theme-dark .pa-mode-tab[data-view="paste"] {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.42) !important;
    color: #fcd34d !important;
}
.theme-dark .pa-mode-tab.active {
    background: #4f46e5 !important;
    border-color: transparent !important;
    color: #fff !important;
}
/* :2242 轮到走子的一方：浅蓝渐变条 + 深蓝字 */
.theme-dark .position-analysis-page .player-box.turn-active {
    background: rgba(74, 144, 217, 0.2) !important;
}
.theme-dark .position-analysis-page .player-box.turn-active .player-name { color: #93c5fd !important; }
.theme-dark .position-analysis-page .player-box .player-turn-chip { background: #2563eb !important; }
.theme-dark .position-analysis-page .player-box.ai-thinking .player-turn-chip { background: #7c3aed !important; }
/* :917 导出 PGN 白底按钮 */
.theme-dark .movetext-actions .save-pgn-btn {
    border-color: var(--border-color, #333344) !important;
    color: #a5b4fc !important;
}

/* ---- 17.19 AI 复盘 · 示例条（:628 浅蓝紫渐变）---- */
.theme-dark .aru-demo {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(168, 85, 247, 0.16)) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .aru-demo-close { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .aru-demo-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary, #e0e0e0) !important;
}

/* ---- 17.20 零散补漏 ---- */
.theme-dark .mg-overview-title,
.theme-dark .mg-elo-count,
.theme-dark .mg-widget strong,
.theme-dark .mg-top10-card strong { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .mg-elo-label,
.theme-dark .mg-dist-legend-item { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .game-player-modal .move-counter,
.theme-dark .game-player-modal .current-fen { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .opening-item .opening-name { color: var(--text-primary, #e0e0e0) !important; }
/* 分节 15 的 .btn-text 是给 theme_practice 灰字用的，但 opening 的 AI 对弈键是彩色实底，要白字 */
.theme-dark .ai-game-btn .btn-text,
.theme-dark .ai-game-btn .btn-icon { color: #fff !important; }
/* position_analysis.php:1435 .save-pgn-btn 浅紫渐变底 */
.theme-dark .save-pgn-btn {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: #a5b4fc !important;
}
.theme-dark .save-pgn-btn:hover {
    background: #33415f !important;
    border-color: #7c8ee8 !important;
    color: #c7d2fe !important;
}
.theme-dark .gif-toggle-inline,
.theme-dark .gif-toggle-inline span { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .gif-board-theme-name,
.theme-dark .gif-theme-preview-name { color: var(--text-secondary, #aaaaaa) !important; }

/* ---- 17.9 官方赛历（official_calendar）：写死的浅色徽章/高亮行 ----
   .oc-table tr.is-new td{background:#fffdf3} 是硬编码浅底，
   分节 15 又把 .oc-title/.oc-date 提亮成 #e0e0e0 → 白底浅字（1.29:1）。
   这里不逐个 td 改色（会把「新赛事」高亮语义一起抹掉），而是把高亮行压成半透明靛蓝。 */
.theme-dark .oc-table tr.is-new td {
    background: rgba(74, 84, 196, 0.18) !important;
}
.theme-dark .oc-badge.up {
    background: rgba(74, 84, 196, 0.2) !important;
    color: #a5b4fc !important;
}
.theme-dark .oc-badge.live {
    background: rgba(31, 122, 58, 0.25) !important;
    color: #86efac !important;
}
.theme-dark .oc-badge.done {
    background: var(--bg-elevated, #2a3550) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .oc-new {
    background: rgba(179, 38, 30, 0.24) !important;
    color: #fca5a5 !important;
}
.theme-dark .oc-rate {
    background: rgba(138, 90, 0, 0.28) !important;
    color: #fbbf24 !important;
}
.theme-dark .oc-rate.none {
    background: transparent !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
/* 强调色靛蓝在深底上偏暗 */
.theme-dark .oc-games,
.theme-dark .oc-export,
.theme-dark .oc-foot a {
    color: #a5b4fc !important;
}

/* ---- 17.21 选中态：容器压暗后不能把「选中」的高亮一起抹掉 ---- */
/* opening.php:972 .opening-item.selected */
.theme-dark div.opening-item.selected {
    background: rgba(99, 102, 241, 0.24) !important;
}
.theme-dark .opening-item:hover { background: #33415f !important; }
/* coordinate.css:146 .ct-opt.active */
.theme-dark span.ct-opt.ct-q-opt.active,
.theme-dark .ct-opt.active {
    background: rgba(124, 58, 237, 0.32) !important;
    border-color: #a78bfa !important;
    color: #ddd6fe !important;
}
/* settings_piece.php:53 .theme-opt.active */
.theme-dark div.theme-opt.active {
    background: rgba(102, 126, 234, 0.24) !important;
    border-color: #7c8ee8 !important;
    color: #c7d2fe !important;
}

/* ---- 补充：文字 73 条 / 容器 29 个 / 跳过 94 个 ---- */
/* a.ob-login-btn | 原 rgb(0, 0, 238) on rgb(31,41,64) = 1.54 -> #8787ff | online_battle */
.theme-dark a.ob-login-btn { color: #8787ff !important; }
/* a.op-back-btn | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | opening_personal_editor */
.theme-dark a.op-back-btn { color: #7a8fed !important; }
/* a.traps-hero-btn 承载 a.traps-hero-btn（rgb(255, 255, 255) on rgb(233,228,254) = 1.24）| traps_index */
.theme-dark a.traps-hero-btn { background: var(--bg-elevated, #2a3550) !important; }
/* div.club-optimize-note b | 原 rgb(102, 126, 234) on rgb(40,50,72) = 3.52 -> #879aef | club_coach */
.theme-dark div.club-optimize-note b { color: #879aef !important; }
/* div.ct-intro-item b | 原 rgb(31, 41, 55) on rgb(31,41,64) = 1.01 -> --text-primary | coordinate_index */
.theme-dark div.ct-intro-item b { color: var(--text-primary, #e0e0e0) !important; }
/* div.oa-intro-desc b | 原 rgb(59, 111, 166) on rgb(26,26,46) = 3.26 -> #578bc3 | opponent_analysis */
.theme-dark div.oa-intro-desc b { color: #578bc3 !important; }
/* button#pcScoutBtn.pc-btn 承载 button#pcScoutBtn.pc-btn（rgb(224, 224, 224) on rgb(255,255,255) = 1.32）| player_center */
.theme-dark button#pcScoutBtn.pc-btn { background: var(--bg-elevated, #2a3550) !important; }
/* button#publishHomeworkBtn.pa-share-btn 承载 button#publishHomeworkBtn.pa-share-btn（rgb(102, 126, 234) on rgb(255,255,255) = 3.66）| club_position_analysis */
.theme-dark button#publishHomeworkBtn.pa-share-btn { background: var(--bg-elevated, #2a3550) !important; }
/* button#recognizeBtn.ocr-btn.ocr-btn-primary 承载 button#recognizeBtn.ocr-btn.ocr-btn-primary（rgb(255, 255, 255) on rgb(203,213,225) = 1.48）| ocr_pgn */
.theme-dark button#recognizeBtn.ocr-btn.ocr-btn-primary { background: var(--bg-elevated, #2a3550) !important; }
/* button#scFilterReset.sc-filter-reset | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | study_courses */
.theme-dark button#scFilterReset.sc-filter-reset { color: #7a8fed !important; }
/* button.bt-mini | 原 rgb(74, 108, 247) on rgb(31,41,64) = 3.3 -> #748ef9 | club_board_teach */
.theme-dark button.bt-mini { color: #748ef9 !important; }
/* button.club-btn.club-btn-back 承载 button.club-btn.club-btn-back（rgb(74, 108, 247) on rgb(255,255,255) = 4.39）| club_courseware_view */
.theme-dark button.club-btn.club-btn-back { background: var(--bg-elevated, #2a3550) !important; }
/* button.ocr-history-btn 承载 button.ocr-history-btn（rgb(224, 224, 224) on rgb(255,255,255) = 1.32）| ocr_pgn */
.theme-dark button.ocr-history-btn { background: var(--bg-elevated, #2a3550) !important; }
/* button.op-board-btn.op-board-btn-answer 承载 button.op-board-btn.op-board-btn-answer（rgb(170, 170, 170) on rgb(240,240,240) = 2.04）| opening,opening_detail */
.theme-dark button.op-board-btn.op-board-btn-answer { background: var(--bg-elevated, #2a3550) !important; }
/* div.club-modal div | 原 rgb(51, 51, 51) on rgb(31,41,64) = 1.15 -> --text-primary | club_index */
.theme-dark div.club-modal div { color: var(--text-primary, #e0e0e0) !important; }
/* div.club-row-card 承载 div.dp-cover div（rgb(224, 224, 224) on rgb(234,238,254) = 1.14）| club_demo_preview */
.theme-dark div.club-row-card { background: var(--bg-card, #1f2940) !important; }
/* div#bt-san | 原 rgb(68, 68, 68) on rgb(31,41,64) = 1.49 -> #949494 | club_board_teach */
.theme-dark div#bt-san { color: #949494 !important; }
/* div#dp-all-toggle.club-menu-sub.club-menu-sub-toggle | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | club_demo_preview */
.theme-dark div#dp-all-toggle.club-menu-sub.club-menu-sub-toggle { color: #7a8fed !important; }
/* div#dp-ann-more.dp-ann-more | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | club_demo_preview */
.theme-dark div#dp-ann-more.dp-ann-more { color: #7a8fed !important; }
/* div#movesList.moves-list | 原 rgb(102, 102, 102) on rgb(42,53,80) = 2.12 -> #a2a2a2 | opening */
.theme-dark div#movesList.moves-list { color: #a2a2a2 !important; }
/* div#pcs-hint.pcs-hint 承载 div#pcs-hint.pcs-hint（rgb(136, 136, 136) on rgb(255,248,230) = 3.35）| puzzle_custom_solve */
.theme-dark div#pcs-hint.pcs-hint { background: var(--bg-card, #1f2940) !important; }
/* div#prExpected.op-current-san | 原 rgb(51, 51, 51) on rgb(42,53,80) = 1.04 -> --text-primary | opening_practice */
.theme-dark div#prExpected.op-current-san { color: var(--text-primary, #e0e0e0) !important; }
/* div.club-stat-num | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | club_demo_preview */
.theme-dark div.club-stat-num { color: #7a8fed !important; }
/* div.ct-intro-item | 原 rgb(75, 85, 99) on rgb(31,41,64) = 1.92 -> #8a96a6 | coordinate_index */
.theme-dark div.ct-intro-item { color: #8a96a6 !important; }
/* div.ct-intro-title | 原 rgb(55, 65, 81) on rgb(31,41,64) = 1.41 -> #8795ad | coordinate_index */
.theme-dark div.ct-intro-title { color: #8795ad !important; }
/* div.demo-role-tab 承载 div.demo-role-tab（rgb(224, 224, 224) on rgb(233,237,251) = 1.13）| club_index */
.theme-dark div.demo-role-tab { background: var(--bg-elevated, #2a3550) !important; }
/* div.dg-head-note | 原 rgb(138, 138, 153) on rgb(31,41,64) = 4.26 -> #9393a1 | club_diagnosis,club_opponents */
.theme-dark div.dg-head-note { color: #9393a1 !important; }
/* div.game-arrow | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | cg_game_modal,classic_games */
.theme-dark div.game-arrow { color: #7a8fed !important; }
/* div.gif-tab 承载 div.gif-tab（rgb(170, 170, 170) on rgb(245,245,245) = 2.13）| gif_embed,gif_maker */
.theme-dark div.gif-tab { background: var(--bg-elevated, #2a3550) !important; }
/* div.gif-tab.active | 原 rgb(224, 224, 224) on rgb(106,144,74) = 2.79 -> #ffffff | gif_embed,gif_maker */
.theme-dark div.gif-tab.active { color: #ffffff !important; }
/* div.ms-desc | 原 rgb(122, 130, 152) on rgb(26,26,46) = 4.45 -> #80889d | match_search */
.theme-dark div.ms-desc { color: #80889d !important; }
/* div.ms-promo | 原 rgb(85, 85, 85) on rgb(26,26,46) = 2.29 -> #888888 | match_search */
.theme-dark div.ms-promo { color: #888888 !important; }
/* div.ocr-hero-tip | 原 rgb(180, 83, 9) on rgb(32,34,61) = 3.08 -> #e86b0c | ocr_pgn */
.theme-dark div.ocr-hero-tip { color: #e86b0c !important; }
/* div.op-current-label | 原 rgb(136, 136, 136) on rgb(42,53,80) = 3.44 -> #a2a2a2 | opening_practice */
.theme-dark div.op-current-label { color: #a2a2a2 !important; }
/* div.op-login-banner | 原 rgb(230, 81, 0) on rgb(53,41,40) = 3.68 -> #ff6714 | opening_practice */
.theme-dark div.op-login-banner { color: #ff6714 !important; }
/* div.op-stat-card 承载 div.op-stat-lbl（rgb(136, 136, 136) on rgb(255,255,255) = 3.54）| opening_practice */
.theme-dark div.op-stat-card { background: var(--bg-card, #1f2940) !important; }
/* div.op-stat-lbl-big | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | opening_stats */
.theme-dark div.op-stat-lbl-big { color: #949494 !important; }
/* div#pcs-note-block.pcs-note-block 承载 div.pcs-note-label（rgb(181, 137, 0) on rgb(255,248,230) = 3.03）| puzzle_custom_solve */
.theme-dark div#pcs-note-block.pcs-note-block { background: var(--bg-card, #1f2940) !important; }
/* div.player-icon.white 承载 div.player-icon.white（rgb(224, 224, 224) on rgb(245,245,245) = 1.21）| club_position_analysis,pa_embed,position_analysis */
.theme-dark div.player-icon.white { background: var(--bg-card, #1f2940) !important; }
/* div.pp-book-desc | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | puzzle_practice */
.theme-dark div.pp-book-desc { color: #949494 !important; }
/* div.traps-cat-arrow | 原 rgb(124, 58, 237) on rgb(31,41,64) = 2.54 -> #a97ef3 | traps_index */
.theme-dark div.traps-cat-arrow { color: #a97ef3 !important; }
/* div.traps-prog-num | 原 rgb(124, 58, 237) on rgb(31,41,64) = 2.54 -> #8f57f0 | traps_index */
.theme-dark div.traps-prog-num { color: #8f57f0 !important; }
/* span.ms-card-sec-badge em | 原 rgb(124, 134, 168) on rgb(54,66,107) = 2.73 -> #afb5ca | match_search */
.theme-dark span.ms-card-sec-badge em { color: #afb5ca !important; }
/* div.sc-head-title h1 | 原 rgb(51, 51, 51) on rgb(26,26,46) = 1.35 -> --text-primary | study_courses */
.theme-dark div.sc-head-title h1 { color: var(--text-primary, #e0e0e0) !important; }
/* div.club-modal h3 | 原 rgb(51, 51, 51) on rgb(31,41,64) = 1.15 -> --text-primary | club_index */
.theme-dark div.club-modal h3 { color: var(--text-primary, #e0e0e0) !important; }
/* span.ct-opt.ct-q-opt 承载 span.ct-opt.ct-q-opt i（rgb(170, 170, 170) on rgb(255,255,255) = 2.32）| coordinate_index */
.theme-dark span.ct-opt.ct-q-opt { background: var(--bg-elevated, #2a3550) !important; }
/* span.ct-opt.ct-q-opt.active 承载 span.ct-opt.ct-q-opt.active i（rgb(170, 170, 170) on rgb(243,232,255) = 1.97）| coordinate_index */
.theme-dark span.ct-opt.ct-q-opt.active { background: var(--bg-elevated, #2a3550) !important; }
/* div.op-form-row label | 原 rgb(102, 102, 102) on rgb(31,41,64) = 2.52 -> #949494 | opening_personal_editor */
.theme-dark div.op-form-row label { color: #949494 !important; }
/* label.cu-login-dismiss | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | club_create,club_join,online_battle,user_center */
.theme-dark label.cu-login-dismiss { color: #949494 !important; }
/* div.ai-header p | 原 rgb(102, 102, 102) on rgb(31,41,64) = 2.52 -> #949494 | ai_game */
.theme-dark div.ai-header p { color: #949494 !important; }
/* div.cu-module-header p | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | master_games,mg_game_modal,mg_player_modal */
.theme-dark div.cu-module-header p { color: #949494 !important; }
/* div.dg-empty p | 原 rgb(51, 51, 51) on rgb(31,41,64) = 1.15 -> --text-primary | club_diagnosis,club_opponents */
.theme-dark div.dg-empty p { color: var(--text-primary, #e0e0e0) !important; }
/* div.wtp-card.wtp-empty p | 原 rgb(51, 51, 51) on rgb(31,41,64) = 1.15 -> --text-primary | training_plan */
.theme-dark div.wtp-card.wtp-empty p { color: var(--text-primary, #e0e0e0) !important; }
/* p.c960-hint | 原 rgb(93, 64, 55) on rgb(42,37,25) = 1.64 -> #b0877a | chess960 */
.theme-dark p.c960-hint { color: #b0877a !important; }
/* a.traps-cat-card span | 原 rgb(124, 58, 237) on rgb(31,41,64) = 2.54 -> #a97ef3 | traps_index */
.theme-dark a.traps-cat-card span { color: #a97ef3 !important; }
/* div.ct-intro-item span | 原 rgb(75, 85, 99) on rgb(31,41,64) = 1.92 -> #8a96a6 | coordinate_index */
.theme-dark div.ct-intro-item span { color: #8a96a6 !important; }
/* div.cw-actions-new span | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | club_courseware */
.theme-dark div.cw-actions-new span { color: #7a8fed !important; }
/* div.dp-puzzle-info 承载 div.dp-puzzle-info span（rgb(170, 170, 170) on rgb(248,249,250) = 2.2）| daily_puzzle */
.theme-dark div.dp-puzzle-info { background: var(--bg-card, #1f2940) !important; }
/* div.pp-progress-text span | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | puzzle_practice */
.theme-dark div.pp-progress-text span { color: #949494 !important; }
/* span.club-user-cell 承载 span.club-user-cell span（rgb(224, 224, 224) on rgb(248,249,250) = 1.25）| club_demo_preview */
.theme-dark span.club-user-cell { background: var(--bg-card, #1f2940) !important; }
/* span#bt-turn.bt-chip 承载 span#bt-turn.bt-chip（rgb(74, 108, 247) on rgb(240,244,255) = 3.99）| club_board_teach */
.theme-dark span#bt-turn.bt-chip { background: var(--bg-elevated, #2a3550) !important; }
/* span#c960SpNumber.c960-sp-num | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | chess960 */
.theme-dark span#c960SpNumber.c960-sp-num { color: #7a8fed !important; }
/* span#dp-all-arrow | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | club_demo_preview */
.theme-dark span#dp-all-arrow { color: #7a8fed !important; }
/* span#ms-stats-label.ms-stats-label | 原 rgb(122, 130, 152) on rgb(31,41,64) = 3.78 -> #8e94a7 | match_search */
.theme-dark span#ms-stats-label.ms-stats-label { color: #8e94a7 !important; }
/* span#opEcoApct.op-eco-pct | 原 rgb(85, 85, 85) on rgb(31,41,64) = 1.94 -> #949494 | opening_stats */
.theme-dark span#opEcoApct.op-eco-pct { color: #949494 !important; }
/* span#opEcoBpct.op-eco-pct | 原 rgb(85, 85, 85) on rgb(31,41,64) = 1.94 -> #949494 | opening_stats */
.theme-dark span#opEcoBpct.op-eco-pct { color: #949494 !important; }
/* span#opEcoCpct.op-eco-pct | 原 rgb(85, 85, 85) on rgb(31,41,64) = 1.94 -> #949494 | opening_stats */
.theme-dark span#opEcoCpct.op-eco-pct { color: #949494 !important; }
/* span#opEcoDpct.op-eco-pct | 原 rgb(85, 85, 85) on rgb(31,41,64) = 1.94 -> #949494 | opening_stats */
.theme-dark span#opEcoDpct.op-eco-pct { color: #949494 !important; }
/* span#opEcoEpct.op-eco-pct | 原 rgb(85, 85, 85) on rgb(31,41,64) = 1.94 -> #949494 | opening_stats */
.theme-dark span#opEcoEpct.op-eco-pct { color: #949494 !important; }
/* span#opEditorTitle.op-editor-title | 原 rgb(51, 51, 51) on rgb(31,41,64) = 1.15 -> --text-primary | opening_personal_editor */
.theme-dark span#opEditorTitle.op-editor-title { color: var(--text-primary, #e0e0e0) !important; }
/* span#opFavToggle.op-fav-toggle 承载 span#opFavCount（rgb(170, 170, 170) on rgb(255,255,255) = 2.32）| opening,opening_detail */
.theme-dark span#opFavToggle.op-fav-toggle { background: var(--bg-card, #1f2940) !important; }
/* span#openingCount.opening-count | 原 rgb(153, 153, 153) on rgb(42,53,80) = 4.28 -> #a2a2a2 | opening,opening_detail */
.theme-dark span#openingCount.opening-count { color: #a2a2a2 !important; }
/* div.op-progress-card 承载 span#prProgressText（rgb(102, 126, 234) on rgb(255,255,255) = 3.66）| opening_practice */
.theme-dark div.op-progress-card { background: var(--bg-card, #1f2940) !important; }
/* span#scFilterCount.sc-filter-count | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | study_courses */
.theme-dark span#scFilterCount.sc-filter-count { color: #949494 !important; }
/* span#tg-clear-btn.tg-clear | 原 rgb(239, 68, 68) on rgb(31,41,64) = 3.85 -> #f26868 | tactical_generator */
.theme-dark span#tg-clear-btn.tg-clear { color: #f26868 !important; }
/* span.ai-level-rating | 原 rgb(153, 153, 153) on rgb(42,53,80) = 4.28 -> #a2a2a2 | ai_game */
.theme-dark span.ai-level-rating { color: #a2a2a2 !important; }
/* span.ct-opt.ct-toggle.ct-q-opt 承载 span.ct-opt.ct-toggle.ct-q-opt（rgb(224, 224, 224) on rgb(255,255,255) = 1.32）| coordinate_index */
.theme-dark span.ct-opt.ct-toggle.ct-q-opt { background: var(--bg-elevated, #2a3550) !important; }
/* span.cu-learn-streak-check 承载 span.cu-learn-streak-check（rgb(22, 163, 74) on rgb(220,252,231) = 3）| learn_index */
.theme-dark span.cu-learn-streak-check { background: var(--bg-card, #1f2940) !important; }
/* span.demo-watermark | 原 rgb(102, 126, 234) on rgb(35,38,69) = 4 -> #798eed | club_demo_preview */
.theme-dark span.demo-watermark { color: #798eed !important; }
/* span.dp-locked 承载 span.dp-locked（rgb(156, 163, 175) on rgb(243,244,246) = 2.31）| club_demo_preview */
.theme-dark span.dp-locked { background: var(--bg-card, #1f2940) !important; }
/* span.ecl-tag.rating 承载 span.ecl-tag.rating（rgb(230, 81, 0) on rgb(255,243,224) = 3.46）| event_calendar */
.theme-dark span.ecl-tag.rating { background: var(--bg-elevated, #2a3550) !important; }
/* span.gif-options-title | 原 rgb(51, 65, 85) on rgb(22,33,62) = 1.53 -> #798fae | gif_embed,gif_maker */
.theme-dark span.gif-options-title { color: #798fae !important; }
/* span.mg-rank-elo | 原 rgb(102, 126, 234) on rgb(31,41,64) = 3.96 -> #7a8fed | master_games */
.theme-dark span.mg-rank-elo { color: #7a8fed !important; }
/* span.mg-rank-elo-mini | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | master_games */
.theme-dark span.mg-rank-elo-mini { color: #949494 !important; }
/* span.mg-rank-flag | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | master_games */
.theme-dark span.mg-rank-flag { color: #949494 !important; }
/* span.mg-rank-name | 原 rgb(51, 51, 51) on rgb(31,41,64) = 1.15 -> --text-primary | master_games */
.theme-dark span.mg-rank-name { color: var(--text-primary, #e0e0e0) !important; }
/* span.move-pill.move-pill-empty | 原 rgba(0, 0, 0, 0) on rgb(31,41,64) = 1 -> --text-primary | mg_game_modal */
.theme-dark span.move-pill.move-pill-empty { color: var(--text-primary, #e0e0e0) !important; }
/* span.ms-card-arrow | 原 rgb(90, 99, 120) on rgb(31,41,64) = 2.41 -> #8c95a9 | match_search */
.theme-dark span.ms-card-arrow { color: #8c95a9 !important; }
/* span.ms-card-date | 原 rgb(122, 130, 152) on rgb(31,41,64) = 3.78 -> #8e94a7 | match_search */
.theme-dark span.ms-card-date { color: #8e94a7 !important; }
/* span.ms-search-icon | 原 rgb(122, 130, 152) on rgb(26,26,46) = 4.45 -> #80889d | match_search */
.theme-dark span.ms-search-icon { color: #80889d !important; }
/* span.oa-intro-badge | 原 rgb(74, 144, 217) on rgb(32,40,67) = 4.34 -> #5798dc | opponent_analysis */
.theme-dark span.oa-intro-badge { color: #5798dc !important; }
/* div.opening-item 承载 span.oi-fav（rgb(224, 224, 224) on rgb(248,249,250) = 1.25）| opening,opening_detail */
.theme-dark div.opening-item { background: var(--bg-card, #1f2940) !important; }
/* div.opening-item.selected 承载 span.oi-games（rgb(154, 160, 174) on rgb(232,240,255) = 2.29）| opening_detail */
.theme-dark div.opening-item.selected { background: var(--bg-card, #1f2940) !important; }
/* span.op-required | 原 rgb(229, 57, 53) on rgb(31,41,64) = 3.43 -> #ec6d6a | opening_personal_editor */
.theme-dark span.op-required { color: #ec6d6a !important; }
/* span.pp-progress-label | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | puzzle_practice */
.theme-dark span.pp-progress-label { color: #949494 !important; }
/* div.sc-course-card span.sc-course-icon | 原 rgb(224, 224, 224) on rgb(177,138,162) = 2.26 -> #ffffff | study_courses */
.theme-dark div.sc-course-card span.sc-course-icon { color: #ffffff !important; }
/* span.sc-filter-label | 原 rgb(136, 136, 136) on rgb(31,41,64) = 4.09 -> #949494 | study_courses */
.theme-dark span.sc-filter-label { color: #949494 !important; }
/* span.tab-count | 原 rgb(153, 153, 153) on rgb(42,53,80) = 4.28 -> #a2a2a2 | theme_index,theme_practice */
.theme-dark span.tab-count { color: #a2a2a2 !important; }
/* span.tab-name | 原 rgb(102, 102, 102) on rgb(42,53,80) = 2.12 -> #a2a2a2 | theme_index,theme_practice */
.theme-dark span.tab-name { color: #a2a2a2 !important; }
/* div.theme-opt 承载 span.theme-opt-name（rgb(224, 224, 224) on rgb(255,255,255) = 1.32）| settings_piece */
.theme-dark div.theme-opt { background: var(--bg-elevated, #2a3550) !important; }
/* div.ocr-section 承载 div#quotaHint.ocr-quota-hint strong（rgb(217, 119, 6) on rgb(255,247,217) = 2.96）| ocr_pgn */
.theme-dark div.ocr-section { background: var(--bg-card, #1f2940) !important; }
/* div.ocr-hero-tip strong | 原 rgb(180, 83, 9) on rgb(32,34,61) = 3.08 -> #e86b0c | ocr_pgn */
.theme-dark div.ocr-hero-tip strong { color: #e86b0c !important; }

/* ---- 17.22 收尾：剩余的浅底块 / 低对比（放在生成规则之后，同优先级时胜出）---- */
/* position_analysis.php:1621 .oa-demo-card 浅蓝紫渐变（对手分析示例卡） */
.theme-dark .oa-demo-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(168, 85, 247, 0.16)) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .oa-demo-desc,
.theme-dark .oa-demo-close { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .oa-demo-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
/* club/demo_preview.php:51 .dp-cover 浅紫渐变封面占位 */
.theme-dark .dp-cover { background: var(--bg-elevated, #2a3550) !important; }

/* ocr_pgn.php:808 收益卡 / :127 额度提示条 */
.theme-dark .ocr-benefit-card {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .ocr-benefit-title { color: #7dd3fc !important; }
.theme-dark .ocr-benefit-desc { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ocr-quota-hint {
    background: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(245, 158, 11, 0.38) !important;
    color: #fcd34d !important;
}
.theme-dark .ocr-quota-hint strong,
.theme-dark .ocr-quota-hint .ocr-quota-sub,
.theme-dark .ocr-quota-hint .ocr-quota-icon { color: #fcd34d !important; }
.theme-dark .ocr-quota-hint.ocr-quota-exhausted {
    background: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.38) !important;
}
.theme-dark .ocr-quota-hint.ocr-quota-exhausted strong,
.theme-dark .ocr-quota-hint.ocr-quota-exhausted .ocr-quota-sub { color: #fca5a5 !important; }

/* css/traps.css:175 主按钮夜间仍是白底深紫字，容器压暗后变成深底深字 */
.theme-dark .traps-hero-btn.main {
    background: #6d28d9 !important;
    border-color: transparent !important;
    color: #fff !important;
}
.theme-dark .traps-hero-btn:not(.main) {
    border-color: var(--border-color, #333344) !important;
    color: var(--text-primary, #e0e0e0) !important;
}

/* 无 class 的裸链接 */
.theme-dark .oc-module a:not([class]) { color: #93c5fd !important; }
.theme-dark .dg-nav a { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .dg-head-note a { color: #a5b4fc !important; }

/* 棋盘分析 / 开局练习 / 俱乐部的零散项 */
.theme-dark .position-analysis-page .pa-feature-tip {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .position-analysis-page .pa-feature-tip b { color: #a5b4fc !important; }
.theme-dark .op-moves-display { background: var(--bg-card, #1f2940) !important; }
.theme-dark .op-progress-row span,
.theme-dark .op-current-label,
.theme-dark .op-stat-lbl,
.theme-dark .op-stat-lbl-big,
.theme-dark .pcs-hint { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .ecl-tag.rating { color: #fdba74 !important; }
.theme-dark .cu-learn-streak-check { color: #4ade80 !important; }

/* 靛蓝强调字在深底上只有 3~4:1 */
.theme-dark .bt-chip,
.theme-dark .club-btn-back,
.theme-dark .pa-share-btn,
.theme-dark #prProgressText,
.theme-dark .dg-head-note,
.theme-dark .club-back-btn { color: #a5b4fc !important; }
.theme-dark a.club-btn {
    background: var(--bg-elevated, #2a3550) !important;
    color: #a5b4fc !important;
}
/* club/courseware_edit.php:271 .club-back-btn 白→浅蓝渐变 */
.theme-dark .club-back-btn {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .club-back-btn:hover { background: #33415f !important; }
.theme-dark .bt-chip-blue {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.42) !important;
    color: #93c5fd !important;
}
.theme-dark .bt-chip-green {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: rgba(16, 185, 129, 0.42) !important;
    color: #6ee7b7 !important;
}
.theme-dark .bt-chip-red {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.42) !important;
    color: #fca5a5 !important;
}

/* club/create.php:38 建俱乐部说明卡：内联样式写死浅底，只能按属性匹配 */
.theme-dark .club-card[style*="#f0f7ff"],
.theme-dark .club-card[style*="#eef3ff"] {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
    color: var(--text-secondary, #aaaaaa) !important;
}
.theme-dark .club-card[style*="#f0f7ff"] div[style*="#4a6cf7"] { color: #a5b4fc !important; }
.theme-dark .club-card[style*="#f0f7ff"] b { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .club-card[style*="#f0f7ff"] div[style*="border-top"] { border-top-color: var(--border-color, #333344) !important; }

/* ---- 17.23 最后一轮补漏（候选验证后剩余）---- */
/* opening_personal_editor.php:73 空走子提示 #333 */
.theme-dark .op-sans-list { color: var(--text-secondary, #aaaaaa) !important; }
/* opening_practice.php .op-sans-history 白底走法历史卡 */
.theme-dark .op-sans-history {
    background: var(--bg-card, #1f2940) !important;
    border-color: var(--border-color, #333344) !important;
}
/* club/join.php:67 内联 #2c3e66 提示行 */
.theme-dark .club-card div[style*="#2c3e66"] { color: var(--text-secondary, #aaaaaa) !important; }
/* club_index 欢迎弹窗（暖白底，css2.php 的 var(--bg-card) 被本页内联样式盖掉） */
.theme-dark .club-modal {
    background: var(--bg-card, #1f2940) !important;
    color: var(--text-primary, #e0e0e0) !important;
}
/* gif_maker 底部操作条白底 */
.theme-dark .gif-footer {
    background: var(--bg-card, #1f2940) !important;
    border-top-color: var(--border-color, #333344) !important;
}
/* 生成的 #949494 被同特异性后置规则压回次要色（master_games 副标题 4.09→4.65） */
.theme-dark div.cu-module-header p { color: var(--text-secondary, #aaaaaa) !important; }

/* ---- 17.24 特异性收口 ----
   master_games.php:791 用 (0,3,2)+!important 把副标题钉死在 #888，
   常规 .theme-dark 规则压不过，必须用同等特异性反超。 */
.theme-dark .cu-module.master-games-module .cu-module-header p {
    color: var(--text-secondary, #aaaaaa) !important;
}
/* club_index 欢迎弹窗：三张入口卡全是内联样式（暖橙渐变 / #f8faff 浅蓝），
   内联 background 只有带 !important 的作者规则才压得住，用属性选择器定位。 */
.theme-dark .club-modal div[style*="#fff7ed"] {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.42) !important;
}
.theme-dark .club-modal div[style*="#fff7ed"] div { color: var(--text-primary, #e0e0e0) !important; }
.theme-dark .club-modal div[style*="#fff7ed"] div[style*="#a16207"],
.theme-dark .club-modal div[style*="#fff7ed"] div[style*="#999"] { color: var(--text-secondary, #aaaaaa) !important; }
.theme-dark .club-modal div[style*="#f8faff"] {
    background: var(--bg-elevated, #2a3550) !important;
    border-color: var(--border-color, #333344) !important;
}
.theme-dark .club-modal div[style*="#ccc"] { color: var(--text-secondary, #aaaaaa) !important; }
