* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    overflow: hidden; 
    background-color: #0a0a0f; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #e0e0e0;
}
canvas { display: block; }
#input_video { position: absolute; top: -1000px; left: -1000px; transform: scaleX(-1); }

#browser-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: rgba(20, 20, 25, 0.25);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 100;
    gap: 8px;
    transition: background 0.5s ease;
}

.browser-button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.browser-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}
.browser-button:active {
    transform: scale(0.95);
}

#btn-loop {
    font-size: 14px;
}
#btn-loop.active {
    color: var(--accent-color, #00d4ff);
}
#btn-play {
    font-size: 12px;
}

#url-bar-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    overflow: visible;
}

#url-bar {
    width: 100%;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 12px;
    padding-right: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}
#url-bar:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 122, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}
#url-bar::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

#url-bar.showing-title {
    text-align: center;
    animation: breathe 5s ease-in-out infinite;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 350;
    letter-spacing: 1px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

#image-input { display: none; }

#volume-slider {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    opacity: 0.3;
    transition: opacity 0.3s ease, background 0.3s ease;
    width: 8px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
}

#volume-slider:hover {
    opacity: 1;
}

#progress-bar {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    z-index: 95;
    opacity: 0.3;
    transition: opacity 0.3s ease, background 0.3s ease;
    cursor: pointer;
}

#progress-bar:hover {
    opacity: 1;
}

#progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0 2px 2px 0;
    pointer-events: none;
    transition: background 0.3s ease;
}

#progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
}

#progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#progress-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: none;
}

#volume-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #fff;
    border-radius: 4px;
    pointer-events: none;
}

#audio-threshold {
    position: absolute;
    top: 0;
    left: -10px;
    width: calc(100% + 20px);
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    -webkit-appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
}

#audio-threshold::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#audio-threshold::-moz-range-thumb {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: none;
}

#status {
    position: fixed;
    top: 64px;
    left: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    background: rgba(30, 30, 40, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 8px 14px;
    border-radius: 8px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 90;
}

#webcam-preview {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 180px;
    height: 135px;
    background: rgba(30, 30, 40, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    overflow: hidden;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    transform: scaleX(-1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 90;
}

body.fullscreen-mode #browser-toolbar,
body.fullscreen-mode #status,
body.fullscreen-mode #webcam-preview,
body.fullscreen-mode #volume-slider,
body.fullscreen-mode #band-display,
body.fullscreen-mode #progress-bar {
    display: none !important;
}

#band-display {
    display: none;
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    padding: 12px 16px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 90;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 160px;
}
.band-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.band-row:last-child {
    margin-bottom: 0;
}
.band-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    width: 36px;
    flex-shrink: 0;
}
.band-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 8px;
}
.band-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.05s ease;
}
.band-bar.subBass { background: linear-gradient(90deg, #880000, #ff0000); }
.band-bar.bass { background: linear-gradient(90deg, #ff4444, #ff8800); }
.band-bar.lowMid { background: linear-gradient(90deg, #ffaa00, #ffff00); }
.band-bar.mid { background: linear-gradient(90deg, #44ff44, #88ff00); }
.band-bar.highMid { background: linear-gradient(90deg, #00ffff, #0088ff); }
.band-bar.treble { background: linear-gradient(90deg, #4444ff, #8800ff); }
.band-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.divider {
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    margin: 16px 0;
    padding-top: 16px;
}

/* 网易云音乐图标按钮 */
#btn-netease {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}
#btn-netease:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}
#btn-netease:active {
    transform: scale(0.95);
}
#btn-netease svg {
    width: 18px;
    height: 18px;
}

/* 二维码弹窗 */
#qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
#qrcode-modal.show {
    display: flex;
}
#qrcode-container {
    position: relative;
    background: rgba(var(--modal-color, 139, 0, 255), 0.12);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 280px;
    animation: modalFadeIn 0.25s ease-out;
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
#qrcode-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 14px;
    color: var(--modal-text-color, rgba(255, 255, 255, 0.85));
    letter-spacing: 1px;
    text-transform: uppercase;
}
#qrcode-image {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#qrcode-image svg {
    width: 100%;
    height: 100%;
}
#qrcode-status {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--modal-text-color, rgba(255, 255, 255, 0.5));
    opacity: 0.6;
    margin-top: 12px;
    letter-spacing: 0.5px;
}

/* 二维码加载动画 - 跳动点 */
.dots-loader {
    display: flex;
    gap: 6px;
}
.dots-loader div {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: dots-jump 1.4s infinite ease-in-out both;
}
.dots-loader div:nth-child(1) { animation-delay: -0.32s; }
.dots-loader div:nth-child(2) { animation-delay: -0.16s; }
@keyframes dots-jump {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1.0); opacity: 1; }
}

/* 用户信息显示 */
#user-info {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    overflow: visible;
    z-index: 100;
}
#user-info.show {
    display: flex;
}
#user-info:hover {
    background: rgba(255, 255, 255, 0.2);
}
#user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(30%) brightness(1.1) contrast(0.9);
    opacity: 0.85;
    transition: all 0.2s ease;
}
#user-info:hover #user-avatar {
    filter: grayscale(0%) brightness(1) contrast(1);
    opacity: 1;
}
#user-name {
    display: none;
}

/* 用户下拉菜单 */
/* 隐藏原因：点击用户头像直接触发搜索歌单列表，登出功能暂时不需要
   如需恢复登出功能，请删除下方的 display: none !important */
#user-dropdown {
    position: absolute;
    top: 38px;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: none !important;
    z-index: 150;
}
#user-dropdown.show {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.5);
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

/* 搜索结果弹窗 - 下拉样式 */
#search-modal {
    position: fixed;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    max-width: calc(100vw - 24px);
    display: none;
    z-index: 200;
}
#search-modal.show {
    display: block;
    animation: slideDown 0.25s ease-out;
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
#search-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#search-list {
    overflow-y: auto;
    flex: 1;
}
#search-list::-webkit-scrollbar {
    width: 6px;
}
#search-list::-webkit-scrollbar-track {
    background: transparent;
}
#search-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
    gap: 14px;
}
.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.search-result-item:last-child {
    border-bottom: none;
}
.song-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    object-fit: cover;
    flex-shrink: 0;
}
.song-info-wrapper {
    flex: 1;
    min-width: 0;
}
.song-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.song-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.song-vip-tag {
    font-size: 10px;
    color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 0.5px solid rgba(255, 215, 0, 0.5);
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.song-artist-album {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.song-duration {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}
#search-loading {
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}
#search-empty {
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    display: none;
}
#search-more {
    padding: 1px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: 0.5px solid rgba(255, 255, 255, 0.05);
}
#search-more:hover {
    background: rgba(255, 255, 255, 0.05);
}
