/* ===== 视频转GIF/音频提取 工具专属样式 =====
   设计令牌与组件基调复用官网 style.css / drill.html
   导航与页脚样式完全由官网 ../../style.css 决定，此处不覆盖 */

/* 工具区底色与官网 section 基调衔接 */
.tk-section {
    padding: 40px 0 80px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* ===== 本地运行提示条 ===== */
.tk-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    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;
    margin-bottom: 32px;
}
.tk-notice-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tk-notice-icon svg { width: 22px; height: 22px; color: white; }
.tk-notice h4 { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.tk-notice p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.tk-notice p b { color: var(--text); }

/* ===== 布局：左工作台 + 右侧栏 ===== */
.tk-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 28px;
    align-items: start;
}
.tk-workbench {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.tk-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }

/* ===== 引擎状态条 ===== */
.tk-engine {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.tk-engine-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
    animation: tk-pulse 1.2s infinite;
}
.tk-engine.ready .tk-engine-dot { background: var(--success); animation: none; }
.tk-engine.error .tk-engine-dot { background: var(--danger); animation: none; }
.tk-engine.error { cursor: pointer; border-color: rgba(220,38,38,0.35); }
.tk-engine.error:hover { background: var(--danger-light); }
.tk-engine-text { flex: 1; line-height: 1.5; }
.tk-engine-pct { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
@keyframes tk-pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* ===== 功能选项卡 ===== */
.tk-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.tk-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.tk-tab svg { width: 16px; height: 16px; }
.tk-tab:hover { border-color: var(--primary); color: var(--primary); }
.tk-tab.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(26,110,255,0.3);
}

/* ===== 上传区 ===== */
.tk-upload { position: relative; }
.tk-upload-inner {
    border: 2px dashed rgba(26,110,255,0.3);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.tk-upload-inner:hover { border-color: var(--primary); background: var(--primary-light); }
.tk-upload.dragging .tk-upload-inner {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}
.tk-upload-icon {
    width: 56px; height: 56px;
    background: var(--primary-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 8px 20px rgba(26,110,255,0.25);
}
.tk-upload-icon svg { width: 26px; height: 26px; color: white; }
.tk-upload-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tk-upload-sub { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.tk-upload-warn { font-size: 12px; color: var(--text-light); }

/* ===== 已选文件卡片 ===== */
.tk-file {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 4px;
}
.tk-file-thumb {
    width: 48px; height: 48px;
    border-radius: 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.tk-file-info { flex: 1; min-width: 0; }
.tk-file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.tk-file-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-light); }
.tk-file-probe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tk-probe-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 100px;
    background: var(--primary-light);
    color: var(--primary);
}
.tk-file-remove {
    width: 32px; height: 32px;
    border: 1.5px solid var(--border);
    background: white;
    border-radius: 8px;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    line-height: 1;
}
.tk-file-remove:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* ===== 参数面板 ===== */
.tk-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    background: white;
}
.tk-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tk-panel-title::before {
    content: '';
    width: 6px; height: 16px;
    background: var(--primary-gradient);
    border-radius: 3px;
}
.tk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}
.tk-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tk-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.tk-val { color: var(--primary); font-weight: 700; margin-left: 4px; }
.tk-field input[type="number"] {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: white;
    transition: var(--transition);
    width: 100%;
}
.tk-field input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,110,255,0.12);
}
.tk-field input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 100px;
    background: var(--border);
    cursor: pointer;
}
.tk-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(26,110,255,0.4);
    cursor: pointer;
}
.tk-field input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

/* 分段选择器 */
.tk-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-seg button {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    background: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: normal;
    line-height: 1.45;
}
.tk-seg button:hover { border-color: var(--primary); color: var(--primary); }
.tk-seg button.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.tk-seg-3 button { min-width: 0; }

.tk-tip {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.7;
    background: var(--bg-warm);
    border-radius: 8px;
    padding: 10px 14px;
}

/* ===== 操作按钮 ===== */
.tk-actions { display: flex; gap: 12px; }
.tk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}
.tk-btn svg { width: 16px; height: 16px; }
.tk-btn-primary {
    flex: 1;
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 20px rgba(26,110,255,0.3);
}
.tk-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(26,110,255,0.4);
}
.tk-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.tk-btn-ghost {
    background: white;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.tk-btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 进度区 ===== */
.tk-progress { display: flex; flex-direction: column; gap: 8px; }
.tk-progress-bar {
    height: 8px;
    background: var(--bg-warm);
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.tk-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 100px;
    transition: width 0.3s ease;
}
.tk-progress-text { font-size: 12px; color: var(--text-light); font-variant-numeric: tabular-nums; }

/* ===== 错误框 ===== */
.tk-error {
    background: var(--danger-light);
    border: 1.5px solid rgba(220,38,38,0.2);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    color: var(--danger);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== 右侧卡片 ===== */
.tk-side-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.tk-side-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tk-side-card h3 svg { width: 18px; height: 18px; color: var(--primary); }

/* 结果列表 */
.tk-results { display: flex; flex-direction: column; gap: 12px; }
.tk-results-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.8;
    padding: 24px 0;
}
.tk-results-empty svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: 0.4; }

.tk-result {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--bg-warm);
}
.tk-result-media {
    width: 84px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #0b1220;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tk-result-media img { width: 100%; height: 100%; object-fit: cover; }
.tk-result-media audio { width: 100%; height: 36px; }
.tk-result-media .tk-result-fileicon { font-size: 26px; }
.tk-result-info { flex: 1; min-width: 0; }
.tk-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.tk-result-meta { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.tk-result-actions { display: flex; gap: 8px; }
.tk-result-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}
.tk-result-btn svg { width: 13px; height: 13px; }
.tk-result-btn.dl { background: var(--primary-gradient); color: white; }
.tk-result-btn.dl:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,110,255,0.35); }
.tk-result-btn.rm { background: white; color: var(--text-light); border: 1.5px solid var(--border); }
.tk-result-btn.rm:hover { border-color: var(--danger); color: var(--danger); }

/* FAQ 列表 */
.tk-faq { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.tk-faq li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 18px;
    position: relative;
}
.tk-faq li::before {
    content: '';
    position: absolute;
    left: 0; top: 9px;
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
}
.tk-faq li b { color: var(--text); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .tk-layout { grid-template-columns: 1fr; }
    .tk-side { position: static; }
}
@media (max-width: 768px) {
    .tk-section { padding: 28px 0 56px; }
    .tk-workbench { padding: 18px; gap: 16px; }
    .tk-notice { padding: 16px 18px; flex-direction: column; gap: 12px; }
    .tk-grid { grid-template-columns: 1fr; }
    .tk-tabs { gap: 8px; }
    .tk-tab { flex: 1; justify-content: center; padding: 10px 8px; font-size: 12px; }
    .tk-upload-inner { padding: 28px 16px; }
    .tk-actions { flex-direction: column; }
    .tk-btn { width: 100%; }
    .tk-side-card { padding: 18px; }
    .tk-result { flex-wrap: wrap; }
    .tk-result-media { width: 100%; height: 120px; }
    .tk-result-media audio { height: 44px; }
    .tk-workbench { padding: 16px; }
    .tk-panel { padding: 16px; }
    .tk-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
    .tk-tab { padding: 9px 4px; font-size: 11px; white-space: normal; line-height: 1.4; }
    .tk-seg { flex-direction: column; }
    .tk-seg button { width: 100%; }
    .tk-file { flex-wrap: wrap; }
}

/* ===== 小屏手机（≤480px） ===== */
@media (max-width: 480px) {
    .tk-workbench { padding: 14px; }
    .tk-panel { padding: 14px; }
    .tk-upload-inner { padding: 24px 14px; }
    .tk-notice { padding: 14px 16px; }
}

/* ===== 移动端导航与页脚适配（照抄官网首页内联 <style> 规则，
   官网 style.css 本身不含媒体查询，各页面需在自身样式中携带） ===== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 16px 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        gap: 4px;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
