* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 24px 16px 48px;
}

.container {
    max-width: 920px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #38bdf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #94a3b8;
    margin-top: 8px;
    font-size: 0.95rem;
}

.card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
}

.now-playing .icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.now-playing .info {
    min-width: 0;
    flex: 1;
}

.now-playing-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.now-playing-head h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.now-playing-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.skip-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.pause-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.progress-fill.paused {
    background: #64748b;
}

.now-playing .info p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.progress-wrap {
    margin-top: 12px;
}

.progress-bar {
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
    border-radius: 999px;
    transition: width 0.4s ease;
    min-width: 0;
}

.progress-time {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #64748b;
    text-align: right;
}

.empty {
    color: #64748b;
    text-align: center;
    padding: 24px;
    font-size: 0.95rem;
}

form {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 6px;
}

.hint {
    margin-top: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #64748b;
}

#neteaseSource {
    min-width: 0;
    overflow: hidden;
}

.search-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    min-width: 0;
}

.search-row input {
    flex: 1;
    min-width: 0;
    width: auto;
}

#searchBtn {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 10px 18px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    list-style: none;
    margin-top: 14px;
    width: 100%;
    max-width: 100%;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.search-results .empty {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
}

.search-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    align-items: center;
    column-gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.search-item:last-child {
    border-bottom: none;
}

.search-info {
    min-width: 0;
    overflow: hidden;
}

.search-info .song-title {
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-info .song-meta {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pick-btn {
    width: 68px;
    padding: 8px 0;
    font-size: 0.85rem;
    justify-self: end;
}

input, select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: #38bdf8;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: scale(0.98);
}

button.secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    font-size: 0.9rem;
    padding: 10px 16px;
}

.queue-list {
    list-style: none;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    margin-bottom: 8px;
    gap: 12px;
}

.queue-item .left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.queue-item .index {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.queue-item .title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item .meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.history .queue-item {
    opacity: 0.7;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: transform 0.3s;
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
}

.tab.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.source-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.source-tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
}

.source-tab.hidden {
    display: none;
}

.source-tab.active {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.hidden {
    display: none !important;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
    margin-right: 6px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
