/* ==================== 主页样式 ==================== */

/* 搜索框容器 */
.home-search-container {
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.home-search-box {
    position: relative;
    width: 100%;
}

.home-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--white);
    cursor: pointer;
}

.home-search-input:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.home-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    cursor: text;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--primary-color);
    pointer-events: none;
}

/* 瀑布流容器 */
.waterfall-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.waterfall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* 物品卡片 */
.item-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.item-image-container {
    position: relative;
    width: 100%;
    padding-top: 75%;
    /* 4:3 宽高比 */
    overflow: hidden;
    background-color: var(--background-color);
}

.item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image {
    transform: scale(1.05);
}

.item-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}

.item-detail-icon {
    font-size: 14px;
    color: var(--primary-color);
}

.item-detail-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 加载更多 */
.load-more-container {
    text-align: center;
    padding: 30px 0;
}

.load-more-btn {
    padding: 12px 32px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

.load-more-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.empty-description {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
}

.empty-action {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.empty-action:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

/* 加载骨架屏 */
.skeleton-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.skeleton-image {
    width: 100%;
    padding-top: 75%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-info {
    padding: 16px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 1024px) {
    .waterfall-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 14px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .home-search-container {
        margin-bottom: 20px;
        padding: 0 12px;
    }

    .home-search-input {
        padding: 14px 45px 14px 16px;
        font-size: 15px;
    }

    .waterfall-container {
        padding: 0 12px;
    }

    .waterfall-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .item-info {
        padding: 12px;
    }

    .item-name {
        font-size: 15px;
    }

    .item-detail {
        font-size: 13px;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .empty-icon {
        font-size: 60px;
    }

    .empty-title {
        font-size: 18px;
    }

    .empty-description {
        font-size: 14px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .waterfall-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}