/* CSS 变量定义 */
:root {
    --bg-color: #fff;
    --text-color: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #eee;
    --border-light: #f0f0f0;
    --link-color: #0066cc;
    --code-bg: #f5f5f5;
    --blockquote-border: #ddd;
    --btn-bg: transparent;
    --btn-border: #ddd;
    --btn-hover: #f5f5f5;
    --font-size-base: 16px;
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --border-color: #333;
    --border-light: #2a2a2a;
    --link-color: #66b3ff;
    --code-bg: #2a2a2a;
    --blockquote-border: #444;
    --btn-bg: transparent;
    --btn-border: #444;
    --btn-hover: #2a2a2a;
}

/* 极简风格样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header {
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title:hover {
    color: var(--link-color);
}

/* 控制按钮组 */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ctrl-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.ctrl-btn:hover {
    background: var(--btn-hover);
    border-color: var(--link-color);
    color: var(--link-color);
}

.ctrl-btn:active {
    transform: scale(0.95);
}

/* 字体大小按钮 */
.font-dec {
    font-size: 1.1rem;
    font-weight: 400;
}

.font-inc {
    font-size: 1.2rem;
    font-weight: 400;
}

/* 主题切换按钮 - 黑白半圆 */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
    display: block;
    background: linear-gradient(to right, var(--text-color) 50%, var(--bg-color) 50%);
    border: 2px solid var(--text-color);
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-icon {
    background: linear-gradient(to right, var(--text-color) 50%, var(--bg-color) 50%);
    border-color: var(--text-color);
}

main {
    min-height: 60vh;
}

/* 文章列表 */
.post-list {
    margin-top: 20px;
}

.post-item {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-item h2 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item h2 a:hover {
    color: var(--link-color);
}

.post-item time {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 10px;
}

.post-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 文章详情页 */
.post {
    margin-top: 20px;
}

.post-header {
    margin-bottom: 30px;
}

.post-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.post-header time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.post-content {
    font-size: 1rem;
    line-height: 1.9;
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2em;
    margin-bottom: 0.8em;
    font-weight: 600;
    color: var(--text-color);
}

.post-content h2 {
    font-size: 1.4rem;
}

.post-content h3 {
    font-size: 1.2rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.post-content li {
    margin-bottom: 0.5em;
}

.post-content code {
    background-color: var(--code-bg);
    color: var(--text-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.post-content pre {
    background-color: var(--code-bg);
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.5em;
    transition: background-color 0.3s ease;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid var(--blockquote-border);
    padding-left: 20px;
    margin: 1.5em 0;
    color: var(--text-secondary);
    transition: border-color 0.3s ease;
}

.post-content a {
    color: var(--link-color);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2em auto;
    border-radius: 4px;
}

/* 页脚 */
footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    transition: border-color 0.3s ease;
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--link-color);
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 600px) {
    body {
        padding: 0 15px;
    }
    
    header {
        padding: 30px 0 15px;
        flex-wrap: wrap;
    }
    
    .site-title {
        font-size: 1.3rem;
    }
    
    .controls {
        gap: 6px;
    }
    
    .ctrl-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .theme-icon {
        width: 18px;
        height: 18px;
    }
    
    .post-header h1 {
        font-size: 1.5rem;
    }
    
    .post-item h2 {
        font-size: 1.2rem;
    }
}