/*
Theme Name: MickeyHome
Theme URI: https://www.mickeyhome.top/
Description: 复刻 mickeyhome.top 官方站点的 Mik Press 主题，黑白极简配色、深浅双主题、2026 现代视觉（玻璃拟态导航、代码视窗英雄区、滚动动效）。
Author: Mickey
Author URI: https://www.mickeyhome.top/
Version: 1.0.0
License: GNU General Public License v2 or later
*/

/* ============================================================
   1. 设计变量（与 mickeyhome.top 设计规范一致）
   ============================================================ */
:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-hover: #fafafa;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --text: #000000;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --accent: #000000;
    --accent-hover: #333333;
    --accent-contrast: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.025);
    --shadow-xl: 0 24px 48px -12px rgba(0,0,0,0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Consolas, 'Courier New', monospace;
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-hover: #1a1a1a;
    --surface-glass: rgba(20, 20, 20, 0.72);
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #555555;
    --border: #2a2a2a;
    --border-light: #1f1f1f;
    --accent: #ffffff;
    --accent-hover: #e0e0e0;
    --accent-contrast: #000000;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
    --shadow-xl: 0 24px 48px -12px rgba(0,0,0,0.5);
}

/* ============================================================
   2. 基础
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-contrast); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   3. 头部导航
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }

.brand-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 17px;
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.brand:hover .brand-icon { transform: rotate(-8deg) scale(1.05); }

.brand-text { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.brand-text small { font-weight: 500; color: var(--text-tertiary); font-size: 13px; margin-left: 6px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.main-nav li { margin: 0; }
.main-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px; font-weight: 500;
    transition: var(--transition);
    position: relative;
    display: block;
}
.main-nav a:hover { color: var(--text); background: var(--surface-hover); }
.main-nav li.current-menu-item > a,
.main-nav a.active { color: var(--text); font-weight: 600; }
.main-nav li.current-menu-item > a::after,
.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 2px; left: 16px; right: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.header-tools { display: flex; align-items: center; gap: 8px; }

.tool-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.tool-btn:hover { background: var(--surface-hover); color: var(--text); }
.tool-btn svg { width: 18px; height: 18px; }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.mobile-menu-btn {
    display: none;
    width: 36px; height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none; border: none; cursor: pointer; padding: 6px;
}
.mobile-menu-btn span {
    display: block; width: 20px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: var(--transition);
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 下滑搜索栏 */
.search-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    border-bottom: 1px solid transparent;
}
.search-bar.open { max-height: 90px; padding: 14px 24px; border-bottom-color: var(--border); }
.search-bar form { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
.search-bar input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar button {
    padding: 11px 22px;
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.search-bar button:hover { opacity: 0.85; }

/* ============================================================
   4. 英雄区（代码视窗）
   ============================================================ */
.hero {
    position: relative;
    padding: 78px 24px 72px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
    pointer-events: none;
}

.hero-glow {
    position: absolute; top: -220px; left: 50%;
    width: 720px; height: 480px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.10), transparent 65%);
    filter: blur(10px);
    pointer-events: none;
}
[data-theme="dark"] .hero-glow { background: radial-gradient(ellipse at center, rgba(255,255,255,0.10), transparent 65%); }

.hero-inner { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-badge .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: clamp(34px, 6vw, 60px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.12;
    margin-bottom: 20px;
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.hero-title .grad {
    background: linear-gradient(120deg, var(--text) 30%, var(--text-tertiary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 40px;
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 72px;
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 30px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.24); opacity: 0.92; }
.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text); transform: translateY(-2px); }

/* 代码视窗组 */
.code-stage {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
    padding: 72px 0 96px;
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.code-window {
    background: #16161a;
    border: 1px solid #26262c;
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}
.code-window:hover { transform: translateY(-6px); box-shadow: 0 32px 64px -16px rgba(0,0,0,0.35); }

.code-window-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #1d1d22;
    border-bottom: 1px solid #26262c;
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-filename {
    margin-left: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: #8b8b93;
}

.code-window pre {
    margin: 0;
    background: #16161a;
    padding: 20px 22px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.75;
    color: #d6d6de;
    overflow: hidden;
    tab-size: 4;
}
.code-window pre { scrollbar-color: #33333a #16161a; scrollbar-width: thin; }
.code-window pre::-webkit-scrollbar { height: 6px; background: #16161a; }
.code-window pre::-webkit-scrollbar-track { background: #16161a; }
.code-window pre::-webkit-scrollbar-thumb { background: #33333a; border-radius: 3px; }

/* 语法高亮（米色系） */
.tok-c { color: #63636e; font-style: italic; }
.tok-k { color: #c792ea; }
.tok-f { color: #82aaff; }
.tok-s { color: #c3e88d; }
.tok-v { color: #f78c6c; }
.tok-n { color: #ffcb6b; }
.tok-p { color: #89ddff; }
.tok-t { color: #7fdbca; }
.tok-m { color: #ff9cac; }

.code-row { display: block; white-space: pre; }

.code-main {
    position: relative;
    z-index: 2;
    width: min(620px, 92%);
    margin: 0 auto;
}
.code-main:hover { z-index: 6; }
.code-float {
    position: absolute;
    z-index: 3;
}
.code-float .code-window { box-shadow: 0 18px 40px -12px rgba(0,0,0,0.4); }
.code-float .code-window pre { font-size: 11.5px; padding: 14px 16px; }
.code-float-l { width: min(300px, 27vw); left: -20px; top: 10px; transform: rotate(-2.5deg); }
.code-float-r { width: min(430px, 38vw); right: -24px; bottom: 10px; transform: rotate(2deg); }
.code-float-l:hover, .code-float-r:hover { z-index: 4; }
.code-main:hover { z-index: 6; }
.code-float-l:hover .code-window, .code-float-r:hover .code-window { transform: translateY(-4px); }

/* ============================================================
   5. 数据统计
   ============================================================ */
.stats-section { padding: 88px 24px 8px; }
.stats-grid-hero {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 960px;
    margin: 0 auto;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--text-tertiary); }
.stat-card .stat-num {
    display: block;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
    margin-bottom: 10px;
    background: linear-gradient(160deg, var(--text), var(--text-tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ============================================================
   6. 核心特性
   ============================================================ */
.features-section { padding: 110px 24px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}
.section-title {
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.2;
    margin-bottom: 16px;
}
.section-desc { font-size: 16px; color: var(--text-secondary); }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(0,0,0,0.045), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
[data-theme="dark"] .feature-card::after {
    background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,0.06), transparent 45%);
}
.feature-card:hover::after { opacity: 1; }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--text-tertiary); }

.feature-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
    transition: var(--transition);
}
.feature-card:hover .feature-icon { background: var(--accent); border-color: var(--accent); }
.feature-icon svg { width: 24px; height: 24px; color: var(--text); transition: var(--transition); }
.feature-card:hover .feature-icon svg { color: var(--accent-contrast); }

.feature-card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.75; }

/* ============================================================
   7. 博客卡片（来自博客）
   ============================================================ */
.blog-section { padding: 40px 24px 110px; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-xl); border-color: var(--text-tertiary); }

.post-card-cover {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.post-card-cover-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: rgba(255,255,255,0.9);
    font-size: 40px;
    font-weight: 800;
}

.post-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 12px;
}
.cat-badge {
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.4px;
}
.post-date { color: var(--text-tertiary); }

.post-card-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: var(--text);
}
.post-card-title a { color: inherit; text-decoration: none; }
.post-card:hover .post-card-title a { opacity: 0.75; }
.cat-badge a { color: inherit; text-decoration: none; }
a.read-more { color: var(--text); text-decoration: none; }

.post-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-tertiary);
}
.read-more {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}
.post-card:hover .read-more { gap: 8px; }

/* ============================================================
   8. CTA
   ============================================================ */
.cta-section { padding: 0 24px 120px; }
.cta-box {
    max-width: 960px;
    margin: 0 auto;
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: 32px;
    padding: 88px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-box::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(128,128,128,0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128,128,128,0.16) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 20%, transparent 75%);
}
.cta-label { font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; opacity: 0.55; margin-bottom: 16px; position: relative; }
.cta-title { font-size: clamp(28px, 5vw, 46px); font-weight: 800; letter-spacing: -1.2px; margin-bottom: 16px; position: relative; }
.cta-desc { font-size: 16px; opacity: 0.72; max-width: 480px; margin: 0 auto 36px; position: relative; }
.cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; position: relative; }
.cta-box .btn-primary { background: var(--accent-contrast); color: var(--accent); }
.cta-box .btn-ghost { background: transparent; color: var(--accent-contrast); border-color: rgba(128,128,128,0.4); }
.cta-box .btn-ghost:hover { border-color: var(--accent-contrast); }

/* ============================================================
   9. 页脚
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); padding: 48px 24px 88px; background: var(--surface); }
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-tertiary);
}
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; text-decoration: none; }
.footer-brand .brand-icon { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; list-style: none; }
.footer-links a { color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--text); }

/* ============================================================
   10. 内页通用（文章 / 归档 / 搜索 / 404）
   ============================================================ */
.page-hero {
    padding: 72px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 25%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 25%, transparent 75%);
    pointer-events: none;
}
.page-hero .crumbs { font-size: 13px; color: var(--text-tertiary); margin-bottom: 16px; position: relative; }
.page-hero .crumbs a { text-decoration: none; color: var(--text-secondary); }
.page-hero .crumbs a:hover { color: var(--text); }
.page-hero .crumbs .cat-badge { background: none; color: inherit; padding: 0; font-weight: inherit; font-size: inherit; letter-spacing: 0; }
.page-hero .crumbs .cat-badge a { color: var(--text-secondary); }
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -1px; position: relative; }
.page-hero .sub { color: var(--text-secondary); margin-top: 12px; font-size: 15px; position: relative; }

.main-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}
.main-layout.no-sidebar { grid-template-columns: 1fr; max-width: 860px; }
.content-area { min-width: 0; }

/* 文章单页 */
.single-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.single-cover { width: 100%; max-height: 420px; object-fit: cover; }
.single-body { padding: 44px 48px 48px; }
.single-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 18px;
}
.single-title {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.25;
    margin-bottom: 28px;
}
.single-content { font-size: 16px; line-height: 1.9; color: var(--text); }
.single-content h2, .single-content h3, .single-content h4 { letter-spacing: -0.4px; margin: 1.6em 0 0.6em; line-height: 1.35; }
.single-content p { margin: 1em 0; }
.single-content img { border-radius: var(--radius); margin: 1.2em 0; }
.single-content a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-tertiary); }
.single-content a:hover { text-decoration-color: var(--text); }
.single-content blockquote {
    margin: 1.4em 0;
    padding: 16px 22px;
    border-left: 3px solid var(--accent);
    background: var(--surface-hover);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.single-content pre {
    background: #16161a;
    color: #d6d6de;
    padding: 20px 22px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.7;
}
.single-content code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-hover); padding: 2px 6px; border-radius: 5px; }
.single-content pre code { background: none; padding: 0; }
.single-content ul, .single-content ol { margin: 1em 0; padding-left: 1.6em; }
.single-content li { margin: 0.35em 0; }
.single-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; }
.single-content th, .single-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.single-content th { background: var(--surface-hover); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}
.back-link:hover { color: var(--text); }

/* 侧边栏 */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }
.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}
.widget:hover { box-shadow: var(--shadow-md); }
.widget-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.widget ul { list-style: none; }
.widget ul li { margin: 0; }
.widget ul li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}
.widget ul li a:hover { background: var(--surface-hover); color: var(--text); }
.widget ul li a .count { font-size: 12px; color: var(--text-tertiary); }
.widget .side-post { display: flex; gap: 12px; padding: 10px; border-radius: var(--radius-sm); text-decoration: none; transition: var(--transition); }
.widget .side-post:hover { background: var(--surface-hover); }
.widget .side-post .thumb {
    width: 64px; height: 48px;
    border-radius: 8px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}
.widget .side-post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget .side-post .sp-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget .side-post .sp-date { font-size: 11.5px; color: var(--text-tertiary); margin-top: 4px; }

/* 分页 */
.pagination-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 40px; }
.pagination-nav a, .pagination-nav span {
    padding: 9px 20px;
    border: 1px solid var(--border);
    border-radius: 100px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    background: var(--surface);
}
.pagination-nav a:hover { border-color: var(--text); color: var(--text); }
.pagination-nav .current { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 600; }

/* 空状态 / 404 */
.empty-state { text-align: center; padding: 90px 24px; color: var(--text-tertiary); }
.empty-state h3 { font-size: 22px; color: var(--text); margin: 20px 0 10px; font-weight: 700; }
.empty-state p { font-size: 14px; margin-bottom: 26px; color: var(--text-secondary); }
.empty-icon { width: 72px; height: 72px; margin: 0 auto; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.empty-icon svg { width: 32px; height: 32px; }

/* 返回顶部 */
.back-top {
    position: fixed;
    right: 24px; bottom: 140px;
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: var(--transition);
    z-index: 90;
}
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-top:hover { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.back-top svg { width: 18px; height: 18px; }

/* ============================================================
   11. 动效
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   12. 响应式
   ============================================================ */
@media (max-width: 1100px) {
    .code-float { display: none; }
    .code-stage { padding: 0; }
}

@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-hero { grid-template-columns: repeat(2, 1fr); }
    .main-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (max-width: 768px) {
    .header-inner { height: 56px; padding: 0 16px; }
    .brand-text { font-size: 16px; }
    .brand-text small { display: none; }

    .main-nav {
        position: fixed;
        top: 56px; left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        z-index: 99;
        box-shadow: var(--shadow-lg);
    }
    .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: all; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
    .main-nav a { padding: 12px 16px; width: 100%; }
    .main-nav li.current-menu-item > a::after,
    .main-nav a.active::after { display: none; }
    .mobile-menu-btn { display: flex; }

    .hero { padding: 64px 16px 48px; }
    .hero-actions { margin-bottom: 52px; }
    .code-float { display: none; }
    .code-stage { padding: 0; }

    .stats-grid-hero { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 24px 12px; }
    .stat-card .stat-num { font-size: 32px; }

    .features-grid { grid-template-columns: 1fr; }
    .features-section { padding: 72px 16px; }
    .blog-section { padding: 16px 16px 80px; }
    .blog-grid { grid-template-columns: 1fr; }

    .cta-box { padding: 64px 24px; border-radius: 24px; }

    .main-layout { padding: 24px 16px 64px; }
    .single-body { padding: 28px 22px 32px; }
    .sidebar { grid-template-columns: 1fr; }

    .footer-inner { flex-direction: column; text-align: center; justify-content: center; }
}

@media (max-width: 480px) {
    .stats-grid-hero { grid-template-columns: repeat(2, 1fr); }
    .stat-card .stat-num { font-size: 26px; }
    .btn { padding: 12px 24px; font-size: 14px; }
}
