/* ========================================
   深色主题适配样式
   ======================================== */

/* ========================================
   1. CSS 变量定义
   ======================================== */

[data-bs-theme="dark"],
[data-bs-theme="dark-small"] {
    --sgf-card-bg: #343a40;
    --sgf-card-hover-bg: #495057;
    --sgf-border: rgba(255, 255, 255, 0.1);
    --sgf-text-primary: #f8f9fa;
    --sgf-text-secondary: #adb5bd;
    --sgf-text-muted: #6c757d;
    --sgf-link-color: #0dcaf0;
    --sgf-success-color: #20c997;
    --sgf-warning-color: #ffc107;
    --sgf-danger-color: #dc3545;
}

/* ========================================
   2. 卡片组件样式
   ======================================== */

/* 基础卡片样式 */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark-small"] .card {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .card:hover,
[data-bs-theme="dark-small"] .card:hover {
    background-color: var(--sgf-card-hover-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 卡片头部 */
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark-small"] .card-header {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark-small"] .card-header.bg-light {
    background-color: var(--sgf-card-bg) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .card-header.text-black,
[data-bs-theme="dark-small"] .card-header.text-black {
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .card-header.bg-light.text-black,
[data-bs-theme="dark-small"] .card-header.bg-light.text-black {
    background-color: var(--sgf-card-hover-bg) !important;
    color: var(--sgf-text-primary) !important;
}

/* 消息页面渐变背景 - 亮色和暗黑主题都使用 */
.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-gradient h5,
.bg-gradient .text-white,
.bg-gradient * {
    color: white !important;
}

/* 表格表头渐变背景 */
.table-header-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.table-header-gradient th {
    color: white !important;
}

/* 暗黑主题下也保持相同的渐变 */
[data-bs-theme="dark"] .card-header.bg-gradient,
[data-bs-theme="dark-small"] .card-header.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

[data-bs-theme="dark"] .table-header-gradient,
[data-bs-theme="dark-small"] .table-header-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

[data-bs-theme="dark"] .table-header-gradient th,
[data-bs-theme="dark-small"] .table-header-gradient th {
    color: white !important;
}

/* 个人中心 - 人机分析券（紫色）在暗黑主题下保持紫色 */
[data-bs-theme="dark"] .ticket-card.bg-purple,
[data-bs-theme="dark-small"] .ticket-card.bg-purple {
    background: rgba(121, 82, 179, 0.2) !important;
    border-color: #5a3d85 !important;
}

[data-bs-theme="dark"] .ticket-card.bg-purple .ticket-name.text-purple,
[data-bs-theme="dark"] .ticket-card.bg-purple .ticket-count.text-purple,
[data-bs-theme="dark-small"] .ticket-card.bg-purple .ticket-name.text-purple,
[data-bs-theme="dark-small"] .ticket-card.bg-purple .ticket-count.text-purple {
    color: #a78bfa !important;
}

/* ========================================
   个人中心 me 页面暗黑适配（覆盖 me.css 的 !important）
   ======================================== */
[data-bs-theme="dark"] .me-container .card,
[data-bs-theme="dark-small"] .me-container .card {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .me-container .card:hover,
[data-bs-theme="dark-small"] .me-container .card:hover {
    background-color: var(--sgf-card-hover-bg) !important;
    border-color: var(--sgf-border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

[data-bs-theme="dark"] .me-container .card h6.fw-bold,
[data-bs-theme="dark-small"] .me-container .card h6.fw-bold {
    border-bottom-color: var(--sgf-border) !important;
}

[data-bs-theme="dark"] .me-container .card h4.fw-bold.text-primary,
[data-bs-theme="dark-small"] .me-container .card h4.fw-bold.text-primary {
    color: var(--sgf-link-color) !important;
}

[data-bs-theme="dark"] .me-container .info-row,
[data-bs-theme="dark-small"] .me-container .info-row {
    border-bottom-color: var(--sgf-border) !important;
}

[data-bs-theme="dark"] .me-container .info-row .info-label,
[data-bs-theme="dark-small"] .me-container .info-row .info-label {
    color: var(--sgf-text-secondary) !important;
}

[data-bs-theme="dark"] .me-container .info-row .info-content,
[data-bs-theme="dark-small"] .me-container .info-row .info-content {
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .me-container .avatar-card,
[data-bs-theme="dark-small"] .me-container .avatar-card {
    border-color: var(--sgf-border) !important;
}

[data-bs-theme="dark"] .me-container .avatar-card:hover,
[data-bs-theme="dark-small"] .me-container .avatar-card:hover {
    border-color: var(--sgf-link-color) !important;
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.2) !important;
}

[data-bs-theme="dark"] .me-container .alert-warning,
[data-bs-theme="dark-small"] .me-container .alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-color: rgba(255, 193, 7, 0.4) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .me-container .form-control:focus,
[data-bs-theme="dark-small"] .me-container .form-control:focus {
    border-color: var(--sgf-link-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.15) !important;
}

[data-bs-theme="dark"] .me-container .link-primary,
[data-bs-theme="dark-small"] .me-container .link-primary {
    color: var(--sgf-link-color) !important;
}

/* 个人中心小程序推荐栏在暗黑下的背景 */
[data-bs-theme="dark"] .me-container .alert-warning[style*="background"],
[data-bs-theme="dark-small"] .me-container .alert-warning[style*="background"] {
    background: rgba(255, 193, 7, 0.12) !important;
}

[data-bs-theme="dark"] .me-container .alert-warning .mb-1[style*="color"],
[data-bs-theme="dark"] .me-container .alert-warning .mb-2[style*="color"],
[data-bs-theme="dark-small"] .me-container .alert-warning .mb-1[style*="color"],
[data-bs-theme="dark-small"] .me-container .alert-warning .mb-2[style*="color"] {
    color: var(--sgf-text-secondary) !important;
}

[data-bs-theme="dark"] .me-container .alert-warning .text-success,
[data-bs-theme="dark-small"] .me-container .alert-warning .text-success {
    color: var(--sgf-success-color) !important;
}

[data-bs-theme="dark"] .minipromo-card,
[data-bs-theme="dark-small"] .minipromo-card {
    border-color: rgba(255, 193, 7, 0.35) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .minipromo-header,
[data-bs-theme="dark-small"] .minipromo-header,
[data-bs-theme="dark"] .minipromo-body,
[data-bs-theme="dark-small"] .minipromo-body {
    background: rgba(255, 193, 7, 0.1) !important;
}

[data-bs-theme="dark"] .minipromo-item,
[data-bs-theme="dark-small"] .minipromo-item {
    background: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .minipromo-gift,
[data-bs-theme="dark-small"] .minipromo-gift {
    background: rgba(220, 53, 69, 0.15) !important;
}

/* 个人中心移动版 - 人机分析券（紫色）小卡片暗黑下保持紫色 */
[data-bs-theme="dark"] .me-container .ticket-card-mini.bg-purple,
[data-bs-theme="dark-small"] .me-container .ticket-card-mini.bg-purple {
    background: rgba(121, 82, 179, 0.2) !important;
    border-color: #5a3d85 !important;
}

[data-bs-theme="dark"] .me-container .ticket-card-mini.bg-purple .text-purple,
[data-bs-theme="dark-small"] .me-container .ticket-card-mini.bg-purple .text-purple {
    color: #a78bfa !important;
}

/* 消息行背景色 - 亮色主题 */
.message-row-unread {
    background-color: #fffbf0 !important;
}

.message-row-unread:hover {
    background-color: #fff3cd !important;
}

.message-row-read:hover {
    background-color: #f8f9fa !important;
}

/* 消息行背景色 - 暗黑主题 */
[data-bs-theme="dark"] .message-row-unread,
[data-bs-theme="dark-small"] .message-row-unread {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

[data-bs-theme="dark"] .message-row-unread:hover,
[data-bs-theme="dark-small"] .message-row-unread:hover {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

[data-bs-theme="dark"] .message-row-read:hover,
[data-bs-theme="dark-small"] .message-row-read:hover {
    background-color: var(--sgf-card-hover-bg) !important;
}

/* 表格边框 - 亮色主题 */
.table thead th {
    border-bottom: 2px solid #dee2e6 !important;
}

/* 表格边框 - 暗黑主题 */
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark-small"] .table thead th {
    border-bottom: 2px solid var(--sgf-border) !important;
}

[data-bs-theme="dark"] .card.shadow-sm .card-header.bg-light.text-black,
[data-bs-theme="dark-small"] .card.shadow-sm .card-header.bg-light.text-black {
    background-color: var(--sgf-card-hover-bg) !important;
    color: var(--sgf-text-primary) !important;
}

/* 卡片主体 */
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark-small"] .card-body {
    background-color: var(--sgf-card-bg);
    color: var(--sgf-text-primary);
}

/* 阴影卡片 */
[data-bs-theme="dark"] .card.shadow-sm,
[data-bs-theme="dark-small"] .card.shadow-sm {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .card.shadow-sm:hover,
[data-bs-theme="dark-small"] .card.shadow-sm:hover {
    background-color: var(--sgf-card-hover-bg);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

/* ========================================
   3. 表格样式
   ======================================== */

/* 基础表格 */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark-small"] .table-light {
    --bs-table-color: var(--sgf-text-primary);
    --bs-table-bg: var(--sgf-card-bg);
    --bs-table-border-color: var(--sgf-border);
    --bs-table-striped-bg: var(--sgf-card-hover-bg);
    --bs-table-striped-color: var(--sgf-text-primary);
    --bs-table-hover-bg: var(--sgf-card-hover-bg);
    --bs-table-hover-color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark-small"] .table-light th {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .table-light th i,
[data-bs-theme="dark-small"] .table-light th i {
    color: var(--sgf-link-color);
}

/* 表格悬停效果 */
[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark-small"] .table-hover tbody tr:hover {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--sgf-text-primary);
}

/* 表格链接 */
[data-bs-theme="dark"] .table a.link-primary,
[data-bs-theme="dark-small"] .table a.link-primary {
    color: var(--sgf-link-color) !important;
}

[data-bs-theme="dark"] .table a.link-primary:hover,
[data-bs-theme="dark-small"] .table a.link-primary:hover {
    color: var(--sgf-link-color) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
}

/* 移动版表格 */
[data-bs-theme="dark"] .table-secondary,
[data-bs-theme="dark-small"] .table-secondary {
    --bs-table-bg: var(--sgf-card-hover-bg);
    --bs-table-color: var(--sgf-text-primary);
    background-color: var(--sgf-card-hover-bg);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .table-secondary th,
[data-bs-theme="dark-small"] .table-secondary th {
    background-color: var(--sgf-card-hover-bg);
    color: var(--sgf-text-primary);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .table tbody tr,
[data-bs-theme="dark-small"] .table tbody tr {
    background-color: var(--sgf-card-bg);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .table tbody tr:hover,
[data-bs-theme="dark-small"] .table tbody tr:hover {
    background-color: var(--sgf-card-hover-bg);
    color: var(--sgf-text-primary);
}

/* ========================================
   4. 按钮样式
   ======================================== */

/* 轮廓按钮 */
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark-small"] .btn-outline-secondary {
    color: var(--sgf-text-primary);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark-small"] .btn-outline-secondary:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

/* 实心按钮 */
[data-bs-theme="dark"] .btn-warning,
[data-bs-theme="dark-small"] .btn-warning {
    background-color: var(--sgf-warning-color);
    border-color: var(--sgf-warning-color);
    color: #000;
}

[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark-small"] .btn-primary {
    background-color: var(--sgf-link-color);
    border-color: var(--sgf-link-color);
}

/* 移动版按钮 */
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark-small"] .btn-light {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark-small"] .btn-light:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark-small"] .btn-secondary {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark-small"] .btn-secondary:hover {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

/* ========================================
   5. 徽章样式
   ======================================== */

[data-bs-theme="dark"] .badge,
[data-bs-theme="dark-small"] .badge {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark-small"] .badge.bg-light {
    background-color: var(--sgf-card-hover-bg) !important;
    color: var(--sgf-text-primary) !important;
    border-color: var(--sgf-border) !important;
}

/* ========================================
   6. 分页样式
   ======================================== */

[data-bs-theme="dark"] .pagination .page-link,
[data-bs-theme="dark-small"] .pagination .page-link {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .pagination .page-link:hover,
[data-bs-theme="dark-small"] .pagination .page-link:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .page-item.active .page-link,
[data-bs-theme="dark-small"] .page-item.active .page-link {
    background-color: var(--sgf-link-color);
    border-color: var(--sgf-link-color);
    color: #000;
}

[data-bs-theme="dark"] .page-item.disabled .page-link,
[data-bs-theme="dark-small"] .page-item.disabled .page-link {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-muted);
}

/* ========================================
   7. 表单样式
   ======================================== */

/* 输入框 */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark-small"] .form-control {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark-small"] .form-control:focus {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-link-color);
    color: var(--sgf-text-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
}

/* 选择框 */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark-small"] .form-select {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark-small"] .form-select:focus {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-link-color);
    color: var(--sgf-text-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
}

/* 标签 */
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark-small"] .form-label {
    color: var(--sgf-text-primary);
}

/* ========================================
   8. 文本颜色样式
   ======================================== */

[data-bs-theme="dark"] .text-success,
[data-bs-theme="dark-small"] .text-success {
    color: var(--sgf-success-color) !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark-small"] .text-muted {
    color: var(--sgf-text-secondary) !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark-small"] .text-dark {
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .text-warning,
[data-bs-theme="dark-small"] .text-warning {
    color: var(--sgf-warning-color) !important;
}

[data-bs-theme="dark"] .text-danger,
[data-bs-theme="dark-small"] .text-danger {
    color: var(--sgf-danger-color) !important;
}

[data-bs-theme="dark"] .text-body-emphasis,
[data-bs-theme="dark-small"] .text-body-emphasis {
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .small.text-muted strong,
[data-bs-theme="dark-small"] .small.text-muted strong {
    color: #adb5bd;
}

/* ========================================
   9. 棋手信息卡片样式
   ======================================== */

[data-bs-theme="dark"] .player-info-card,
[data-bs-theme="dark-small"] .player-info-card {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .player-info-card:hover,
[data-bs-theme="dark-small"] .player-info-card:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-link-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .player-info-card .text-muted,
[data-bs-theme="dark-small"] .player-info-card .text-muted {
    color: var(--sgf-text-secondary) !important;
}

[data-bs-theme="dark"] .player-info-card .link-primary,
[data-bs-theme="dark-small"] .player-info-card .link-primary {
    color: var(--sgf-link-color) !important;
}

[data-bs-theme="dark"] .player-info-card .link-primary:hover,
[data-bs-theme="dark-small"] .player-info-card .link-primary:hover {
    color: var(--sgf-link-color) !important;
}

/* ========================================
   10. 背景和边框样式
   ======================================== */

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark-small"] .bg-light {
    background-color: var(--sgf-card-hover-bg) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .border-black,
[data-bs-theme="dark-small"] .border-black {
    border-color: var(--sgf-border) !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark-small"] .border {
    border-color: var(--sgf-border) !important;
}

/* ========================================
   11. 特殊组件样式
   ======================================== */

/* 列表组 */
[data-bs-theme="dark"] .list-group-item-action:hover,
[data-bs-theme="dark-small"] .list-group-item-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* AI分析指标框 */
[data-bs-theme="dark"] .text-center.p-2.border.rounded,
[data-bs-theme="dark-small"] .text-center.p-2.border.rounded {
    background-color: var(--sgf-card-hover-bg) !important;
    border-color: var(--sgf-border) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .text-center.p-2.border.rounded:hover,
[data-bs-theme="dark-small"] .text-center.p-2.border.rounded:hover {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-link-color) !important;
}

[data-bs-theme="dark"] .text-center.p-2.border.rounded .small,
[data-bs-theme="dark-small"] .text-center.p-2.border.rounded .small {
    color: var(--sgf-text-secondary) !important;
}

[data-bs-theme="dark"] .text-center.p-2.border.rounded .fw-bold,
[data-bs-theme="dark-small"] .text-center.p-2.border.rounded .fw-bold {
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .text-center.p-2.border.rounded .text-muted,
[data-bs-theme="dark-small"] .text-center.p-2.border.rounded .text-muted {
    color: var(--sgf-text-secondary) !important;
}

/* ========================================
   12. 表单插件样式
   ======================================== */

/* tt_sgfs 棋谱比较分析文本框 */
[data-bs-theme="dark"] #tt_sgfs,
[data-bs-theme="dark-small"] #tt_sgfs {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-border) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] #tt_sgfs:focus,
[data-bs-theme="dark-small"] #tt_sgfs:focus {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-link-color) !important;
    color: var(--sgf-text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25) !important;
}

[data-bs-theme="dark"] #tt_sgfs::placeholder,
[data-bs-theme="dark-small"] #tt_sgfs::placeholder {
    color: var(--sgf-text-secondary) !important;
    opacity: 0.8;
}

/* tagEditor 插件 */
[data-bs-theme="dark"] .tag-editor,
[data-bs-theme="dark-small"] .tag-editor {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-border) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .tag-editor:focus,
[data-bs-theme="dark-small"] .tag-editor:focus {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-link-color) !important;
    color: var(--sgf-text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25) !important;
}

[data-bs-theme="dark"] .tag-editor .tag,
[data-bs-theme="dark-small"] .tag-editor .tag {
    background-color: var(--sgf-card-hover-bg) !important;
    color: var(--sgf-text-primary) !important;
    border-color: var(--sgf-border) !important;
}

[data-bs-theme="dark"] .tag-editor .tag:hover,
[data-bs-theme="dark-small"] .tag-editor .tag:hover {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-link-color) !important;
}

[data-bs-theme="dark"] .tag-editor .tag .tag-remove,
[data-bs-theme="dark-small"] .tag-editor .tag .tag-remove {
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .tag-editor .tag .tag-remove:hover,
[data-bs-theme="dark-small"] .tag-editor .tag .tag-remove:hover {
    color: var(--sgf-danger-color) !important;
}

[data-bs-theme="dark"] .tag-editor .tag-editor-autocomplete,
[data-bs-theme="dark-small"] .tag-editor .tag-editor-autocomplete {
    background-color: var(--sgf-card-bg) !important;
    border-color: var(--sgf-border) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .tag-editor .tag-editor-autocomplete .tag-editor-autocomplete-item,
[data-bs-theme="dark-small"] .tag-editor .tag-editor-autocomplete .tag-editor-autocomplete-item {
    background-color: var(--sgf-card-bg) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .tag-editor .tag-editor-autocomplete .tag-editor-autocomplete-item:hover,
[data-bs-theme="dark-small"] .tag-editor .tag-editor-autocomplete .tag-editor-autocomplete-item:hover {
    background-color: var(--sgf-card-hover-bg) !important;
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .tag-editor .tag-editor-autocomplete .tag-editor-autocomplete-item.selected,
[data-bs-theme="dark-small"] .tag-editor .tag-editor-autocomplete .tag-editor-autocomplete-item.selected {
    background-color: var(--sgf-link-color) !important;
    color: var(--sgf-card-bg) !important;
}

/* ========================================
   13. 图标和特殊元素样式
   ======================================== */

/* 国旗图标 */
[data-bs-theme="dark"] .flag-icon,
[data-bs-theme="dark-small"] .flag-icon {
    border-color: #6c757d;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .flag-icon:hover,
[data-bs-theme="dark-small"] .flag-icon:hover {
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.2);
}

/* Tipbar 样式 */
[data-bs-theme="dark"] .alert {
    border: 1px solid rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .alert-success {
    --bs-alert-bg: rgba(25, 135, 84, 0.1);
    --bs-alert-border-color: rgba(25, 135, 84, 0.3);
    --bs-alert-color: #75b798;
}

[data-bs-theme="dark"] .alert-danger {
    --bs-alert-bg: rgba(220, 53, 69, 0.1);
    --bs-alert-border-color: rgba(220, 53, 69, 0.3);
    --bs-alert-color: #f1aeb5;
}

[data-bs-theme="dark"] .alert-info {
    --bs-alert-bg: rgba(13, 202, 240, 0.1);
    --bs-alert-border-color: rgba(13, 202, 240, 0.3);
    --bs-alert-color: #6edff6;
}

/* ========================================
   14. 会员权益页面暗色主题适配
   ======================================== */

/* 会员容器 */
[data-bs-theme="dark"] .member-container,
[data-bs-theme="dark-small"] .member-container {
    color: var(--sgf-text-primary);
}

/* 会员页面头部 */
[data-bs-theme="dark"] .member-page-header,
[data-bs-theme="dark-small"] .member-page-header {
    background: linear-gradient(135deg, #0a4a8a 0%, #5a0d7a 100%);
    box-shadow: 0 10px 40px rgba(10, 74, 138, 0.4);
}

[data-bs-theme="dark"] .member-page-header::before,
[data-bs-theme="dark-small"] .member-page-header::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

/* 会员卡片 */
[data-bs-theme="dark"] .pricing-card,
[data-bs-theme="dark-small"] .pricing-card {
    background: var(--sgf-card-bg);
    border-color: var(--bs-border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .pricing-card::before,
[data-bs-theme="dark-small"] .pricing-card::before {
    background: linear-gradient(90deg, var(--sgf-link-color) 0%, #6610f2 100%);
}

[data-bs-theme="dark"] .pricing-card:hover,
[data-bs-theme="dark-small"] .pricing-card:hover {
    border-color: var(--bs-border-color);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* 推荐卡片 */
[data-bs-theme="dark"] .pricing-card.featured,
[data-bs-theme="dark-small"] .pricing-card.featured {
    border-color: var(--bs-border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .pricing-card.member-type-option,
[data-bs-theme="dark-small"] .pricing-card.member-type-option,
[data-bs-theme="dark"] .pricing-card.member-type-option:hover,
[data-bs-theme="dark-small"] .pricing-card.member-type-option:hover,
[data-bs-theme="dark"] .pricing-card.member-type-option.featured,
[data-bs-theme="dark-small"] .pricing-card.member-type-option.featured {
    box-shadow: none;
}

[data-bs-theme="dark"] .pricing-card.card-normal:not(.member-type-option),
[data-bs-theme="dark-small"] .pricing-card.card-normal:not(.member-type-option) {
    border-color: var(--bs-secondary);
}

[data-bs-theme="dark"] .pricing-card.card-problem:not(.member-type-option),
[data-bs-theme="dark-small"] .pricing-card.card-problem:not(.member-type-option) {
    border-color: var(--bs-info);
}

[data-bs-theme="dark"] .pricing-card.card-play:not(.member-type-option),
[data-bs-theme="dark-small"] .pricing-card.card-play:not(.member-type-option) {
    border-color: var(--bs-success);
}

[data-bs-theme="dark"] .pricing-card.card-vip:not(.member-type-option),
[data-bs-theme="dark-small"] .pricing-card.card-vip:not(.member-type-option) {
    border-color: var(--bs-warning);
}

[data-bs-theme="dark"] .pricing-card.member-type-option.featured:not(.active),
[data-bs-theme="dark-small"] .pricing-card.member-type-option.featured:not(.active) {
    border-color: var(--bs-border-color);
    box-shadow: none;
}

[data-bs-theme="dark"] .pricing-card.featured::after,
[data-bs-theme="dark-small"] .pricing-card.featured::after {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

/* 卡片头部 */
[data-bs-theme="dark"] .pricing-card-header,
[data-bs-theme="dark-small"] .pricing-card-header {
    border-bottom-color: var(--sgf-border);
}

[data-bs-theme="dark"] .pricing-card-header::after,
[data-bs-theme="dark-small"] .pricing-card-header::after {
    background: linear-gradient(90deg, var(--sgf-link-color) 0%, #6610f2 100%);
}

/* 各类型卡片装饰线 */
[data-bs-theme="dark"] .pricing-card.card-normal .pricing-card-header::after,
[data-bs-theme="dark-small"] .pricing-card.card-normal .pricing-card-header::after {
    background: linear-gradient(90deg, #6c757d 0%, #495057 100%);
}

[data-bs-theme="dark"] .pricing-card.card-problem .pricing-card-header::after,
[data-bs-theme="dark-small"] .pricing-card.card-problem .pricing-card-header::after {
    background: linear-gradient(90deg, var(--sgf-link-color) 0%, #0a8ca8 100%);
}

[data-bs-theme="dark"] .pricing-card.card-play .pricing-card-header::after,
[data-bs-theme="dark-small"] .pricing-card.card-play .pricing-card-header::after {
    background: linear-gradient(90deg, var(--sgf-success-color) 0%, #146c43 100%);
}

[data-bs-theme="dark"] .pricing-card.card-vip .pricing-card-header::after,
[data-bs-theme="dark-small"] .pricing-card.card-vip .pricing-card-header::after {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

/* 副标题 */
[data-bs-theme="dark"] .pricing-subtitle,
[data-bs-theme="dark-small"] .pricing-subtitle {
    color: var(--sgf-text-secondary);
}

/* 价格区域 */
[data-bs-theme="dark"] .pricing-price,
[data-bs-theme="dark-small"] .pricing-price {
    background: linear-gradient(135deg, rgba(73, 80, 87, 0.2) 0%, rgba(52, 58, 64, 0.2) 100%);
}

[data-bs-theme="dark"] .price-amount,
[data-bs-theme="dark-small"] .price-amount {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .price-amount strong,
[data-bs-theme="dark-small"] .price-amount strong {
    color: var(--sgf-link-color);
}

/* 功能列表 */
[data-bs-theme="dark"] .pricing-features li,
[data-bs-theme="dark-small"] .pricing-features li {
    color: var(--sgf-text-secondary);
    border-bottom-color: var(--sgf-border);
}

[data-bs-theme="dark"] .pricing-features li:hover,
[data-bs-theme="dark-small"] .pricing-features li:hover {
    color: var(--sgf-link-color);
    background: rgba(13, 202, 240, 0.05);
}

[data-bs-theme="dark"] .pricing-features li i,
[data-bs-theme="dark-small"] .pricing-features li i {
    color: var(--sgf-success-color);
}

/* 按钮 - 保持原有渐变色以保持视觉识别 */
[data-bs-theme="dark"] .pricing-btn,
[data-bs-theme="dark-small"] .pricing-btn {
    /* 按钮保持原有渐变色 */
}

/* 会员详情页 - 区块卡片 */
[data-bs-theme="dark"] .member-section-card,
[data-bs-theme="dark-small"] .member-section-card {
    background: var(--sgf-card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .member-section-card:hover,
[data-bs-theme="dark-small"] .member-section-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* 会员卡片头部 */
[data-bs-theme="dark"] .member-card-header,
[data-bs-theme="dark-small"] .member-card-header {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
}

/* 会员表格 */
[data-bs-theme="dark"] .member-table,
[data-bs-theme="dark-small"] .member-table {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .member-table thead,
[data-bs-theme="dark-small"] .member-table thead {
    background: linear-gradient(135deg, #0a4a8a 0%, #5a0d7a 100%);
}

[data-bs-theme="dark"] .member-table thead th,
[data-bs-theme="dark-small"] .member-table thead th {
    color: white;
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .member-table tbody td,
[data-bs-theme="dark-small"] .member-table tbody td {
    border-color: var(--sgf-border);
    background-color: var(--sgf-card-bg);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .member-table tbody tr:hover,
[data-bs-theme="dark-small"] .member-table tbody tr:hover {
    background-color: var(--sgf-card-hover-bg);
}

[data-bs-theme="dark"] .member-table tbody tr:hover td,
[data-bs-theme="dark-small"] .member-table tbody tr:hover td {
    background-color: var(--sgf-card-hover-bg);
}

/* 会员徽章 - 保持原色以便识别 */
[data-bs-theme="dark"] .member-type-badge,
[data-bs-theme="dark-small"] .member-type-badge {
    /* 徽章保持原色系以便识别 */
}

/* 价格链接 */
[data-bs-theme="dark"] .price-link,
[data-bs-theme="dark-small"] .price-link {
    color: var(--sgf-link-color);
}

[data-bs-theme="dark"] .price-link:hover,
[data-bs-theme="dark-small"] .price-link:hover {
    color: var(--sgf-link-color);
    text-decoration: underline;
}

/* 功能可用性图标 - 保持原色 */
[data-bs-theme="dark"] .icon-available,
[data-bs-theme="dark-small"] .icon-available {
    color: var(--sgf-success-color);
}

[data-bs-theme="dark"] .icon-unavailable,
[data-bs-theme="dark-small"] .icon-unavailable {
    color: var(--sgf-danger-color);
}

/* 专业图标样式 - 暗黑主题 */
[data-bs-theme="dark"] .icon-check,
[data-bs-theme="dark-small"] .icon-check {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
}

[data-bs-theme="dark"] .icon-check:hover,
[data-bs-theme="dark-small"] .icon-check:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
}

[data-bs-theme="dark"] .icon-cross,
[data-bs-theme="dark-small"] .icon-cross {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

[data-bs-theme="dark"] .icon-cross:hover,
[data-bs-theme="dark-small"] .icon-cross:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
}

/* ========================================
   15. AI解题页面暗色主题适配
   ======================================== */

/* 题库搜索结果项 hover 效果 */
[data-bs-theme="dark"] .pro-search-item:hover,
[data-bs-theme="dark-small"] .pro-search-item:hover {
    box-shadow: 0 6px 20px rgba(13, 202, 240, 0.3) !important;
}

/* 棋盘链接背景 */
[data-bs-theme="dark"] .pro-search-item a.bg-light,
[data-bs-theme="dark-small"] .pro-search-item a.bg-light {
    background-color: var(--sgf-card-hover-bg) !important;
}

[data-bs-theme="dark"] .pro-search-item a.bg-light:hover,
[data-bs-theme="dark-small"] .pro-search-item a.bg-light:hover {
    background-color: var(--sgf-card-bg) !important;
}

/* ========================================
   16. 统计页面暗色主题适配
   ======================================== */

/* 图表卡片 hover 效果暗色适配 */
[data-bs-theme="dark"] .chart-card-hover:hover,
[data-bs-theme="dark-small"] .chart-card-hover:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

/* 图表包装器背景 */
[data-bs-theme="dark"] .bg-light.rounded.border,
[data-bs-theme="dark-small"] .bg-light.rounded.border {
    background-color: var(--sgf-card-hover-bg) !important;
    border-color: var(--sgf-border) !important;
}

/* ========================================
   17. 支付页面暗色主题适配
   ======================================== */

/* 余额显示区域 */
[data-bs-theme="dark"] .balance-display,
[data-bs-theme="dark-small"] .balance-display {
    background: none;
    background-image: none;
    box-shadow: none;
}

[data-bs-theme="dark"] .balance-display h4,
[data-bs-theme="dark-small"] .balance-display h4 {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .balance-amount,
[data-bs-theme="dark-small"] .balance-amount {
    color: var(--sgf-text-primary);
}

/* 选项卡导航 */
[data-bs-theme="dark"] .pay-tabs,
[data-bs-theme="dark-small"] .pay-tabs {
    border-bottom-color: var(--sgf-border);
}

[data-bs-theme="dark"] .pay-tabs .nav-link,
[data-bs-theme="dark-small"] .pay-tabs .nav-link {
    color: var(--sgf-text-secondary);
}

[data-bs-theme="dark"] .pay-tabs .nav-link:hover,
[data-bs-theme="dark-small"] .pay-tabs .nav-link:hover {
    color: var(--sgf-link-color);
    background-color: rgba(13, 202, 240, 0.05);
    border-bottom-color: rgba(13, 202, 240, 0.3);
}

[data-bs-theme="dark"] .pay-tabs .nav-link.active,
[data-bs-theme="dark-small"] .pay-tabs .nav-link.active {
    color: var(--sgf-link-color);
}

/* 选择按钮通用样式 */
[data-bs-theme="dark"] .option-btn,
[data-bs-theme="dark-small"] .option-btn {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .option-btn:hover,
[data-bs-theme="dark-small"] .option-btn:hover {
    border-color: var(--sgf-link-color);
    background-color: var(--sgf-card-hover-bg);
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.2);
}

[data-bs-theme="dark"] .option-btn.active,
[data-bs-theme="dark-small"] .option-btn.active {
    background: none;
    background-image: none;
    background-color: transparent;
    border-color: var(--sgf-link-color);
    box-shadow: none;
}

/* 充值金额选项 */
[data-bs-theme="dark"] .recharge-amount-option .amount-value,
[data-bs-theme="dark-small"] .recharge-amount-option .amount-value {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .recharge-amount-option.active .amount-value,
[data-bs-theme="dark-small"] .recharge-amount-option.active .amount-value {
    color: var(--sgf-text-primary);
}

/* 会员类型选项 */
[data-bs-theme="dark"] .member-type-option .member-name,
[data-bs-theme="dark-small"] .member-type-option .member-name {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .member-type-option.active .member-name,
[data-bs-theme="dark-small"] .member-type-option.active .member-name {
    color: white;
}

[data-bs-theme="dark"] .member-type-option .member-desc,
[data-bs-theme="dark-small"] .member-type-option .member-desc {
    color: var(--sgf-text-secondary);
}

[data-bs-theme="dark"] .member-type-option.active .member-desc,
[data-bs-theme="dark-small"] .member-type-option.active .member-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* 会员类型卡片选中状态（无外围阴影） */
[data-bs-theme="dark"] .pricing-card.member-type-option.active,
[data-bs-theme="dark-small"] .pricing-card.member-type-option.active {
    border-color: var(--sgf-link-color);
    box-shadow: none;
}

[data-bs-theme="dark"] .pricing-card.member-type-option,
[data-bs-theme="dark-small"] .pricing-card.member-type-option,
[data-bs-theme="dark"] .pricing-card.member-type-option:hover,
[data-bs-theme="dark-small"] .pricing-card.member-type-option:hover,
[data-bs-theme="dark"] .pricing-card.member-type-option.featured,
[data-bs-theme="dark-small"] .pricing-card.member-type-option.featured {
    box-shadow: none;
}

[data-bs-theme="dark"] .pricing-card.member-type-option:not(.active),
[data-bs-theme="dark-small"] .pricing-card.member-type-option:not(.active) {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .pricing-card.member-type-option.active::after,
[data-bs-theme="dark-small"] .pricing-card.member-type-option.active::after {
    background: linear-gradient(135deg, var(--sgf-link-color) 0%, #6610f2 100%);
    box-shadow: 0 2px 8px rgba(13, 202, 240, 0.5);
}

/* 会员周期选项 */
[data-bs-theme="dark"] .member-period-option .period-price,
[data-bs-theme="dark-small"] .member-period-option .period-price {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .member-period-option.active .period-price,
[data-bs-theme="dark-small"] .member-period-option.active .period-price {
    color: white;
}

[data-bs-theme="dark"] .member-period-option .period-label,
[data-bs-theme="dark-small"] .member-period-option .period-label {
    color: var(--sgf-text-secondary);
}

[data-bs-theme="dark"] .member-period-option.active .period-label,
[data-bs-theme="dark-small"] .member-period-option.active .period-label {
    color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .member-period-option .discount-badge,
[data-bs-theme="dark-small"] .member-period-option .discount-badge {
    color: var(--sgf-danger-color);
}

[data-bs-theme="dark"] .member-period-option.active .discount-badge,
[data-bs-theme="dark-small"] .member-period-option.active .discount-badge {
    color: #ffd700;
}

/* 分析券选项 */
[data-bs-theme="dark"] .analysis-type-option .analysis-price,
[data-bs-theme="dark-small"] .analysis-type-option .analysis-price {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .analysis-type-option.active .analysis-price,
[data-bs-theme="dark-small"] .analysis-type-option.active .analysis-price {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .analysis-type-option .analysis-label,
[data-bs-theme="dark-small"] .analysis-type-option .analysis-label {
    color: var(--sgf-text-secondary);
}

[data-bs-theme="dark"] .analysis-type-option.active .analysis-label,
[data-bs-theme="dark-small"] .analysis-type-option.active .analysis-label {
    color: var(--sgf-text-secondary);
}

/* 数量选项 */
[data-bs-theme="dark"] .quantity-option .quantity-value,
[data-bs-theme="dark-small"] .quantity-option .quantity-value {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .quantity-option.active .quantity-value,
[data-bs-theme="dark-small"] .quantity-option.active .quantity-value {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .quantity-option .quantity-discount,
[data-bs-theme="dark-small"] .quantity-option .quantity-discount {
    color: var(--sgf-danger-color);
}

[data-bs-theme="dark"] .quantity-option.active .quantity-discount,
[data-bs-theme="dark-small"] .quantity-option.active .quantity-discount {
    color: #ffd700;
}

/* 提示信息卡片 */
[data-bs-theme="dark"] .info-card,
[data-bs-theme="dark-small"] .info-card {
    background: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.3);
}

[data-bs-theme="dark"] .info-card .info-text,
[data-bs-theme="dark-small"] .info-card .info-text {
    color: var(--sgf-link-color);
}

/* 区域标题样式 */
[data-bs-theme="dark"] .section-label,
[data-bs-theme="dark-small"] .section-label {
    color: var(--sgf-text-primary);
}

/* 提示文本 */
[data-bs-theme="dark"] .hint-text,
[data-bs-theme="dark-small"] .hint-text {
    color: var(--sgf-danger-color);
}

[data-bs-theme="dark"] .hint-text a,
[data-bs-theme="dark-small"] .hint-text a {
    color: var(--sgf-link-color);
}

/* ========================================
   定式统计页面 (gosetsstats)
   ======================================== */

/* 容器背景 */
[data-bs-theme="dark"] .stats-container,
[data-bs-theme="dark-small"] .stats-container {
    background-color: transparent;
}

/* 卡片头部 */
[data-bs-theme="dark"] .stats-container .card-header,
[data-bs-theme="dark-small"] .stats-container .card-header {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .stats-container .card-header h6,
[data-bs-theme="dark-small"] .stats-container .card-header h6 {
    color: var(--sgf-text-primary);
}

/* 卡片标题 */
[data-bs-theme="dark"] .stats-container .card-title,
[data-bs-theme="dark-small"] .stats-container .card-title {
    color: var(--sgf-link-color);
}

/* 页面标题 */
[data-bs-theme="dark"] .stats-container .page-title,
[data-bs-theme="dark-small"] .stats-container .page-title {
    color: var(--sgf-text-primary);
}

/* 表格样式 */
[data-bs-theme="dark"] .stats-container .table,
[data-bs-theme="dark-small"] .stats-container .table {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .stats-container .table thead th,
[data-bs-theme="dark-small"] .stats-container .table thead th {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .stats-container .table tbody td,
[data-bs-theme="dark-small"] .stats-container .table tbody td {
    border-color: var(--sgf-border);
    color: var(--sgf-text-secondary);
}

[data-bs-theme="dark"] .stats-container .table tbody tr:hover,
[data-bs-theme="dark-small"] .stats-container .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 定式名称样式 */
[data-bs-theme="dark"] .stats-container .gosets-name,
[data-bs-theme="dark-small"] .stats-container .gosets-name {
    color: var(--sgf-text-primary);
}

/* Badge 样式 */
[data-bs-theme="dark"] .stats-container .badge.bg-primary-subtle,
[data-bs-theme="dark-small"] .stats-container .badge.bg-primary-subtle {
    background-color: rgba(13, 202, 240, 0.15) !important;
    color: var(--sgf-link-color) !important;
}

/* 按钮组样式 */
[data-bs-theme="dark"] .stats-container .btn-outline-primary,
[data-bs-theme="dark-small"] .stats-container .btn-outline-primary {
    border-color: rgba(13, 202, 240, 0.5);
    color: var(--sgf-link-color);
}

[data-bs-theme="dark"] .stats-container .btn-outline-primary:hover,
[data-bs-theme="dark-small"] .stats-container .btn-outline-primary:hover {
    background-color: rgba(13, 202, 240, 0.15);
    border-color: var(--sgf-link-color);
    color: var(--sgf-link-color);
}

[data-bs-theme="dark"] .stats-container .btn-outline-success,
[data-bs-theme="dark-small"] .stats-container .btn-outline-success {
    border-color: rgba(32, 201, 151, 0.5);
    color: var(--sgf-success-color);
}

[data-bs-theme="dark"] .stats-container .btn-outline-success:hover,
[data-bs-theme="dark-small"] .stats-container .btn-outline-success:hover {
    background-color: rgba(32, 201, 151, 0.15);
    border-color: var(--sgf-success-color);
    color: var(--sgf-success-color);
}

/* 表单控件 */
[data-bs-theme="dark"] .stats-container .form-control,
[data-bs-theme="dark-small"] .stats-container .form-control,
[data-bs-theme="dark"] .stats-container .form-select,
[data-bs-theme="dark-small"] .stats-container .form-select {
    background-color: #212529;
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .stats-container .form-control:focus,
[data-bs-theme="dark-small"] .stats-container .form-control:focus,
[data-bs-theme="dark"] .stats-container .form-select:focus,
[data-bs-theme="dark-small"] .stats-container .form-select:focus {
    background-color: #2d3238;
    border-color: rgba(13, 202, 240, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.15);
}

/* 分页样式 */
[data-bs-theme="dark"] .stats-container .pagination .page-link,
[data-bs-theme="dark-small"] .stats-container .pagination .page-link {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .stats-container .pagination .page-link:hover,
[data-bs-theme="dark-small"] .stats-container .pagination .page-link:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-link-color);
}

[data-bs-theme="dark"] .stats-container .pagination .page-item.disabled .page-link,
[data-bs-theme="dark-small"] .stats-container .pagination .page-item.disabled .page-link {
    background-color: #2b3035;
    border-color: var(--sgf-border);
    color: var(--sgf-text-muted);
}

/* 分页分隔线 */
[data-bs-theme="dark"] .stats-container .pagination-wrapper,
[data-bs-theme="dark-small"] .stats-container .pagination-wrapper {
    border-color: var(--sgf-border);
}

/* 分隔线 */
[data-bs-theme="dark"] .stats-container .border-top,
[data-bs-theme="dark-small"] .stats-container .border-top {
    border-color: var(--sgf-border) !important;
}

/* 滚动条样式 */
[data-bs-theme="dark"] .stats-container .table-responsive::-webkit-scrollbar-track,
[data-bs-theme="dark-small"] .stats-container .table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .stats-container .table-responsive::-webkit-scrollbar-thumb,
[data-bs-theme="dark-small"] .stats-container .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .stats-container .table-responsive::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark-small"] .stats-container .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   AI猜局首页 (guess/home)
   ======================================== */

/* 主卡片边框 */
[data-bs-theme="dark"] .border-primary,
[data-bs-theme="dark-small"] .border-primary {
    border-color: rgba(13, 202, 240, 0.3) !important;
}

/* 卡片悬停阴影 */
[data-bs-theme="dark"] .border:hover,
[data-bs-theme="dark-small"] .border:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* 链接悬停背景 */
[data-bs-theme="dark"] .flex-column .link:hover,
[data-bs-theme="dark-small"] .flex-column .link:hover {
    background: rgba(13, 202, 240, 0.1);
    box-shadow: 0 2px 10px rgba(13, 202, 240, 0.2);
}

/* 链接光晕效果 */
[data-bs-theme="dark"] .flex-column .link::before,
[data-bs-theme="dark-small"] .flex-column .link::before {
    background: linear-gradient(90deg, transparent, rgba(13, 202, 240, 0.2), transparent);
}

/* ========================================
   我的猜局列表 (guess/list)
   ======================================== */

/* 容器背景 */
[data-bs-theme="dark"] .guess-list-page,
[data-bs-theme="dark-small"] .guess-list-page {
    background-color: transparent;
}

/* 页面标题 */
[data-bs-theme="dark"] .guess-list-page .page-title,
[data-bs-theme="dark-small"] .guess-list-page .page-title {
    color: var(--sgf-text-primary);
}

/* 卡片头部 */
[data-bs-theme="dark"] .guess-list-page .card-header,
[data-bs-theme="dark-small"] .guess-list-page .card-header {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

/* 表格样式 */
[data-bs-theme="dark"] .guess-list-page .table,
[data-bs-theme="dark-small"] .guess-list-page .table {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-list-page .table thead th,
[data-bs-theme="dark-small"] .guess-list-page .table thead th {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-list-page .table tbody td,
[data-bs-theme="dark-small"] .guess-list-page .table tbody td {
    border-color: var(--sgf-border);
    color: var(--sgf-text-secondary);
}

[data-bs-theme="dark"] .guess-list-page .table tbody tr:hover,
[data-bs-theme="dark-small"] .guess-list-page .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 表单控件 */
[data-bs-theme="dark"] .guess-list-page .form-control,
[data-bs-theme="dark-small"] .guess-list-page .form-control,
[data-bs-theme="dark"] .guess-list-page .form-select,
[data-bs-theme="dark-small"] .guess-list-page .form-select {
    background-color: #212529;
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-list-page .form-control:focus,
[data-bs-theme="dark-small"] .guess-list-page .form-control:focus,
[data-bs-theme="dark"] .guess-list-page .form-select:focus,
[data-bs-theme="dark-small"] .guess-list-page .form-select:focus {
    background-color: #2d3238;
    border-color: rgba(13, 202, 240, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.15);
}

/* 分隔线 */
[data-bs-theme="dark"] .guess-list-page .border-top,
[data-bs-theme="dark-small"] .guess-list-page .border-top {
    border-color: var(--sgf-border) !important;
}

/* 分页样式 */
[data-bs-theme="dark"] .guess-list-page .pagination .page-link,
[data-bs-theme="dark-small"] .guess-list-page .pagination .page-link {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-list-page .pagination .page-link:hover,
[data-bs-theme="dark-small"] .guess-list-page .pagination .page-link:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-link-color);
}

[data-bs-theme="dark"] .guess-list-page .pagination .page-item.disabled .page-link,
[data-bs-theme="dark-small"] .guess-list-page .pagination .page-item.disabled .page-link {
    background-color: #2b3035;
    border-color: var(--sgf-border);
    color: var(--sgf-text-muted);
}

/* 滚动条样式 */
[data-bs-theme="dark"] .guess-list-page .table-responsive::-webkit-scrollbar-track,
[data-bs-theme="dark-small"] .guess-list-page .table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .guess-list-page .table-responsive::-webkit-scrollbar-thumb,
[data-bs-theme="dark-small"] .guess-list-page .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .guess-list-page .table-responsive::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark-small"] .guess-list-page .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   AI猜局缩略图页面暗黑主题适配
   ======================================== */

/* 容器样式 */
[data-bs-theme="dark"] .guess-thumbnail-container,
[data-bs-theme="dark-small"] .guess-thumbnail-container {
    background-color: transparent;
}

/* 筛选卡片 */
[data-bs-theme="dark"] .guess-thumbnail-container .filter-card,
[data-bs-theme="dark-small"] .guess-thumbnail-container .filter-card {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .guess-thumbnail-container .filter-card .card-header,
[data-bs-theme="dark-small"] .guess-thumbnail-container .filter-card .card-header {
    background-color: var(--sgf-card-hover-bg) !important;
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary) !important;
}

[data-bs-theme="dark"] .guess-thumbnail-container .filter-card .card-body,
[data-bs-theme="dark-small"] .guess-thumbnail-container .filter-card .card-body {
    background-color: var(--sgf-card-bg);
    color: var(--sgf-text-primary);
}

/* 标签样式 */
[data-bs-theme="dark"] .guess-thumbnail-container .label-compact,
[data-bs-theme="dark-small"] .guess-thumbnail-container .label-compact {
    color: var(--sgf-text-secondary);
}

/* 表单控件 */
[data-bs-theme="dark"] .guess-thumbnail-container .form-select,
[data-bs-theme="dark-small"] .guess-thumbnail-container .form-select {
    background-color: #2b3035;
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-thumbnail-container .form-select:focus,
[data-bs-theme="dark-small"] .guess-thumbnail-container .form-select:focus {
    background-color: #2d3238;
    border-color: rgba(13, 202, 240, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.15);
}

/* 缩略图卡片 */
[data-bs-theme="dark"] .guess-thumbnail-container .thumbnail-card,
[data-bs-theme="dark-small"] .guess-thumbnail-container .thumbnail-card {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .guess-thumbnail-container .thumbnail-card:hover,
[data-bs-theme="dark-small"] .guess-thumbnail-container .thumbnail-card:hover {
    background-color: var(--sgf-card-hover-bg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .guess-thumbnail-container .thumbnail-title,
[data-bs-theme="dark-small"] .guess-thumbnail-container .thumbnail-title {
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-thumbnail-container .thumbnail-title a,
[data-bs-theme="dark-small"] .guess-thumbnail-container .thumbnail-title a {
    color: var(--sgf-link-color) !important;
}

/* 分隔线 */
[data-bs-theme="dark"] .guess-thumbnail-container .border-top,
[data-bs-theme="dark-small"] .guess-thumbnail-container .border-top {
    border-color: var(--sgf-border) !important;
}

/* 按钮样式 */
[data-bs-theme="dark"] .guess-thumbnail-container .btn-outline-secondary,
[data-bs-theme="dark-small"] .guess-thumbnail-container .btn-outline-secondary {
    color: var(--sgf-text-secondary);
    border-color: var(--sgf-border);
}

[data-bs-theme="dark"] .guess-thumbnail-container .btn-outline-secondary:hover,
[data-bs-theme="dark-small"] .guess-thumbnail-container .btn-outline-secondary:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-text-secondary);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-thumbnail-container .btn-outline-warning,
[data-bs-theme="dark-small"] .guess-thumbnail-container .btn-outline-warning {
    color: var(--sgf-warning-color);
    border-color: var(--sgf-warning-color);
}

[data-bs-theme="dark"] .guess-thumbnail-container .btn-outline-warning:hover,
[data-bs-theme="dark-small"] .guess-thumbnail-container .btn-outline-warning:hover {
    background-color: var(--sgf-warning-color);
    border-color: var(--sgf-warning-color);
    color: #212529;
}

[data-bs-theme="dark"] .guess-thumbnail-container .btn-outline-danger,
[data-bs-theme="dark-small"] .guess-thumbnail-container .btn-outline-danger {
    color: var(--sgf-danger-color);
    border-color: var(--sgf-danger-color);
}

[data-bs-theme="dark"] .guess-thumbnail-container .btn-outline-danger:hover,
[data-bs-theme="dark-small"] .guess-thumbnail-container .btn-outline-danger:hover {
    background-color: var(--sgf-danger-color);
    border-color: var(--sgf-danger-color);
    color: white;
}

/* 分页样式 */
[data-bs-theme="dark"] .guess-thumbnail-container .pagination-compact .page-link,
[data-bs-theme="dark-small"] .guess-thumbnail-container .pagination-compact .page-link {
    background-color: var(--sgf-card-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-text-primary);
}

[data-bs-theme="dark"] .guess-thumbnail-container .pagination-compact .page-link:hover,
[data-bs-theme="dark-small"] .guess-thumbnail-container .pagination-compact .page-link:hover {
    background-color: var(--sgf-card-hover-bg);
    border-color: var(--sgf-border);
    color: var(--sgf-link-color);
}

[data-bs-theme="dark"] .guess-thumbnail-container .pagination-compact .page-item.active .page-link,
[data-bs-theme="dark-small"] .guess-thumbnail-container .pagination-compact .page-item.active .page-link {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #212529;
}

[data-bs-theme="dark"] .guess-thumbnail-container .pagination-compact .page-item.disabled .page-link,
[data-bs-theme="dark-small"] .guess-thumbnail-container .pagination-compact .page-item.disabled .page-link {
    background-color: #2b3035;
    border-color: var(--sgf-border);
    color: var(--sgf-text-muted);
}

/* 文本颜色 */
[data-bs-theme="dark"] .guess-thumbnail-container .text-muted,
[data-bs-theme="dark-small"] .guess-thumbnail-container .text-muted {
    color: var(--sgf-text-secondary) !important;
}

[data-bs-theme="dark"] .guess-thumbnail-container .fw-semibold,
[data-bs-theme="dark-small"] .guess-thumbnail-container .fw-semibold {
    color: var(--sgf-text-primary);
}

/* AI猜局答题页面暗黑主题 - 让Bootstrap自动控制颜色 */
[data-bs-theme="dark"] .guess-container .analysis-text:not(:empty) {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .guess-container .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ========================================
   能力测试页面暗黑主题
   ======================================== */

/* 能力测试卡片悬停效果 */
[data-bs-theme="dark"] .capability-card:hover,
[data-bs-theme="dark-small"] .capability-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

/* 激活状态卡片悬停 */
[data-bs-theme="dark"] .capability-active:hover,
[data-bs-theme="dark-small"] .capability-active:hover {
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3) !important;
}

/* 奖杯图标悬停动画 */
[data-bs-theme="dark"] .capability-trophy,
[data-bs-theme="dark-small"] .capability-trophy {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(255, 193, 7, 0.4));
}

[data-bs-theme="dark"] .capability-active:hover .capability-trophy,
[data-bs-theme="dark-small"] .capability-active:hover .capability-trophy {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 12px rgba(255, 193, 7, 0.6));
}

/* 锁定状态卡片 */
[data-bs-theme="dark"] .capability-locked:hover,
[data-bs-theme="dark-small"] .capability-locked:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* ========================================
   能力测试结果页面暗黑主题
   ======================================== */

/* 题目卡片悬停效果 */
[data-bs-theme="dark"] .capability-question-card:hover,
[data-bs-theme="dark-small"] .capability-question-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

/* ========================================
   底部菜单暗黑主题适配
   ======================================== */

/* 底部菜单背景和边框 */
[data-bs-theme="dark"] .bottom-menu,
[data-bs-theme="dark-small"] .bottom-menu {
    background-color: #161b22 !important;
    border-top-color: #30363d !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* 底部菜单文字颜色 */
[data-bs-theme="dark"] .bottom-menu .menu-text,
[data-bs-theme="dark-small"] .bottom-menu .menu-text {
    color: #adb5bd !important;
}

/* 底部菜单激活状态文字颜色 */
[data-bs-theme="dark"] .bottom-menu .menu-item.active .menu-text,
[data-bs-theme="dark-small"] .bottom-menu .menu-item.active .menu-text {
    color: #ffc107 !important;
}

/* ========================================
   radio-link 文字按钮暗色主题适配（使用badge样式）
   ======================================== */

/* 选中的文字按钮使用badge样式 */
[data-bs-theme="dark"] .radio-link.badge,
[data-bs-theme="dark-small"] .radio-link.badge {
    background-color: var(--sgf-link-color) !important;
    color: #000 !important;
    font-weight: normal;
}

/* 未选中的文字按钮在暗色主题下的样式 */
[data-bs-theme="dark"] .radio-link.link-primary:not(.badge),
[data-bs-theme="dark-small"] .radio-link.link-primary:not(.badge) {
    color: var(--sgf-text-secondary) !important;
}

/* 未选中的文字按钮悬停效果 */
[data-bs-theme="dark"] .radio-link.link-primary:not(.badge):hover,
[data-bs-theme="dark-small"] .radio-link.link-primary:not(.badge):hover {
    color: var(--sgf-link-color) !important;
    opacity: 0.85;
}