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

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    background-color: #faf7f2;
    color: #2d2a24;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- 容器 ---------- */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 头部 ---------- */
.header {
    padding: 32px 0 20px;
    border-bottom: 1px solid #ece6dd;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #3d2c1e;
    letter-spacing: -0.3px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    background: linear-gradient(135deg, #3d2c1e 0%, #6b4f3a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 450;
    color: #6b5f52;
    border-radius: 40px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #ece6dd;
    color: #2d2a24;
}

.nav-link.admin-link {
    border: 1px solid #d5cdc4;
    font-size: 12px;
    padding: 4px 12px;
    color: #8a7a6a;
}

.nav-link.admin-link:hover {
    background-color: #2d2a24;
    color: #faf7f2;
    border-color: #2d2a24;
}

/* ---------- 主体 ---------- */
.main {
    flex: 1;
    padding: 40px 0 60px;
}

/* ---------- 首页 Hero ---------- */
.hero {
    text-align: center;
    padding: 20px 0 32px;
}

.hero-title {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #2d2a24;
    font-family: 'Georgia', 'Times New Roman', serif;
    margin-bottom: 4px;
}

.hero-sub {
    font-size: 18px;
    color: #6b5f52;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 16px;
}

.hero-divider {
    color: #c9bdb0;
    font-size: 18px;
    margin-bottom: 20px;
}

.hero-bio {
    max-width: 540px;
    margin: 0 auto;
    font-size: 16px;
    color: #4d3f33;
    line-height: 1.9;
}

.hero-bio p {
    margin-bottom: 6px;
}

/* ---------- 通用标题 ---------- */
.section-title {
    font-size: 22px;
    font-weight: 500;
    color: #2d2a24;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ece6dd;
    letter-spacing: 1px;
}

/* ---------- 作品集网格 ---------- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 48px;
}

.work-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffffcc;
    backdrop-filter: blur(2px);
    border-radius: 16px;
    border: 1px solid #ece6dd;
    transition: all 0.2s ease;
}

.work-card:hover {
    background: #ffffff;
    border-color: #c9bdb0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 42, 36, 0.04);
}

.work-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.work-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a24;
    margin-bottom: 2px;
}

.work-info p {
    font-size: 12px;
    color: #8a7a6a;
    line-height: 1.3;
}

/* ---------- 文章列表（首页 & 博客页） ---------- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.post-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background 0.15s;
    border-bottom: 1px solid #f0ebe6;
}

.post-item:hover {
    background: #f5f0e8;
}

.post-date {
    font-size: 13px;
    color: #a69686;
    font-feature-settings: "tnum";
    flex-shrink: 0;
    min-width: 80px;
}

.post-title {
    flex: 1;
    font-size: 15px;
    color: #2d2a24;
    font-weight: 450;
}

.post-read {
    color: #c9bdb0;
    font-size: 14px;
    transition: transform 0.2s;
}

.post-item:hover .post-read {
    color: #4d3f33;
    transform: translateX(4px);
}

.post-more {
    text-align: right;
    margin-top: 8px;
}

.post-more a {
    font-size: 14px;
    color: #6b5f52;
    border-bottom: 1px dashed #d5cdc4;
    padding-bottom: 2px;
    transition: color 0.2s;
}

.post-more a:hover {
    color: #2d2a24;
}

/* ---------- 博客列表页 ---------- */
.blog-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 30px;
    font-weight: 300;
    color: #2d2a24;
    font-family: 'Georgia', serif;
    margin-bottom: 2px;
}

.page-desc {
    color: #8a7a6a;
    font-size: 15px;
}

.blog-item {
    padding: 20px 0;
    border-bottom: 1px solid #ece6dd;
}

.blog-item:last-child {
    border-bottom: none;
}

.blog-link {
    display: block;
}

.blog-title {
    font-size: 20px;
    font-weight: 500;
    color: #2d2a24;
    margin-bottom: 6px;
    transition: color 0.15s;
}

.blog-link:hover .blog-title {
    color: #6b4f3a;
}

.blog-summary {
    color: #5a4d3f;
    font-size: 15px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #8a7a6a;
    align-items: center;
}

.blog-tags {
    background: #f0ebe6;
    padding: 0 10px;
    border-radius: 40px;
    font-size: 12px;
    color: #6b5f52;
}

.blog-read {
    margin-left: auto;
    font-size: 13px;
    color: #b3a597;
}

.blog-link:hover .blog-read {
    color: #4d3f33;
}

/* ---------- 文章详情页 ---------- */
.post-detail {
    max-width: 720px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 32px;
}

.post-title {
    font-size: 32px;
    font-weight: 500;
    line-height: 1.3;
    color: #2d2a24;
    font-family: 'Georgia', serif;
    margin-bottom: 10px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #8a7a6a;
    margin-bottom: 12px;
}

.post-tags {
    background: #f0ebe6;
    padding: 0 12px;
    border-radius: 40px;
    font-size: 12px;
    color: #6b5f52;
}

.post-views {
    margin-left: auto;
}

.post-summary {
    font-size: 17px;
    color: #4d3f33;
    padding: 16px 20px;
    background: #f5f0e8;
    border-radius: 16px;
    border-left: 3px solid #c9bdb0;
    font-style: italic;
}

/* 文章正文 Markdown 渲染样式 */
.post-body {
    font-size: 17px;
    line-height: 1.9;
    color: #2d2a24;
}

.post-body h1, .post-body h2, .post-body h3 {
    font-family: 'Georgia', serif;
    font-weight: 500;
    margin: 28px 0 12px;
    color: #2d2a24;
}

.post-body h1 { font-size: 28px; }
.post-body h2 { font-size: 24px; border-bottom: 1px solid #ece6dd; padding-bottom: 6px; }
.post-body h3 { font-size: 20px; }

.post-body p {
    margin-bottom: 18px;
}

.post-body blockquote {
    margin: 20px 0;
    padding: 12px 24px;
    background: #f5f0e8;
    border-left: 4px solid #b3a597;
    color: #4d3f33;
    font-style: italic;
}

.post-body ul, .post-body ol {
    margin: 12px 0 18px 24px;
}

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

.post-body code {
    background: #f0ebe6;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #4d2e1e;
}

.post-body pre {
    background: #2d2a24;
    color: #f0ebe6;
    padding: 20px;
    border-radius: 16px;
    overflow-x: auto;
    margin: 20px 0;
}

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

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

.post-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #ece6dd;
}

.back-link {
    color: #6b5f52;
    font-size: 14px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #2d2a24;
}

/* ---------- 留言板 ---------- */
.guestbook-header {
    margin-bottom: 32px;
}

.guestbook-form {
    background: #ffffff;
    padding: 28px 32px;
    border-radius: 24px;
    border: 1px solid #ece6dd;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d5cdc4;
    border-radius: 40px;
    font-size: 15px;
    font-family: inherit;
    background: #faf7f2;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6b4f3a;
    background: #ffffff;
}

.form-group textarea {
    border-radius: 20px;
    resize: vertical;
}

.btn-submit {
    padding: 12px 32px;
    background: #2d2a24;
    color: #faf7f2;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #4d3f33;
}

.guestbook-list {
    margin-top: 12px;
}

.message-item {
    padding: 20px 0;
    border-bottom: 1px solid #ece6dd;
}

.message-item:last-child {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.message-name {
    font-weight: 600;
    color: #2d2a24;
}

.message-date {
    font-size: 13px;
    color: #a69686;
}

.message-content {
    color: #4d3f33;
    line-height: 1.6;
}

.message-reply {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f5f0e8;
    border-radius: 16px;
    font-size: 14px;
}

.reply-label {
    font-weight: 600;
    color: #4d3f33;
}

/* ---------- 页脚 ---------- */
.footer {
    border-top: 1px solid #ece6dd;
    padding: 28px 0 32px;
    text-align: center;
    color: #8a7a6a;
    font-size: 14px;
}

.footer-copy {
    font-weight: 450;
    color: #4d3f33;
}

.footer-desc {
    font-size: 13px;
    letter-spacing: 2px;
    margin-top: 2px;
}

.footer-year {
    margin-top: 6px;
    font-size: 12px;
    color: #c9bdb0;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav {
        width: 100%;
        justify-content: flex-start;
        gap: 4px;
    }

    .nav-link {
        font-size: 13px;
        padding: 4px 12px;
    }

    .hero-title {
        font-size: 30px;
    }

    .hero-sub {
        font-size: 15px;
        letter-spacing: 2px;
    }

    .works-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .work-card {
        padding: 10px 14px;
    }

    .work-info h3 {
        font-size: 13px;
    }

    .post-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    .post-date {
        min-width: auto;
        font-size: 12px;
        color: #a69686;
        width: 100%;
    }

    .post-title {
        font-size: 15px;
        width: 100%;
        order: 2;
    }

    .post-read {
        order: 3;
        margin-left: auto;
    }

    .post-title {
        font-size: 24px;
    }

    .guestbook-form {
        padding: 20px 16px;
    }

    .blog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .blog-read {
        margin-left: 0;
    }
}

@media (max-width: 420px) {
    .works-grid {
        grid-template-columns: 1fr;
    }
}