:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #ec4899;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-soft: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --radius: 16px;
    --max-width: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== 导航栏 ===== */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 18px 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all 0.35s ease;
}
.navbar.scrolled {
    padding: 12px 0;
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.nav-back {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 500; color: var(--text-soft);
    transition: color 0.25s;
}
.nav-back:hover { color: var(--primary); }
.nav-back svg { width: 16px; height: 16px; }

/* ===== 通用容器 ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease; border: none; font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,0.45); }
.btn-outline {
    background: transparent; color: var(--text);
    border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* ===== 面包屑 ===== */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 0; font-size: 14px; color: var(--text-soft);
    margin-top: 80px;
}
.breadcrumb a { color: var(--primary); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb span { color: var(--text-soft); }

/* ===== 页面 Hero ===== */
.page-hero {
    padding: 50px 0 40px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}
.page-hero h1 {
    font-size: 42px; font-weight: 800; letter-spacing: -1.5px;
    margin-bottom: 12px;
}
.page-hero .meta {
    display: flex; gap: 24px; flex-wrap: wrap;
    color: var(--text-soft); font-size: 14px;
}
.page-hero .meta span {
    display: flex; align-items: center; gap: 6px;
}

/* ===== 详情内容区 ===== */
.detail-content {
    padding: 50px 0 80px;
}
.detail-content h2 {
    font-size: 26px; font-weight: 700; margin: 40px 0 16px;
    padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.detail-content h2:first-child { margin-top: 0; }
.detail-content h3 {
    font-size: 20px; font-weight: 600; margin: 28px 0 12px;
    color: var(--primary-dark);
}
.detail-content p {
    color: var(--text-soft); margin-bottom: 16px; font-size: 16px;
}
.detail-content ul {
    margin: 12px 0 20px 24px;
    color: var(--text-soft);
}
.detail-content ul li { margin-bottom: 8px; }
.detail-content .highlight-box {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.06));
    border-left: 4px solid var(--primary);
    padding: 20px 24px; border-radius: 0 12px 12px 0;
    margin: 24px 0;
}
.detail-content .highlight-box p { margin-bottom: 0; }

/* 技术栈标签 */
.tech-stack { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 30px; }
.tech-tag {
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.08));
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 20px; font-size: 14px; font-weight: 500;
    color: var(--primary-dark);
}

/* 截图/图片占位 */
.screenshot-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px; margin: 24px 0;
}
.screenshot-placeholder {
    height: 200px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 42px; color: rgba(255,255,255,0.9);
}
.screenshot-placeholder:nth-child(1) { background: linear-gradient(135deg, #667eea, #764ba2); }
.screenshot-placeholder:nth-child(2) { background: linear-gradient(135deg, #f093fb, #f5576c); }
.screenshot-placeholder:nth-child(3) { background: linear-gradient(135deg, #4facfe, #00f2fe); }

/* 统计数字 */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 20px; margin: 30px 0;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-card .num {
    font-size: 32px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card .label { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

/* ===== 博客列表 ===== */
.blog-list { padding: 60px 0; margin-top: 80px; }
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.blog-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; cursor: pointer;
    transition: all 0.35s ease; box-shadow: var(--shadow-sm);
    display: block;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.blog-card .category {
    display: inline-block; padding: 4px 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
    border-radius: 20px; font-size: 12px; font-weight: 600;
    color: var(--primary); margin-bottom: 16px;
}
.blog-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.blog-card p { color: var(--text-soft); font-size: 15px; margin-bottom: 16px; }
.blog-card .post-meta {
    display: flex; gap: 16px; font-size: 13px; color: var(--text-soft);
}

/* ===== 博客详情 ===== */
.article-content {
    max-width: 780px; margin: 0 auto; padding: 40px 0 80px;
}
.article-content p {
    color: var(--text-soft); margin-bottom: 20px; font-size: 17px; line-height: 1.9;
}
.article-content h2 {
    font-size: 26px; font-weight: 700; margin: 44px 0 18px;
    color: var(--text);
}
.article-content h3 {
    font-size: 21px; font-weight: 600; margin: 32px 0 14px;
    color: var(--primary-dark);
}
.article-content ul {
    margin: 16px 0 24px 24px; color: var(--text-soft);
}
.article-content ul li { margin-bottom: 10px; line-height: 1.8; }
.article-content pre {
    background: #1e293b; color: #e2e8f0;
    padding: 20px 24px; border-radius: 12px; margin: 20px 0;
    overflow-x: auto; font-size: 14px; line-height: 1.6;
}
.article-content code { font-family: 'Fira Code', 'Cascadia Code', monospace; font-size: 13px; }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px; margin: 20px 0;
    background: rgba(99,102,241,0.04); border-radius: 0 12px 12px 0;
    color: var(--text-soft); font-style: italic;
}

/* ===== 页脚 ===== */
footer {
    background: #0f172a; color: #cbd5e1; padding: 40px 0 30px; text-align: center;
}
.footer-logo {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.footer-copy {
    font-size: 13px; color: #64748b;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 20px; margin-top: 20px;
}

/* 回到顶部 */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
    z-index: 999; border: none; font-size: 20px;
}
.back-to-top.show { opacity: 1; visibility: visible; }

/* ========== 页面过渡动画 ========== */

/* 页面入场：body 整体淡入上滑 */
body {
    animation: pageBodyEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageBodyEnter {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 页面退场：点击返回时触发 */
body.page-exiting {
    animation: pageBodyExit 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes pageBodyExit {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.97); }
}

/* 内容区逐项浮现 */
.content-enter {
    animation: contentSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.content-enter-d1 { animation-delay: 0.08s; }
.content-enter-d2 { animation-delay: 0.16s; }
.content-enter-d3 { animation-delay: 0.24s; }
.content-enter-d4 { animation-delay: 0.32s; }
.content-enter-d5 { animation-delay: 0.40s; }

@keyframes contentSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 统计卡片弹入 */
.stat-pop {
    animation: statPopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes statPopIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* 滚动触发的段落动画：由 Intersection Observer 控制 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式 */
@media (max-width: 900px) {
    .screenshot-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .blog-grid { grid-template-columns: 1fr; }
    .page-hero h1 { font-size: 32px; }
}
@media (max-width: 640px) {
    .screenshot-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .page-hero h1 { font-size: 26px; }
}
