/* ============================================
   主题选择器  .theme-picker-wrap
   ============================================ */

.theme-picker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* 触发按钮 */
.theme-picker-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.28rem 0.65rem;
    background: transparent;
    border: 1px solid var(--border-medium, rgba(0,200,255,0.3));
    border-radius: 6px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.theme-picker-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* 当前主题色点 */
.theme-picker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s;
}

/* 下拉面板 — 紧凑两列 */
.theme-picker-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--bg-secondary, rgba(15,25,45,0.96));
    border: 1px solid var(--border-medium, rgba(0,200,255,0.25));
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: none;
    animation: theme-panel-in 0.18s ease;
}
.theme-picker-panel.open { display: block; }

@keyframes theme-panel-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-picker-label {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    padding: 2px 4px 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* 分组标题 */
.theme-picker-group-label {
    font-size: 0.70rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    padding: 2px 4px 5px;
    letter-spacing: 0.04em;
}

/* 分组分隔线 */
.theme-picker-divider {
    height: 1px;
    background: var(--border-light, rgba(255,255,255,0.08));
    margin: 6px 0;
}

/* 两列网格 */
.theme-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 2px;
}

/* 主题选项 — 紧凑竖排 */
.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 7px 6px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1.5px solid transparent;
    position: relative;
    text-align: center;
}
.theme-option:hover {
    background: rgba(255,255,255,0.07);
}
.theme-option.active {
    border-color: var(--color-primary, #00ffff);
    background: rgba(255,255,255,0.05);
}

/* 主题预览色块 */
.theme-option-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.theme-option-swatch::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.15);
}

/* 各主题色块 */
.swatch-cyber    { background: linear-gradient(135deg, #070a12 0%, #0d1220 60%, #3b82f6 100%); }
.swatch-aurora   { background: linear-gradient(135deg, #05050c 0%, #0c0c1e 60%, #6366f1 100%); }
.swatch-obsidian { background: linear-gradient(135deg, #060606 0%, #111111 60%, #e2e8f0 100%); }
.swatch-dusk     { background: linear-gradient(135deg, #090604 0%, #130e0a 60%, #f97316 100%); }
.swatch-night    { background: linear-gradient(135deg, #1c2128 0%, #22272e 60%, #58a6ff 100%); }
.swatch-light    { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #2563eb 100%); }
.swatch-sakura   { background: linear-gradient(135deg, #ffffff 0%, #fff1f2 60%, #e11d48 100%); }
.swatch-pearl    { background: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 60%, #7c3aed 100%); }

/* 兼容旧主题名（防止色块显示空白） */
.swatch-dark   { background: linear-gradient(135deg, #070a12 0%, #0d1220 60%, #3b82f6 100%); }
.swatch-ocean  { background: linear-gradient(135deg, #010c1e 0%, #021830 60%, #38bdf8 100%); }
.swatch-sunset { background: linear-gradient(135deg, #100518 0%, #1e0a10 60%, #fb923c 100%); }
.swatch-dreamy { background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%); }
.swatch-fresh  { background: linear-gradient(135deg, #0f2027 0%, #203a43 45%, #2c5364 100%); }
.swatch-nature { background: linear-gradient(135deg, #F5E6D3 0%, #D4A574 50%, #4A6741 100%); }
.swatch-dopamine { background: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 50%, #4ECDC4 100%); }
.swatch-heal   { background: linear-gradient(135deg, #F1FAEE 0%, #A8DADC 50%, #457B9D 100%); }
.swatch-mint   { background: linear-gradient(135deg, #a8edea 0%, #38ef7d 50%, #0d9488 100%); }
.swatch-neon   { background: linear-gradient(135deg, #0a0010 0%, #ff2d78 40%, #00f5ff 70%, #bf5fff 100%); }

.theme-option-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.2;
}

/* 选中勾 — 右上角角标 */
.theme-option-check {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 10px;
    color: var(--color-primary, #00ffff);
    opacity: 0;
    transition: opacity 0.15s;
    line-height: 1;
}
.theme-option.active .theme-option-check { opacity: 1; }

/* 浅色主题下面板适配 */
[data-theme="light"] .theme-picker-panel,
[data-theme="sakura"] .theme-picker-panel,
[data-theme="pearl"] .theme-picker-panel,
[data-theme="dreamy"] .theme-picker-panel,
[data-theme="nature"] .theme-picker-panel,
[data-theme="dopamine"] .theme-picker-panel,
[data-theme="heal"] .theme-picker-panel,
[data-theme="mint"] .theme-picker-panel {
    background: rgba(255,255,255,0.97);
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
[data-theme="light"] .theme-option-name,
[data-theme="sakura"] .theme-option-name,
[data-theme="pearl"] .theme-option-name,
[data-theme="dreamy"] .theme-option-name,
[data-theme="nature"] .theme-option-name,
[data-theme="dopamine"] .theme-option-name,
[data-theme="heal"] .theme-option-name,
[data-theme="mint"] .theme-option-name { color: #1a1a1a; }
[data-theme="light"] .theme-picker-group-label,
[data-theme="sakura"] .theme-picker-group-label,
[data-theme="dreamy"] .theme-picker-group-label,
[data-theme="nature"] .theme-picker-group-label,
[data-theme="dopamine"] .theme-picker-group-label,
[data-theme="heal"] .theme-picker-group-label,
[data-theme="mint"] .theme-picker-group-label { color: #64748b; }
[data-theme="light"] .theme-option:hover,
[data-theme="sakura"] .theme-option:hover,
[data-theme="dreamy"] .theme-option:hover,
[data-theme="nature"] .theme-option:hover,
[data-theme="dopamine"] .theme-option:hover,
[data-theme="heal"] .theme-option:hover,
[data-theme="mint"] .theme-option:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .theme-picker-divider,
[data-theme="sakura"] .theme-picker-divider,
[data-theme="dreamy"] .theme-picker-divider,
[data-theme="nature"] .theme-picker-divider,
[data-theme="dopamine"] .theme-picker-divider,
[data-theme="heal"] .theme-picker-divider,
[data-theme="mint"] .theme-picker-divider { background: rgba(0,0,0,0.08); }
