/* --- 变量定义 --- */
:root {
    --primary: #1E2A78;
    --accent: #FF7A00;
    --bg-color: #F5F5F7;
    --text-main: #333333;
    --text-light: #666666;
    --white: #FFFFFF;
    --max-width: 1100px;
    --font-heading: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --transition: all 0.3s ease;
}

/* --- 基础重置 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- 布局容器 --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 导航栏 --- */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo img { height: 40px; }
.nav-links { display: flex; gap: 30px; }
.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    font-size: 16px;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.cta-btn {
    background: var(--accent);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 5px;
}
.cta-btn:hover { background: #e66e00; }
.mobile-toggle { display: none; font-size: 24px; cursor: pointer; }

/* --- 首页 Hero 区域 --- */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #1E2A78 0%, #2a3c9e 100%);
    color: var(--white);
}
.hero h1 { font-size: 3rem; margin-bottom: 20px; font-family: var(--font-heading); }
.hero p { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; }
.hero-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: bold;
}

/* --- 通用区块 --- */
section { padding: 60px 0; }
h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 40px;
    text-align: center;
    font-family: var(--font-heading);
}

/* --- 博客列表 (Grid) --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.post-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: var(--transition);
}
.post-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.post-content { padding: 25px; }
.post-meta { font-size: 0.9rem; color: var(--text-light); margin-bottom: 10px; }
.tag { color: var(--accent); font-weight: bold; margin-right: 10px; }
.post-title { font-size: 1.25rem; margin-bottom: 10px; color: var(--primary); }

/* --- 资源页列表 --- */
.resource-category { margin-bottom: 50px; }
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.resource-item {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}
.resource-item h3 { margin-bottom: 10px; font-size: 1.1rem; }
.resource-item p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 15px; }
.resource-link { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* --- 文章详情页 --- */
.article-container { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.article-header { text-align: center; margin-bottom: 40px; border-bottom: 1px solid #ddd; padding-bottom: 20px;}
.article-body { font-size: 1.1rem; line-height: 1.8; color: #222; }
.article-body h2 { text-align: left; margin-top: 40px; margin-bottom: 20px; font-size: 1.5rem; }
.article-body p { margin-bottom: 20px; }
.back-link { display: inline-block; margin-top: 40px; color: var(--primary); }

/* --- 页脚 --- */
footer {
    background: var(--primary);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
    margin-top: auto;
}
.footer-links { margin-bottom: 20px; }
.footer-links a { color: rgba(255,255,255,0.8); margin: 0 15px; }

/* --- 响应式 --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: block; }
    .hero h1 { font-size: 2rem; }
}
