


#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(2vh);
    z-index: 1500;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1vh);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    padding: 8vh 5vw;
}

#search-overlay.active {
    display: flex;
    flex-direction: column;
}

#search-overlay.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#search-overlay.is-closing {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1vh);
    pointer-events: none;
}


.platform-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5vh;
    margin-bottom: 3vh;
    padding: 0 1vh;
    flex-wrap: wrap;
}

.platform-tab {
    display: flex;
    align-items: center;
    gap: 0.8vh;
    padding: 1vh 2vh;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2vh;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 0.1vh solid transparent;
}

.platform-tab:hover {
    background: rgba(255, 255, 255, 0.15);
}

.platform-tab.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.platform-tab .icon {
    width: 2.2vh;
    height: 2.2vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-tab .name {
    font-size: 1.6vh;
    color: #fff;
}

.platform-tab .count {
    font-size: 1.3vh;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3vh 0.8vh;
    border-radius: 1vh;
}


.result-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 1vh;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45vw, 1fr));
    gap: 1.2vh 2vw;
}

@media (max-width: 900px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
}


.result-item {
    display: flex;
    align-items: center;
    gap: 1.5vh;
    padding: 1.5vh;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1.2vh;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 0.1vh solid transparent;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}


.result-cover {
    width: 6vh;
    height: 6vh;
    border-radius: 0.8vh;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0.3vh 1vh rgba(0, 0, 0, 0.3);
}


.result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4vh;
}

.result-title {
    font-size: 1.6vh;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-artist {
    font-size: 1.3vh;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 1vh;
    font-size: 1.2vh;
    color: rgba(255, 255, 255, 0.4);
}

.result-album {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15vh;
}

.result-duration {
    flex-shrink: 0;
}


.result-platform {
    display: flex;
    align-items: center;
    gap: 0.4vh;
    padding: 0.3vh 0.8vh;
    border-radius: 0.8vh;
    font-size: 1.1vh;
    flex-shrink: 0;
}

.result-platform .icon {
    width: 1.4vh;
    height: 1.4vh;
}


.result-actions {
    display: flex;
    align-items: center;
    gap: 0.8vh;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding-right: 1vh;
}

.result-item:hover .result-actions {
    opacity: 1;
}

.action-btn {
    width: 3.5vh;
    height: 3.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.action-btn svg {
    width: 1.8vh;
    height: 1.8vh;
    color: #fff;
}


.no-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 30vh;
    color: rgba(255, 255, 255, 0.5);
    gap: 2vh;
}

.no-result svg {
    width: 8vh;
    height: 8vh;
    opacity: 0.3;
}

.no-result p {
    font-size: 1.8vh;
}


.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20vh;
    gap: 1.5vh;
}

.search-loading .spinner {
    width: 3vh;
    height: 3vh;
    border: 0.3vh solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-loading span {
    font-size: 1.5vh;
    color: rgba(255, 255, 255, 0.6);
}


.result-stats {
    display: flex;
    align-items: center;
    gap: 2vh;
    padding: 1vh 2vh;
    margin-bottom: 2vh;
    font-size: 1.3vh;
    color: rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
}

.result-stats .total {
    color: #fff;
    font-weight: 600;
}


.search-type-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-left: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0;
}

.search-type-tab {
    cursor: pointer;
    padding: 0.8vh 2vh;
    font-size: 1.3vh;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.4);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.search-type-tab:hover {
    color: rgba(255,255,255,0.7);
}

.search-type-tab.active {
    color: var(--apple-red, #ff3b30);
    border-bottom-color: var(--apple-red, #ff3b30);
    font-weight: 600;
}


.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8vh;
    padding: 1.2vh 2vh;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5vh;
    cursor: pointer;
    font-size: 1.5vh;
    color: #fff;
    margin-bottom: 2vh;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}


.back-to-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8vh;
    padding: 1.2vh 2vh;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5vh;
    cursor: pointer;
    font-size: 1.5vh;
    color: #fff;
    margin-bottom: 2vh;
    transition: all 0.3s ease;
}

.back-to-list-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}


.result-grid.list-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

.result-grid.list-view .result-item {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.result-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(45vw, 1fr)) !important;
    gap: 1.2vh 2vw !important;
}


.view-toggle-btns {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 2px;
}

.view-toggle-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
}

.view-toggle-btn.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}


.sub-page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(2vh);
    z-index: 1500;
    overflow-y: auto;
    padding: 8vh 5vw;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1vh);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}
.sub-page-overlay.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.sub-page-overlay.is-closing { opacity: 0; visibility: hidden; transform: translateY(1vh); pointer-events: none; }

#artist-overlay, #album-overlay {
    z-index: 1550;
}


.artist-link:hover, .album-link:hover {
    color: var(--apple-red, #ff3b30) !important;
}

@media (hover: none), (pointer: coarse) {
    .result-actions { opacity: 1; pointer-events: auto; }
}


.search-side-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4.4vh;
    height: 4.4vh;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    background: var(--glass-bg, rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(1vh);
    -webkit-backdrop-filter: blur(1vh);
    border: 0.0926vh solid rgba(255, 255, 255, 0.1);
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 6;
    transition: background 0.2s ease, transform 0.2s ease;
}

.search-side-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-50%) scale(1.06);
}

#searchBackBtn { left: calc(-1 * (4.4vh + 1.2vh)); }
#searchClearBtn { right: calc(-1 * (4.4vh + 1.2vh)); }
body.page-search #searchBackBtn { display: flex; }
#searchClearBtn.is-visible { display: flex; }

.round-back-btn {
    position: fixed;
    top: 1.8519vh;
    left: 1.8519vh;
    width: 4.4vh;
    height: 4.4vh;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    background: var(--glass-bg, rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(1vh);
    -webkit-backdrop-filter: blur(1vh);
    border: 0.0926vh solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease, transform 0.2s ease;
}

.round-back-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.06);
}

@media (max-width: 768px) {
    #searchBackBtn { left: -2vh; }
    #searchClearBtn { right: -2vh; }
    .round-back-btn { width: 3.6vh; height: 3.6vh; min-width: 30px; min-height: 30px; }
    .round-back-btn.lyric-lib-back { height: 5.6vh; min-height: 42px; padding: 0 2vh; }
}

.lyric-lib-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3.2vh;
}

.lyric-lib-tip {
    font-size: 1.9vh;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.1em;
}

.round-back-btn.lyric-lib-back {
    position: static;
    width: auto;
    min-width: 0;
    height: 6.4vh;
    min-height: 48px;
    padding: 0 2.6vh;
    border-radius: 999px;
    gap: 0.9vh;
    font-size: 1.5vh;
    letter-spacing: 0.05em;
}
