/* 隐藏滚动条但保持滚动功能 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* 搜索页面容器 */
.search-page-container {
    min-height: 100vh;
    background-color: #f8f8f8;
    padding-bottom: 30px;
}

/* 顶部搜索栏 */
.search-header-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #f5f5f5;
}

.back-btn:active {
    background-color: #e8e8e8;
}

.search-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 25px;
    padding: 10px 16px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.search-input-box:focus-within {
    background-color: #ffffff;
    border-color: #ff3366;
}

.search-input-box .search-icon {
    margin-right: 10px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    margin-left: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff3366, #ff6b9d);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-btn:hover {
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.search-btn:active {
    transform: scale(0.95);
}

/* 搜索区块 */
.search-section {
    padding: 20px 16px;
    background-color: #ffffff;
    margin-bottom: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.title-icon {
    margin-right: 8px;
}

.clear-btn {
    font-size: 14px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}

.clear-btn:hover {
    color: #ff3366;
}

/* 搜索历史标签 */
.history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.history-tag-item {
    display: flex;
    align-items: center;
    padding: 8px 12px 8px 16px;
    background-color: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-tag-item:hover {
    background-color: #ff3366;
}

.history-tag-item:hover .history-tag {
    color: #ffffff;
}

.history-tag-item:hover .history-close {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.3);
}

.history-tag-item.hidden {
    display: none;
}

.history-tag-item.hidden.show {
    display: flex;
}

.history-tag {
    font-size: 14px;
    color: #666;
    transition: color 0.3s;
}

.history-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    font-size: 14px;
    color: #999;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.history-close:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* 展开按钮 */
.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.expand-btn:hover {
    color: #ff3366;
}

.expand-btn svg {
    transition: transform 0.3s;
}

.expand-btn.expanded svg {
    transform: rotate(180deg);
}

.expand-btn:hover {
    color: #ff3366;
}

.expand-btn svg {
    transition: transform 0.3s;
}

.expand-btn.expanded svg {
    transform: rotate(180deg);
}

.history-tag:active {
    transform: scale(0.95);
}

/* 热门搜索列表 */
.hot-search-list {
    display: flex;
    flex-direction: column;
}

.hot-search-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 8px;
}

.hot-search-item:hover {
    background-color: #f8f8f8;
}

.hot-search-item:active {
    background-color: #f0f0f0;
}

.hot-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #ff6b35, #ff4400);
    color: #ffffff;
}

.rank-2 {
    background: linear-gradient(135deg, #ff9500, #ff7700);
    color: #ffffff;
}

.rank-3 {
    background: linear-gradient(135deg, #ffb800, #ff9500);
    color: #ffffff;
}

.rank-other {
    background-color: #f0f0f0;
    color: #999;
}

.hot-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.hot-badge {
    padding: 2px 8px;
    background-color: #ffe4e9;
    color: #ff3366;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

/* 刷新按钮 */
.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background-color: #f5f5f5;
}

.refresh-btn:active {
    background-color: #e8e8e8;
}

.refresh-btn.spinning svg {
    animation: spin 0.5s linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 猜你想搜索网格 */
.guess-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.guess-item {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.guess-item::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.1), rgba(255, 107, 157, 0.1));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

.guess-item:hover {
    transform: translateY(-8px) scale(1.02);
}

.guess-item:hover::before {
    opacity: 1;
}

.guess-item:active {
    transform: scale(0.95);
}

.guess-cover {
    position: relative;
    width: 100%;
    padding-top: 133%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.guess-item:hover .guess-cover img {
    transform: scale(1.05);
}

.free-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ff3366, #ff6b9d);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    z-index: 10;
}

.vip-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #333;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    z-index: 10;
}

.guess-name {
    margin-top: 8px;
    font-size: 13px;
    color: #333;
    text-align: center;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 36px;
}

/* ========== PC端适配 ========== */
@media screen and (min-width: 1024px) {
    .search-page-container {
        max-width: 800px;
        margin: 0 auto;
    }

    .search-header-bar {
        padding: 16px 24px;
    }

    .search-input-box {
        padding: 12px 20px;
    }

    .search-input {
        font-size: 16px;
    }

    .search-btn {
        padding: 10px 24px;
        font-size: 15px;
    }

    .search-section {
        padding: 24px;
    }

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

    .history-tag {
        padding: 10px 20px;
        font-size: 15px;
    }

    .hot-search-item {
        padding: 14px 0;
    }

    .hot-text {
        font-size: 16px;
    }

    .guess-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* 平板适配 */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .guess-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* 小屏幕适配 */
@media screen and (max-width: 374px) {
    .guess-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}
