/* ======================================================
   theme-switcher.css — 主题切换组件
   ====================================================== */

.theme-switcher {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.theme-switcher-toggle {
    width: 36px;
    height: 48px;
    border: none;
    border-radius: 8px 0 0 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: -2px 2px 12px rgba(0,0,0,0.15);
}

.theme-switcher-toggle:hover {
    width: 40px;
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.theme-switcher-panel {
    position: absolute;
    top: 0;
    right: 100%;
    width: 200px;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 4px 24px rgba(0,0,0,0.12);
    padding: 12px;
    display: none;
    animation: themePanelIn 0.2s ease;
}

.theme-switcher-panel.show {
    display: block;
}

@keyframes themePanelIn {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.theme-switcher-title {
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-left: 4px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin-bottom: 4px;
}

.theme-option:last-child {
    margin-bottom: 0;
}

.theme-option:hover {
    background: #f5f7fa;
}

.theme-option.active {
    border-color: #667eea;
    background: rgba(102,126,234,0.06);
}

.theme-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.theme-preview-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #fff 50%, #e0e4ea 100%);
}

.theme-preview-light::after {
    content: '';
    position: absolute;
    top: 6px; left: 6px;
    width: 20px; height: 3px;
    background: #667eea;
    border-radius: 2px;
}

.theme-preview-dark {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a26 50%, #12121a 100%);
}

.theme-preview-dark::after {
    content: '';
    position: absolute;
    top: 6px; left: 6px;
    width: 20px; height: 3px;
    background: #e63946;
    border-radius: 2px;
}

.theme-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.theme-desc {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

.theme-option.active .theme-label {
    color: #667eea;
}

/* ===== 深色主题下的切换器 ===== */
[data-theme="racing-dark"] .theme-switcher-toggle {
    background: linear-gradient(135deg, #e63946, #ff4d5a);
}

[data-theme="racing-dark"] .theme-switcher-toggle:hover {
    background: linear-gradient(135deg, #ff4d5a, #e63946);
}

[data-theme="racing-dark"] .theme-switcher-panel {
    background: #1a1a26;
    border-color: rgba(255,255,255,0.06);
    box-shadow: -4px 4px 24px rgba(0,0,0,0.5);
}

[data-theme="racing-dark"] .theme-switcher-title {
    color: #6a6a82;
}

[data-theme="racing-dark"] .theme-option:hover {
    background: #222233;
}

[data-theme="racing-dark"] .theme-option.active {
    border-color: #e63946;
    background: rgba(230,57,70,0.12);
}

[data-theme="racing-dark"] .theme-label {
    color: #f0f0f5;
}

[data-theme="racing-dark"] .theme-option.active .theme-label {
    color: #e63946;
}

[data-theme="racing-dark"] .theme-desc {
    color: #6a6a82;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    .theme-switcher {
        top: auto;
        bottom: 20px;
        right: 16px;
        transform: none;
    }

    .theme-switcher-toggle {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    }

    .theme-switcher-toggle:hover {
        width: 44px;
        transform: scale(1.05);
    }

    .theme-switcher-panel {
        top: auto;
        bottom: 100%;
        right: 0;
        margin-bottom: 8px;
        border-radius: 12px;
        width: 200px;
    }
}
