/* 渐进式增强 - 矿物色调主题 */
:root {
    --primary: #1a3e72; /* 青金石蓝 */
    --secondary: #5d8dc9; 
    --accent: #6c5ce7;
    --text: #2d3436;
    --light: #f5f6fa;
    --dark: #1e272e;
    --success: #00b894;
    --warning: #fdcb6e;
    --error: #d63031;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 基础样式 - 保证最低功能 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--light);
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

a {
    color: var(--primary);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    padding: 0 15px;
}

/* 增强样式 - 支持现代浏览器 */
@supports (display: grid) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* 头部样式 */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: "🖌️";
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
}

nav a {
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

nav a:hover {
    background-color: var(--primary);
    color: white;
}

/* 主要内容 */
.main {
    padding: 2rem 0;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 3px;
    background: linear-gradient(to right, var(--primary), transparent);
}

/* 渐进式卡片布局 */
.article-grid {
    display: grid;
    gap: 1.5rem;
}

/* 基础回退布局 */
.article-grid > * {
    margin-bottom: 1.5rem;
}

@supports (display: grid) {
    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .article-grid > * {
        margin-bottom: 0;
    }
}

.article-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #666;
    margin-top: 1rem;
}

/* 分类标签 */
.category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary);
    color: white;
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

/* 文章详情 */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.article-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.article-image {
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.article-content {
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.5rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background-color: white;
    border: 1px solid #ddd;
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 友情链接 */
.friend-links {
    background-color: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.friend-links h3 {
    margin-bottom: 1rem;
}

.friend-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.friend-links-container a {
    padding: 0.5rem 1rem;
    background-color: #f0f4f8;
    border-radius: 1rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.friend-links-container a:hover {
    background-color: var(--primary);
    color: white;
}

/* 页脚 */
footer {
    background-color: var(--dark);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
}

.copyright {
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
}

/* 渐进式交互效果 */
@media (prefers-reduced-motion: no-preference) {
    .article-card {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInUp 0.6s forwards;
    }
    
    @keyframes fadeInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .article-card:nth-child(1) { animation-delay: 0.1s; }
    .article-card:nth-child(2) { animation-delay: 0.2s; }
    .article-card:nth-child(3) { animation-delay: 0.3s; }
    .article-card:nth-child(4) { animation-delay: 0.4s; }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--dark);
        color: #eee;
    }
    
    header, .article-card, .friend-links {
        background-color: #2d3436;
    }
    
    a {
        color: var(--secondary);
    }
    
    .section-title, .logo {
        color: var(--secondary);
    }
    
    nav a:hover {
        background-color: var(--secondary);
    }
    
    .category-tag {
        background-color: var(--secondary);
    }
    
    .pagination a:hover, .friend-links-container a:hover {
        background-color: var(--secondary);
    }
}