        /* Keyframe Animations */
        @keyframes fadeInDown {
            from { opacity: 0; transform: translateY(-30px); }
            to   { opacity: 1; transform: translateY(0); }
        }

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

        @keyframes slideIn {
            from { opacity: 0; transform: translateX(-20px); }
            to   { opacity: 1; transform: translateX(0); }
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation: none !important;
                transition: none !important;
                scroll-behavior: auto !important;
            }
        }

        /* Responsive */
        @media (max-width: 768px) {
            header { padding: 2rem 0 1.2rem; }
            .logo { font-size: 1.9rem; margin-bottom: 0.9rem; }
            h1 { font-size: 2rem; margin-bottom: 0.5rem; }
            .subtitle { font-size: 0.95rem; }
            .download-section { margin: 1.25rem auto; }
            .download-card { padding: 1.35rem 1rem; }
            .preview-card { grid-template-columns: 1fr; }
            .features { grid-template-columns: 1fr; }
            .history-panel { width: 100%; right: -100%; }
            .stats-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; margin: 1rem 0 1.2rem; }
            .stat-card { border-radius: 10px; padding: 0.55rem 0.35rem 0.6rem; }
            .stat-number { font-size: 1.05rem; margin-bottom: 0.1rem; }
            .stat-label { font-size: 0.62rem; line-height: 1.2; }
            .shortcuts-hint { display: none; }
            .top-nav { flex-wrap: wrap; gap: 0.5rem; }
            .nav-btn { font-size: 0.85rem; padding: 0.5rem 0.9rem; }
            .logo::after { right: -35px; font-size: 0.45rem; }
            body::before { animation: none; }
        }

        /* Playlist Quality Selector */
        .playlist-quality-selector {
            margin: 1.5rem 0;
            padding: 1.5rem;
            background: var(--surface-secondary);
            border-radius: 12px;
        }

        .playlist-quality-selector h4 {
            margin: 0 0 1rem 0;
            font-size: 1rem;
            color: var(--text-secondary);
        }

        .quality-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 1rem;
        }

        .quality-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1rem;
            background: var(--surface-primary);
            border: 2px solid transparent;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--text-primary);
        }

        .quality-btn:hover {
            border-color: var(--accent-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .quality-btn.active {
            border-color: var(--accent-primary);
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: white;
        }

        .quality-label { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
        .quality-size  { font-size: 0.85rem; opacity: 0.8; }

        .playlist-video-format-list {
            margin: 1rem 0 1.5rem;
            padding: 1rem;
            background: var(--surface-secondary);
            border-radius: 12px;
            border: 1px solid var(--border-color);
            max-height: 280px;
            overflow: auto;
        }

        .playlist-video-format-list h4 {
            margin: 0 0 0.75rem 0;
            font-size: 0.95rem;
            color: var(--text-secondary);
        }

        .playlist-video-row {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 0.75rem;
            align-items: center;
            padding: 0.55rem 0.25rem;
            border-bottom: 1px solid var(--border-color);
        }

        .playlist-video-row:last-child { border-bottom: none; }

        .playlist-video-meta {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            min-width: 0;
        }

        .playlist-video-index {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2rem;
            height: 1.4rem;
            border-radius: 0.4rem;
            background: rgba(99, 102, 241, 0.12);
            color: #6366f1;
            font-size: 0.8rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .playlist-video-name {
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 0.9rem;
            color: var(--text-primary);
        }

        .playlist-format-select {
            min-width: 7.5rem;
            border: 1px solid var(--border-color);
            background: var(--surface-primary);
            color: var(--text-primary);
            border-radius: 8px;
            padding: 0.42rem 0.55rem;
            font-size: 0.82rem;
            font-weight: 600;
        }

        /* Playlist Progress Tracker */
        .playlist-progress-tracker {
            margin-top: 2rem;
            padding: 1.5rem;
            background: var(--surface-secondary);
            border-radius: 16px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .playlist-progress-header {
            margin-bottom: 1.5rem;
            text-align: center;
        }

        .playlist-progress-header h4 { margin: 0 0 0.5rem 0; font-size: 1.2rem; color: var(--text-primary); }
        .playlist-progress-header p  { margin: 0; font-size: 0.95rem; color: var(--text-secondary); }

        .current-video-progress {
            background: var(--surface-primary);
            padding: 1.5rem;
            border-radius: 12px;
            margin-bottom: 1rem;
            border: 2px solid #6366f1;
        }

        .current-video-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            font-weight: 600;
        }

        .video-indicator {
            background: #6366f1;
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.85rem;
        }

        .current-video-info #currentVideoNumber { color: #6366f1; font-size: 1.1rem; }
        .current-video-info #currentVideoTitle  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }

        .progress-bar-container {
            position: relative;
            background: rgba(99, 102, 241, 0.1);
            height: 36px;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 0.75rem;
        }

        .progress-bar { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 0.3s ease; border-radius: 8px; }

        .progress-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-weight: 700;
            color: var(--text-primary);
            font-size: 0.95rem;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            z-index: 2;
        }

        .progress-speed { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-secondary); }
        .progress-speed span { font-weight: 500; }

        .overall-progress { background: var(--surface-primary); padding: 1rem; border-radius: 12px; margin-bottom: 1rem; }
        .overall-progress-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
        }
        .overall-progress-label { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
        .overall-progress-actions {
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .cancel-download-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            width: 100%;
            margin-top: 1rem;
            padding: 0.85rem 1.5rem;
            background: #ef4444;
            border: 2px solid #ef4444;
            border-radius: 12px;
            color: #fff;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            letter-spacing: 0.03em;
        }

        .cancel-download-btn:hover:not(.inactive) {
            background: #dc2626;
            border-color: #dc2626;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
        }

        .cancel-download-btn:active:not(.inactive) {
            transform: translateY(0);
        }

        .cancel-download-btn.inactive {
            background: rgba(239, 68, 68, 0.12);
            border-color: rgba(239, 68, 68, 0.25);
            color: rgba(239, 68, 68, 0.4);
            cursor: not-allowed;
            transform: none !important;
            box-shadow: none !important;
        }

        .overall-progress-pct {
            font-weight: 700;
            color: #6366f1;
            font-size: 1rem;
        }

        .completed-videos-section h5 { margin: 0 0 1rem 0; font-size: 1rem; color: var(--text-secondary); }

        .completed-videos {
            max-height: 300px;
            overflow-y: auto;
            background: var(--surface-primary);
            padding: 1rem;
            border-radius: 12px;
        }

        .completed-videos::-webkit-scrollbar       { width: 8px; }
        .completed-videos::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
        .completed-videos::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 4px; }

        .completed-video {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            background: var(--surface-secondary);
            border-radius: 8px;
            margin-bottom: 0.5rem;
            border-left: 3px solid transparent;
            transition: all 0.2s ease;
        }

        .completed-video:hover         { transform: translateX(4px); }
        .completed-video.success       { border-left-color: #10b981; }
        .completed-video.failed        { border-left-color: #ef4444; }

        .video-number { font-weight: 700; color: #6366f1; min-width: 35px; font-size: 0.95rem; }
        .video-title  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .video-status { font-size: 1.2rem; }
