/* ========================================
   V3 模板 - 现代简约风格
   响应式设计，全设备适配
======================================== */

/* === 1. 基础样式 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #1d4ed8;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === 2. 容器 === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === 3. 头部导航 === */
.header {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* === 4. 主内容区 === */
.main-content {
    padding: 1.5rem 0;
    min-height: calc(100vh - 200px);
}

/* === 5. 文章卡片 === */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.article-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: var(--bg-light);
}

.article-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-body {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-color);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-summary {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* === 6. 文章详情 === */
.article-detail {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 1rem 0;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    margin: 2rem 0;
    border-radius: var(--radius);
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.article-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.article-content pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* === 7. 侧边栏 === */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-color);
    display: block;
}

.widget a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

/* === 8. 标签云 === */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud a {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: var(--transition);
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: white;
}

/* === 9. 分页 === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    color: var(--text-color);
    min-width: 40px;
    text-align: center;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* === 10. 面包屑 === */
.breadcrumb {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* === 11. 页脚 === */
.footer {
    background: var(--text-color);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* === 12. 布局 === */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin: 1rem 0;
}

/* === 13. 响应式设计 === */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr 280px;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 0;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .article-detail {
        padding: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 1.5rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container,
    .container-wide {
        padding: 0 15px;
    }
    
    .article-detail {
        padding: 1rem;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
}

/* === 14. 工具类 === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #1d4ed8;
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #475569;
}