.unsplash-home {
    min-height: 100vh;
    padding: 20px 0;
}

.unsplash-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
 * 首页最新文章列表（纯文字）
 * ============================================ */
.home-latest-posts {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

/* 三个卡片容器 - 一行三列 */
.latest-posts-list-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.latest-posts-category {

    box-sizing: border-box;
    overflow: hidden;
}

.latest-posts-category:last-child {
    margin-bottom: 0;
}

.latest-posts-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.latest-posts-title a {
    color: #333;
    text-decoration: none;
}

.latest-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}


.latest-posts-item {
    padding: 0;
    margin-bottom: 8px;
}

.latest-posts-item:last-child {
    margin-bottom: 0;
}

.latest-posts-item a {
    display: block;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
 * 图片展示区域
 * ============================================ */
.unsplash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    width: 100%;
    grid-auto-rows: min-content;
    grid-auto-flow: dense;
}

.unsplash-item {
    position: relative;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: unsplashFadeIn 0.6s ease forwards;
}

.unsplash-item:nth-child(3n+1) { grid-row: span 2; }
.unsplash-item:nth-child(5n+2) { grid-row: span 3; }
.unsplash-item:nth-child(7n+3) { grid-row: span 2; }

.unsplash-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.unsplash-item:nth-child(1) { animation-delay: 0.1s; }
.unsplash-item:nth-child(2) { animation-delay: 0.2s; }
.unsplash-item:nth-child(3) { animation-delay: 0.3s; }
.unsplash-item:nth-child(4) { animation-delay: 0.4s; }
.unsplash-item:nth-child(5) { animation-delay: 0.5s; }
.unsplash-item:nth-child(6) { animation-delay: 0.6s; }
.unsplash-item:nth-child(7) { animation-delay: 0.7s; }
.unsplash-item:nth-child(8) { animation-delay: 0.8s; }
.unsplash-item:nth-child(9) { animation-delay: 0.9s; }
.unsplash-item:nth-child(10) { animation-delay: 1.0s; }

.unsplash-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.unsplash-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    min-height: 200px;
    transition: transform 0.5s ease;
}

.unsplash-item:hover .unsplash-image {
    transform: scale(1.05);
}

.unsplash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unsplash-item:hover .unsplash-overlay {
    opacity: 1;
}

.unsplash-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: #fff;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.unsplash-item:hover .unsplash-content {
    opacity: 1;
    transform: translateY(0);
}

.unsplash-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.unsplash-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.unsplash-item:hover .unsplash-title a {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.unsplash-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding: 20px;
}

.unsplash-pagination .page-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.unsplash-pagination .page-navigator li {
    display: inline-block;
    margin: 0;
}

.unsplash-pagination .page-navigator a,
.unsplash-pagination .page-navigator span {
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.unsplash-pagination .page-navigator a:hover {
    background: #e0e0e0;
}

.unsplash-pagination .page-navigator .current a,
.unsplash-pagination .page-navigator .current span {
    background: #333;
    color: #fff;
}

.unsplash-no-content {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    font-size: 18px;
}

.unsplash-no-content svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

@keyframes unsplashFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.unsplash-home .simple-subcats {
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.unsplash-home .simple-subcats .label {
    background: #333;
    color: #fff;
}

.unsplash-home .simple-subcats a {
    color: #666;
    border-bottom-color: #eee;
}

.unsplash-home .simple-subcats a:hover,
.unsplash-home .simple-subcats a.current {
    color: #333;
    border-bottom-color: #333;
}

.unsplash-home .simple-subcats a.current {
    font-weight: bold;
}

.unsplash-load-more {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
}

.unsplash-load-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.unsplash-load-btn:hover {
    background: #555;
    transform: translateY(-2px);
}

.unsplash-load-btn span {
    position: relative;
    z-index: 1;
}

.unsplash-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
}

.unsplash-loading svg {
    width: 100%;
    height: 100%;
    animation: rotate 2s linear infinite;
}

.unsplash-loading circle {
    stroke: #333;
    stroke-width: 4;
    fill: none;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .unsplash-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    /* 平板端：三列变两列 */
    .latest-posts-list-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    #main {
        padding: 10px 0;
    }

    /* 隐藏三个分类调用 */
    .home-latest-posts {
        display: none;
    }

    .unsplash-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .unsplash-title {
        font-size: 14px;
    }

    .unsplash-content {
        padding: 12px;
    }

    .unsplash-load-btn {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* 移动端：单列布局 */
    .latest-posts-list-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .latest-posts-category {
        padding: 15px;
    }

    .latest-posts-title {
        font-size: 16px;
    }

    .latest-posts-item a {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .unsplash-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .unsplash-title {
        font-size: 13px;
    }

    .unsplash-load-btn {
        padding: 10px 24px;
        font-size: 13px;
    }

    .latest-posts-title {
        font-size: 15px;
    }

    .latest-posts-item a {
        font-size: 12px;
    }
}
