/* Blog Public Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.logo span { color: var(--primary); }

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
}

.main-nav a:hover { color: var(--text); }

/* Mobile menu button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-light);
}

/* Section */
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Post Cards */
.posts-grid {
    padding: 40px 0;
}

.post-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.post-cover img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.post-body {
    padding: 20px;
}

.post-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-body h3 a { color: var(--text); }
.post-body h3 a:hover { color: var(--primary); }

.post-summary {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.post-tags {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Blog List */
.blog-list {
    padding: 40px 0;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 32px;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post-item {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.post-item:hover { border-color: var(--primary); }

.post-item h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--primary); }

/* Post Detail */
.post-detail {
    padding: 40px 0;
    max-width: 760px;
    margin: 0 auto;
}

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

.post-header h1 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
}

.post-content {
    font-size: 17px;
    line-height: 1.8;
}

.post-content p { margin-bottom: 20px; }
.post-content h2 { font-size: 24px; margin: 32px 0 16px; }
.post-content h3 { font-size: 20px; margin: 24px 0 12px; }
.post-content img { max-width: 100%; border-radius: var(--radius); margin: 20px 0; }
.post-content code { background: var(--bg-light); padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.post-content pre { background: var(--bg-light); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 20px 0; }
.post-content blockquote { border-left: 4px solid var(--primary); padding-left: 16px; color: var(--text-light); margin: 20px 0; }

.post-cover-large {
    margin-bottom: 32px;
}

.post-cover-large img {
    width: 100%;
    border-radius: var(--radius);
}

.post-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.back-link {
    color: var(--text-light);
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.pagination a {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pagination a:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.page-info { color: var(--text-light); font-size: 14px; }

/* Home Actions */
.home-actions {
    text-align: center;
    padding: 40px 0;
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

.footer-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a { color: var(--text-light); }
.footer-links a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    body { overflow-x: hidden; max-width: 100vw; }

    /* Mobile navigation */
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
        gap: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    .main-nav.open { display: flex; }
    .main-nav a { font-size: 15px; padding: 8px 0; }

    .hero { padding: 40px 0 32px; }
    .hero h1 { font-size: 26px; line-height: 1.3; }
    .hero-sub { font-size: 15px; }

    .post-cards { grid-template-columns: 1fr; gap: 16px; }

    .site-header .container { height: 52px; position: relative; }
    .logo { font-size: 17px; }

    .container { padding: 0 16px; }

    .page-title { font-size: 22px; margin-bottom: 20px; }

    .post-item { padding: 16px; }
    .post-item h2 { font-size: 17px; line-height: 1.4; }
    .post-item .post-summary { font-size: 14px; -webkit-line-clamp: 3; }

    .post-detail { padding: 20px 0; }
    .post-header h1 { font-size: 22px; line-height: 1.3; }
    .post-content { font-size: 15px; line-height: 1.8; }
    .post-content img { margin: 16px 0; border-radius: 6px; }
    .post-content pre { font-size: 13px; padding: 12px; overflow-x: auto; }

    .post-meta { flex-wrap: wrap; gap: 6px; font-size: 12px; }
    .post-tags { font-size: 11px; }

    .post-card .post-body { padding: 16px; }
    .post-card .post-body h3 { font-size: 16px; }
    .post-card .post-summary { font-size: 13px; }

    .pagination { flex-wrap: wrap; gap: 10px; padding: 16px 0; }
    .pagination a { padding: 8px 14px; font-size: 13px; }

    .section-title { font-size: 20px; }

    .site-footer { padding: 24px 0; }
    .footer-links { gap: 16px; flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .hero { padding: 32px 0 24px; }
    .hero h1 { font-size: 22px; }
    .hero-sub { font-size: 14px; }

    .main-nav { gap: 10px; }
    .main-nav a { font-size: 12px; }

    .page-title { font-size: 20px; }

    .post-item { padding: 14px; }
    .post-item h2 { font-size: 16px; }

    .post-header h1 { font-size: 20px; }
    .post-content { font-size: 15px; }
    .post-content h2 { font-size: 19px; }
    .post-content h3 { font-size: 17px; }

    .post-card .post-body { padding: 14px; }
    .post-card .post-body h3 { font-size: 15px; }

    .btn-primary { padding: 10px 20px; font-size: 14px; }

    .site-header .container { height: 48px; }
    .logo { font-size: 16px; }
}
