/* 极速视频剪辑 —— 全局样式（暗色主题，桌面 / 手机自适应） */

:root {
    --bg: #0b0d12;
    --bg2: #12151d;
    --panel: #151924;
    --panel2: #1a1f2d;
    --line: #262c3b;
    --line2: #333b4f;
    --text: #e8ebf2;
    --dim: #8b93a7;
    --accent: #f59e0b;
    --accent2: #fbbf24;
    --accent-dark: #b45309;
    --ok: #34d399;
    --warn: #fbbf24;
    --err: #f87171;
    --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 关键修复：任何带 hidden 属性的元素一律不显示（防止 display:flex 覆盖 hidden） */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
    background:
        radial-gradient(1200px 500px at 50% -100px, #1a2030 0%, transparent 60%),
        var(--bg);
    color: var(--text);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    padding: 0 16px 40px;
}

.wrap {
    max-width: 1020px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------------- 顶栏 ---------------- */
/* ---------------- 全站置顶导航栏 ---------------- */
.sitenav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 13, 18, .88);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
    margin: 0 -16px;
}
.sitenav-in {
    max-width: 1020px; margin: 0 auto;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
}
.sitenav .nav-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit; margin-right: 8px; min-width: 0;
}
.sitenav .nav-logo {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center; font-size: 17px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, .35);
}
.sitenav .nav-name { font-size: 16px; font-weight: 700; white-space: nowrap; letter-spacing: .3px; }
.sitenav .nav-links { display: flex; align-items: center; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.sitenav .nav-links a {
    color: var(--dim); text-decoration: none;
    font-size: 14px; padding: 7px 12px; border-radius: 8px;
    white-space: nowrap; transition: color .15s, background .15s;
}
.sitenav .nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.sitenav .nav-links a.active { color: var(--accent2); }
@media (max-width: 560px) {
    .sitenav-in { padding: 8px 12px; gap: 4px; flex-wrap: wrap; }
    .sitenav .nav-name { font-size: 15px; }
    .sitenav .nav-links a { padding: 6px 9px; font-size: 13px; }
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 2px 6px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.logo {
    width: 42px; height: 42px;
    flex: none;
    display: grid; place-items: center;
    font-size: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: 0 4px 18px rgba(245, 158, 11, .35);
}
.brand-text h1 { font-size: 19px; letter-spacing: .5px; white-space: nowrap; }
.brand-text p { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.topbar .btn.primary { margin-left: auto; }

/* ---------------- 通用卡片 / 按钮 ---------------- */
.card {
    background: linear-gradient(180deg, var(--panel2) 0%, var(--panel) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.btn {
    appearance: none;
    border: 1px solid var(--line2);
    background: #1d2331;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { background: #252c3e; border-color: #3d4660; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
    background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 55%, #e08b06 100%);
    border-color: var(--accent-dark);
    color: #241503;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(245, 158, 11, .28);
}
.btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fcd34d 0%, var(--accent2) 55%, var(--accent) 100%);
    box-shadow: 0 6px 22px rgba(245, 158, 11, .4);
}
.btn.big { padding: 12px 26px; font-size: 15.5px; border-radius: 12px; }
.btn.icon {
    width: 44px; height: 44px;
    padding: 0;
    font-size: 17px;
    border-radius: 50%;
    display: grid; place-items: center;
}
.btn.danger { border-color: #7f1d1d; background: #2a1416; color: #fca5a5; }
.btn.danger:hover:not(:disabled) { background: #3b191c; border-color: #b91c1c; }

.grow { flex: 1; }

/* ---------------- 播放区 ---------------- */
.stage {
    position: relative;
    min-height: 300px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(600px 260px at 50% 0%, #1c2233 0%, transparent 70%),
        #0d1017;
}
.stage.dragging { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }

.drop-hint { text-align: center; padding: 56px 24px; }
.dh-icon { font-size: 44px; margin-bottom: 12px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.dh-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.dh-sub { font-size: 13px; color: var(--dim); }

.stage video {
    display: none;
    width: 100%;
    max-height: 56vh;
    background: #000;
    outline: none;
}
.stage video.ready { display: block; }

/* 暂停时的抖音式大播放键（点视频任意处播放/暂停） */
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}
.play-overlay svg {
    width: 86px;
    height: 86px;
    fill: rgba(255, 255, 255, .85);
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .55));
    animation: playPop .18s ease-out;
}
@keyframes playPop {
    from { transform: scale(1.55); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.codec-note {
    position: absolute;
    left: 50%; bottom: 14px;
    transform: translateX(-50%);
    max-width: 92%;
    background: rgba(12, 14, 20, .92);
    border: 1px solid var(--line2);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--warn);
    z-index: 3;
}

/* ---------------- 播放控制行 ---------------- */
.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: wrap;
}
.time { font-variant-numeric: tabular-nums; font-size: 15px; }
.time b { color: var(--accent2); font-weight: 700; }
.time .sep { color: var(--dim); margin: 0 6px; }

/* ---------------- 时间轴 ---------------- */
.tl-card { padding: 8px 6px 2px; }
#timelineCanvas {
    display: block;
    width: 100%;
    height: 112px;
    touch-action: none;   /* 手机拖手柄时不滚动页面 */
    cursor: pointer;
}

/* ---------------- 导出区 ---------------- */
.exportbar { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.modes { display: flex; gap: 12px; }
.mode-card { flex: 1; position: relative; display: block; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mc-body {
    display: block;
    height: 100%;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #131722;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.mode-card:hover .mc-body { border-color: var(--line2); background: #171c2a; }
.mc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.mc-title { font-size: 15.5px; font-weight: 700; }
.mc-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(245, 158, 11, .15);
    color: var(--accent2);
    border: 1px solid rgba(245, 158, 11, .35);
}
.mc-badge.alt { background: rgba(96, 165, 250, .12); color: #93c5fd; border-color: rgba(96, 165, 250, .3); }
.mc-desc { display: block; font-size: 12.5px; color: var(--dim); line-height: 1.55; }

/* 选中态：亮边框 + 光晕 + 右上角对勾 */
.mode-card input:checked + .mc-body {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(245, 158, 11, .10) 0%, rgba(245, 158, 11, .04) 100%), #131722;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, .3), 0 4px 18px rgba(245, 158, 11, .15);
}
.mode-card input:checked + .mc-body .mc-desc { color: #b9c0d2; }
.mode-card input:checked + .mc-body::after {
    content: "✓";
    position: absolute;
    top: -9px; right: -7px;
    width: 22px; height: 22px;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 900;
    color: #241503;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(245, 158, 11, .5);
}
.mode-card input:disabled + .mc-body { opacity: .45; cursor: not-allowed; }
.mode-card input:disabled ~ * { cursor: not-allowed; }

.mode-note { font-size: 12.5px; color: var(--dim); padding: 0 2px; }
.mode-note b { color: var(--accent2); }

.export-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 2px;
    border-top: 1px dashed var(--line);
}
.range-info { font-variant-numeric: tabular-nums; font-size: 14.5px; padding-top: 10px; }
.est { color: var(--dim); font-size: 13px; padding-top: 10px; }
.export-row .btn.big { margin-top: 10px; }

/* ---------------- 进度 ---------------- */
.progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}
.ptrack {
    flex: 1;
    height: 12px;
    border-radius: 99px;
    background: #10131b;
    border: 1px solid var(--line);
    overflow: hidden;
}
.pfill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent2));
    box-shadow: 0 0 12px rgba(245, 158, 11, .5);
    transition: width .15s linear;
}
.ptext { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- 状态 / 元信息 ---------------- */
.status {
    min-height: 22px;
    font-size: 13.5px;
    color: var(--dim);
    padding: 0 4px;
}
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.error { color: var(--err); }

.meta { font-size: 12.5px; color: var(--dim); padding: 0 4px; word-break: break-all; }
.caps { font-size: 12px; color: #6b7285; padding: 0 4px; }

/* ---------------- SEO 介绍内容区 ---------------- */
.seo { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.seo section {
    background: linear-gradient(180deg, var(--panel2) 0%, var(--panel) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
}
.seo h2 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    line-height: 1.4;
}
.steps { list-style: none; display: flex; gap: 14px; }
.steps li {
    flex: 1;
    background: #131722;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--dim);
    line-height: 1.7;
}
.steps li b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 6px; }
.features { list-style: none; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.features li {
    background: #131722;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 15px;
    font-size: 12.5px;
    color: var(--dim);
    line-height: 1.65;
}
.features li b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.faq details {
    border-bottom: 1px dashed var(--line);
    padding: 4px 0;
}
.faq details:last-child { border-bottom: none; }
.faq summary {
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
    padding: 9px 4px;
    list-style-position: inside;
    user-select: none;
}
.faq summary:hover { color: var(--accent2); }
.faq p { font-size: 13.5px; color: var(--dim); padding: 2px 4px 12px 22px; }

.site-foot {
    text-align: center;
    font-size: 12.5px;
    color: #5b6377;
    padding: 22px 0 6px;
}
.site-foot a { color: #8b93a7; }

/* ---------------- 教程列表（首页 + 文章页共用） ---------------- */
.guides { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.guides a {
    display: block;
    background: #131722;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 13.5px;
    transition: border-color .15s, background .15s;
}
.guides a:hover { border-color: var(--accent); background: #171c2a; }
.guides a::before { content: "📖 "; }

/* ---------------- 教程文章页 ---------------- */
.crumb { font-size: 12.5px; color: var(--dim); padding: 0 2px; }
.crumb a { color: var(--dim); }
.crumb a:hover { color: var(--accent2); }
.art-body { padding: 26px 28px 22px; }
.art-body h1 { font-size: 23px; line-height: 1.45; margin-bottom: 12px; }
.art-lead {
    color: #b6bdcd;
    font-size: 14.5px;
    line-height: 1.8;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    margin: 14px 0 6px;
}
.art-body h2 {
    font-size: 17.5px;
    margin: 26px 0 10px;
    padding-left: 11px;
    border-left: 4px solid var(--accent);
}
.art-body p { font-size: 14px; color: #b6bdcd; line-height: 1.85; margin: 8px 0; }
.art-body p b, .art-steps li b { color: var(--text); }
.art-body a { color: var(--accent2); }
.art-steps { list-style: none; counter-reset: s; margin: 12px 0 4px; }
.art-steps li {
    position: relative;
    padding: 11px 0 11px 42px;
    font-size: 14px;
    color: #b6bdcd;
    line-height: 1.8;
    border-bottom: 1px dashed var(--line);
    counter-increment: s;
}
.art-steps li:last-child { border-bottom: none; }
.art-steps li::before {
    content: counter(s);
    position: absolute;
    left: 2px; top: 12px;
    width: 27px; height: 27px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #241503;
    font-weight: 800;
    font-size: 13.5px;
    border-radius: 8px;
}
.cta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 24px 0 6px;
    padding: 16px;
    background: rgba(245, 158, 11, .07);
    border: 1px dashed rgba(245, 158, 11, .4);
    border-radius: 12px;
}
.cta .note { color: var(--dim); font-size: 12.5px; }
.art-rel { padding: 20px 22px; }
.art-rel h2 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-left: 11px;
    border-left: 4px solid var(--accent);
}

/* ---------------- 老浏览器拦截 ---------------- */
#oldBrowser {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(8, 10, 14, .96);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.ob-box {
    max-width: 520px;
    text-align: center;
    background: #151924;
    border: 1px solid #333b4f;
    border-radius: 16px;
    padding: 40px 32px;
}
.ob-icon { font-size: 46px; margin-bottom: 14px; }
.ob-box h2 { font-size: 19px; margin-bottom: 12px; }
.ob-box p { font-size: 14px; color: #8b93a7; line-height: 1.9; }
.ob-box b { color: #f59e0b; }

/* ---------------- 手机端适配 ---------------- */
@media (max-width: 760px) {
    body { padding: 0 10px 32px; }
    .wrap { gap: 10px; }
    .topbar { padding: 12px 0 2px; gap: 10px; }
    .brand-text h1 { font-size: 17px; }
    .brand-text p { font-size: 11px; }
    .logo { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }

    .stage { min-height: 200px; }
    .stage video { max-height: 44vh; }
    .drop-hint { padding: 40px 14px; }
    .dh-title { font-size: 15px; }
    .dh-sub { font-size: 12px; }
    .play-overlay svg { width: 64px; height: 64px; }

    .controls { padding: 8px 10px; gap: 8px; }
    .controls .btn { padding: 9px 12px; font-size: 13px; }
    .btn.icon { width: 40px; height: 40px; }

    #timelineCanvas { height: 96px; }

    .exportbar { padding: 12px; }
    .modes { flex-direction: column; gap: 10px; }
    .export-row { flex-direction: column; align-items: stretch; gap: 4px; }
    .export-row .grow { display: none; }
    .range-info, .est { padding-top: 8px; }
    .export-row .btn.big { width: 100%; margin-top: 10px; }

    .progress-row { flex-wrap: wrap; }
    .ptrack { flex-basis: 100%; }

    .seo section { padding: 16px; }
    .seo h2 { font-size: 16px; }
    .steps { flex-direction: column; gap: 10px; }
    .features { grid-template-columns: 1fr; gap: 10px; }

    .guides { grid-template-columns: 1fr; }
    .art-body { padding: 18px 16px; }
    .art-body h1 { font-size: 19px; }
    .art-rel { padding: 16px; }
}
