/* search.css */

.search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.search {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    padding-right: 96px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.clear-search {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    display: none;
    padding: 0;
}

.clear-search:hover {
    color: #333;
}

.voice-search {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 22px;
    color: #666;
}

.voice-search:hover {
    color: #111827;
}

.hot-keywords {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: -4px;
    margin-bottom: 12px;
}

.hot-keyword {
    border: 0;
    border-radius: 999px;
    padding: 5px 9px;
    background: transparent;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.hot-keyword:hover {
    background: #f3f4f6;
}

.announcement-bar {
    display: none;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
    overflow: hidden;
    white-space: nowrap;
}

.top-announcement {
    margin-top: -4px;
    margin-bottom: 12px;
}

.announcement-track {
    display: inline-block;
    padding-left: 100%;
    animation: announcement-marquee 14s linear infinite;
}

@keyframes announcement-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* PWA 安裝提示：改成底部浮動，不再擠壓首頁第一屏 */

.pwa-install-tip {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #312e81;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.pwa-install-floating {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 99990;
    max-width: 720px;
    margin: 0 auto;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.pwa-install-tip button {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-install-btn {
    background: #111827;
    color: #ffffff;
}

.pwa-dismiss-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
}

/* 舊版首頁說明已從 index.html 移除，保留樣式不影響畫面 */

.feature-note {
    margin-bottom: 10px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.feature-note-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
    font-weight: 900;
    color: #111827;
}

.feature-note-summary::-webkit-details-marker {
    display: none;
}

.feature-note-icon {
    color: #9ca3af;
    font-weight: 900;
    line-height: 1;
    transition: transform .15s ease;
}

.feature-note[open] .feature-note-icon {
    transform: rotate(45deg);
}

.feature-note-content {
    padding: 0 16px 14px;
}

.feature-note-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
}

.feature-note-list span {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    cursor: default;
}

.affiliate-note {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}

.affiliate-note summary {
    cursor: pointer;
    list-style: none;
    color: #6b7280;
    font-weight: 800;
}

.affiliate-note summary::-webkit-details-marker {
    display: none;
}

.affiliate-note summary::after {
    content: "＋";
    margin-left: 6px;
    color: #9ca3af;
}

.affiliate-note[open] summary::after {
    content: "－";
}

.affiliate-note-body {
    margin-top: 6px;
    color: #6b7280;
}

/* 篩選排序按鈕搬進 advancedFilters 後，修正內距 */

.advanced-filters .toolbar {
    margin-top: 8px;
    margin-bottom: 18px;
}

.about-site-note {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.7;
}

.about-site-note summary {
    cursor: pointer;
    list-style: none;
    color: #6b7280;
    font-weight: 900;
}

.about-site-note summary::-webkit-details-marker {
    display: none;
}

.about-site-note summary::after {
    content: "＋";
    margin-left: 6px;
    color: #9ca3af;
}

.about-site-note[open] summary::after {
    content: "－";
}

.about-site-note-body {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .search-wrapper {
        margin-bottom: 10px;
    }

    .search {
        width: 100%;
        box-sizing: border-box;
        padding: 13px 88px 13px 14px;
        border-radius: 14px;
        font-size: 16px;
    }

    .voice-search {
        right: 48px;
        width: 32px;
        height: 32px;
        font-size: 21px;
    }

    .clear-search {
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 30px;
    }

    .hot-keywords {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        margin-top: -4px;
        margin-bottom: 10px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .hot-keywords::-webkit-scrollbar {
        display: none;
    }

    .hot-keyword {
        flex: 0 0 auto;
        padding: 5px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .announcement-bar {
        margin-bottom: 10px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 12px;
    }

    .top-announcement {
        margin-top: -2px;
        margin-bottom: 12px;
    }

    .pwa-install-floating {
        left: 10px;
        right: 10px;
        bottom: 10px;
        border-radius: 16px;
    }

    .pwa-install-tip {
        gap: 8px;
        padding: 9px 10px;
    }

    .pwa-install-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pwa-install-actions {
        justify-content: flex-end;
    }

    .pwa-install-tip button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .feature-note {
        margin-bottom: 10px;
        border-radius: 14px;
    }

    .feature-note-summary {
        padding: 12px 14px;
        font-size: 15px;
    }

    .feature-note-content {
        padding: 0 14px 12px;
    }

    .feature-note-list {
        grid-template-columns: 1fr;
        gap: 6px;
        font-size: 14px;
    }

    .advanced-filters .toolbar {
        margin-bottom: 16px;
    }
}

@media (max-width: 420px) {
    .search {
        padding-right: 82px;
    }

    .voice-search {
        right: 44px;
    }

    .clear-search {
        right: 8px;
    }
}
