/* ===== 基础样式 ===== */
:root {
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #3d3d3d;
    --text-secondary: #888888;
    --accent: #007AFF;
    --accent-hover: #0056cc;
    --border: #e0e5ea;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
    --max-width: 720px;
}

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

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.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.hidden { display: none !important; }

/* ===== 导航栏 ===== */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.85);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-links { list-style: none; display: flex; gap: 24px; }

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ===== 首页 ===== */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.hero p  { color: var(--text-secondary); font-size: 1.05rem; }

/* 文章列表 */
.post-list { padding-bottom: 60px; }

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.post-card .post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.post-card h2 {
    font-size: 1.3rem;
    margin-bottom: 6px;
    color: var(--text);
}

.post-card .post-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-tags {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    background: #e8f2ff;
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* ===== 文章详情 ===== */
#post-page { padding: 40px 0 60px; }

.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.back-btn:hover { color: var(--accent-hover); }

#post-content h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

#post-content .post-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

#post-content .post-body { font-size: 1rem; }

#post-content .post-body h2 {
    font-size: 1.35rem;
    margin: 36px 0 12px;
}

#post-content .post-body h3 {
    font-size: 1.15rem;
    margin: 28px 0 8px;
}

#post-content .post-body p {
    margin-bottom: 16px;
}

#post-content .post-body ul,
#post-content .post-body ol {
    margin: 8px 0 16px 24px;
}

#post-content .post-body li { margin-bottom: 6px; }

#post-content .post-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 16px 0;
}

#post-content .post-body code {
    background: #f0f3f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #0066d6;
}

#post-content .post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

#post-content .post-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    color: var(--text-secondary);
    margin: 16px 0;
}

#post-content .post-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

/* ===== 关于页 ===== */
#about-page { padding: 60px 0; display: flex; justify-content: center; }

.about-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.about-avatar { font-size: 3rem; margin-bottom: 16px; }

.about-card h2 { font-size: 1.4rem; margin-bottom: 16px; }

.about-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.about-tags span {
    background: #e8f2ff;
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.about-contact {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== 页脚 ===== */
.footer {
    margin-top: auto;
    padding: 24px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .hero { padding: 40px 0 28px; }
    .hero h1 { font-size: 1.6rem; }
    .post-card { padding: 20px 24px; }
    .post-card h2 { font-size: 1.15rem; }
    #post-content h1 { font-size: 1.5rem; }
    .about-card { padding: 32px 24px; }
}
