/* 大模型与机器学习博客 - 翠绿学术风格 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #059669;
    --primary-hover: #047857;
    --secondary-color: #10b981;
    --accent-color: #34d399;
    --data-color: #6ee7b7;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent-gradient: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    --data-gradient: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
    --card-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(5, 150, 105, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

/* 学术背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 90%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(52, 211, 153, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

/* 导航栏 - 学术简洁风格 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 14px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '⬡';
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    padding: 4px 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.2s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 英雄区域 - 学术简洁设计 */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, var(--background-color) 100%);
}

.hero::after {
    content: '∑ ∫ ∂ ∀ ∃';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 15px;
    opacity: 0.4;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero h1::before {
    content: '⬡ ';
    color: var(--primary-color);
}

.hero .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-tags {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    padding: 8px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 分类入口区域 */
.categories-section {
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
}

.categories-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-link {
    padding: 10px 20px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-link::before {
    content: '▸';
    color: var(--primary-color);
    font-size: 0.7rem;
}

.category-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(5, 150, 105, 0.05);
}

/* 文章区域 */
.articles-section {
    padding: 48px 0;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '⬡';
    color: var(--primary-color);
}

/* 文章网格 - 学术期刊风格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* 文章卡片 - 清晰学术风格 */
.article-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--accent-gradient);
    transition: height 0.2s ease;
}

.article-card:hover::before {
    height: 100%;
}

.article-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.card-image {
    width: 100%;
    height: 160px;
    background: var(--data-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    position: relative;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(5, 150, 105, 0.1));
}

.card-content {
    padding: 20px;
}

.card-category {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(5, 150, 105, 0.1);
    color: var(--primary-color);
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-meta .read-time::before {
    content: '◉';
    color: var(--data-color);
    margin-right: 4px;
}

/* 外链区域 */
.links-section {
    padding: 48px 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.links-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    text-align: center;
}

.links-title::before {
    content: '⬡ ';
    color: var(--primary-color);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.link-category {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 16px;
    transition: all 0.2s ease;
}

.link-category:hover {
    border-color: var(--primary-color);
}

.link-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.link-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.link-item {
    padding: 4px 10px;
    background: rgba(5, 150, 105, 0.05);
    border: 1px solid rgba(5, 150, 105, 0.1);
    border-radius: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.link-item:hover {
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 页脚 */
.footer {
    padding: 48px 0 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 48px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.footer-section h3::before {
    content: '▸ ';
    color: var(--primary-color);
}

.footer-section p,
.footer-section a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom::before {
    content: '⬡ ⬡ ⬡';
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    letter-spacing: 10px;
}

/* 文章详情页样式 */
.article-header {
    padding: 120px 0 48px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--background-color) 100%);
}

.article-header .category {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(5, 150, 105, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 700;
    max-width: 700px;
    margin: 0 auto 20px;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-header .meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-header .meta span::before {
    content: '◉ ';
    color: var(--data-color);
}

.article-content {
    max-width: 750px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-content h2::before {
    content: '▸';
    color: var(--primary-color);
    font-size: 0.8rem;
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.article-content li::marker {
    color: var(--primary-color);
}

.article-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding: 12px 20px;
    margin: 20px 0;
    background: rgba(5, 150, 105, 0.05);
    border-radius: 0 4px 4px 0;
    color: var(--text-secondary);
}

.article-content blockquote::before {
    content: '⬡';
    color: var(--primary-color);
    margin-right: 8px;
}

.article-content .tip-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    padding: 16px;
    margin: 20px 0;
}

.article-content .tip-box h4 {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.article-content .tip-box h4::before {
    content: '▸ ';
}

.article-content pre {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 16px;
    margin: 20px 0;
    overflow-x: auto;
}

.article-content pre code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.article-content code {
    background: rgba(5, 150, 105, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', monospace;
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* 分类页面样式 */
.category-header {
    padding: 120px 0 48px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--background-color) 100%);
}

.category-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.category-header h1::before {
    content: '⬡ ';
    color: var(--primary-color);
}

.category-header .description {
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.7;
}

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

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

    .nav-links {
        display: none;
    }

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

    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-header .meta {
        flex-direction: column;
        gap: 10px;
    }

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

    .categories-grid {
        flex-direction: column;
        align-items: center;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 选择文本样式 */
::selection {
    background: var(--primary-color);
    color: white;
}

/* 淡入动画 */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}