/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(20, 184, 166, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.min-h-screen {
    min-height: 100vh;
}

/* Header Styles */
header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.text-blue {
    color: var(--primary);
}

.text-gray-600 {
    color: #6b7280;
}

.text-gray-800 {
    color: #374151;
}

.bg-white {
    background-color: white;
}

.border-t {
    border-top: 1px solid #e5e7eb;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.platform-select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 1rem;
    background: #ffffff;
    color: var(--dark);
    font-weight: 500;
}

.platform-select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}

p {
    margin-bottom: 1rem;
    color: var(--gray);
}

.text-center {
    text-align: center;
}

.text-gray-600 {
    color: var(--gray);
}

.text-gray-800 {
    color: var(--dark);
}

.text-blue-600 {
    color: var(--primary);
}

.text-gray-500 {
    color: var(--gray);
}

.text-gray-400 {
    color: #94a3b8;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

/* Modern text utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-white {
    color: var(--white);
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group {
    position: relative;
}

input[type="text"],
select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 1rem;
    line-height: 1.5rem;
    transition: var(--transition);
    background: #ffffff;
    color: var(--dark);
    font-weight: 500;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

input[type="text"]::placeholder {
    color: var(--gray);
    font-weight: 400;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.w-full {
    width: 100%;
}

/* Card Styles */
.bg-white {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rounded-lg {
    border-radius: var(--radius);
}

.rounded-xl {
    border-radius: var(--radius-lg);
}

.shadow-md {
    box-shadow: var(--shadow);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-16 {
    margin-top: 4rem;
}

.mt-8 {
    margin-top: 2rem;
}

/* Modern card variations */
.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    border-radius: var(--radius);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.card-glow:hover::before {
    opacity: 0.7;
}

/* Loading Spinner */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-top: 3px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern loading animation */
.loading-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Results Container */
.space-y-4 > * + * {
    margin-top: 1rem;
}

/* Music Result Card */
.music-result {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.music-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transition: var(--transition);
}

.music-result:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.music-result:hover::before {
    transform: scaleX(1);
}

.music-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.music-info {
    flex: 1;
}

.music-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.music-artist {
    font-size: 1.125rem;
    color: var(--gray);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.music-artist::before {
    content: '🎵';
    font-size: 1rem;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.platform-kugou {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: var(--white);
}

.platform-qq {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: var(--white);
}

.platform-netease {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    color: var(--white);
}



.platform-apple {
    background: linear-gradient(135deg, #6b7280, #374151);
    color: var(--white);
}



.music-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 600;
    line-height: 1.3;
}

/* Icons for detail labels */
.detail-item:nth-child(1) .detail-label::before { content: '💿'; }
.detail-item:nth-child(2) .detail-label::before { content: '🏢'; }
.detail-item:nth-child(3) .detail-label::before { content: '📅'; }
.detail-item:nth-child(4) .detail-label::before { content: '⏱️'; }
.detail-item:nth-child(5) .detail-label::before { content: '🎼'; }

/* Platform Selection Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.platform-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    background: #ffffff;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.platform-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.platform-option.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
}

.platform-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.platform-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.platform-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.kugou-fallback {
    background: #fbbf24;
}

.qq-fallback {
    background: #3b82f6;
}

.netease-fallback {
    background: #a855f7;
}

.apple-fallback {
    background: #374151;
}

.platform-option span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
}

.close-modal {
    color: var(--gray);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.changelog-version {
    margin-bottom: 2rem;
}

.changelog-version:last-child {
    margin-bottom: 0;
}

.changelog-version h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.changelog-version ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-version li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

.changelog-version li:last-child {
    border-bottom: none;
}

.version-info {
    color: var(--gray);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.8rem;
}

.version-info:hover {
    color: var(--primary);
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Music result layout improvements */
.music-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.music-cover-container {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.music-cover:hover {
    transform: scale(1.05);
}

.music-cover-placeholder {
    font-size: 3rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
}

.music-info {
    flex: 1;
    min-width: 0;
}

.music-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

/* Search Notice */
.search-notice {
    background: rgba(251, 191, 36, 0.1);
    border-left: 4px solid #fbbf24;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    color: #f59e0b;
    font-size: 0.875rem;
}

/* Responsive adjustments for music results */
@media (max-width: 768px) {
    .music-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .music-cover-container {
        width: 100%;
        height: 200px;
    }
    
    .music-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.justify-center {
    justify-content: center;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid #e5e7eb;
}

.border-t {
    border-top-width: 1px;
}

/* Search History Dropdown */
#searchHistoryDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-top: 0.25rem;
    z-index: 50;
    max-height: 15rem;
    overflow-y: auto;
}

#searchHistoryDropdown .p-2 {
    padding: 0.5rem;
}

#searchHistoryDropdown .border-b {
    border-bottom-width: 1px;
}

#searchHistoryDropdown .border-t {
    border-top-width: 1px;
}

#searchHistoryDropdown .border-gray-100 {
    border-color: #f3f4f6;
}

#searchHistoryDropdown .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

#searchHistoryDropdown .font-medium {
    font-weight: 500;
}

#searchHistoryDropdown .text-gray-500 {
    color: #6b7280;
}

#searchHistoryDropdown .px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#searchHistoryDropdown .py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#searchHistoryDropdown .hover\:bg-gray-50:hover {
    background-color: #f9fafb;
}

#searchHistoryDropdown .cursor-pointer {
    cursor: pointer;
}

#searchHistoryDropdown .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

#searchHistoryDropdown .text-gray-700 {
    color: #374151;
}

#searchHistoryDropdown .text-blue-600 {
    color: #2563eb;
}

#searchHistoryDropdown .hover\:text-blue-700:hover {
    color: #1d4ed8;
}

/* Error Alert Styles */
.bg-red-50 {
    background-color: #fef2f2;
}

.border-red-200 {
    border-color: #fecaca;
}

.text-red-700 {
    color: #b91c1c;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.ml-3 {
    margin-left: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .music-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .music-details {
        grid-template-columns: 1fr;
    }
    
    .platform-badge {
        align-self: flex-start;
    }
    
    #searchHistoryDropdown {
        max-height: 12rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .music-result {
        padding: 1rem;
    }
    
    .detail-item {
        font-size: 0.875rem;
    }
}