/*
Theme Name: 安好时光
Theme URI: https://yourdomain.com
Author: Anhao
Author URI: https://yourdomain.com
Description: 一个清新、宁静的个人博客主题，适合技术笔记与生活随笔。
Version: 1.0
License: GPL v2 or later
Text Domain: anhao-times
*/

/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif;
    background: #faf9f8;
    color: #1e1e2a;
    line-height: 1.5;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 头部样式 */
.site-header {
    background: #ffffffcc;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 16px 0;
    gap: 16px;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    background: linear-gradient(135deg, #2c3e66, #4a6f9c);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: #2c3e50;
    transition: color 0.2s;
    font-size: 1rem;
}

.nav-links a:hover,
.nav-links .current-menu-item a,
.nav-links .current_page_item a {
    color: #4a6f9c;
    border-bottom: 2px solid #4a6f9c;
    padding-bottom: 4px;
}

/* 搜索表单 */
.search-wrap form {
    display: inline-block;
}
.search-wrap input {
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.9rem;
    width: 200px;
    transition: 0.2s;
}
.search-wrap input:focus {
    outline: none;
    border-color: #4a6f9c;
    width: 240px;
}

/* Hero 区域（仅首页） */
.hero {
    background: linear-gradient(145deg, #eef2f7 0%, #ffffff 100%);
    padding: 56px 0 48px;
    border-radius: 0 0 48px 48px;
    margin-bottom: 48px;
}
.hero-content {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}
.avatar {
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, #6c8db0, #2e4a6b);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.05);
}
.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1f2f3e;
}
.hero .tagline {
    font-size: 1.2rem;
    color: #4b5563;
    max-width: 560px;
    margin: 0 auto;
}

/* 博客文章列表 */
.blog-section {
    padding: 16px 0 64px;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 32px;
    border-left: 5px solid #4a6f9c;
    padding-left: 20px;
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}
.post-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.1);
    border-color: #dce5ef;
}
.card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #cbd5e1;
}
.card-content {
    padding: 24px 22px 28px;
    flex: 1;
}
.post-category {
    display: inline-block;
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #2c5282;
    margin-bottom: 12px;
}
.post-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}
.post-title a {
    text-decoration: none;
    color: #1e293b;
    transition: color 0.2s;
}
.post-title a:hover {
    color: #4a6f9c;
}
.post-excerpt {
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid #edf2f7;
    padding-top: 18px;
    margin-top: auto;
}
.read-more {
    font-weight: 500;
    color: #4a6f9c;
    text-decoration: none;
    font-size: 0.85rem;
}
.read-more:hover {
    text-decoration: underline;
}

/* 两栏布局（首页侧边栏） */
.two-columns {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    margin-top: 40px;
}
.main-content {
    flex: 2;
    min-width: 260px;
}
.sidebar {
    flex: 1;
    min-width: 240px;
}
.sidebar-card {
    background: white;
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid #eef2f8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.sidebar-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 18px;
    position: relative;
    display: inline-block;
}
.sidebar-title:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 3px;
    background: #4a6f9c;
    border-radius: 3px;
}
.category-list, .recent-list {
    list-style: none;
    margin-top: 12px;
}
.category-list li, .recent-list li {
    margin-bottom: 14px;
}
.category-list a, .recent-list a {
    text-decoration: none;
    color: #2d3e50;
    font-weight: 500;
    transition: 0.2s;
}
.category-list a:hover, .recent-list a:hover {
    color: #4a6f9c;
    padding-left: 4px;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.tag {
    background: #f1f5f9;
    padding: 5px 14px;
    border-radius: 40px;
    font-size: 0.75rem;
    color: #2c3e66;
    text-decoration: none;
    transition: 0.1s;
}
.tag:hover {
    background: #e2e8f0;
    transform: scale(0.97);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 48px 0 20px;
}
.pagination a, .pagination span {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 40px;
    text-decoration: none;
    color: #2c3e66;
}
.pagination .current {
    background: #4a6f9c;
    color: white;
    border-color: #4a6f9c;
}

/* 单篇文章/页面样式 */
.single-post .post-content, .page-content {
    background: white;
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid #edf2f7;
}
.single-post .post-content h1, .page-content h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}
.single-post .post-content img, .page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

/* 技术页面筛选栏 */
.tech-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.filter-btn {
    background: transparent;
    border: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
    color: #2d3e50;
    transition: all 0.2s;
}
.filter-btn:hover {
    background: #eef2ff;
    color: #2c5282;
}
.filter-btn.active {
    background: #4a6f9c;
    color: white;
    box-shadow: 0 2px 8px rgba(74,111,156,0.2);
}

/* 页脚 */
.site-footer {
    background: #1e2a36;
    color: #cfdfed;
    padding: 40px 0 30px;
    margin-top: 64px;
    font-size: 0.85rem;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}
.footer-links a {
    color: #bfd7f0;
    text-decoration: none;
    margin-right: 24px;
}
.footer-links a:hover {
    text-decoration: underline;
    color: white;
}
.beian a {
    color: #bfd7f0;
    text-decoration: none;
    margin: 0 6px;
}

/* 响应式 */
@media (max-width: 780px) {
    .header-inner {
        flex-direction: column;
        text-align: center;
    }
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 18px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .two-columns {
        flex-direction: column;
    }
    .single-post .post-content, .page-content {
        padding: 24px;
    }
}