/* ============================================================
   Search v2 · 玫红夜空主题
   置于 search.css 之后, 用 !important 覆盖
   ============================================================ */

:root {
    --acg-bg-1: #2A0F1F;
    --acg-bg-2: #3A1228;
    --acg-bg-deep: #1A0610;
    --acg-surface: #C25578;
    --acg-surface-hi: #DC6E92;
    --acg-gold: #E8B79A;
    --acg-gold-light: #FFC09F;
    --acg-gold-soft: #FAD4C0;
    --acg-rose: #FF8FA3;
    --acg-rose-deep: #C44569;
    --acg-text-1: #FFF0E0;
    --acg-text-2: #E8B7A8;
    --acg-text-3: #C9A98C;
    --acg-border: rgba(255, 192, 159, 0.32);
    --acg-border-strong: rgba(255, 192, 159, 0.55);
}

/* —— 页面底色 —— */
html.app-dark,
html.app-dark body {
    background: var(--acg-bg-1) !important;
    color: var(--acg-text-1) !important;
}
html.app-dark .main-container {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--acg-text-1) !important;
}
html.app-dark body {
    background:
        radial-gradient(110% 45% at 50% 0%, rgba(255, 90, 160, 0.22) 0%, transparent 60%),
        radial-gradient(60% 35% at 92% 18%, rgba(255, 143, 181, 0.20) 0%, transparent 55%),
        radial-gradient(80% 40% at 30% 50%, rgba(200, 70, 115, 0.16) 0%, transparent 60%),
        radial-gradient(70% 38% at 95% 95%, rgba(130, 35, 65, 0.22) 0%, transparent 60%),
        linear-gradient(180deg, #1A0610 0%, #2A0F1F 30%, #3A1228 60%, #2A0F1F 90%, #1A0610 100%) !important;
}

/* —— 背景装饰 —— */
html.app-dark .main-container::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        url('/themes/simpleboot3/mobilepublic/assets/images/anime/rose.svg'),
        url('/themes/simpleboot3/mobilepublic/assets/images/anime/butterfly.svg'),
        url('/themes/simpleboot3/mobilepublic/assets/images/anime/moon.svg'),
        url('/themes/simpleboot3/mobilepublic/assets/images/anime/sparkle.svg');
    background-repeat: no-repeat;
    background-position: 94% 92%, 88% 35%, 92% 10%, 30% 25%;
    background-size: 44px, 26px, 36px, 18px;
    opacity: 0.42;
    animation: acgSearchFloat 16s ease-in-out infinite;
}
@keyframes acgSearchFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* —— 搜索头部 —— */
html.app-dark .search-header {
    background: transparent !important;
    position: relative;
    z-index: 1;
}
html.app-dark .search-header .back-button {
    background: rgba(58, 18, 40, 0.55) !important;
    border: 1px solid var(--acg-border) !important;
    border-radius: 50%;
    transition: transform 0.15s ease;
}
html.app-dark .search-header .back-button:active {
    transform: scale(0.93);
}
html.app-dark .search-header .back-button img {
    filter: brightness(0) invert(1) sepia(0.5) saturate(450%) hue-rotate(320deg) brightness(1.05);
    opacity: 0.95;
}
/* 输入框: 玻璃酒红 + 蜜桃金描边 */
html.app-dark .search-input-container {
    background: rgba(74, 42, 64, 0.72) !important;
    border: 1px solid var(--acg-gold-light) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(139, 44, 63, 0.32);
}
html.app-dark .search-input {
    background: transparent !important;
    color: var(--acg-text-1) !important;
    caret-color: var(--acg-rose);
}
html.app-dark .search-input::placeholder {
    color: var(--acg-text-2) !important;
    opacity: 0.75;
}
/* 搜索框放大镜 */
html.app-dark .search-input-icon {
    color: var(--acg-rose);
}
/* 搜索按钮 → 玫粉渐变胶囊 + 流光 */
html.app-dark .search-action {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FAD4C0 0%, #FF8FA3 55%, #C44569 100%) !important;
    color: #2D1018 !important;
    border: 1px solid rgba(244, 212, 168, 0.85);
    box-shadow: 0 4px 14px rgba(196, 69, 105, 0.5);
}
html.app-dark .search-action::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: translateX(-150%) skewX(-18deg);
    animation: acgShine 3.4s ease-in-out infinite;
}

/* —— 热门游戏区 —— */
html.app-dark .hot-games-section {
    background: transparent !important;
    position: relative;
    z-index: 1;
}
/* 标题行：火苗玫粉 + 玫金衬线字 + 渐隐分隔线 */
html.app-dark .hot-games-title-icon {
    color: var(--acg-rose);
    filter: drop-shadow(0 0 6px rgba(255, 143, 163, 0.55));
}
html.app-dark .hot-games-title-text {
    font-family: 'Noto Serif SC', 'Songti SC', serif;
    background: linear-gradient(90deg, #FFE0C0, #FF8FA3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 143, 163, 0.35));
}
html.app-dark .hot-games-title-tag {
    color: #2D1018;
    background: linear-gradient(135deg, #FFC09F, #FF8FA3);
    box-shadow: 0 2px 8px rgba(255, 143, 163, 0.4);
}
html.app-dark .hot-games-title-line {
    background: linear-gradient(90deg, rgba(255, 143, 163, 0.5), transparent);
}
/* 热搜榜名次：名次列所有行同宽(消除错位)；4+ 纯序号，前三名金属奖牌 */
html.app-dark .hot-games-list { counter-reset: hotrank; }
html.app-dark .hot-game-item::before {
    counter-increment: hotrank;
    content: counter(hotrank);
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    font-style: italic;
    color: var(--acg-text-3);
}
/* 前三名：金属奖牌（高光 + 描边 + 内阴影 + 辉光） */
html.app-dark .hot-game-item:nth-child(-n+3)::before {
    font-style: normal;
    font-size: 1.25rem;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
}
html.app-dark .hot-game-item:nth-child(1)::before {
    background: radial-gradient(circle at 32% 26%, #FFF6C0, #FFC23D 55%, #E89A12);
    color: #6B3B00;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.85),
        inset 0 -2px 3px rgba(150, 90, 0, 0.35),
        0 0 14px rgba(255, 196, 80, 0.7),
        0 2px 6px rgba(0, 0, 0, 0.35);
}
html.app-dark .hot-game-item:nth-child(2)::before {
    background: radial-gradient(circle at 32% 26%, #FFFFFF, #D7D9E3 55%, #A9ADBE);
    color: #444A5C;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(90, 90, 110, 0.3),
        0 0 12px rgba(220, 220, 235, 0.55),
        0 2px 6px rgba(0, 0, 0, 0.32);
}
html.app-dark .hot-game-item:nth-child(3)::before {
    background: radial-gradient(circle at 32% 26%, #FFE0B8, #E0915A 55%, #B5642E);
    color: #5A2E0E;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        inset 0 -2px 3px rgba(120, 60, 20, 0.3),
        0 0 12px rgba(224, 145, 90, 0.55),
        0 2px 6px rgba(0, 0, 0, 0.32);
}
/* 列表外框: 玫金渐变描边 + 深酒红玻璃面 + 投影 */
html.app-dark .hot-games-list {
    background:
        linear-gradient(180deg, rgba(58, 18, 40, 0.72), rgba(36, 12, 24, 0.82)) padding-box,
        linear-gradient(160deg, rgba(255, 192, 159, 0.55), rgba(255, 143, 163, 0.15) 40%, rgba(196, 69, 105, 0.35)) border-box !important;
    border: 1px solid transparent !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 30px rgba(26, 6, 16, 0.5) !important;
}
html.app-dark .hot-game-item {
    border-bottom: 1px solid var(--acg-border);
    transition: background 0.15s ease;
}
html.app-dark .hot-game-item:last-child {
    border-bottom: none;
}
html.app-dark .hot-game-item:hover {
    background: rgba(255, 192, 159, 0.08);
}
html.app-dark .hot-game-icon {
    border: 1.5px solid var(--acg-gold-light) !important;
    box-shadow: 0 0 8px rgba(255, 107, 138, 0.32);
    background: var(--acg-bg-2);
}
html.app-dark .hot-game-name {
    color: var(--acg-text-1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
html.app-dark .hot-game-cat {
    color: var(--acg-text-2) !important;
}
/* 试玩按钮: 原橙色 → 玫红/蜜桃 渐变 + 流光 */
html.app-dark .hot-game-trial-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FAD4C0 0%, #FF8FA3 60%, #C44569 100%) !important;
    color: #2D1018 !important;
    font-weight: 700 !important;
    border: 1px solid rgba(244, 212, 168, 0.85) !important;
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.45);
}
html.app-dark .hot-game-trial-btn:hover {
    background: linear-gradient(135deg, #FFD8C0 0%, #FFA0B5 60%, #D4567A 100%) !important;
}
/* 按钮流光（试玩 / 去玩 / 搜索 共用） */
html.app-dark .hot-game-trial-btn::after,
html.app-dark .search-result-play-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-150%) skewX(-18deg);
    animation: acgShine 3.4s ease-in-out infinite;
}
html.app-dark .search-result-play-btn {
    position: relative;
    overflow: hidden;
}
@keyframes acgShine {
    0% { transform: translateX(-150%) skewX(-18deg); }
    60%, 100% { transform: translateX(320%) skewX(-18deg); }
}

/* —— 空状态 —— */
html.app-dark .hot-games-empty-text {
    color: var(--acg-text-2) !important;
}

/* —— 搜索结果区 —— */
html.app-dark .search-results-section {
    background: transparent !important;
    background-color: transparent !important;
    position: relative;
    z-index: 1;
}
html.app-dark .search-results-title {
    color: var(--acg-text-1) !important;
    text-shadow: 0 2px 8px rgba(196, 69, 105, 0.45), 0 0 14px rgba(255, 143, 163, 0.25);
    font-family: 'Noto Serif SC', 'Songti SC', serif;
}

/* 搜索摘要 */
html.app-dark .search-summary {
    background: rgba(58, 18, 40, 0.5) !important;
    border: 1px solid var(--acg-border) !important;
    color: var(--acg-text-1) !important;
    box-shadow: 0 2px 8px rgba(139, 44, 63, 0.28) !important;
}
html.app-dark .search-keyword,
html.app-dark .search-count {
    color: var(--acg-gold-light) !important;
    text-shadow: 0 0 6px rgba(255, 192, 159, 0.45);
}

/* 结果列表 —— 深酒红玻璃面（与输入框/摘要框/热门列表同体系，不再用亮粉实色块） */
html.app-dark .search-result-item {
    background: linear-gradient(155deg, rgba(74, 42, 64, 0.78) 0%, rgba(48, 16, 36, 0.82) 100%) !important;
    border-radius: 16px !important;
    border: 1px solid var(--acg-border) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(26, 6, 16, 0.45), inset 0 1px 0 rgba(255, 192, 159, 0.12) !important;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
html.app-dark .search-result-item:hover {
    transform: translateY(-2px);
    border-color: var(--acg-border-strong) !important;
    box-shadow: 0 10px 26px rgba(196, 69, 105, 0.32), inset 0 1px 0 rgba(255, 192, 159, 0.16) !important;
}
html.app-dark .search-result-icon {
    border: 1.5px solid var(--acg-gold-light) !important;
    background-color: var(--acg-bg-2) !important;
    box-shadow: 0 0 10px rgba(255, 107, 138, 0.35);
}
html.app-dark .search-result-name {
    color: var(--acg-text-1) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 700 !important;
}
html.app-dark .search-result-category {
    color: var(--acg-text-2) !important;
}
/* 去玩按钮: 原蓝紫渐变 → 玫红蜜桃渐变 */
html.app-dark .search-result-play-btn {
    background: linear-gradient(135deg, #FAD4C0 0%, #FFB088 25%, #FF8FA3 55%, #C44569 85%, #6B1A2F 100%) !important;
    color: #2D1018 !important;
    border: 1px solid rgba(244, 212, 168, 0.85) !important;
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.45) !important;
    font-weight: 800 !important;
}
html.app-dark .search-result-play-btn:hover {
    color: #2D1018 !important;
    filter: brightness(1.05);
}

/* —— Loading / 错误 / 无结果 —— */
html.app-dark .loading-text {
    color: var(--acg-rose) !important;
}
html.app-dark .no-results-text {
    color: var(--acg-text-2) !important;
}
html.app-dark .error-text {
    color: #FFA0AC !important;
}

/* —— 可访问 —— */
@media (prefers-reduced-motion: reduce) {
    html.app-dark .search-action::after,
    html.app-dark .hot-game-trial-btn::after,
    html.app-dark .search-result-play-btn::after {
        animation: none !important;
        display: none !important;
    }
    html.app-dark .main-container::before {
        animation: none !important;
    }
}
