/* 个人博客样式 - 升级版 */
/* 视觉升级：莫兰迪色系 + 现代字体 */
/* 布局优化：磨砂玻璃Header + 卡片间距调整 */
/* 新增元素：返回顶部按钮 + 阅读进度条 */

:root {
    /* 莫兰迪色系配色方案 */
    --bg-color: #f5f5f0;
    --text-color: #4a4a4a;
    --link-color: #7c9a82;
    --link-hover: #5d7a63;
    --border-color: #e8e8e3;
    --header-bg: rgba(255, 255, 255, 0.85);
    --accent-color: #7c9a82;
    --accent-light: #e8ede6;
    --tag-bg: #f0ede8;
    --code-bg: #f8f7f4;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #7c9a82 0%, #a3b8a5 100%);
    --gradient-hover: linear-gradient(135deg, #5d7a63 0%, #7c9a82 100%);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background: var(--bg-color);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(124, 154, 130, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(163, 184, 165, 0.08) 0%, transparent 50%);
    min-height: 100vh;
}

.wrap {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header - 磨砂玻璃效果 ===== */
.site-head {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 18px 0;
    margin-bottom: 48px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.site-head .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
}

.brand:hover {
    transform: translateX(4px);
}

.brand span {
    color: var(--accent-color);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 28px;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav a:hover,
.nav a.active {
    color: var(--accent-color);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

/* ===== 主内容区域 ===== */
.main {
    padding-bottom: 60px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 36px;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* ===== 文章列表卡片 ===== */
.posts {
    padding: 20px 0;
}

.post-list {
    list-style: none;
}

.post-list > li {
    margin-bottom: 28px;
}

.post-item {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(124, 154, 130, 0.3);
}

.post-item h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 12px 0 14px;
    letter-spacing: -0.3px;
}

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

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

.post-meta {
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.excerpt {
    color: #666;
    font-size: 15px;
    line-height: 1.7;
    margin-top: 12px;
}

/* ===== 文章详情页 ===== */
.post {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 48px 56px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 40px;
}

.post-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.post-header .post-meta {
    font-size: 14px;
    color: #888;
}

.content {
    font-size: 16px;
    line-height: 1.85;
    color: #555;
}

.content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin: 40px 0 20px;
    letter-spacing: -0.3px;
}

.content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 32px 0 16px;
}

.content p {
    margin-bottom: 20px;
}

.content ul, .content ol {
    margin: 0 0 20px 24px;
}

.content li {
    margin-bottom: 10px;
}

.content code {
    background: var(--code-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    font-size: 14px;
    color: #7c9a82;
}

.content pre {
    background: var(--code-bg);
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--border-color);
}

.content pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
}

.content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.content a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

.content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 20px;
    margin: 24px 0;
    color: #666;
    font-style: italic;
    background: var(--accent-light);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== 关于页面 ===== */
.about .content {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 40px 48px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.about h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 36px 0 18px;
    letter-spacing: -0.3px;
}

.about h2:first-child {
    margin-top: 0;
}

.about ul {
    margin: 0 0 20px 24px;
}

.about li {
    margin-bottom: 10px;
    color: #555;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.skill-tag {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    background: var(--gradient-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* 时间线样式 */
.timeline {
    position: relative;
    padding-left: 30px;
    margin: 24px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-color), #a3b8a5);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    margin-bottom: 28px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--accent-color);
    transform: scale(1.2);
}

.timeline-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.timeline-item p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ===== Footer ===== */
.footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-top: auto;
}

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

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

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--gradient-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

/* ===== 阅读进度条 ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 101;
    transition: width 0.1s ease;
    border-radius: 0 3px 3px 0;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .site-head .wrap {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav {
        gap: 24px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .post {
        padding: 28px 24px;
    }
    
    .post-header h1 {
        font-size: 24px;
    }
    
    .post-item {
        padding: 22px 24px;
    }
    
    .post-item h2 {
        font-size: 18px;
    }
    
    .about .content {
        padding: 28px 24px;
    }
    
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .nav {
        gap: 18px;
        font-size: 14px;
    }
    
    .brand {
        font-size: 20px;
    }
    
    .wrap {
        padding: 0 16px;
    }
}

/* ===== 暗色模式（可选） ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #333;
        --header-bg: rgba(26, 26, 26, 0.9);
        --code-bg: #252525;
        --tag-bg: #2a2a2a;
    }
    
    .post-item,
    .post,
    .about .content,
    .footer {
        background: #222;
        border-color: #333;
    }
    
    .content {
        color: #bbb;
    }
    
    .excerpt {
        color: #999;
    }
}