/* 搜索页 高保真样式 */
/* 页面特定变量已移至 base.css */

/* ============================================
   Header Styles
   ============================================ */

body {
    margin: 0 auto;    
    max-width: 500px;
}
.search-header {
    display: flex;
    align-items: center;
    padding: 0.83rem 1.38rem 0.83rem 1.04rem;
    gap: 1.04rem;
    height: 4.15rem;
}

@media screen and (orientation: landscape) {
    .main-container {
        padding: 0;
    }
}

.search-header .back-button {
    position: static !important;
    top: auto !important;
    transform: none !important;
    left: auto !important;
    width: 2.08rem;
    height: 2.08rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.back-button img {
    width: 2.08rem;
    height: 2.08rem;
}

.search-input-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 0.083rem solid var(--accent-color-orange);
    border-radius: 1.55rem;
    padding: 0 1.33rem;
    height: 3.11rem;
}

.search-input-icon {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
}

.search-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-size: 1.21rem;
    color: var(--text-color-light);
}

.search-input::placeholder {
    color: var(--text-color-light);
}

.search-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.6rem 1.33rem;
    border-radius: 1.55rem;
    font-size: 1.21rem;
    font-weight: 600;
    color: var(--accent-color-light);
    text-decoration: none;
}

/* ============================================
   Hot Games Section Styles
   ============================================ */
.hot-games-section {
    padding: 0 1.04rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 热门推荐 标题行（主题化文字标题，配色见 search_anime.css） */
.hot-games-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.42rem 0.17rem 0.9rem;
}
.hot-games-title-icon {
    width: 1.66rem;
    height: 1.66rem;
    flex-shrink: 0;
}
.hot-games-title-text {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.hot-games-title-tag {
    flex-shrink: 0;
    font-size: 0.83rem;
    font-weight: 600;
    padding: 0.17rem 0.58rem;
    border-radius: 0.66rem;
}
.hot-games-title-line {
    flex: 1;
    height: 1px;
}

/* 无数据占位 —— 居中、弱化提示文字（主题中性灰，token 驱动） */
.hot-games-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.66rem;
    text-align: center;
}

.hot-games-empty-text {
    margin: 0;
    font-size: 1.21rem;
    line-height: 1.5;
    color: var(--text-color-light);
}

.hot-games-list {
    list-style: none;
    margin: 0;
    padding: 0.042rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: linear-gradient(180deg, rgba(249, 100, 50, 0.06) 2%, rgba(249, 100, 50, 0) 98%);                                                                
    border: 0.083rem solid var(--border-light-orange);
    border-radius: 0.69rem;
}

.hot-game-item {
    display: flex;
    align-items: center;
    padding: 0.9rem 0.83rem;
}

.hot-game-icon {
    width: 4.98rem;
    height: 4.98rem;
    border-radius: 0.6rem;
    border: 0.083rem solid var(--border-light-gray);
    margin-right: 0.9rem;
    flex-shrink: 0;
    object-fit: cover;
}

.hot-game-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hot-game-name {
    margin: 0;
    font-size: 1.412rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: normal;
}

.hot-game-cat {
    margin: 0;
    font-size: 1.08rem;
    color: var(--text-color-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.hot-game-trial-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 4rem;
    height: 2.2rem;
    padding: 0 1rem;
    background-color: var(--accent-color-orange);
    color: var(--text-color-white);
    font-size: 0.95rem;
    border-radius: 1.295rem;
    flex-shrink: 0;
    margin-left: 1rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.hot-game-trial-btn:hover {
    background-color: var(--accent-color-orange-dark, #e55a00);
}

/* ============================================
   Search State Styles
   ============================================ */
.loading-item, .no-results-item, .error-item {
    text-align: center;
    padding: 3.32rem 1.66rem;
}

.loading-text, .no-results-text, .error-text {
    color: #666;
    font-size: 1.33rem;
    margin: 0;
}

.loading-text {
    color: #007bff;
}

.error-text {
    color: #dc3545;
}

/* ============================================
   Search Results Section Styles
   ============================================ */
.search-results-section {
    padding: 1.5rem 1.04rem 1.21rem;
    background-color: #fff;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-results-title {
    font-size: 1.329rem; /* 16px / 12.037 */
    font-weight: 700;
    color: #333;
    margin: 0 0 0.664rem 0; /* 8px / 12.037 */
    line-height: 1.2;
}

.search-summary {
    background-color: #F2F4F7;
    border: 0.083rem solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.664rem 1.329rem 0.664rem 0.664rem; /* 8px 16px 8px 8px / 12.037 */
    box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.05);
    font-size: 1.1rem;
    color: #222426;
    text-align: left;
    line-height: 1.4;
    display: inline-block;
    width: auto;
    max-width: 100%;
}

.search-keyword {
    color: #ff7a1a;
    font-weight: 600;
}

.search-count {
    color: #ff7a1a;
    font-weight: 600;
}


.search-results-list {
    list-style: none;
    margin-top: 0.664rem; /* 8px / 12.037 */
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    transition: box-shadow 0.2s ease;
}

.search-result-item:hover {
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.1);
}

.search-result-icon {
    width: 5.562rem; /* 67px / 12.037 */
    height: 5.562rem; /* 67px / 12.037 */
    border-radius: 0.6rem;
    border: 0.083rem solid #e9ecef;
    margin-right: 1rem;
    flex-shrink: 0;
    object-fit: cover;
}

.search-result-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.search-result-name {
    font-size: 1.412rem; /* 17px / 12.037 */
    font-weight: 400;
    color: #222426;
    margin: 0;
    line-height: 1.3;
}

.search-result-category {
    font-size: 1.080rem; /* 13px / 12.037 */
    color: #616366;
    margin: 0;
    line-height: 1.2;
}

.search-result-play-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 4rem;
    height: 2.2rem;
    background: linear-gradient(135deg, #B47CFF 0%, #FF8FB1 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    border: 0;
    border-radius: 1.295rem; /* 15.6px / 12.037 */
    box-shadow: 0 0.25rem 0.7rem rgba(180, 124, 255, 0.30);
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.search-result-play-btn:hover {
    filter: brightness(0.97);
    color: #fff;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (orientation: landscape) {
    .hot-games-section {
        max-width: 53.15rem;
        margin: 0 auto;
    }
    
    .search-results-section {
        max-width: 53.15rem;
        margin: 0 auto;
    }
}
.back-button img {
    margin-left: 0;
}

@media screen and (max-width: 375px) {
    .main-container {
        padding:0;
    }
}

/* ============================================
   Dark Theme Overrides (html.app-dark)
   Task 4 – 搜索页深色精练
   ============================================ */

/* State text: muted (no-results) */
html.app-dark .loading-text,
html.app-dark .no-results-text,
html.app-dark .error-text {
    color: var(--hd-text-3);
}
/* Override muted-only; semantic blue (.loading-text) and red (.error-text)
   are re-asserted below to restore their semantic meaning after the above */
html.app-dark .loading-text {
    color: #4da3ff; /* keep semantic blue, lightened for dark bg */
}
html.app-dark .error-text {
    color: #f28b82; /* keep semantic red, lightened for dark bg */
}

/* Search results section background */
html.app-dark .search-results-section {
    background-color: var(--hd-surface);
}

/* Results title */
html.app-dark .search-results-title {
    color: var(--hd-text);
}

/* Search summary card */
html.app-dark .search-summary {
    background-color: var(--hd-elevated);
    border-color: var(--hd-border);
    color: var(--hd-text);
    box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.4);
}

/* Orange accent keywords (keep as accent token) */
html.app-dark .search-keyword,
html.app-dark .search-count {
    color: var(--hd-accent);
}

/* Result item hover shadow */
html.app-dark .search-result-item:hover {
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.4);
}

/* Result icon border */
html.app-dark .search-result-icon {
    border-color: var(--hd-border);
}

/* Result name (primary text) */
html.app-dark .search-result-name {
    color: var(--hd-text);
}

/* Result category (secondary text) */
html.app-dark .search-result-category {
    color: var(--hd-text-2);
}

/* Play button —— 品牌粉紫渐变（与全站去玩 CTA 统一） */
html.app-dark .search-result-play-btn {
    background: linear-gradient(135deg, #B47CFF 0%, #FF8FB1 100%);
    color: #fff;
    border-color: transparent;
}
html.app-dark .search-result-play-btn:hover {
    filter: brightness(0.97);
    border-color: transparent;
    color: #fff;
}

/* Hot games list: orange-tinted gradient → 深色抬升面（token 驱动，避免未定义的 --hd-accent-rgb） */
html.app-dark .hot-games-list {
    background: var(--hd-elevated);
    border-color: var(--hd-border);
}

/* Hot game icon border */
html.app-dark .hot-game-icon {
    border-color: var(--hd-border);
}

/* Hot game name text */
html.app-dark .hot-game-name {
    color: var(--hd-text);
}

/* SKIPPED (white-on-colored — intentional):
   .hot-game-trial-btn  background-color: var(--accent-color-orange) + color: white
   .hot-game-trial-btn:hover  background-color: #e55a00 (dark orange, white text) */

/* ============================================================
   搜索页主题统一由 search_anime.css（玫红夜空）接管，且在本文件之后加载、
   通篇 !important 覆盖。原先此处的「强制浅色薄荷」整套覆盖与玫红夜空冲突，
   已移除，避免两套皮打架。本页配色见 search_anime.css。
   ============================================================ */
