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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    background-color: #fff;
}

.header {
    padding: 24px 24px;
    border-bottom: 1px solid #eee;
}

.header-content {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.site-title a {
    color: #000;
    text-decoration: none;
}

.site-title a:hover {
    color: #666;
}

.site-description {
    font-size: 14px;
    color: #999;
    font-weight: 400;
    margin: 4px 0 0 0;
}

.site-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.site-nav li {
    display: inline;
}

.site-nav a {
    color: #666;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s;
}

.site-nav a:hover {
    color: #000;
}

.main {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

.quote-section {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
}

.quote-text {
    font-size: 16px;
    color: #999;
    line-height: 1.8;
    margin: 0;
    font-style: italic;
}

.post-container {
    display: flex;
    gap: 40px;
}

.post {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

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

.post-date {
    font-size: 14px;
    color: #bbb;
    margin-bottom: 16px;
    display: block;
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.post-title a {
    color: #000;
    text-decoration: none;
}

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

.post-thumbnails {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-thumbnails a {
    flex: 1;
    min-width: calc(50% - 4px);
    max-width: calc(50% - 4px);
}

.post-thumbnails img {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

.post-thumbnails a:first-child:nth-last-child(1) {
    min-width: 100%;
    max-width: 100%;
}

.post-thumbnails a:first-child:nth-last-child(2),
.post-thumbnails a:first-child:nth-last-child(2) ~ a {
    min-width: calc(50% - 4px);
    max-width: calc(50% - 4px);
}

.post-thumbnails a:first-child:nth-last-child(3),
.post-thumbnails a:first-child:nth-last-child(3) ~ a {
    min-width: calc(33.333% - 5.333px);
    max-width: calc(33.333% - 5.333px);
}

.post-thumbnails a:first-child:nth-last-child(n+4),
.post-thumbnails a:first-child:nth-last-child(n+4) ~ a {
    min-width: calc(50% - 4px);
    max-width: calc(50% - 4px);
}

.post-content {
    font-size: 17px;
    color: #444;
    line-height: 1.9;
    margin-bottom: 20px;
}

.post-content p {
    margin-bottom: 16px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 24px 0;
    border-radius: 4px;
    cursor: zoom-in;
}

.post-content a {
    color: #000;
    text-decoration: underline;
}

.post-content a:hover {
    color: #666;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
}

.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 22px; }
.post-content h3 { font-size: 20px; }

.post-meta {
    font-size: 14px;
    color: #999;
}

.post-meta a {
    color: #666;
    text-decoration: none;
}

.post-meta a:hover {
    color: #000;
}

.read-time {
    display: inline;
}

.pagination {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 60px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    text-decoration: none;
    color: #666;
    font-size: 16px;
}

.pagination a:hover {
    color: #000;
}

.pagination .current {
    color: #000;
    font-weight: 600;
}

.post-full {
    margin-bottom: 60px;
    flex: 1;
    min-width: 0;
    max-width: 700px;
}

.post-full .post-header {
    margin-bottom: 40px;
}

.post-full .post-date {
    font-size: 15px;
    color: #999;
    margin-bottom: 20px;
}

.post-full .post-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 20px;
}

.post-full .post-tags {
    font-size: 15px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    line-height: 1.8;
}

.post-full .post-tags span {
    color: #999;
}

.post-full .post-tags a {
    color: #666;
    text-decoration: none;
}

.post-full .post-tags a:hover {
    color: #000;
}

.post-full .post-content {
    font-size: 18px;
    line-height: 2;
}

.post-full .post-content h2 {
    font-size: 22px;
    border-left: 3px solid #000;
    padding-left: 12px;
}

.post-full .post-content h3 {
    font-size: 20px;
}

.post-full .post-content p {
    margin-bottom: 20px;
}

.post-full .post-content img {
    margin: 32px 0 8px 0;
}

.image-group {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}

.image-group img {
    margin: 0;
    border-radius: 4px;
    cursor: zoom-in;
    width: 100%;
    height: auto;
    display: block;
}

.image-group .image-item {
    display: flex;
    flex-direction: column;
}

.image-group .image-caption {
    font-size: 14px;
    color: #999;
    margin-top: 1px;
    line-height: 1.6;
    text-align: center;
}

.image-group:has(.image-item:first-child:nth-last-child(1)) {
    grid-template-columns: 1fr;
}

.image-group:has(.image-item:first-child:nth-last-child(2)) {
    grid-template-columns: repeat(2, 1fr);
}

.image-group:has(.image-item:first-child:nth-last-child(3)) {
    grid-template-columns: repeat(3, 1fr);
}

.image-group:has(.image-item:first-child:nth-last-child(n+4)) {
    grid-template-columns: repeat(2, 1fr);
}

.image-caption {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.back-to-top {
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 40px;
    right: 40px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top:hover {
    color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.has-toc {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #888;
}

.post-nav {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.post-nav a {
    color: #666;
    text-decoration: none;
    font-size: 16px;
}

.post-nav a:hover {
    color: #000;
}

.footer {
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: 60px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-nav li {
    display: inline;
}

.footer-nav a {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #000;
}

.footer-info p {
    font-size: 14px;
    color: #bbb;
}

.footer-info a {
    color: #999;
    text-decoration: none;
}

.footer-info a:hover {
    color: #666;
}

.comments {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.comment-list {
    list-style: none;
    margin-bottom: 30px;
}

.comment-list li {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 8px;
}

.comment-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
}

.comment-content {
    font-size: 16px;
    line-height: 1.8;
}

.comment-form {
    margin-top: 30px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form button {
    padding: 12px 24px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.comment-form button:hover {
    background: #333;
}

.slideshow-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.slideshow-overlay.show {
    display: flex;
}

.slideshow-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.slideshow-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.slideshow-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 14px;
    opacity: 0.8;
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.slideshow-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.slideshow-nav.prev {
    left: -60px;
}

.slideshow-nav.next {
    right: -60px;
}

.slideshow-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.slideshow-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.slideshow-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    border: none;
}

.slideshow-indicator.active {
    background: #fff;
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .header {
        padding: 20px 16px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .site-nav ul {
        gap: 16px;
    }
    
    .site-title {
        font-size: 22px;
    }
    
    .main {
        padding: 0 16px;
    }
    
    .post-container {
        flex-direction: column;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
    
    .post-title {
        font-size: 20px;
    }
    
    .post-full .post-title {
        font-size: 26px;
    }
    
    .post-content {
        font-size: 16px;
    }
    
    .post-full .post-content {
        font-size: 17px;
    }
    
    .image-group img {
        width: 100% !important;
    }
    
    .slideshow-nav.prev {
        left: 10px;
    }
    
    .slideshow-nav.next {
        right: 10px;
    }
    
    .theme-toggle {
        margin-left: 8px;
    }
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 16px;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s ease;
}

.icon-moon {
    display: none;
}

body.dark-mode .icon-sun {
    display: none;
}

body.dark-mode .icon-moon {
    display: block;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .header {
    border-bottom-color: #333;
    background-color: #1a1a1a;
}

body.dark-mode .site-title a {
    color: #fff;
}

body.dark-mode .site-title a:hover {
    color: #ccc;
}

body.dark-mode .site-description {
    color: #666;
}

body.dark-mode .site-nav a {
    color: #888;
}

body.dark-mode .site-nav a:hover {
    color: #fff;
}

body.dark-mode .theme-toggle {
    color: #888;
}

body.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .post {
    border-bottom-color: #333;
}

body.dark-mode .post-title a {
    color: #fff;
}

body.dark-mode .post-title a:hover {
    color: #ccc;
}

body.dark-mode .post-excerpt {
    color: #888;
}

body.dark-mode .post-tags a {
    color: #888;
}

body.dark-mode .post-nav a {
    color: #888;
}

body.dark-mode .post-nav a:hover {
    color: #fff;
}

body.dark-mode .pagination a {
    color: #888;
    border-color: #333;
}

body.dark-mode .pagination a:hover {
    color: #fff;
    border-color: #666;
}

body.dark-mode .pagination span {
    color: #666;
    border-color: #333;
}

body.dark-mode .footer {
    border-top-color: #333;
    color: #666;
}

body.dark-mode .footer a {
    color: #888;
}

body.dark-mode .footer a:hover {
    color: #fff;
}

body.dark-mode .back-to-top {
    background: #2a2a2a;
    color: #888;
}

body.dark-mode .back-to-top:hover {
    background: #3a3a3a;
    color: #fff;
}

body.dark-mode .image-caption {
    color: #888;
}

body.dark-mode .comments {
    border-top-color: #333;
}

body.dark-mode .comments-title {
    color: #fff;
}
