/* ============================================================
   GIF分解与视频帧提取 · 工具专属样式
   全局导航/页脚/版心样式由 ../../style.css 提供，此处仅补充工具样式
   ============================================================ */

.tool-page-header { padding-bottom: 40px; }
.tool-page-header h1 { font-size: clamp(26px, 4vw, 38px); }
.hl-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tool-subtitle { margin-bottom: 20px !important; }
.tool-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tool-badge {
    font-size: 12px; font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(26,110,255,0.15);
    padding: 5px 14px; border-radius: 100px;
}

.tool-main { min-height: 60vh; }
.tool-workspace-section { padding-top: 48px; }

/* ===== 模式切换 ===== */
.mode-tabs {
    display: flex; gap: 10px; justify-content: center;
    margin-bottom: 28px; flex-wrap: wrap;
}
.mode-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 26px;
    font-family: inherit; font-size: 15px; font-weight: 600;
    color: var(--text-secondary);
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
}
.mode-tab:hover { border-color: var(--primary); color: var(--primary); }
.mode-tab.active {
    background: var(--primary-gradient);
    color: white; border-color: transparent;
    box-shadow: 0 6px 20px rgba(26,110,255,0.3);
}

/* ===== 拖拽上传区 ===== */
.dropzone {
    border: 2px dashed rgba(26,110,255,0.35);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f6f9ff 0%, #ffffff 100%);
    text-align: center;
    padding: 56px 24px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.dropzone.dragover { border-style: solid; }
.dz-icon { font-size: 46px; margin-bottom: 14px; }
.dz-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.dz-desc { font-size: 13px; color: var(--text-light); }

/* ===== 信息栏 ===== */
.info-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
}
.info-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    font-size: 12px; color: var(--text-secondary);
    background: white; border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 100px;
    white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 700; }

/* ===== 通用按钮 ===== */
.tool-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px;
    font-family: inherit; font-size: 13px; font-weight: 600;
    border-radius: 10px; border: none; cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tool-btn-primary {
    background: var(--primary-gradient); color: white;
    box-shadow: 0 4px 16px rgba(26,110,255,0.3);
}
.tool-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(26,110,255,0.4); }
.tool-btn-accent {
    background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%); color: white;
    box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}
.tool-btn-accent:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(255,107,53,0.4); }
.tool-btn-ghost {
    background: white; color: var(--primary);
    border: 1.5px solid rgba(26,110,255,0.4);
}
.tool-btn-ghost:hover:not(:disabled) { background: var(--primary-light); }
.tool-btn-danger {
    background: white; color: var(--danger);
    border: 1.5px solid rgba(220,38,38,0.4);
}
.tool-btn-danger:hover:not(:disabled) { background: var(--danger-light); }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ===== 表单控件 ===== */
.tool-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.tool-select, .tool-input, .tool-textarea {
    font-family: inherit; font-size: 13px;
    color: var(--text);
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    transition: var(--transition);
    min-width: 0;
}
.tool-select:focus, .tool-input:focus, .tool-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,110,255,0.12);
}
.tool-textarea { width: 100%; resize: vertical; line-height: 1.6; }
.tool-input[type="number"] { width: 90px; }
input[type="range"] { accent-color: var(--primary); width: 100px; }

/* ===== GIF 预览 ===== */
.preview-wrap {
    background: #0d1220;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.preview-stage {
    display: flex; justify-content: center; align-items: center;
    min-height: 120px;
    background:
        repeating-conic-gradient(#1a2236 0% 25%, #121829 0% 50%) 0 0 / 20px 20px;
    border-radius: 10px;
    padding: 12px;
}
.preview-stage canvas {
    max-width: 100%; max-height: 380px;
    image-rendering: auto;
    border-radius: 6px;
}
.preview-controls {
    display: flex; align-items: center; gap: 14px;
    margin-top: 14px; flex-wrap: wrap;
}
.preview-status { font-size: 12px; color: rgba(255,255,255,0.65); font-family: monospace; white-space: nowrap; }
.preview-progress {
    flex: 1; min-width: 120px; height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 100px; cursor: pointer; overflow: hidden;
}
.preview-progress-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #ff6b35, #ff4757);
    border-radius: 100px;
    transition: width 0.15s linear;
}

/* ===== 工具栏 ===== */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
}
.toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); }
.toolbar-count { font-size: 12px; font-weight: 600; color: var(--text-light); }

/* ===== 帧网格 ===== */
.frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.frame-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.frame-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.frame-card.selected { border-color: var(--primary); box-shadow: 0 4px 16px rgba(26,110,255,0.2); }
.frame-thumb {
    width: 100%; aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    background:
        repeating-conic-gradient(#eef1f7 0% 25%, #ffffff 0% 50%) 0 0 / 16px 16px;
    overflow: hidden;
}
.frame-thumb canvas, .frame-thumb img { max-width: 100%; max-height: 100%; display: block; }
.frame-meta {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px;
    font-size: 11px; color: var(--text-light);
    border-top: 1px solid var(--border);
    gap: 6px;
}
.frame-meta .fm-idx { font-weight: 700; color: var(--text); }
.frame-check {
    position: absolute; top: 8px; left: 8px;
    width: 22px; height: 22px;
    border-radius: 6px;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: transparent;
    transition: var(--transition);
    z-index: 2;
}
.frame-card.selected .frame-check { background: var(--primary); border-color: var(--primary); color: white; }
.frame-actions {
    display: flex; gap: 6px; padding: 0 8px 8px;
}
.frame-actions button {
    flex: 1; padding: 5px 0;
    font-family: inherit; font-size: 11px; font-weight: 600;
    border-radius: 6px; cursor: pointer;
    transition: var(--transition);
}
.fa-view { background: var(--primary-light); color: var(--primary); border: none; }
.fa-view:hover { background: var(--primary); color: white; }
.fa-dl { background: var(--bg-warm); color: var(--text-secondary); border: 1px solid var(--border); }
.fa-dl:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 视频工作区 ===== */
.video-workspace { margin-top: 4px; }
.video-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 18px;
}
.video-player-card {
    background: #0d1220;
    border-radius: var(--radius);
    padding: 16px;
}
.video-player-card video {
    width: 100%; max-height: 420px;
    border-radius: 10px; display: block;
    background: #000;
}
.video-player-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.video-control-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.vcc-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.vcc-mode { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.vcc-radio {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 500; color: var(--text);
    padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: 10px;
    cursor: pointer; transition: var(--transition);
}
.vcc-radio:hover { border-color: var(--primary); }
.vcc-radio input { accent-color: var(--primary); }
.vcc-radio:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.vcc-body { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.vcc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vcc-row label { font-size: 13px; color: var(--text-secondary); min-width: 84px; }
.vcc-hint { font-size: 12px; color: var(--text-light); }
.vcc-batch { border-top: 1px dashed var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ===== 进度条 ===== */
.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress-bar {
    flex: 1; height: 8px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 100px; overflow: hidden;
}
.progress-fill {
    height: 100%; width: 0;
    background: var(--primary-gradient);
    border-radius: 100px;
    transition: width 0.2s ease;
}
.progress-text { font-size: 12px; font-family: monospace; color: var(--text-secondary); white-space: nowrap; }

/* ===== 空态 ===== */
.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--text-light); font-size: 14px;
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ===== 功能亮点 ===== */
.feat-section { padding: 64px 0; }
.feat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.feat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    transition: var(--transition);
}
.feat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: rgba(26,110,255,0.2); }
.feat-icon { font-size: 30px; margin-bottom: 14px; }
.feat-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feat-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ===== 使用说明 ===== */
.how-section { padding: 64px 0 80px; }
.how-steps {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px; margin-bottom: 32px;
}
.how-step {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px;
    text-align: center; position: relative;
    transition: var(--transition);
}
.how-step:hover { box-shadow: var(--shadow-hover); border-color: rgba(26,110,255,0.2); }
.how-num {
    width: 44px; height: 44px;
    background: var(--primary-gradient); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900;
    margin: 0 auto 14px;
    box-shadow: 0 6px 16px rgba(26,110,255,0.3);
}
.how-step h4 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.how-step p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.tip-banner {
    display: flex; gap: 14px; align-items: flex-start;
    background: linear-gradient(135deg, #e8f1ff 0%, #f0f5ff 100%);
    border: 1.5px solid rgba(26,110,255,0.15);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.tip-icon { font-size: 24px; flex-shrink: 0; }
.tip-banner strong { display: block; font-size: 14px; color: var(--primary); margin-bottom: 6px; }
.tip-banner p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* ===== Lightbox ===== */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(5,8,18,0.85);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.lightbox-inner {
    background: white; border-radius: var(--radius);
    padding: 24px; max-width: min(92vw, 860px);
    max-height: 92vh; overflow: auto;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    position: relative;
}
.lightbox-close {
    position: absolute; top: 12px; right: 14px;
    width: 36px; height: 36px;
    border: none; border-radius: 10px;
    background: var(--bg-warm); color: var(--text-secondary);
    font-size: 20px; cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}
.lightbox-close:hover { background: var(--danger-light); color: var(--danger); }
.lightbox canvas { max-width: 100%; max-height: 60vh; border-radius: 10px; background: #0d1220; }
.lightbox-meta { font-size: 13px; color: var(--text-secondary); font-family: monospace; text-align: center; }

/* ===== Toast ===== */
.toast {
    position: fixed; left: 50%; bottom: 32px;
    transform: translateX(-50%);
    z-index: 10000;
    background: var(--text); color: white;
    font-size: 13px; font-weight: 500;
    padding: 11px 22px; border-radius: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 86vw; text-align: center;
}

[hidden] { display: none !important; }

/* ===== 解析中遮罩 ===== */
.processing-mask {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(6px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 18px;
}
.processing-mask .pm-spin {
    width: 46px; height: 46px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: fe-spin 0.9s linear infinite;
}
@keyframes fe-spin { to { transform: rotate(360deg); } }
.processing-mask .pm-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

/* ===== 响应式：1024px ===== */
@media (max-width: 1024px) {
    .feat-grid { grid-template-columns: repeat(2, 1fr); }
    .video-layout { grid-template-columns: 1fr; }
    .how-steps { grid-template-columns: 1fr; }
}

/* ===== 响应式：768px ===== */
@media (max-width: 768px) {
    .tool-workspace-section { padding-top: 32px; }
    .dropzone { padding: 40px 16px; }
    .dz-icon { font-size: 36px; }
    .dz-title { font-size: 15px; }
    .mode-tab { padding: 10px 18px; font-size: 13px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-group { justify-content: flex-start; }
    .frames-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    .frame-meta { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 8px; }
    .feat-grid { grid-template-columns: 1fr; }
    .video-player-bar { flex-direction: column; align-items: stretch; }
    .video-player-bar .tool-btn { justify-content: center; }
    .preview-controls { gap: 10px; }
    .tool-input[type="number"] { width: 78px; }
    .info-bar { flex-direction: column; align-items: flex-start; }
    .lightbox { padding: 12px; }
    .lightbox-inner { padding: 16px; }
    .tip-banner { flex-direction: column; }
}

/* ===== 响应式：480px ===== */
@media (max-width: 480px) {
    .frames-grid { grid-template-columns: repeat(2, 1fr); }
    .tool-badge { font-size: 11px; padding: 4px 10px; }
    .vcc-row label { min-width: 74px; font-size: 12px; }
}
