/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* 导航栏 */
header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 主页 Hero 区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 文章网格 */
.featured-posts {
    padding: 4rem 0;
}

.featured-posts h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.post-card h4 a:hover {
    color: var(--primary-color);
}

.post-meta {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.post-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 目录页面 */
.catalog-section {
    padding: 4rem 0;
}

.catalog-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    text-align: center;
    color: var(--text-light);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.catalog-list {
    max-width: 800px;
    margin: 0 auto;
}

.catalog-item {
    background: var(--card-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.catalog-item h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

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

.catalog-item h3 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    line-height: 1.8;
}

/* 关于页面 */
.about-section {
    padding: 4rem 0;
}

.about-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.profile {
    text-align: center;
    margin-bottom: 3rem;
}

.avatar-placeholder {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.profile h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile .title {
    color: var(--text-light);
    font-size: 1.125rem;
}

.bio {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.bio h4 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.bio h4:first-child {
    margin-top: 0;
}

.bio p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

.skills-list,
.interests-list,
.contact-list {
    list-style: none;
    margin: 1rem 0;
}

.skills-list li,
.interests-list li,
.contact-list li {
    padding: 0.5rem 0;
    color: var(--text-light);
}

.contact-list a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-list a:hover {
    color: var(--primary-dark);
}

/* 博客文章页面 */
.post-content {
    padding: 4rem 0;
}

.post-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
}

.post-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post-body {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.post-body h3 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.post-body p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.post-body ul,
.post-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.post-body code {
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: "Courier New", monospace;
    font-size: 0.875rem;
}

.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

/* 页脚 */
footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1.125rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-body {
        padding: 1.5rem;
    }

    .container {
        padding: 1rem;
    }
}
