/* 深度学习博客 - 琥珀金橙研究风格 */

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

:root {
    --primary-color: #f59e0b;
    --primary-hover: #d97706;
    --secondary-color: #ea580c;
    --accent-color: #fbbf24;
    --warm-color: #fcd34d;
    --background-color: #1c1917;
    --surface-color: #292524;
    --surface-hover: #3f3a38;
    --text-primary: #fef3c7;
    --text-secondary: #d6d3d1;
    --text-muted: #a8a29e;
    --border-color: #44403c;
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #dc2626 100%);
    --warm-gradient: linear-gradient(90deg, #fbbf24, #f59e0b, #ea580c);
    --card-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(245, 158, 11, 0.2);
    --glow-effect: 0 0 15px rgba(245, 158, 11, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    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 15% 85%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(234, 88, 12, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.04) 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(28, 25, 23, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 14px 0;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--warm-gradient);
    opacity: 0.4;
}

.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: 6px;
}

.logo::before {
    content: '∇';
    font-size: 1.3rem;
}

.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.25s ease;
}

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

/* 英雄区域 - 研究探索风格 */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, var(--background-color) 0%, var(--surface-color) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 60%);
    animation: gradientPulse 8s ease-in-out infinite;
}

@keyframes gradientPulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateX(-50%) scale(1.2); }
}

.hero::after {
    content: '∇ ∂ ∈ ⊂ ∪ ∩';
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 12px;
    opacity: 0.35;
}

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

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

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

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

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

.tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--glow-effect);
}

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

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

.category-link {
    padding: 10px 18px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    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);
    box-shadow: var(--glow-effect);
}

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

.section-title {
    font-size: 1.5rem;
    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);
    font-size: 1rem;
}

/* 文章网格 - 研究风格 */
.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: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
}

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

.article-card:hover::before {
    opacity: 1;
}

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

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

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, rgba(28, 25, 23, 0.3));
}

.card-content {
    padding: 18px;
}

.card-category {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary-color);
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 10px;
}

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

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 14px;
    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.78rem;
    color: var(--text-muted);
}

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

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

.links-title {
    font-size: 1.2rem;
    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(240px, 1fr));
    gap: 14px;
}

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

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

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

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

.link-item {
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    transition: all 0.15s ease;
}

.link-item:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--warm-gradient);
    opacity: 0.3;
}

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

.footer-section h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 12px;
    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.82rem;
    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: 22px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
}

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

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

.article-header .category {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary-color);
    border-radius: 2px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 18px;
}

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

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

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

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

.article-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 36px 0 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.article-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 26px 0 10px;
    color: var(--text-primary);
}

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

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

.article-content li {
    margin-bottom: 6px;
    line-height: 1.65;
}

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

.article-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding: 10px 16px;
    margin: 18px 0;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 0 3px 3px 0;
    color: var(--text-secondary);
}

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

.article-content .tip-box {
    background: rgba(234, 88, 12, 0.1);
    border: 1px solid rgba(234, 88, 12, 0.2);
    border-radius: 3px;
    padding: 14px;
    margin: 18px 0;
}

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

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

.article-content pre {
    background: #0c0a09;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 14px;
    margin: 18px 0;
    overflow-x: auto;
}

.article-content pre code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.article-content code {
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 6px;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary-color);
    font-size: 0.82rem;
}

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

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

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

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

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

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

    .nav-links {
        display: none;
    }

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

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

    .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: var(--background-color);
}

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

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