/* ===== 基础重置 ===== */
*, *::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;
    font-size: 16px; line-height: 1.7; color: #1a1a1a; background: #fafafa;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; outline: none; }

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

/* ===== 头部 ===== */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo { display: flex; align-items: center; font-weight: 700; font-size: 20px; letter-spacing: -0.5px; }
.logo img { height: 32px; width: auto; }
.logo-text { color: #000; }

.main-nav { display: flex; gap: 32px; }
.nav-link {
    font-size: 14px; font-weight: 500; color: #666;
    position: relative; padding: 4px 0;
}
.nav-link:hover, .nav-link.active { color: #000; }
.nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: #000; transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.search-toggle {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #666; transition: all 0.2s;
}
.search-toggle:hover { background: #f0f0f0; color: #000; }

.mobile-menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.mobile-menu-toggle span {
    display: block; width: 20px; height: 2px; background: #333;
    transition: all 0.3s ease;
}

/* ===== 搜索弹窗 ===== */
.search-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: none; align-items: flex-start; justify-content: center; padding-top: 15vh;
    opacity: 0; transition: opacity 0.3s ease;
}
.search-overlay.active { display: flex; opacity: 1; }
.search-box {
    background: #fff; border-radius: 16px; padding: 24px; width: 90%; max-width: 560px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    position: relative;
}
.search-box form { display: flex; gap: 12px; }
.search-box input {
    flex: 1; padding: 14px 18px; border: 2px solid #e5e5e5; border-radius: 12px;
    font-size: 16px; transition: border-color 0.2s;
}
.search-box input:focus { border-color: #000; }
.search-box button[type="submit"] {
    padding: 14px 24px; background: #000; color: #fff; border-radius: 12px;
    font-weight: 600; font-size: 14px; transition: all 0.2s;
}
.search-box button[type="submit"]:hover { background: #333; transform: translateY(-1px); }
.search-close {
    position: absolute; top: -40px; right: 0; color: #fff; font-size: 24px;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
}

/* ===== 移动端菜单 ===== */
.mobile-menu {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 99;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(20px);
    padding: 32px 24px; display: none; flex-direction: column; gap: 4px;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    padding: 16px 0; font-size: 18px; font-weight: 500;
    border-bottom: 1px solid #f0f0f0; color: #333;
}
.mobile-menu a:hover { color: #000; padding-left: 8px; }

/* ===== Hero 区域 ===== */
.hero {
    padding: 100px 0 80px; text-align: center;
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
    border-bottom: 1px solid #eee;
}
.hero-title {
    font-size: clamp(32px, 5vw, 56px); font-weight: 800;
    letter-spacing: -1.5px; line-height: 1.15; color: #000;
    margin-bottom: 20px;
}
.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px); color: #666; font-weight: 400;
    max-width: 560px; margin: 0 auto; line-height: 1.6;
}

/* ===== 文章列表 ===== */
.posts-section { padding: 60px 0; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px; }

.post-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    border: 1px solid #eee; transition: all 0.3s ease;
    display: flex; flex-direction: column;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.1);
    border-color: #ddd;
}
.post-card-image {
    width: 100%; height: 200px; object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}
.post-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.post-card-meta {
    display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
    font-size: 12px; color: #999;
}
.post-card-category {
    padding: 4px 10px; background: #f5f5f5; border-radius: 20px;
    font-weight: 600; color: #555; font-size: 11px;
}
.post-card-title {
    font-size: 20px; font-weight: 700; line-height: 1.4; color: #000;
    margin-bottom: 12px; letter-spacing: -0.3px;
}
.post-card-summary {
    font-size: 14px; color: #666; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; flex: 1;
}
.post-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid #f0f0f0;
    font-size: 13px; color: #999;
}

/* ===== 文章详情 ===== */
.post-single { padding: 60px 0; }
.post-single-inner { max-width: 720px; margin: 0 auto; }
.post-single-header { margin-bottom: 40px; text-align: center; }
.post-single-category {
    display: inline-block; padding: 6px 14px; background: #000; color: #fff;
    border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 20px;
}
.post-single-title {
    font-size: clamp(28px, 4vw, 42px); font-weight: 800;
    line-height: 1.2; letter-spacing: -1px; margin-bottom: 20px;
}
.post-single-meta {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    font-size: 14px; color: #999;
}
.post-single-meta span { display: flex; align-items: center; gap: 6px; }
.post-single-cover {
    width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px;
    margin-bottom: 40px; background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

/* 文章内容排版 */
.post-content { font-size: 17px; line-height: 1.9; color: #333; }
.post-content h2, .post-content h3, .post-content h4 {
    font-weight: 700; color: #000; margin: 48px 0 20px; line-height: 1.4;
}
.post-content h2 { font-size: 28px; letter-spacing: -0.5px; }
.post-content h3 { font-size: 22px; }
.post-content p { margin-bottom: 20px; }
.post-content ul, .post-content ol { margin-bottom: 20px; padding-left: 28px; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 8px; }
.post-content a { color: #000; text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { opacity: 0.7; }
.post-content blockquote {
    border-left: 4px solid #000; padding-left: 24px; margin: 32px 0;
    font-style: italic; color: #555; font-size: 18px;
}
.post-content code {
    background: #f4f4f4; padding: 3px 8px; border-radius: 4px;
    font-family: "SF Mono", Monaco, monospace; font-size: 14px;
}
.post-content pre {
    background: #1a1a1a; color: #e8e8e8; padding: 20px; border-radius: 12px;
    overflow-x: auto; margin: 24px 0; font-size: 14px; line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content img { border-radius: 12px; margin: 24px 0; }
.post-content hr { border: none; border-top: 1px solid #e5e5e5; margin: 40px 0; }
.post-content strong { color: #000; font-weight: 700; }

/* ===== 侧边栏 ===== */
.sidebar { padding: 40px 0; }
.sidebar-inner { max-width: 720px; margin: 0 auto; }
.sidebar-section {
    background: #fff; border-radius: 16px; padding: 28px;
    border: 1px solid #eee; margin-bottom: 24px;
}
.sidebar-title {
    font-size: 16px; font-weight: 700; color: #000; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-list { display: flex; flex-direction: column; gap: 12px; }
.sidebar-list a {
    font-size: 14px; color: #555; display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid #f5f5f5;
}
.sidebar-list a:hover { color: #000; padding-left: 4px; }
.sidebar-list a span { color: #999; font-size: 12px; }

/* 关于卡片 */
.about-card { text-align: center; }
.about-avatar {
    width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 16px;
    object-fit: cover; border: 3px solid #f0f0f0;
    background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
}
.about-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.about-bio { font-size: 14px; color: #666; line-height: 1.6; }

/* ===== 分页 ===== */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 60px;
}
.page-link {
    min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 14px; font-weight: 500; color: #555;
    border: 1px solid #e5e5e5; background: #fff; transition: all 0.2s;
}
.page-link:hover { border-color: #000; color: #000; }
.page-link.active { background: #000; color: #fff; border-color: #000; }
.page-ellipsis { color: #999; padding: 0 4px; }

/* ===== 页脚 ===== */
.site-footer {
    background: #0a0a0a; color: #888; padding: 60px 0 30px; margin-top: 80px;
}
.footer-inner {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px;
}
.footer-logo { font-size: 20px; font-weight: 700; color: #fff; display: block; margin-bottom: 12px; }
.footer-desc { font-size: 14px; line-height: 1.7; color: #777; }
.footer-links h4 { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 20px; }
.footer-links a { display: block; font-size: 14px; color: #888; margin-bottom: 12px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #222; padding-top: 24px;
    text-align: center; font-size: 13px; color: #555;
}
.footer-bottom p { margin-bottom: 4px; }
.icp { color: #444; }

/* ===== 页面通用 ===== */
.page-header {
    padding: 80px 0 40px; text-align: center;
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
    border-bottom: 1px solid #eee;
}
.page-title {
    font-size: clamp(28px, 4vw, 40px); font-weight: 800;
    letter-spacing: -1px; margin-bottom: 12px;
}
.page-desc { font-size: 16px; color: #888; }
.page-content { padding: 60px 0; max-width: 720px; margin: 0 auto; }
.page-content .post-content { margin-top: 0; }

/* 分类标签 */
.category-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; background: #f5f5f5; border-radius: 20px;
    font-size: 13px; font-weight: 600; color: #555;
}

/* ===== 评论 ===== */
.comments-section { max-width: 720px; margin: 60px auto 0; padding-top: 40px; border-top: 1px solid #eee; }
.comments-title { font-size: 20px; font-weight: 700; margin-bottom: 32px; }
.comment-form { margin-bottom: 40px; }
.comment-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.comment-form input, .comment-form textarea {
    width: 100%; padding: 14px 16px; border: 2px solid #e5e5e5; border-radius: 12px;
    font-size: 15px; transition: border-color 0.2s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: #000; }
.comment-form textarea { min-height: 120px; resize: vertical; grid-column: 1 / -1; }
.comment-form button {
    padding: 14px 32px; background: #000; color: #fff; border-radius: 12px;
    font-weight: 600; font-size: 14px; transition: all 0.2s;
}
.comment-form button:hover { background: #333; transform: translateY(-1px); }

.comment-item { padding: 24px 0; border-bottom: 1px solid #f0f0f0; }
.comment-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.comment-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #333, #666);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px;
}
.comment-author { font-weight: 600; font-size: 15px; }
.comment-time { font-size: 13px; color: #999; }
.comment-body { font-size: 15px; color: #444; line-height: 1.7; padding-left: 52px; }

/* ===== 搜索结果 ===== */
.search-results { padding: 60px 0; }
.search-results-title { font-size: 24px; font-weight: 700; margin-bottom: 32px; }
.search-results-title span { color: #999; font-weight: 400; }
.search-empty { text-align: center; padding: 80px 0; color: #999; }
.search-empty svg { margin-bottom: 20px; opacity: 0.3; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .hero { padding: 60px 0 40px; }
    .posts-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    .post-single-meta { flex-wrap: wrap; gap: 12px; }
    .comment-form-grid { grid-template-columns: 1fr; }
    .sidebar-inner { padding: 0 16px; }
    .post-content { font-size: 16px; }
    .post-content h2 { font-size: 24px; }
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.post-card { animation: fadeInUp 0.5s ease forwards; }
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }
