/* 搜索页面特定样式 */

/* 顶部搜索栏 */
.search-header {
    height: 56px;
    background: linear-gradient(135deg, #FF4D4F, #FF7875);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
}

.back-btn {
    color: white;
    font-size: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.search-input-container {
    flex: 1;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.search-icon {
    color: #999;
    font-size: 18px;
    margin-right: 6px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background: transparent;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    color: white;
    font-size: 14px;
    margin-left: 12px;
    cursor: pointer;
}

/* 搜索历史区域 */
.search-history {
    padding: 15px;
}

.section-title {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-history {
    font-size: 12px;
    color: #999;
}

.history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-tag {
    background-color: #f0f0f0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

/* 热门搜索区域 */
.hot-search {
    padding: 5px 15px 15px;
}

.hot-tags {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.hot-tag {
    background-color: rgba(255, 77, 79, 0.1);
    color: #FF4D4F;
    border-radius: 16px;
    padding: 6px 0;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

/* 搜索结果区域 */
.search-results {
    padding: 16px 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Tablet layout: 3 columns */
@media (min-width: 768px) {
    .search-results {
        grid-template-columns: repeat(3, 1fr);
        padding: 20px;
        gap: 16px;
    }
}

/* PC layout: auto-fill columns */
@media (min-width: 1200px) {
    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

/* 加载状态 */
.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* 错误信息 */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #ff4757;
    font-size: 16px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* 无结果提示 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* 加载更多按钮 */
.load-more-btn {
    grid-column: 1 / -1;
    margin: 20px auto;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: 25px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    max-width: 200px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.load-more-btn:active {
    transform: translateY(0);
}

.result-item {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.result-item:active {
    transform: scale(0.98);
}

.result-image {
    width: 100%;
    height: 0;
    padding-bottom: 152%; /* 保持861:1308的比例 */
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
}

.result-image-1 {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
}

.result-image-2 {
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
}

.result-image-3 {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
}

.result-image-4 {
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
}

.result-image-5 {
    background: linear-gradient(135deg, #d4fc79, #96e6a1);
}

.result-image-6 {
    background: linear-gradient(135deg, #84fab0, #8fd3f4);
}

.result-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: radial-gradient(circle, #fff 1px, transparent 1px);
    background-size: 10px 10px;
}

.price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #ff4d4f;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.result-info {
    padding: 8px 10px;
}

.result-title {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
    gap: 4px;
}

.result-tag {
    background-color: rgba(255, 77, 79, 0.1);
    color: #FF4D4F;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

/* 懒加载相关样式 */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.lazy-image {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lazy-image.loading {
    opacity: 0.5;
}

.lazy-image.loaded {
    opacity: 1;
}

.image-loading {
    z-index: 1;
}

/* 图片加载失败样式 */
.result-image img[src=""] {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 状态切换 */
.search-state-1 {
    display: block;
}

.search-state-2 {
    display: none;
}