/* ============================================================
   任务中心 / 通知中心 (NAS 风格)
   ============================================================ */

/* 顶部通知图标容器 */
.navbar-tools {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 2005;
}

.task-toggle-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text);
    font-size: 1.4em;
    box-shadow: 0 4px 15px var(--shadow);
}

.task-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: var(--primary);
}

/* 运行中任务的带呼吸效果的角标 */
.task-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--bg-dark);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 任务面板 */
.task-panel {
    position: fixed;
    top: 75px;
    right: 20px;
    width: 380px;
    max-height: 80vh;
    width: 380px;
    max-height: 80vh;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow);
    z-index: 2004;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: top right;
    transform: scale(0.9) translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.task-panel.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.task-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.task-panel-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text);
    font-weight: 600;
}

.task-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    max-height: 60vh;
}

/* 任务卡片样式 */
.task-card {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-card:last-child {
    border-bottom: none;
}

.task-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.task-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-main-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text);
    margin-bottom: 2px;
}

.task-sub-info {
    font-size: 0.8em;
    opacity: 0.6;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 进度条样式 */
.task-progress-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.task-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease-out;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.task-progress-bar.success {
    background: var(--success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.task-progress-bar.failure {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.task-progress-bar.canceled {
    background: #6b7280;
    box-shadow: none;
}

.task-status-text {
    font-size: 0.8em;
    margin-top: 2px;
    transition: all 0.3s;
}

/* 操作按钮 */
.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-stop-btn {
    background: rgba(239, 68, 68, 0.1);
    /* Keep opacity for now or define --danger-soft */
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s;
}

.task-stop-btn:hover {
    background: var(--danger);
    color: #fff;
}

.task-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* New Theme-aware Button Classes */
.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text);
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--primary);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: #fff;
}

.empty-task-state {
    padding: 40px 20px;
    text-align: center;
    opacity: 0.5;
    font-size: 0.9em;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   预览弹窗 (Modal) 全局样式底座
   ========================================== */
.modal {
    display: none !important;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.channel-modal-card {
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer-stats {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--modal-header);
    flex-shrink: 0;
}

[data-theme="light"] .modal-footer-stats,
[data-theme="light"] .modal-header-toolbar {
    background: #f8fafc !important;
    border-color: #cbd5e1;
}

.modal-header-toolbar {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--modal-header);
    z-index: 10;
    flex-shrink: 0;
}

.icon-spin {
    display: inline-block;
    animation: spin 2s linear infinite;
}

@media (max-width: 480px) {
    .task-panel {
        width: calc(100vw - 40px);
        right: 20px;
    }
}

:root {
    /* 深色模式 - 柔和护眼 (Material Dark 灵感) */
    --primary: #6366f1;
    /* Indigo 500 */
    --bg-body: #121212;
    /* 避免纯黑 */
    --bg-surface: #1e1e1e;
    /* 稍微提亮 */
    --bg-card: #252526;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text: #e0e0e0;
    /* 避免纯白 */
    --text-muted: #a0a0a0;
    --shadow: rgba(0, 0, 0, 0.4);

    /* 状态色 */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* 特定组件 */
    --preview-bg: rgba(15, 23, 42, 0.98);
    --btn-secondary-bg: rgba(255, 255, 255, 0.1);
    --btn-secondary-text: #ffffff;
    --checkbox-border: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] {
    --primary: #7C3AED;
    /* Deep Purple - Solid */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --glass-bg: #ffffff;
    /* Opaque white for cards */
    --glass-border: #e2e8f0;
    /* Slate 200 */

    --text: #0f172a;
    /* Slate 900 - Almost Black */
    --text-muted: #64748b;
    /* Slate 500 */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Card Shadow */

    /* Solid State Colors (No Fluorescence) */
    --success: #16a34a;
    /* Green 600 */
    --danger: #dc2626;
    /* Red 600 */
    --warning: #d97706;
    /* Amber 600 */
    --info: #2563eb;
    /* Blue 600 */

    --modal-bg: #ffffff;
    --modal-header: #ffffff;
    --input-bg: #f1f5f9;
    /* Slate 100 */
    --preview-bg: #ffffff;
    --btn-secondary-bg: #e2e8f0;
    --btn-secondary-text: #1e293b;
    --code-bg: #e2e8f0;
    --code-text: #334155;
    --btn-text: #ffffff;
    --text-highlight: #15803d;
    /* Green 700 */
    --text-loading: #4338ca;
    /* Indigo 700 */
    --checkbox-border: #cbd5e1;
}

/* Light Mode Card Depth */
[data-theme="light"] .glass-card,
[data-theme="light"] .modal {
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    background: #ffffff !important;
    backdrop-filter: none;
}


body {
    background-color: var(--bg-body);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
}

.output-item-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;

    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    position: relative;
}

.output-item-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.slug-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    margin-left: 8px;
    vertical-align: middle;
}

.url-display {
    background: var(--code-bg);
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    word-break: break-all;
    color: var(--code-text);
    border: 1px dashed var(--glass-border);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.url-display:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.url-display::after {
    content: "点击复制";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.url-display:hover::after {
    opacity: 1;
}

h1,
h2 {
    color: var(--primary);
}

.btn {
    background: var(--primary);
    color: var(--btn-text);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn:hover {
    filter: brightness(1.2);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.85em;
}

.toolbar-btn {
    height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 90px;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-secondary {
    background: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-text) !important;
}

.sub-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.form-group {
    margin-bottom: 16px;
}

.tab-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    opacity: 0.7;
}

.tab-btn i {
    font-size: 1.1em;
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    opacity: 1;
    font-weight: bold;
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}


#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: none;
}

.channel-table-container {
    width: 100%;
}

input,
textarea {
    width: 100%;
    background: var(--input-bg);
    color: var(--text);
    padding: 12px;
    border-radius: 8px;
    box-sizing: border-box;
}

#status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 8px;
    display: none;
    z-index: 3000;
}


.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 8px;
    min-height: 42px;
    margin-bottom: 8px;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
    font-weight: bold;
    font-size: 1.2em;
    padding-left: 2px;
}

.tag-remove:hover {
    opacity: 1;
    color: #ff4d4d;
}

/* ====== 标签拖拽排序样式 ====== */

/* 标签内容区域 */
.tag-content {
    pointer-events: none;
}

/* 拖拽中的克隆标签 */
.tag-dragging {
    cursor: grabbing !important;
    transition: none !important;
}

/* 原位置占位符 */
.tag-placeholder {
    opacity: 0.3 !important;
    border: 2px dashed var(--primary) !important;
    background: transparent !important;
}

/* 目标位置让出空间动画 */
.tag-shift-right {
    transform: translateX(15px);
    transition: transform 0.2s ease-out;
}

.tag-shift-left {
    transform: translateX(-15px);
    transition: transform 0.2s ease-out;
}

/* 拖拽激活状态 - 容器 */
.dragging-active .tag {
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1);
}

.dragging-active .tag:not(.tag-placeholder):not(.tag-dragging) {
    cursor: default;
}

/* ====== 标签编辑器样式 ====== */

/* 编辑模式：其他标签模糊 */
.tag-container.editing-mode .tag:not(.tag-editing) {
    filter: blur(2px) opacity(0.5);
    pointer-events: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* 正在编辑的标签高亮放大 */
.tag.tag-editing {
    transform: scale(1.15);
    z-index: 100;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    border: 2px solid var(--primary) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
}

/* 浮动编辑器 - 覆盖在标签上方 */
.tag-editor-overlay {
    position: absolute;
    z-index: 2000;
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--bg-surface);
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
    animation: editorPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes editorPopIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 输入框抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.4s ease;
}

.tag-edit-keyword {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 0.9em;
    outline: none;
    transition: all 0.2s ease;
    min-width: 100px;
}

.tag-edit-keyword:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tag-edit-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tag-edit-confirm,
.tag-edit-cancel {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tag-edit-cancel {
    background: var(--danger);
}

.tag-edit-confirm:hover {
    background: #7c7ff0;
    transform: scale(1.1);
}

.tag-edit-cancel:hover {
    background: #f87171;
    transform: scale(1.1);
}

.sub-selector-list {
    max-height: 380px;
    overflow-y: auto;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    /* 左对齐 */
    text-align: left !important;
}

.sub-checkbox-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 8px !important;
    cursor: pointer !important;
    width: 100% !important;
    box-sizing: border-box !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text) !important;

}

.sub-checkbox-item:last-child {
    border-bottom: none;
}

.sub-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.sub-checkbox-item span {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    text-align: left !important;
    font-size: 0.9em;
}

.sub-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}


.preview-float {
    position: absolute;
    z-index: 1000;
    width: 100%;
    left: 0;
    bottom: 100%;
    /* 向上浮出 */
    background: var(--preview-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    /* 底部间距 */
    max-height: 320px;
    /* 限制最高高度，比之前稍微缩小一点更稳 */
    overflow-y: auto;
    display: none;
    font-size: 0.9em;
    color: var(--text);
    box-shadow: 0 -10px 40px var(--shadow);
    /* 投影方向也向上 */
    scroll-behavior: smooth;
    box-sizing: border-box;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] .preview-item small {
    color: var(--text-muted) !important;
}

.preview-item img {
    height: 24px;
    width: 24px;
    object-fit: contain;
    background: rgba(125, 125, 125, 0.1);
    padding: 2px;
    border-radius: 4px;
}

.edit-mode {
    border: 2px solid var(--primary) !important;
    animation: pulse 2s infinite;
}

.sub-item {
    transition: opacity 0.2s;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* ============================================================
   控制台日志区域 (Terminal Look)
   ============================================================ */
.console-panel {
    position: fixed;
    bottom: 20px;
    right: 420px;
    /* 避开任务面板 */
    width: 500px;
    height: 350px;
    background: var(--bg-surface);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 15px 45px var(--shadow);
    z-index: 2003;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.console-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.console-header {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    /* 增加移动手势 */
    user-select: none;
    /* 防止选中文本 */
}

.console-header h3 {
    margin: 0;
    font-size: 0.9em;
    color: #a5b4fc;
    letter-spacing: 0.5px;
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #cbd5e1;
    background: #000;
    /* 纯黑背景更像终端 */
    scroll-behavior: smooth;
}

.console-line {
    margin-bottom: 4px;
    word-break: break-all;
    white-space: pre-wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 2px;
}

.log-time {
    color: #64748b;
    margin-right: 8px;
    font-weight: 500;
}

.log-content {
    color: #e2e8f0;
}

/* 通用 Logo 样式 (PC & Mobile) */
.channel-table-container img {
    background: rgba(125, 125, 125, 0.1);
    padding: 2px;
    border-radius: 4px;
    object-fit: contain;
}

/* 移动端适配 */
@media (max-width: 1000px) {
    .console-panel {
        right: 20px;
        bottom: 80px;
        width: calc(100vw - 40px);
        height: 300px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        margin: 10px auto;
        padding: 10px;
    }

    .glass-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    /* 隐藏表头 */
    .channel-table-container thead {
        display: none;
    }

    /* 表格转卡片列表 */
    .channel-table-container,
    .channel-table-container tbody,
    .channel-table-container tr,
    .channel-table-container td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .channel-table-container tr {
        background: var(--bg-card);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 8px;
        position: relative;
        overflow: hidden;
        transition: all 0.2s;
        opacity: 1 !important;
        /* 覆盖之前的透明度设置 */
    }

    .channel-table-container tr.card-selected {
        border-color: #fbbf24 !important;
        background: rgba(251, 191, 36, 0.05) !important;
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
    }

    .channel-table-container tr[style*="opacity: 0.5"] {
        background: rgba(0, 0, 0, 0.4);
    }

    [data-theme="light"] .channel-table-container tr[style*="opacity: 0.5"] {
        background: rgba(0, 0, 0, 0.05);
        /* Lighter background for disabled items in light mode */
        opacity: 0.6 !important;
    }

    /* 单元格样式适配卡片 */
    .channel-table-container td {
        padding: 4px 0 !important;
        border: none !important;
        display: flex;
        align-items: flex-start;
        /* 改为起点对齐，防止长文本错位 */
        gap: 8px;
        min-height: 20px;
        gap: 8px;
        min-height: 20px;
        font-size: 13px;
        /* 统一字号 */
        color: var(--text);
        /* 统一内容颜色 */
        line-height: 1.4;
    }

    /* 为特定字段添加标签 */
    .channel-table-container td::before {
        content: attr(data-label);
        font-weight: 600;
        /* 统一样式：中粗体 */
        color: var(--text-muted);
        /* 使用主题变量 */
        min-width: 60px;
        font-size: 13px;
        flex-shrink: 0;
    }

    [data-theme="light"] .channel-table-container td::before {
        font-weight: 700;
        color: var(--text-muted);
        /* Ensure legible in light mode */
    }

    /* 隐藏不需要标签的字段 */
    .channel-table-container td:nth-child(1)::before,
    .channel-table-container td:nth-child(2)::before {
        display: none;
    }

    /* 复选框位置 */
    .channel-table-container td:nth-child(1) {
        position: absolute;
        top: 12px;
        right: 12px;
        width: auto;
        padding: 0 !important;
        z-index: 2;
    }

    .channel-table-container td:nth-child(2) {
        margin-bottom: 8px;
        padding-top: 0 !important;
    }

    .channel-table-container td:nth-child(2) img {
        height: 28px !important;
        max-width: 120px;
        object-fit: contain;
        border-radius: 4px;
        background: rgba(125, 125, 125, 0.1);
        /* Neutral grey bg for logos */
        padding: 2px;
    }

    /* 截图预览区域特殊处理 */
    .channel-table-container td:has(img[style*="height: 40px"]) {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-top: 10px;
    }

    .channel-table-container td:has(img[style*="height: 40px"])::before {
        margin-bottom: 4px;
    }

    .channel-table-container td img[style*="height: 40px"] {
        height: auto !important;
        max-height: 160px;
        width: 100% !important;
        max-width: 100%;
        border-radius: 10px;
        object-fit: cover;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* 底部操作按钮 */
    .channel-table-container td:last-child {
        margin-top: 10px;
        padding-top: 10px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        display: block;
    }

    .channel-table-container td:last-child::before {
        display: none;
    }

    .channel-table-container td:last-child .btn {
        width: 100%;
        padding: 8px;
        font-size: 15px;
        border-radius: 10px;
        font-weight: bold;
    }

    /* 弹窗及工具栏适配 - 修复显示不全 */
    .modal .glass-card {
        height: 100dvh !important;
        /* 使用 dynamic vh 处理移动端地址栏变动 */
        max-height: 100dvh !important;
        border-radius: 0;
        padding: 0 !important;
        width: 100vw !important;
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* 顶部工具栏高度优化 */
    #channel_modal .glass-card>div:first-child {
        padding: 8px 12px !important;
        /* 缩小内边距 */
        gap: 6px !important;
        background: var(--modal-header) !important;
        border-bottom: 1px solid var(--glass-border);
        z-index: 10;
    }

    /* 核心修复：工具栏按钮排版美化 & 紧凑化 (iOS 增强版) */
    #channel_modal .glass-card>div:first-child>div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        /* 统一更小的间距 */
        width: 100% !important;
    }

    .toolbar-btn {
        flex: 1 1 calc(50% - 4px) !important;
        /* 增加余量防止 iOS 溢出 */
        max-width: calc(50% - 4px) !important;
        font-size: 13px !important;
        height: 38px !important;
        border-radius: 8px !important;
        font-weight: 500;
        padding: 0 2px !important;
        display: flex;
        /* 移除 !important 以允许 JS 控制显隐 */
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    /* ========== 移动端工具栏按钮美化 (效果图风格) ========== */

    /* 全选/反选按钮的父容器强制100%宽度 */
    .modal-header-toolbar>div:last-child>div:has(.toolbar-btn[onclick*="toggleSelectAll"]) {
        width: 100% !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }

    /* 全选/反选/全选启用/全选禁用 - 白色描边风格 */
    .toolbar-btn[onclick*="toggleSelectAll"],
    .toolbar-btn[onclick*="invertSelection"],
    .toolbar-btn[onclick*="selectByStatus"],
    #sel_all_btn,
    #sel_inv_btn,
    #sel_enabled_btn,
    #sel_disabled_btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 12px !important;
        height: 32px !important;
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        color: var(--text) !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        padding: 0 8px !important;
    }

    .toolbar-btn[onclick*="toggleSelectAll"]:hover,
    .toolbar-btn[onclick*="invertSelection"]:hover,
    .toolbar-btn[onclick*="selectByStatus"]:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
    }

    /* 快速检测 - 紫色渐变描边风格 */
    #check_btn {
        flex: 1 1 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        height: 36px !important;
        font-size: 13px !important;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3)) !important;
        border: 1.5px solid #8b5cf6 !important;
        color: #c4b5fd !important;
        border-radius: 12px !important;
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
    }

    #check_btn:hover {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.5)) !important;
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.4) !important;
    }

    /* 深度检测 - 粉红渐变描边风格 */
    #check_visual_btn {
        flex: 1 1 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        height: 36px !important;
        font-size: 13px !important;
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(219, 39, 119, 0.25)) !important;
        border: 1.5px solid #ec4899 !important;
        color: #f9a8d4 !important;
        border-radius: 12px !important;
        box-shadow: 0 0 15px rgba(236, 72, 153, 0.2) !important;
    }

    #check_visual_btn:hover {
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.4), rgba(219, 39, 119, 0.4)) !important;
        box-shadow: 0 0 20px rgba(236, 72, 153, 0.4) !important;
    }

    /* 刷新节目表 - 绿色描边透明背景 */
    #refresh_epg_btn {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        height: 32px !important;
        font-size: 12px !important;
        background: transparent !important;
        border: 1.5px solid #10b981 !important;
        color: #6ee7b7 !important;
        border-radius: 12px !important;
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
    }

    #refresh_epg_btn:hover {
        background: rgba(16, 185, 129, 0.15) !important;
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3) !important;
    }

    /* 启用选中 - 绿色渐变实心 + 底部发光 */
    .toolbar-btn[onclick*="batchSetStatus(true)"],
    #batch_enable_btn {
        flex: 1 1 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        height: 38px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%) !important;
        border: none !important;
        color: white !important;
        border-radius: 22px !important;
        box-shadow: 0 4px 20px rgba(22, 163, 74, 0.5), 0 8px 30px rgba(22, 163, 74, 0.3) !important;
    }

    .toolbar-btn[onclick*="batchSetStatus(true)"]:hover,
    #batch_enable_btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 25px rgba(22, 163, 74, 0.6), 0 10px 40px rgba(22, 163, 74, 0.4) !important;
    }

    /* 禁用选中 - 红色渐变实心 + 底部发光 */
    .toolbar-btn[onclick*="batchSetStatus(false)"],
    #batch_disable_btn {
        flex: 1 1 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        height: 38px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        background: linear-gradient(180deg, #f87171 0%, #dc2626 100%) !important;
        border: none !important;
        color: white !important;
        border-radius: 22px !important;
        box-shadow: 0 4px 20px rgba(220, 38, 38, 0.5), 0 8px 30px rgba(220, 38, 38, 0.3) !important;
    }

    .toolbar-btn[onclick*="batchSetStatus(false)"]:hover,
    #batch_disable_btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 25px rgba(220, 38, 38, 0.6), 0 10px 40px rgba(220, 38, 38, 0.4) !important;
    }

    /* ========== 浅色主题按钮适配 ========== */
    [data-theme="light"] .toolbar-btn[onclick*="toggleSelectAll"],
    [data-theme="light"] .toolbar-btn[onclick*="invertSelection"],
    [data-theme="light"] .toolbar-btn[onclick*="selectByStatus"],
    [data-theme="light"] #sel_all_btn,
    [data-theme="light"] #sel_inv_btn,
    [data-theme="light"] #sel_enabled_btn,
    [data-theme="light"] #sel_disabled_btn {
        border: 1px solid rgba(0, 0, 0, 0.2) !important;
        color: #333 !important;
    }

    [data-theme="light"] .toolbar-btn[onclick*="toggleSelectAll"]:hover,
    [data-theme="light"] .toolbar-btn[onclick*="invertSelection"]:hover,
    [data-theme="light"] .toolbar-btn[onclick*="selectByStatus"]:hover,
    [data-theme="light"] #sel_all_btn:hover,
    [data-theme="light"] #sel_inv_btn:hover,
    [data-theme="light"] #sel_enabled_btn:hover,
    [data-theme="light"] #sel_disabled_btn:hover {
        background: rgba(0, 0, 0, 0.05) !important;
        border-color: rgba(0, 0, 0, 0.4) !important;
    }

    [data-theme="light"] #check_btn {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15)) !important;
        border: 1.5px solid #6366f1 !important;
        color: #4f46e5 !important;
        font-weight: 600 !important;
    }

    [data-theme="light"] #check_visual_btn {
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(219, 39, 119, 0.15)) !important;
        border: 1.5px solid #db2777 !important;
        color: #be185d !important;
        font-weight: 600 !important;
    }

    [data-theme="light"] #refresh_epg_btn {
        border-color: #059669 !important;
        color: #059669 !important;
        font-weight: 600 !important;
    }

    #check_options_container {
        width: 100% !important;
        background: rgba(255, 255, 255, 0.08);
        padding: 8px 12px !important;
        border-radius: 10px;
        margin-bottom: 2px;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
    }

    #check_options_container input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .modal-header-toolbar {
        padding: 12px 16px !important;
        gap: 6px !important;
        background: rgba(20, 20, 30, 0.98) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 20 !important;
    }

    .modal-footer-stats {
        padding: 8px 16px max(8px, env(safe-area-inset-bottom)) !important;
        gap: 6px !important;
        background: rgba(15, 15, 25, 1) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 20 !important;
        flex-direction: column !important;
    }

    .modal-footer-stats div:first-child {
        font-size: 13px !important;
        text-align: center;
        width: 100%;
    }

    .modal-footer-stats .btn {
        width: 100% !important;
        height: 36px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
        background: #334155 !important;
        display: flex;
        /* 移除 !important */
        align-items: center;
        justify-content: center;
    }

    #channel_list_container {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 10px !important;
    }

    #channel_list_container {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 10px !important;
    }

    /* 订阅列表适配 */
    .sub-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 18px 0 !important;
        gap: 14px !important;
    }

    .sub-item>div:first-child {
        width: 100% !important;
        margin-bottom: 4px;
    }

    /* 订阅项按钮组 */
    .sub-item>div:last-child {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        /* 5列平铺 */
        gap: 6px !important;
    }

    .sub-item .btn-sm {
        padding: 10px 0 !important;
        width: 100% !important;
        font-size: 11px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        border-radius: 8px !important;
        min-width: 0 !important;
    }

    /* 优化订阅项内的状态文字 */
    .sub-item small {
        display: block;
        word-break: break-all;
        margin-top: 4px;
        line-height: 1.2;
    }
}

/* ============================================================
   平板及大屏移动设备适配 (针对用户提到的 1504px / 2442px 等)
   ============================================================ */
@media (min-width: 769px) and (max-width: 2560px) {
    .modal .glass-card {
        max-height: calc(100dvh - 60px) !important;
        /* 对屏幕较大的平板，留出一定的上下边距 */
        height: auto !important;
        width: 92vw !important;
        max-width: 1200px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #channel_list_container {
        flex: 1 !important;
        overflow-y: auto !important;
    }

    /* 平板下的工具栏按钮美化 */
    #channel_modal .toolbar-btn {
        height: 36px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
        padding: 0 12px !important;
        flex: unset !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }

    #channel_search {
        height: 36px !important;
        border-radius: 10px !important;
        background: rgba(0, 0, 0, 0.3) !important;
    }

    /* 优化自动检测选项排版 */
    #check_options_container {
        background: rgba(99, 102, 241, 0.1) !important;
        padding: 5px 12px !important;
        border-radius: 8px !important;
        border: 1px solid rgba(99, 102, 241, 0.2) !important;
    }

    /* 平板模式下让统计栏也保持固定且更美观 */
    .modal-footer-stats {
        position: sticky;
        bottom: 0;
        background: rgba(15, 15, 25, 1) !important;
        z-index: 10;
        padding: 12px 24px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    }

    .modal-footer-stats .btn {
        height: 36px !important;
        padding: 0 20px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
}

/* ==========================================
   图片预览 Lightbox
   ========================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-out;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 3001;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   移动端频道预览卡片 - 双层布局 (大卡片 + 毛玻璃小卡片)
   仅在聚合预览模式下使用
   ============================================================ */

/* 大卡片容器 - 作为背景层 */
.mobile-channel-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    margin-bottom: 8px;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

/* 禁用状态的卡片 */
.mobile-channel-card.disabled {
    opacity: 0.6;
}

.mobile-channel-card.disabled .mobile-channel-card__bg {
    filter: grayscale(0.5);
}

/* 选中状态 - 渐变光圈效果 */
.mobile-channel-card.selected {
    border: 2px solid transparent !important;
    background:
        linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef) border-box !important;
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 40px rgba(139, 92, 246, 0.2),
        inset 0 0 20px rgba(99, 102, 241, 0.05);
    animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(99, 102, 241, 0.4),
            0 0 40px rgba(139, 92, 246, 0.2),
            inset 0 0 20px rgba(99, 102, 241, 0.05);
    }

    50% {
        box-shadow:
            0 0 25px rgba(99, 102, 241, 0.6),
            0 0 50px rgba(139, 92, 246, 0.3),
            inset 0 0 25px rgba(99, 102, 241, 0.1);
    }
}

/* 背景预览图层 - 右侧偏移显示 */
.mobile-channel-card__bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mobile-channel-card__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 5px 5px 0;
    filter: brightness(0.85);
}

/* 无预览图时的占位 - 右侧区域居中显示 */
.mobile-channel-card__bg--empty {
    background: linear-gradient(135deg, rgba(50, 55, 70, 0.6), rgba(40, 45, 60, 0.8));
}

.mobile-channel-card__bg--empty span {
    font-size: 3em;
    opacity: 0.4;
    color: var(--text-muted);
}

/* 移动端卡片复制链接按钮 - 预览图右下角 */
.mobile-channel-card__copy-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-channel-card__copy-btn:hover {
    background: rgba(99, 102, 241, 0.8);
    transform: scale(1.1);
}

.mobile-channel-card__copy-btn:active {
    transform: scale(0.95);
}

/* 浅色主题适配 */
[data-theme="light"] .mobile-channel-card__copy-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .mobile-channel-card__copy-btn:hover {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

/* 毛玻璃信息小卡片 - 左侧 55% 宽度 */
.mobile-channel-card__info {
    position: relative;
    z-index: 2;
    width: 55%;
    min-width: 55%;
    background: rgba(40, 45, 60, 0.55);
    backdrop-filter: blur(25px) saturate(1.2);
    -webkit-backdrop-filter: blur(25px) saturate(1.2);
    border-radius: 5px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}

/* 浅色主题适配 */
/* 浅色主题适配 - 增加毛玻璃 */
[data-theme="light"] .mobile-channel-card__info {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(25px) saturate(1.5);
    -webkit-backdrop-filter: blur(25px) saturate(1.5);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* 频道 Logo - 大卡片右上角（预览图上方） */
.mobile-channel-card__logo {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 56px;
    height: 40px;
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
    padding: 0;
    z-index: 10;
}

/* 信息行 */
.mobile-channel-card__row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--text);
}

.mobile-channel-card__label {
    min-width: 40px;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.mobile-channel-card__value {
    flex: 1;
    word-break: break-word;
}

/* 节目标签样式 */
.mobile-channel-card__epg-tag {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.mobile-channel-card__epg-tag--empty {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.2);
}

/* 上次检测时间 */
.mobile-channel-card__check-time {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 4px;
}

/* 底部操作栏 */
.mobile-channel-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .mobile-channel-card__actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

/* 圆形复选框 - 新拟态 Neumorphism 风格 */
.mobile-channel-card__checkbox {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.mobile-channel-card__checkbox input {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    height: 40px;
    width: 40px;
    background: rgba(60, 65, 80, 0.9);
    box-shadow:
        -5px -5px 10px rgba(255, 255, 255, 0.08),
        5px 5px 10px rgba(0, 0, 0, 0.4),
        inset -3px -3px 8px rgba(255, 255, 255, 0.1),
        inset 3px 3px 8px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border: none;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s ease;
    position: relative;
    margin: 0;
}

.mobile-channel-card__checkbox input::after {
    content: '';
    width: 10px;
    height: 16px;
    border: solid rgba(150, 150, 150, 0.5);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    transition: all 0.4s ease;
    margin-bottom: 3px;
}

.mobile-channel-card__checkbox input:checked {
    background: rgba(60, 65, 80, 0.9);
    box-shadow:
        -6px -6px 12px rgba(255, 255, 255, 0.08),
        6px 6px 12px rgba(0, 0, 0, 0.4);
}

.mobile-channel-card__checkbox input:checked::after {
    border-color: #10b981;
}

/* 浅色主题适配 */
[data-theme="light"] .mobile-channel-card__checkbox input {
    background: #ececec;
    box-shadow:
        -10px -10px 15px rgba(255, 255, 255, 0.5),
        10px 10px 15px rgba(0, 0, 70, 0.12),
        inset -10px -10px 15px rgba(255, 255, 255, 0.5),
        inset 10px 10px 15px rgba(70, 70, 70, 0.12);
    border: 4px solid #ececec;
}

[data-theme="light"] .mobile-channel-card__checkbox input::after {
    border-color: #7a7a7a;
}

[data-theme="light"] .mobile-channel-card__checkbox input:checked {
    box-shadow:
        -10px -10px 15px rgba(255, 255, 255, 0.5),
        10px 10px 15px rgba(70, 70, 70, 0.12);
}

[data-theme="light"] .mobile-channel-card__checkbox input:checked::after {
    border-color: #15e38a;
}

/* 禁用/启用按钮 - 胶囊形状红色 */
/* 切换按钮 */
.mobile-channel-card__toggle-btn {
    flex: 1;
    max-width: 140px;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.mobile-channel-card__toggle-btn--disable {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.mobile-channel-card__toggle-btn--enable {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
}

.mobile-channel-card__toggle-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}