/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafafa;
    --text: #333;
    --text-muted: #999;
    --accent: #df846c;
    --accent-hover: #c96f57;
    --card-bg: #ffffff;
    --border: #eaeaea;
    --shadow: 0 1px 3px rgba(0,0,0,.06);
    --shadow-hover: 0 4px 12px rgba(0,0,0,.1);
    --transition: .25s ease;
    --max-w: 780px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* === Header === */
.site-header {
    position: relative;
    text-align: center;
    padding: 60px 24px 40px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.header-bg {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(135deg, #fce4e0 0%, #f8d5ce 50%, #f0c0b5 100%);
    opacity: .4;
}
.header-content {
    position: relative;
    z-index: 1;
}
.header-avatar {
    margin-bottom: 16px;
}
.avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.site-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}
.site-title a { color: var(--text); }
.site-title a:hover { color: var(--accent); }
.site-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0 20px;
    letter-spacing: .5px;
}
.header-nav {
    display: flex;
    justify-content: center;
    gap: 32px;
}
.header-nav a {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 4px;
}
.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition);
}
.header-nav a:hover { color: var(--accent); }
.header-nav a:hover::after { transform: scaleX(1); }

/* === Main Wrap === */
.main-wrap {
    padding: 40px 24px 60px;
}

/* === Section Heading === */
.section-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 40px 0 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    letter-spacing: .5px;
}

/* === Post Card (full-width) === */
.post-card {
    background: var(--card-bg);
    padding: 32px 36px;
    border-radius: 2px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}
.post-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: .5px;
}

/* === Entry Content === */
.entry-content {
    color: var(--text);
    font-size: 14px;
    line-height: 2;
}
.entry-content p {
    margin-bottom: 16px;
}
.entry-content p:last-child {
    margin-bottom: 0;
}

/* === Posts List === */
.posts-list {}
.post-item {
    background: var(--card-bg);
    padding: 24px 28px;
    border-radius: 2px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    margin-bottom: 16px;
    position: relative;
}
.post-item:hover {
    box-shadow: var(--shadow-hover);
}
.post-date {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}
.post-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.post-item h3 a { color: var(--text); }
.post-item h3 a:hover { color: var(--accent); }
.post-item p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
}
.post-cat {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

/* === Contact === */
.contact-content {
    font-size: 14px;
}
.contact-list {
    list-style: none;
    margin-top: 12px;
}
.contact-list li {
    padding: 6px 0;
    font-size: 14px;
}
.contact-list li a {
    font-weight: 500;
}

/* === Footer === */
.site-footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

/* === Scroll to Top === */
#scrolltop {
    width: 40px;
    height: 40px;
    position: fixed;
    right: 30px;
    bottom: 40px;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .4s ease;
    z-index: 99;
    user-select: none;
}
#scrolltop.show {
    opacity: .8;
}
#scrolltop:hover {
    opacity: 1;
}

/* === 404 === */
.error-page {
    text-align: center;
    padding: 120px 24px;
}
.error-page h1 {
    font-size: 72px;
    color: var(--accent);
    margin-bottom: 16px;
}
.error-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
}
.error-page a {
    display: inline-block;
    padding: 10px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 2px;
    transition: background var(--transition);
}
.error-page a:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* === Responsive === */
@media (max-width: 768px) {
    .site-header { padding: 40px 16px 30px; }
    .header-bg { height: 150px; }
    .avatar-img { width: 72px; height: 72px; }
    .site-title { font-size: 22px; }
    .header-nav { gap: 20px; }
    .header-nav a { font-size: 12px; }
    .main-wrap { padding: 24px 16px 40px; }
    .post-card { padding: 24px 20px; }
    .post-item { padding: 20px; }
    .section-heading { font-size: 16px; margin: 28px 0 20px; }
    #scrolltop { right: 16px; bottom: 24px; width: 36px; height: 36px; line-height: 36px; font-size: 16px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .post-card { padding: 20px 16px; }
    .post-item { padding: 16px; }
}

/* === Article Page === */
.post-meta {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
}
.post-nav {
    margin-top: 32px;
    padding: 16px 0;
}
.back-home {
    display: inline-block;
    color: var(--text-muted);
    font-size: 13px;
    transition: color var(--transition);
}
.back-home:hover {
    color: var(--accent);
}

/* Entry content rich text */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 28px 0 12px;
    font-weight: 700;
    line-height: 1.4;
}
.entry-content h1 { font-size: 22px; }
.entry-content h2 { font-size: 19px; }
.entry-content h3 { font-size: 17px; }
.entry-content p {
    margin-bottom: 16px;
}
.entry-content ul,
.entry-content ol {
    margin: 0 0 16px 24px;
}
.entry-content li {
    margin-bottom: 6px;
}
.entry-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 16px 0;
    padding: 12px 16px;
    background: #fafafa;
    color: var(--text-muted);
    font-style: normal;
}
.entry-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 13px;
    font-family: Consolas, Monaco, "Courier New", monospace;
}
.entry-content pre {
    background: #f5f5f5;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
    font-family: Consolas, Monaco, "Courier New", monospace;
}
.entry-content pre code {
    background: none;
    padding: 0;
}
.entry-content a {
    color: var(--accent);
    text-decoration: underline;
}
.entry-content a:hover {
    color: var(--accent-hover);
}
.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 16px auto;
}
.entry-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Heading meta */
.heading-meta {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}
.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: -16px 0 20px;
}

/* Post tags */
.post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.post-tags .tag {
    font-size: 11px;
    padding: 2px 8px;
    background: #f5f5f5;
    color: var(--text-muted);
    border-radius: 2px;
}
