/* 小红书风格瀑布流布局 */
.xhs-waterfall {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding: 0 4px;
    min-height: 200px;
}

.xhs-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.xhs-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.4s ease;
}

.xhs-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.xhs-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 城市按钮高亮效果 */
.city-btn.active {
    background: #e74c3c !important;
    color: white !important;
    border-color: #e74c3c !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* 筛选动画效果 */
.xhs-column {
    transition: all 0.3s ease;
}

.xhs-card {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态指示器 */
.loading-state {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-state.visible {
    display: block;
}

.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: loading 1.4s infinite ease-in-out both;
    background: #e74c3c;
    border-radius: 50%;
    display: inline-block;
    height: 6px;
    margin: 0 2px;
    width: 6px;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1);
    }
}

/* 图片容器 - 四个角都有圆角 */
.xhs-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 133%;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 6px;
}

.xhs-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 6px;
}

.xhs-card:hover .xhs-image {
    transform: scale(1.03);
}

.xhs-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 6px;
}

.xhs-card:hover .xhs-image-overlay {
    opacity: 1;
}

.view-details {
    color: white;
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(231, 76, 60, 0.9);
    border-radius: 12px;
    font-size: 11px;
}

/* 内容区域 - 彻底解决间距问题 */
.xhs-content {
    padding: 6px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.xhs-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: auto;
    height: auto;
}

.xhs-meta {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.xhs-city {
    background: #e74c3c;
    color: white;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
}

/* 城市筛选 */
.city-filter {
    margin-bottom: 15px;
    padding: 12px 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.city-filter h2 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    padding: 0 4px;
}

.city-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.city-btn {
    padding: 5px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    color: #666;
    transition: all 0.2s ease;
}

.city-btn.active, .city-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin-top: 20px;
    padding: 12px 0;
}

.load-more-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.load-more-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图片加载优化 */
.xhs-image {
    transition: opacity 0.3s ease;
}

.xhs-image:not([src]) {
    opacity: 0;
}

.xhs-image.loaded {
    opacity: 1;
}

/* 无结果提示样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
}

.no-results-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.show-all-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.show-all-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .xhs-waterfall {
        gap: 6px;
        padding: 0 3px;
    }
    
    .xhs-column {
        gap: 6px;
    }
    
    .xhs-content {
        padding: 5px 6px 6px 6px;
    }
    
    .xhs-title {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .xhs-city {
        padding: 1px 5px;
        font-size: 9px;
    }
    
    .city-filter {
        padding: 10px 6px;
        margin: 0 4px 15px 4px;
    }
    
    .city-buttons {
        gap: 4px;
    }
    
    .city-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .load-more-btn {
        padding: 7px 16px;
        font-size: 12px;
    }
    
    .no-results {
        padding: 30px 15px;
        margin: 15px 0;
    }
    
    .no-results-content p {
        font-size: 14px;
    }
    
    .show-all-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 320px) {
    .xhs-waterfall {
        flex-direction: column;
        padding: 0 2px;
    }
    
    .xhs-column {
        width: 100%;
    }
    
    .xhs-content {
        padding: 4px 5px 5px 5px;
    }
    
    .xhs-title {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .xhs-waterfall {
        gap: 10px;
        padding: 0 8px;
    }
    
    .xhs-column {
        gap: 10px;
    }
    
    .xhs-title {
        font-size: 14px;
    }
    
    .xhs-city {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .city-filter {
        padding: 15px 12px;
    }
}

@media (min-width: 1024px) {
    .xhs-waterfall {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0 10px;
    }
    
    .xhs-column {
        display: contents;
    }
}

/* 主要内容区域调整 */
.content-section {
    padding: 0 5px;
}

main {
    padding: 0 3px;
}

/* 加载状态 */
.loading-indicator {
    text-align: center;
    padding: 25px 12px;
    color: #666;
    font-size: 13px;
}