/* === 风中飞鸟的生物世界 — 统一样式（基于 app.html 风格）=== */

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

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eef2ff;
    --accent-subtle: #dbeafe;
    --green: #059669;
    --green-bg: #dcfce7;
    --purple: #7c3aed;
    --purple-bg: #ede9fe;
    --orange: #ea580c;
    --orange-bg: #ffedd5;
    --teal: #0d9488;
    --teal-bg: #ccfbf1;
    --rose: #e11d48;
    --rose-bg: #ffe4e6;
    --radius: 28px;
    --radius-sm: 16px;
    --radius-xs: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 8px 20px rgba(0,0,0,.04);
    --transition: 0.2s ease;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #eef2ff; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 8px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* === 导航栏 === */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.header-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 12px 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-size: 1.7rem; font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    background-clip: text; -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
    display: flex; align-items: center; gap: 6px;
}
.logo-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #3b82f6; display: inline-block;
}
.nav { display: flex; gap: 4px; }
.nav a {
    color: var(--text-secondary); font-size: .85rem; font-weight: 500;
    padding: 8px 16px; border-radius: 40px; transition: all var(--transition);
}
.nav a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.nav a.active { background: var(--accent-light); color: var(--accent); }

/* === 容器 === */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* === 文章卡片 === */
.section-title {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 8px;
    display: flex; align-items: center; gap: 12px;
}
.section-sub {
    color: var(--text-secondary); margin-top: 23px; margin-bottom: 28px;
    border-left: 4px solid var(--accent); padding-left: 16px;
    position: sticky; top: 60px; background: var(--bg); z-index: 10;
    padding-top: 4px; padding-bottom: 4px;
    font-size: 1.1rem; font-weight: 600;
}
.post-card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border-light); padding: 18px 28px; margin-bottom: 12px;
    transition: all var(--transition);
    position: relative; overflow: hidden;
}
.post-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; background: transparent; transition: background var(--transition);
}
.post-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.post-card:hover::before { background: var(--accent); }

.post-card .category {
    display: inline-block; padding: 3px 12px; border-radius: 20px;
    font-size: .72rem; font-weight: 600; margin-bottom: 0;
}
.cat-method { background: var(--green-bg); color: var(--green); }
.cat-bioinfo { background: var(--purple-bg); color: var(--purple); }
.cat-lab { background: var(--orange-bg); color: var(--orange); }
.cat-knowledge { background: var(--teal-bg); color: var(--teal); }
.cat-programming { background: var(--rose-bg); color: var(--rose); }

.post-card h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); }
.post-card p { color: var(--text-secondary); font-size: .9rem; line-height: 1.65; margin-bottom: 12px; }
.post-card .meta-row {
    display: flex; align-items: center; gap: 14px;
    font-size: .8rem; color: var(--text-tertiary);
}
.post-card .read-link {
    margin-left: auto; font-weight: 500; font-size: .82rem; color: var(--accent);
    display: flex; align-items: center; gap: 4px;
}
.post-card .read-link::after { content: '→'; transition: transform var(--transition); }
.post-card:hover .read-link::after { transform: translateX(3px); }

/* === 文章页 === */
.article-container { max-width: 860px; margin: 0 auto; padding: 40px 24px 60px; }
article {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 44px 48px;
    box-shadow: var(--shadow);
}
article .category { margin-bottom: 16px; }
article h1 {
    font-size: 1.55rem; font-weight: 700; line-height: 1.45;
    margin-bottom: 10px; letter-spacing: -0.01em;
}
article .meta {
    font-size: .82rem; color: var(--text-tertiary); margin-bottom: 32px;
    padding-bottom: 20px; border-bottom: 1px solid var(--border);
    display: flex; gap: 16px; align-items: center;
}
article h2 { font-size: 1.15rem; font-weight: 700; margin: 36px 0 12px; color: var(--text); }
article h3 { font-size: 1rem; font-weight: 600; margin: 24px 0 8px; }
article p { margin-bottom: 16px; font-size: .92rem; color: var(--text-secondary); }
article ul, article ol { margin: 10px 0 20px 22px; font-size: .92rem; color: var(--text-secondary); }
article li { margin-bottom: 8px; }
article code {
    background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
    font-size: .85rem; color: #e11d48;
}
article pre {
    background: #1e293b; color: #e2e8f0; padding: 18px 22px;
    border-radius: var(--radius-xs); overflow-x: auto;
    font-size: .82rem; line-height: 1.6; margin-bottom: 20px;
}
article table {
    border-collapse: collapse; width: 100%; margin: 16px 0 24px;
    font-size: .88rem; border-radius: var(--radius-xs); overflow: hidden;
    border: 1px solid var(--border);
}
article th, article td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
article th { background: var(--bg); font-weight: 600; font-size: .82rem; color: var(--text-secondary); }
article td { color: var(--text-secondary); }
article blockquote {
    border-left: 3px solid var(--accent); padding: 10px 18px; margin: 18px 0;
    background: var(--accent-light); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    color: var(--text-secondary); font-size: .9rem;
}
article .callout {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-xs);
    padding: 14px 18px; margin: 18px 0; font-size: .88rem;
    display: flex; gap: 10px; align-items: flex-start;
}

/* === 侧边栏 === */
.sidebar { width: 240px; flex-shrink: 0; padding-top: 0; position: sticky; top: 80px; align-self: flex-start; max-height: calc(100vh - 100px); overflow-y: auto; }
.sidebar-widget:first-child { margin-top: 0; padding-top: 0; }
.sidebar-widget { margin-bottom: 28px; }
.sidebar-widget h3 {
    font-size: .75rem; font-weight: 700; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: .8px; margin-bottom: 12px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a {
    display: inline-block; padding: 6px 14px; border-radius: 40px;
    font-size: .78rem; font-weight: 500; border: 1px solid var(--border);
    color: var(--text-secondary); transition: all var(--transition);
}
.tag-list a:hover {
    background: var(--accent); border-color: var(--accent);
    color: #fff; text-decoration: none;
}
.archive-mini { list-style: none; }
.archive-mini li { margin-bottom: 2px; }
.archive-mini a {
    display: flex; justify-content: space-between; padding: 6px 10px;
    border-radius: var(--radius-xs); font-size: .84rem;
    color: var(--text-secondary); transition: all var(--transition);
}
.archive-mini a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.archive-mini .num { color: var(--text-tertiary); font-size: .74rem; }
.links-mini { list-style: none; }
.links-mini li { margin-bottom: 2px; }
.links-mini a {
    display: block; padding: 6px 10px; border-radius: var(--radius-xs);
    font-size: .84rem; color: var(--text-secondary); transition: all var(--transition);
}
.links-mini a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }

/* === 英雄区 === */
.hero {
    padding: 40px 0 32px;
    display: flex; align-items: center; gap: 20px;
}
.hero-avatar {
    width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(37,99,235,.25);
}
.hero-text h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.hero-text p { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
.hero-meta { display: flex; gap: 20px; margin-top: 8px; }
.hero-meta span { font-size: .82rem; color: var(--text-tertiary); }
.hero-meta strong { color: var(--text); font-weight: 600; }

/* === 内容布局 === */
.content-layout { display: flex; gap: 40px; padding-bottom: 48px; }
.main { flex: 1; min-width: 0; }

/* === 通用按钮 === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border-radius: 40px;
    font-size: .85rem; font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
}
.btn:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.btn-primary {
    background: var(--accent); color: #fff; border: none;
    padding: 10px 24px; border-radius: 40px;
    font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }

/* === 页脚 === */
.footer {
    position: fixed; bottom: 0; left: 0; width: 100%; z-index: 998;
    background: #0f172a; color: #cbd5e1;
    text-align: center; padding: 12px 24px;
    font-size: .8rem;
}
.footer .divider { margin: 0 8px; color: #475569; }
.footer a { color: #cbd5e1; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* === 归档 === */
.year-group { margin-bottom: 24px; }
.year-group h2 {
    font-size: 1rem; color: var(--text-tertiary);
    border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 10px;
}
.year-group ul { list-style: none; }
.year-group li { font-size: .92rem; padding: 5px 0; display: flex; align-items: baseline; }
.year-group .date { color: var(--text-tertiary); font-size: .8rem; width: 60px; flex-shrink: 0; }

/* === 关于页 === */
.about-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 40px; }
.about-card h1 { font-size: 1.4rem; margin-bottom: 20px; }
.about-card p { margin-bottom: 14px; font-size: .94rem; color: var(--text-secondary); }
.about-card ul { margin: 10px 0 20px 22px; font-size: .92rem; color: var(--text-secondary); }
.about-card li { margin-bottom: 6px; }

/* === 响应式 === */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .header-inner { padding: 10px 16px; }
    .logo { font-size: 1.2rem; }
    .content-layout { flex-direction: column; }
    .sidebar { width: 100%; display: flex; gap: 20px; flex-wrap: wrap; }
    .sidebar-widget { flex: 1; min-width: 120px; }
    .hero { flex-direction: column; text-align: center; padding: 28px 0 20px; }
    .hero-meta { justify-content: center; }
    .post-card { padding: 20px; }
    .post-card h2 { font-size: 1.05rem; }
    article { padding: 24px 20px; }
    article h1 { font-size: 1.3rem; }
    .article-container { padding: 20px 16px; }
    .about-card { padding: 24px 20px; }
}
