/* ========================================
   theme-switcher.css - 主题切换器样式
   版本: 1.0.0
   日期: 2026-06-13
   ======================================== */

/* 主题切换器容器 */
.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* 当在导航栏容器内时，使用相对定位 */
.theme-switcher-container .theme-switcher {
    position: relative;
}

/* 独立浮动模式（如果直接挂在 body） */
body > .theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* 切换按钮 */
.theme-switcher-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--skin-primary, var(--primary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--skin-glow, var(--primary-glow));
    transition: all 0.3s ease;
    user-select: none;
    border: none;
}

/* 浮动模式下的大按钮 */
body > .theme-switcher .theme-switcher-toggle {
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px var(--skin-glow, var(--primary-glow));
}

.theme-switcher-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--skin-glow, var(--primary-glow));
}

.theme-switcher-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 18px;
    line-height: 1;
}

/* 浮动模式下的大图标 */
body > .theme-switcher .theme-icon {
    font-size: 24px;
}

/* 主题面板 */
.theme-switcher-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-color, rgba(0, 0, 0, 0.4));
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 1001;
}

/* 浮动模式下的面板位置 */
body > .theme-switcher .theme-switcher-panel {
    top: auto;
    bottom: 60px;
    right: 0;
    margin-top: 0;
}

.theme-switcher-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 面板头部 */
.theme-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.06));
}

.theme-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}

.theme-panel-close {
    background: none;
    border: none;
    color: var(--text-tertiary, #64748b);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.theme-panel-close:hover {
    background: var(--bg-hover, #334155);
    color: var(--text-primary, #f1f5f9);
}

/* 面板内容 */
.theme-panel-content {
    padding: 16px 20px;
}

/* 主题区域 */
.theme-section {
    margin-bottom: 20px;
}

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

.theme-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 模式切换按钮 */
.theme-mode-switch {
    display: flex;
    gap: 8px;
}

.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-tertiary, #334155);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary, #94a3b8);
}

.mode-btn:hover {
    background: var(--bg-hover, #475569);
    border-color: var(--border-primary, rgba(255, 255, 255, 0.12));
}

.mode-btn.active {
    background: var(--skin-primary, var(--primary));
    border-color: var(--skin-primary, var(--primary));
    color: #ffffff;
}

.mode-btn span:first-child {
    font-size: 20px;
    line-height: 1;
}

.mode-btn span:last-child {
    font-size: 11px;
    font-weight: 600;
}

/* 主题皮肤列表 */
.theme-skins {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.theme-skin-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: var(--bg-tertiary, #334155);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-skin-item:hover {
    background: var(--bg-hover, #475569);
    border-color: var(--border-primary, rgba(255, 255, 255, 0.12));
}

.theme-skin-item.active {
    border-color: var(--skin-primary, var(--primary));
    background: var(--skin-bg, var(--primary-bg));
}

/* 皮肤预览 */
.skin-preview {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skin-color {
    width: 100%;
    height: 100%;
    transition: background-color 0.3s ease;
}

/* 锁定图标 */
.skin-lock {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    font-size: 16px;
    backdrop-filter: blur(2px);
}

/* 皮肤名称 */
.skin-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    text-align: center;
}

.theme-skin-item.active .skin-name {
    color: var(--skin-primary, var(--primary));
}

/* 未解锁皮肤价格标签 */
.skin-price {
    font-size: 9px;
    color: var(--gold, #f59e0b);
    background: var(--gold-bg, rgba(245, 158, 11, 0.1));
    padding: 1px 4px;
    border-radius: 4px;
    margin-top: 2px;
}

/* 未解锁皮肤样式 */
.theme-skin-item.locked {
    opacity: 0.7;
    cursor: pointer;
}

.theme-skin-item.locked:hover {
    opacity: 0.9;
    background: var(--bg-hover, #475569);
}

/* 商店链接 */
.theme-shop-link {
    float: right;
    font-size: 11px;
    font-weight: 400;
    color: var(--primary, #6366f1);
    text-decoration: none;
}

.theme-shop-link:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .theme-switcher {
        bottom: 16px;
        right: 16px;
    }
    
    .theme-switcher-toggle {
        width: 44px;
        height: 44px;
    }
    
    .theme-icon {
        font-size: 20px;
    }
    
    .theme-switcher-panel {
        width: calc(100vw - 32px);
        right: -8px;
    }
    
    .theme-skins {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* 动画效果 */
@keyframes themeSwitch {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.theme-skin-item.active {
    animation: themeSwitch 0.3s ease;
}

/* 无障碍 */
.theme-switcher-toggle:focus-visible,
.mode-btn:focus-visible,
.theme-skin-item:focus-visible {
    outline: 2px solid var(--skin-primary, var(--primary));
    outline-offset: 2px;
}
