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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    line-height: 1.55;
}

/* 双栏布局容器 */
.blog-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
}

/* ========= 侧边栏 ========= */
.sidebar {
    background: #fafaf8;
    border-right: 1px solid #eaeef2;
    padding: 2.5rem 1.8rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profile {
    margin-bottom: 2.5rem;
}

.avatar {
    width: 90px;
    height: 90px;
    background: #e4e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 400;
    color: #5b6e8c;
    margin-bottom: 1.2rem;
    border: 1px solid #e2e8f0;
}

.sidebar h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 0.4rem;
    color: #0f172a;
}

.sidebar .bio {
    font-size: 0.85rem;
    color: #5b6e8c;
    margin: 0.6rem 0 1rem;
    line-height: 1.4;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 2rem;
}

.sidebar-nav a {
    text-decoration: none;
    font-size: 0.95rem;
    color: #334155;
    padding: 0.4rem 0;
    transition: color 0.2s;
    font-weight: 450;
    border-left: 2px solid transparent;
    padding-left: 0.8rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #0f172a;
    border-left-color: #3b82f6;
    font-weight: 500;
}

.footer-info {
    font-size: 0.7rem;
    color: #94a3b8;
    border-top: 1px solid #edf2f7;
    padding-top: 1.2rem;
    margin-top: auto;
}

/* ========= 右侧主内容 ========= */
.main-content {
    background: #ffffff;
    padding: 2.5rem 2.8rem;
    overflow-y: auto;
}

/* 欢迎区域 */
.welcome-area {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 1.2rem;
}

.welcome-area h2 {
    font-size: 1.8rem;
    font-weight: 500;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.welcome-area p {
    color: #5b6e8c;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ========= 文章列表 ========= */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 0.5rem;
}

.post-card {
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 1.8rem;
}

.post-card:last-child {
    border-bottom: none;
}

.post-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.post-title a {
    text-decoration: none;
    color: #0f172a;
    transition: color 0.2s;
}

.post-title a:hover {
    color: #3b82f6;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #7e8b9c;
    margin-bottom: 0.7rem;
}

.post-excerpt {
    color: #334155;
    font-size: 0.9rem;
    margin: 0.6rem 0 0.8rem;
    line-height: 1.5;
}

.read-more {
    font-size: 0.8rem;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* ========= 文章详情 ========= */
.detail-container {
    background: #fff;
}

.detail-header {
    margin-bottom: 1.8rem;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 1rem;
}

.detail-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0.5rem 0 0.8rem;
    color: #0f172a;
    line-height: 1.3;
}

.detail-meta {
    font-size: 0.8rem;
    color: #6c7a91;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.detail-content {
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.8;
}

.detail-content p {
    margin-bottom: 1.2rem;
}

.detail-content h2 {
    margin: 1.8rem 0 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.detail-content h3 {
    margin: 1.4rem 0 0.6rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.detail-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: "SF Mono", "Consolas", monospace;
}

.detail-content pre {
    background: #f8fafc;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid #eef2ff;
}

.detail-content pre code {
    background: none;
    padding: 0;
}

.detail-content blockquote {
    border-left: 3px solid #3b82f6;
    margin: 1.2rem 0;
    padding-left: 1rem;
    color: #475569;
    font-style: normal;
    background: #fafcff;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
}

.detail-content ul,
.detail-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.detail-content li {
    margin-bottom: 0.5rem;
}

.back-btn {
    display: inline-block;
    margin-top: 2rem;
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    color: #1f2a44;
    transition: all 0.2s;
    text-decoration: none;
}

.back-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ========= 归档 & 关于 & 项目页面 ========= */
.archive-list,
.about-card,
.projects-grid {
    background: #ffffff;
}

.archive-item {
    border-bottom: 1px solid #edf2f7;
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.archive-item a {
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
}

.archive-item a:hover {
    color: #3b82f6;
}

.archive-date {
    font-size: 0.7rem;
    color: #7c8ba0;
}

.about-content {
    line-height: 1.6;
}

.about-content p {
    margin-bottom: 1rem;
    color: #334155;
}

/* 项目卡片 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    border: 1px solid #eaeef2;
    border-radius: 12px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.project-card p {
    font-size: 0.85rem;
    color: #5b6e8c;
    margin-bottom: 0.8rem;
}

.project-card .tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-card .tag {
    font-size: 0.7rem;
    background: #f1f5f9;
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

/* 联系表单 */
.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #2563eb;
}

/* 分类筛选标签 */
.blog-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.category-tag {
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    color: #5b6e8c;
    text-decoration: none;
    transition: all 0.2s;
}

.category-tag:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #f0f7ff;
}

.category-tag.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
}

.pagination a {
    color: #334155;
    border: 1px solid #e2e8f0;
}

.pagination a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pagination .current {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

/* 响应式：小于800px改为单栏 */
@media (max-width: 800px) {
    .blog-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #eaeef2;
        padding: 1.5rem;
    }
    .main-content {
        padding: 1.8rem;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-nav a {
        padding-left: 0;
        border-left: none;
        padding: 0.4rem 0.8rem;
    }
    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        border-left: none;
    }
}

/* ========= 评论区域 ========= */
.comment-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #edf2f7;
}

.comment-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1.2rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.comment-item {
    padding: 1rem;
    background: #fafaf8;
    border-radius: 8px;
    border: 1px solid #edf2f7;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background: #e4e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #5b6e8c;
}

.comment-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}

.comment-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
}

.comment-content {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
    padding-left: 2.6rem;
}

.comment-form {
    margin-top: 1.5rem;
}

.comment-form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.comment-textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
    transition: border-color 0.2s;
    margin-bottom: 0.75rem;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.comment-tip {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

@media (max-width: 800px) {
    .comment-form-row {
        flex-direction: column;
    }
    .comment-content {
        padding-left: 0;
    }
}