 /* Download Button */
        .chapter-header-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-download {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 1.1rem;
            cursor: pointer;
            transition: var(--transition);
        }

        .btn-download:hover {
            border-color: var(--accent-primary);
            color: var(--accent-primary);
        }

        /* Download Modal */
        .dl-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .dl-modal {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 500px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .dl-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .dl-modal-header h3 {
            font-size: 1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .dl-modal-header h3 i {
            color: var(--accent-primary);
        }

        .dl-modal-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 4px 8px;
            line-height: 1;
            transition: color 0.2s;
        }

        .dl-modal-close:hover {
            color: var(--text-primary);
        }

        .dl-modal-body {
            padding: 16px 20px;
            overflow-y: auto;
            flex: 1;
        }

        .dl-modal-info {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 12px;
        }

        .dl-select-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        #dl-selected-count {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--accent-primary);
        }

        .dl-chapter-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: 350px;
            overflow-y: auto;
        }

        .dl-chapter-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--bg-secondary);
            border: 1px solid transparent;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
        }

        .dl-chapter-item:hover {
            border-color: var(--border-color);
        }

        .dl-chapter-item.selected {
            border-color: var(--accent-primary);
            background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-secondary));
        }

        .dl-chapter-item input[type="checkbox"] {
            accent-color: var(--accent-primary);
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        .dl-chapter-item label {
            flex: 1;
            cursor: pointer;
            font-size: 0.9rem;
        }

        .dl-modal-footer {
            display: flex;
            gap: 10px;
            padding: 16px 20px;
            border-top: 1px solid var(--border-color);
        }

        .dl-btn-cancel {
            flex: 1;
            padding: 10px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
        }

        .dl-btn-cancel:hover {
            border-color: var(--accent-primary);
            color: var(--text-primary);
        }

        .dl-btn-download {
            flex: 2;
            padding: 10px;
            background: var(--accent-gradient);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: var(--transition);
        }

        .dl-btn-download:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .dl-btn-download:not(:disabled):hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        /* Progress Overlay */
        .dl-progress {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-card);
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-lg);
            z-index: 2;
        }

        .dl-progress-content {
            text-align: center;
            padding: 40px 20px;
        }

        .dl-spinner {
            width: 40px;
            height: 40px;
            border: 4px solid var(--border-color);
            border-top-color: var(--accent-primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 16px;
        }

        .dl-progress-bar-wrap {
            width: 240px;
            height: 6px;
            background: var(--bg-secondary);
            border-radius: 3px;
            margin: 12px auto 0;
            overflow: hidden;
        }

        .dl-progress-bar {
            width: 0%;
            height: 100%;
            background: var(--accent-gradient);
            border-radius: 3px;
            transition: width 0.3s ease;
        }

        .dl-progress-detail {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 8px;
        }

        @media (max-width: 768px) {
            .dl-modal {
                max-height: 90vh;
            }
            .dl-chapter-list {
                max-height: 280px;
            }
        }
		