/* ========== 基础变量 ========== */
:root {
    --primary: #4f6ef7;
    --primary-dark: #3d56d4;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #27354f;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: #334155;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* ========== 容器 ========== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ========== 头部 ========== */
.site-header {
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.site-title a:hover {
    opacity: 0.85;
}

.site-desc {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ========== 博客列表 ========== */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 60px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: var(--transition);
    cursor: pointer;
}

.blog-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.blog-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.5;
}

.blog-title a {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-title a:hover {
    opacity: 0.85;
}

.blog-summary {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-date {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.blog-tag {
    background: rgba(79, 110, 247, 0.15);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ========== 博客详情页 ========== */
.blog-detail {
    margin-bottom: 60px;
}

.blog-detail-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.blog-detail-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-detail-content {
    font-size: 1.05rem;
    line-height: 2;
}

.blog-detail-content .lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding: 20px 24px;
    background: rgba(79, 110, 247, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    line-height: 1.9;
}

.blog-detail-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 20px;
    color: #e2e8f0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.blog-detail-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 28px 0 14px;
    color: #cbd5e1;
}

.blog-detail-content p {
    margin-bottom: 16px;
    color: var(--text);
}

.blog-detail-content ul,
.blog-detail-content ol {
    margin: 16px 0 16px 20px;
    padding-left: 16px;
}

.blog-detail-content li {
    margin-bottom: 10px;
    color: var(--text);
}

.blog-detail-content li strong {
    color: #e2e8f0;
}

.blog-detail-content pre {
    background: #0b1120;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: "SF Mono", "Fira Code", Consolas, Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #94a3b8;
}

.blog-detail-content code {
    background: rgba(79, 110, 247, 0.1);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SF Mono", "Fira Code", Consolas, Monaco, monospace;
}

.blog-detail-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* ========== 导航按钮 ========== */
.blog-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 110, 247, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--primary);
}

/* ========== 页脚 ========== */
.site-footer {
    margin-top: auto;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .site-header {
        padding: 40px 0 30px;
    }

    .site-title {
        font-size: 1.7rem;
    }

    .blog-card {
        padding: 24px;
    }

    .blog-title {
        font-size: 1.2rem;
    }

    .blog-detail-title {
        font-size: 1.5rem;
    }

    .blog-detail-content {
        font-size: 0.95rem;
    }

    .blog-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}
