* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #f5f5f7;
    font-family: 'Inter', sans-serif;
    padding: 20px 16px 32px;
    color: #1c1c1e;
}

.app-container {
    max-width: 700px;
    margin: 0 auto;
}

/* 头部 */
.hero {
    background: linear-gradient(135deg, #0f2b3d 0%, #1a3a4f 100%);
    border-radius: 28px;
    padding: 24px 20px 28px;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hero-left {
    display: flex;
    align-items: center;
}

.hero-left h1 {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-left h1 .material-icons {
    font-size: 28px;
}

.hero-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.hero-btn .material-icons {
    font-size: 16px;
}

.hero-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.96);
}

.badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge .material-icons {
    font-size: 14px;
}

.subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 24px;
}

/* 搜索区域 */
.search-area {
    display: flex;
    gap: 12px;
}

.search-input-wrapper {
    flex: 1;
    background: rgba(255,255,255,0.12);
    border-radius: 48px;
    display: flex;
    align-items: center;
    padding: 4px 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
}

.search-input-wrapper .material-icons {
    color: rgba(255,255,255,0.7);
    margin-right: 10px;
    font-size: 20px;
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    padding: 12px 0;
    width: 100%;
    font-size: 0.95rem;
    color: white;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-btn {
    background: white;
    border: none;
    border-radius: 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a3a4f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: 0.2s;
}

.search-btn:active {
    transform: scale(0.94);
}

/* 统计栏 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.result-count {
    background: #e9ecef;
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1c1c1e;
}

.hint-text {
    font-size: 0.65rem;
    color: #8e8e93;
}

/* 歌曲列表 */
.music-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.track-item {
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: 0.2s;
    border: 1px solid rgba(0,0,0,0.03);
}

.track-item:active {
    transform: scale(0.99);
}

.track-cover {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #f0f0f0;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.song-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-album {
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-btn {
    background: #1a3a4f;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: white;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.download-btn:active {
    background: #0f2b3d;
    transform: scale(0.94);
}

.download-btn .material-icons {
    font-size: 20px;
}

/* 加载占位 */
.loading-placeholder {
    text-align: center;
    padding: 48px 20px;
    color: #8e8e93;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #e9ecef;
    border-top-color: #1a3a4f;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e93;
    background: #fff;
    border-radius: 28px;
}

/* 歌单信息栏 */
.playlist-info {
    background: white;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.playlist-cover {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-detail {
    flex: 1;
    min-width: 0;
}

.playlist-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-count {
    font-size: 0.7rem;
    color: #8e8e93;
    margin-bottom: 8px;
}

.clear-playlist-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: 0.2s;
}

.clear-playlist-btn .material-icons {
    font-size: 14px;
}

.clear-playlist-btn:active {
    background: #f8d7da;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.playlist-input-modal {
    background: #fff;
    border-radius: 32px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    animation: fadeInScale 0.25s ease;
    -webkit-animation: fadeInScale 0.25s ease;
}

.playlist-input-area {
    margin: 20px 0;
    width: 100%;
}

.playlist-url-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e9ecef;
    border-radius: 28px;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: 0.2s;
    box-sizing: border-box;
}

.playlist-url-input:focus {
    outline: none;
    border-color: #1a3a4f;
    background: white;
}

.help-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #8e8e93;
    margin-top: 8px;
}

.help-text .material-icons {
    font-size: 14px;
}

.quality-modal {
    background: #fff;
    border-radius: 32px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    animation: fadeInScale 0.25s ease;
    -webkit-animation: fadeInScale 0.25s ease;
}

.decrypt-modal {
    background: #fff;
    border-radius: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    padding: 20px;
    animation: fadeInScale 0.25s ease;
    -webkit-animation: fadeInScale 0.25s ease;
    display: flex;
    flex-direction: column;
}

/* 进度条 */
.progress-wrapper-modal {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #495057;
}

.progress-track {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: #1a3a4f;
    width: 0%;
    height: 100%;
    transition: width 0.3s;
    border-radius: 10px;
}

.log-panel-modal {
    background: #1e1e2e;
    border-radius: 16px;
    padding: 12px;
    height: 250px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    margin-bottom: 16px;
}

.log-line {
    padding: 6px 8px;
    border-bottom: 1px solid #2a2a3a;
    color: #a8a8b0;
    font-family: monospace;
}

.log-line .time {
    color: #4c9aff;
    font-weight: 600;
    margin-right: 8px;
}

.log-line.error {
    color: #ff6b6b;
}

.log-line.success {
    color: #51cf66;
}

.log-line.warning {
    color: #ffd43b;
}

.modal-header, .decrypt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3, .decrypt-header h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #8e8e93;
    padding: 0 8px;
}

.quality-list {
    margin: 16px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
}

.quality-option {
    background: #f8f9fa;
    border-radius: 28px;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 1px solid #e9ecef;
    transition: 0.1s;
}

.quality-option:active {
    background: #e9ecef;
}

.quality-option.selected {
    background: #e0e7ff;
    border-color: #1a3a4f;
}

.quality-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.quality-size {
    font-size: 0.7rem;
    color: #6c757d;
}

.quality-bitrate {
    font-size: 0.65rem;
    color: #8e8e93;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-buttons button {
    flex: 1;
    padding: 14px;
    border-radius: 60px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cancel {
    background: #e9ecef;
    color: #1c1c1e;
}

.btn-confirm {
    background: #1a3a4f;
    color: white;
}

.btn-confirm:active {
    transform: scale(0.98);
}

.decrypt-buttons {
    display: flex;
    gap: 12px;
}

.btn-close-decrypt {
    flex: 1;
    padding: 12px;
    border-radius: 60px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    background: #e9ecef;
    color: #1c1c1e;
}

.btn-close-decrypt:active {
    transform: scale(0.98);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.65rem;
    color: #8e8e93;
    padding: 16px;
}

.playlist-url-input {
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.help-text {
    background: #f0f7ff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 12px;
    color: #1a3a4f;
}

.help-text .material-icons {
    color: #1a3a4f;
}