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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容 */
main {
    background: white;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 分类列表 */
.categories {
    margin-bottom: 40px;
}

.categories h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #667eea;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: transform 0.2s;
}

.category-item:hover {
    transform: translateY(-2px);
    background: #e9ecef;
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-count {
    color: #667eea;
    font-weight: 600;
}

/* 文章列表 */
.articles h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #667eea;
}

.article-list {
    list-style: none;
}

.article-list li {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    gap: 15px;
}

.article-list li:last-child {
    border-bottom: none;
}

.article-link {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}

.article-link:hover {
    color: #667eea;
}

.article-title {
    font-weight: 500;
}

.article-date {
    color: #999;
    font-size: 0.9rem;
}

.article-category {
    padding: 4px 12px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* 文章页面样式 */
.article-page {
    max-width: 800px;
    margin: 0 auto;
}

.article-page h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #667eea;
}

.article-page h2 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
}

.article-page h3 {
    font-size: 1.2rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #555;
}

.article-page p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.article-page ul, .article-page ol {
    margin: 15px 0;
    padding-left: 30px;
}

.article-page li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.article-page code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.article-page pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-page pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.article-page img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
}

.article-page .meta {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.article-page .back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: #667eea;
    text-decoration: none;
}

.article-page .back-link:hover {
    text-decoration: underline;
}

/* 页脚 */
footer {
    background: #2d2d2d;
    color: #999;
    padding: 30px 0;
    text-align: center;
}

footer p {
    margin: 5px 0;
}

footer .icp {
    font-size: 0.9rem;
}

footer a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #667eea;
}

/* 响应式 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .category-list {
        grid-template-columns: 1fr;
    }

    .article-list li {
        flex-wrap: wrap;
    }

    .article-link {
        width: 100%;
        margin-bottom: 10px;
    }

    .article-category {
        width: auto;
    }
}
