/* Cookie主题和用户偏好设置样式 */

/* 主题样式 */
/* 浅色主题 */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 深色主题 */
.theme-dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #404040;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* 字体大小设置 */
.font-size-small {
    --font-size-base: 14px;
    --font-size-h1: 24px;
    --font-size-h2: 20px;
    --font-size-h3: 18px;
    --font-size-h4: 16px;
    --line-height: 1.4;
}

.font-size-medium {
    --font-size-base: 16px;
    --font-size-h1: 28px;
    --font-size-h2: 24px;
    --font-size-h3: 20px;
    --font-size-h4: 18px;
    --line-height: 1.5;
}

.font-size-large {
    --font-size-base: 18px;
    --font-size-h1: 32px;
    --font-size-h2: 28px;
    --font-size-h3: 24px;
    --font-size-h4: 20px;
    --line-height: 1.6;
}

/* 阅读模式设置 */
.reading-mode-normal {
    --reading-bg: var(--bg-primary);
    --reading-text: var(--text-primary);
    --reading-width: 100%;
    --reading-max-width: 1200px;
}

.reading-mode-focus {
    --reading-bg: var(--bg-primary);
    --reading-text: var(--text-primary);
    --reading-width: 100%;
    --reading-max-width: 800px;
    --reading-font-family: 'Georgia', 'Times New Roman', serif;
}

.reading-mode-night {
    --reading-bg: #0a0a0a;
    --reading-text: #e0e0e0;
    --reading-width: 100%;
    --reading-max-width: 1000px;
    --reading-font-family: 'Georgia', 'Times New Roman', serif;
}

/* 应用主题变量 */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 标题字体大小 */
h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

/* 阅读模式样式 */
.reading-mode-focus .post-content,
.reading-mode-night .post-content {
    font-family: var(--reading-font-family);
    max-width: var(--reading-max-width);
    margin: 0 auto;
    padding: 20px;
    background-color: var(--reading-bg);
    color: var(--reading-text);
}

/* 偏好设置页面样式 */
.preferences-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.preferences-card {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.preferences-header {
    text-align: center;
    margin-bottom: 30px;
}

.preferences-header h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.preferences-header p {
    color: var(--text-secondary);
}

.preference-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.preference-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preference-section h3 i {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    background-color: var(--bg-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #007bff;
    font-weight: bold;
}

/* 阅读历史页面样式 */
.history-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.history-header {
    text-align: center;
    margin-bottom: 30px;
}

.history-header h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.history-header p {
    color: var(--text-secondary);
}

.history-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.history-count {
    color: var(--text-secondary);
    font-size: 14px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.history-item:hover {
    box-shadow: var(--shadow-hover);
}

.history-number {
    width: 30px;
    height: 30px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-title {
    margin-bottom: 10px;
}

.history-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.history-title a:hover {
    color: #007bff;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.history-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-excerpt {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 14px;
}

.history-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.empty-history {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-history h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-history p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 主题切换器样式 */
.theme-switcher {
    margin-left: 15px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.1);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .preferences-container,
    .history-container {
        padding: 10px;
    }
    
    .preferences-card {
        padding: 20px;
    }
    
    .history-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .history-actions {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .history-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* 自动主题检测 */
@media (prefers-color-scheme: dark) {
    .theme-auto {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #404040;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-muted: #808080;
        --border-color: #404040;
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
    }
}

@media (prefers-color-scheme: light) {
    .theme-auto {
        --bg-primary: #ffffff;
        --bg-secondary: #f8f9fa;
        --bg-tertiary: #e9ecef;
        --text-primary: #212529;
        --text-secondary: #6c757d;
        --text-muted: #adb5bd;
        --border-color: #dee2e6;
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
}
