/* ===== 单词训练营 全站深色模式(与 mobile/theme.js 配合) ===== */

/* 0. 全局统一返回按钮样式(亮色 + 深色通用,放在最前面保证优先级) */
.back-home,
.back-home-btn {
    display: block !important;
    text-align: center !important;
    margin: 16px auto 6px !important;
    background: var(--secondary) !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 14px 20px !important;
    border-radius: 60px !important;
    max-width: 320px !important;
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.25) !important;
    transition: background 0.2s, transform 0.1s !important;
}
.back-home:hover,
.back-home-btn:hover { background: #3BB8B0 !important; }
.back-home:active,
.back-home-btn:active { transform: scale(0.97) !important; }

/* 1. CSS 变量覆盖:对使用 var(--bg-body) 等变量的页面自动生效 */
html[data-theme="dark"] {
  --primary: #6BA6E8;
  --primary-light: #85B7EB;
  --primary-dark: #A8CBF0;
  --primary-bg: #1E3A5F;
  --secondary: #3BB8B0;
  --secondary-light: #4ECDC4;
  --accent-orange: #EF9F27;
  --accent-orange-light: #BA7517;
  --bg-body: #121A24;
  --bg-card: #1D2836;
  --text-primary: #E6EDF5;
  --text-secondary: #A9B8C8;
  --text-light: #7C8B9C;
  --highlight-bg: #1E3A5F;
  --highlight-border: #33455c;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --shadow-md: 0 6px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}

/* 2. 基础元素 */
html[data-theme="dark"] body { background: #121A24 !important; color: #E6EDF5 !important; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #263445 !important; border-color: #33455c !important; color: #E6EDF5 !important; }
html[data-theme="dark"] ::placeholder { color: #7C8B9C !important; }
html[data-theme="dark"] table th { background: #22303f !important; color: #E6EDF5 !important; border-color: #33455c !important; }
html[data-theme="dark"] table td { color: #A9B8C8 !important; border-color: #33455c !important; }
html[data-theme="dark"] a { color: #6BA6E8; }

/* 3. 卡片/容器(覆盖常见类名,避免漏网) */
html[data-theme="dark"] .card,
html[data-theme="dark"] .menu-card,
html[data-theme="dark"] .book-card,
html[data-theme="dark"] .notice-card,
html[data-theme="dark"] .welcome-card,
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .goal-card,
html[data-theme="dark"] .checkin-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .stat-card-item,
html[data-theme="dark"] .gift-card,
html[data-theme="dark"] .vip-box,
html[data-theme="dark"] .selector-container,
html[data-theme="dark"] .info-modal-box,
html[data-theme="dark"] .upgrade-modal-box,
html[data-theme="dark"] .modal-container,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .drawer-panel,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .unit-card,
html[data-theme="dark"] .sound-card,
html[data-theme="dark"] .login-card { background: #1D2836 !important; }

/* 4. 弹窗遮罩 */
html[data-theme="dark"] .modal-mask,
html[data-theme="dark"] .info-modal-mask,
html[data-theme="dark"] .upgrade-modal-mask,
html[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.6) !important; }

/* 5. 文字颜色(标题/正文/次要) */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .title,
html[data-theme="dark"] .stat-name,
html[data-theme="dark"] .book-title,
html[data-theme="dark"] .word-count,
html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .selector-title,
html[data-theme="dark"] .cal-title,
html[data-theme="dark"] .notice-content,
html[data-theme="dark"] .w-word,
html[data-theme="dark"] .q-line,
html[data-theme="dark"] .question,
html[data-theme="dark"] .stat-number,
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .current-indicator,
html[data-theme="dark"] label { color: #E6EDF5 !important; }
html[data-theme="dark"] .sub,
html[data-theme="dark"] .info-text,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .score-line,
html[data-theme="dark"] .desc,
html[data-theme="dark"] .w-pr,
html[data-theme="dark"] .w-mean,
html[data-theme="dark"] .selector-sub,
html[data-theme="dark"] .info-modal-body,
html[data-theme="dark"] .upgrade-modal-body,
html[data-theme="dark"] .announcement-title,
html[data-theme="dark"] .announcement-time,
html[data-theme="dark"] .empty-text,
html[data-theme="dark"] .count,
html[data-theme="dark"] .time-text { color: #A9B8C8 !important; }
html[data-theme="dark"] .arrow,
html[data-theme="dark"] .text-light,
html[data-theme="dark"] .toast { color: #7C8B9C !important; }

/* 6. 按钮统一处理(解决深色下按钮文字与背景接近看不清的问题) */
/* 6.1 彩色主按钮:背景跟随变量(深色下已变亮),文字保持白色 */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .modal-btn,
html[data-theme="dark"] .sound-btn,
html[data-theme="dark"] .btn-start,
html[data-theme="dark"] .btn-confirm,
html[data-theme="dark"] .btn-stats,
html[data-theme="dark"] .btn-go-redeem,
html[data-theme="dark"] .btn-learn,
html[data-theme="dark"] .btn-pk,
html[data-theme="dark"] .btn-train,
html[data-theme="dark"] .btn-next,
html[data-theme="dark"] .back-home,
html[data-theme="dark"] .back-home-btn,
html[data-theme="dark"] .vip-renew { color: #FFFFFF !important; }

/* 6.2 其余所有按钮/浅灰底交互块:统一深底亮字(重点修复) */
html[data-theme="dark"] button,
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] input[type="submit"] { color: #E6EDF5 !important; }
html[data-theme="dark"] button:not(.btn-primary):not(.modal-btn):not(.sound-btn):not(.btn-start):not(.btn-confirm):not(.btn-stats):not(.btn-go-redeem):not(.btn-learn):not(.btn-review):not(.btn-pk):not(.btn-train):not(.btn-next):not(.back-home):not(.back-home-btn):not(.icon-btn):not(.vip-renew),
html[data-theme="dark"] .selector-btn,
html[data-theme="dark"] .unit-choice-btn,
html[data-theme="dark"] .unit-confirm-btn,
html[data-theme="dark"] .confirm-btn,
html[data-theme="dark"] .switch-unit-btn,
html[data-theme="dark"] .speaker-btn,
html[data-theme="dark"] .error-report-btn,
html[data-theme="dark"] .btn-cancel,
html[data-theme="dark"] .btn-close-upgrade,
html[data-theme="dark"] .btn-close-permission,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .modal-close-btn,
html[data-theme="dark"] .close-modal-btn,
html[data-theme="dark"] .letter-btn,
html[data-theme="dark"] .letter,
html[data-theme="dark"] .letter-space,
html[data-theme="dark"] .key-btn,
html[data-theme="dark"] .block-btn,
html[data-theme="dark"] .version-btn,
html[data-theme="dark"] .opt,
html[data-theme="dark"] .type-btn,
html[data-theme="dark"] .word-item,
html[data-theme="dark"] .answer-btn,
html[data-theme="dark"] .choice-btn,
html[data-theme="dark"] .option-btn,
html[data-theme="dark"] .tab:not(.active) { background: #263445 !important; border-color: #33455c !important; color: #E6EDF5 !important; }
html[data-theme="dark"] .version-btn:hover,
html[data-theme="dark"] .letter-btn:hover,
html[data-theme="dark"] .unit-choice-btn:hover,
html[data-theme="dark"] .selector-btn:hover { background: #2E4055 !important; }

/* 6.2b 主页特殊按钮(修改教材 / 单词PK)深色对比度修正 */
html[data-theme="dark"] a.edit-tag,
html[data-theme="dark"] .edit-tag { background: #185FA5 !important; color: #FFFFFF !important; }
html[data-theme="dark"] a.btn-review,
html[data-theme="dark"] .btn-review { background: #1D2836 !important; color: #FFFFFF !important; border-color: #EF9F27 !important; }
html[data-theme="dark"] a.btn-review:hover,
html[data-theme="dark"] .btn-review:hover { background: #EF9F27 !important; color: #1D2836 !important; }

/* 6.3 固定浅色选中块/卡片(PK页 .selected 等) */
html[data-theme="dark"] .card.selected,
html[data-theme="dark"] .selected,
html[data-theme="dark"] .book-option.selected { background: #1E3A5F !important; color: #E6EDF5 !important; }

/* 7. 绿色主题页面(音标/字母发音)固定色值 */
html[data-theme="dark"] body { background: #121A24 !important; }
html[data-theme="dark"] .card { background: #1D2836 !important; }
html[data-theme="dark"] p { color: #A9B8C8 !important; }

/* 8. PK 对战区域/棋盘 */
html[data-theme="dark"] .game-area,
html[data-theme="dark"] .pk-panel,
html[data-theme="dark"] .battle-panel,
html[data-theme="dark"] .challenge-panel { background: #1D2836 !important; }
