/**
 * 主题样式
 */

/* 默认浅色主题 */
body.theme-light {
    --bg-primary: linear-gradient(135deg, #6495ED 0%, #E6E6FA 100%);
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    --hover-bg: #f8f9fa;
}

/* 暗黑主题 */
body.theme-dark {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-card: #2d2d44;
    --bg-sidebar: #2d2d44;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --text-white: #ffffff;
    --border-color: #404040;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    --hover-bg: #3a3a52;
}

body.theme-dark .header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-white);
}

body.theme-dark .sidebar-card,
body.theme-dark .date-section,
body.theme-dark .search-section,
body.theme-dark .empty-state {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.theme-dark .diary-item:hover {
    background: var(--hover-bg);
}

body.theme-dark .diary-item-title {
    color: var(--text-primary);
}

body.theme-dark .diary-item-preview {
    color: var(--text-secondary);
}

body.theme-dark .diary-item-meta {
    color: var(--text-muted);
}

body.theme-dark .sidebar-item {
    color: var(--text-primary);
}

body.theme-dark .sidebar-item:hover {
    background: var(--hover-bg);
}

body.theme-dark .popular-item {
    background: var(--hover-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.theme-dark .popular-item:hover {
    background: #4a4a62;
}

body.theme-dark .pagination a,
body.theme-dark .pagination span {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.theme-dark .pagination a:hover {
    background: #667eea;
    color: white;
}

body.theme-dark .pagination .current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.theme-dark input[type="text"],
body.theme-dark input[type="search"] {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.theme-dark input[type="text"]:focus,
body.theme-dark input[type="search"]:focus {
    border-color: #667eea;
    background: var(--bg-card);
}

/* 图片主题 */
body.theme-image {
    --bg-primary: url('https://hao.alwaysdata.net/');
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-sidebar: rgba(255, 255, 255, 0.75);
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(248, 249, 250, 0.6);
    background-image: url('https://hao.alwaysdata.net/');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.theme-image::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: -1;
}

body.theme-image .header {
    background: rgba(102, 126, 234, 0.75);
    backdrop-filter: blur(1px);
    color: var(--text-white);
}

body.theme-image .sidebar-card,
body.theme-image .date-section,
body.theme-image .search-section,
body.theme-image .empty-state {
    background: var(--bg-card);
    backdrop-filter: blur(1px);
    color: var(--text-primary);
}

body.theme-image .diary-item:hover {
    background: var(--hover-bg);
}

body.theme-image .date-header {
    background: rgba(102, 126, 234, 0.75);
    backdrop-filter: blur(1px);
}

/* 主题切换按钮样式 */
.theme-switcher-card {
    margin-top: 0;
}

.theme-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.theme-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
    background: #f0f0f0;
    color: #666;
    flex: 1;
    max-width: 60px;
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.theme-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

body.theme-dark .theme-btn {
    background: #3a3a52;
    color: #b0b0b0;
}

body.theme-dark .theme-btn:hover {
    border-color: #667eea;
}

body.theme-dark .theme-btn.active {
    background: #667eea;
    color: white;
}

/* 移除::before伪元素，使用HTML中的emoji */

/* 响应式设计 */
@media (max-width: 768px) {
    .theme-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

