:root {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: #1d2939;
    background: #f4f7fb;
    font-synthesis: none
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

.app {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 30px 24px
}

.topbar {
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e4eaf2;
    margin-bottom: 26px
}

.back {
    color: #66758a;
    text-decoration: none;
    font-size: 14px;
    min-width: 130px
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #2563eb;
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: -1px
}

.brand strong {
    display: block;
    font-size: 18px
}

.brand small {
    display: block;
    color: #8b98aa;
    font-size: 10px;
    letter-spacing: 1.3px;
    margin-top: 4px
}

.version {
    font-size: 12px;
    color: #4268b5;
    background: #eaf1ff;
    border-radius: 20px;
    padding: 7px 12px;
    min-width: 130px;
    text-align: center
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start
}

.main-column {
    display: grid;
    gap: 22px
}

.panel {
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 18px;
    box-shadow: 0 5px 22px #1d35570a
}

.preview-panel,
.cuts-panel {
    padding: 24px
}

.panel-heading,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px
}

.h1,
h1,
h2,
p {
    margin-top: 0
}

h1 {
    font-size: 23px;
    margin-bottom: 7px;
    letter-spacing: -.5px
}

h2 {
    font-size: 18px;
    margin-bottom: 7px
}

.panel-heading p,
.section-heading p,
.muted {
    font-size: 13px;
    color: #7b8798;
    margin-bottom: 0;
    line-height: 1.65
}

.primary-button,
.secondary-button,
.export-button {
    border: 0;
    border-radius: 10px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap
}

.primary-button {
    background: #2563eb;
    color: #fff;
    padding: 12px 17px;
    font-size: 14px
}

.upload-button input {
    display: none
}

.drop-zone {
    position: relative;
    min-height: 220px;
    aspect-ratio: 16/8.5;
    background: #101827;
    border-radius: 13px;
    overflow: hidden;
    display: grid;
    place-items: center
}

.drop-zone.dragover {
    outline: 3px solid #60a5fa;
    outline-offset: 3px
}

.drop-zone video {
    display: none;
    width: 100%;
    height: 100%;
    max-height: 490px;
    background: #101827;
    object-fit: contain
}

.drop-zone.has-video video {
    display: block
}

.drop-zone.has-video .empty-state {
    display: none
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #f1f5f9;
    gap: 8px;
    position: absolute;
    inset: 0
}

.upload-symbol {
    width: 48px;
    height: 48px;
    border: 1px solid #52627a;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 27px;
    color: #93b8ff;
    margin-bottom: 5px
}

.empty-state strong {
    font-size: 16px
}

.empty-state span,
.empty-state small {
    font-size: 12px;
    color: #9eacc0
}

.video-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #6c7a8f;
    font-size: 12px;
    padding: 14px 1px 11px
}

.seek-row {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #78869a;
    font-size: 12px
}

.seek-row input[type=range] {
    flex: 1;
    min-width: 40px;
    accent-color: #2563eb
}

.small-button {
    border: 1px solid #e0e6ef;
    background: #fff;
    border-radius: 7px;
    padding: 6px 9px;
    color: #4b5b70;
    cursor: pointer
}

.small-button:disabled,
.secondary-button:disabled,
.example-button:disabled {
    opacity: .45;
    cursor: not-allowed
}

.section-heading {
    margin-bottom: 18px
}

.secondary-button {
    padding: 10px 13px;
    border: 1px solid #d8e3f7;
    background: #f5f8ff;
    color: #275fc8;
    font-size: 13px
}

.cuts-list {
    display: grid;
    gap: 10px
}

.empty-cuts {
    border: 1px dashed #d8e0eb;
    border-radius: 12px;
    padding: 23px;
    text-align: center;
    color: #8a97a8;
    font-size: 13px;
    line-height: 1.8
}

.cut-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 38px;
    align-items: end;
    gap: 12px;
    padding: 14px;
    background: #f8faff;
    border: 1px solid #e5ebf5;
    border-radius: 12px
}

.cut-number {
    align-self: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #e4edff;
    color: #2862c8;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 750
}

.cut-field label,
.field-label {
    display: block;
    color: #77859a;
    font-size: 11px;
    margin-bottom: 6px
}

.cut-field input,
.filename-field input {
    width: 100%;
    border: 1px solid #dfe6ef;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    color: #243247;
    font: inherit;
    outline: none
}

.cut-field input:focus,
.filename-field input:focus {
    border-color: #6394f8;
    box-shadow: 0 0 0 3px #2563eb14
}

.delete-cut {
    border: 0;
    background: #fff0f0;
    color: #d14d4d;
    border-radius: 8px;
    height: 38px;
    font-size: 18px;
    cursor: pointer
}

.example-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 16px
}

.example-row>span {
    font-size: 12px;
    color: #8a97a8;
    margin-right: 3px
}

.example-button {
    border: 1px solid #e2e8f2;
    background: #fff;
    border-radius: 20px;
    padding: 7px 11px;
    color: #5c6b80;
    font-size: 12px;
    cursor: pointer
}

.export-panel {
    padding: 24px;
    position: sticky;
    top: 18px
}

.export-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #eaf1ff;
    color: #2563eb;
    font-size: 25px;
    margin-bottom: 18px
}

.export-panel h2 {
    font-size: 20px
}

.export-panel>.muted {
    margin-bottom: 22px
}

.summary {
    background: #f7f9fc;
    border: 1px solid #e9eef5;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 22px
}

.summary>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    color: #718096;
    font-size: 12px
}

.summary strong {
    font-size: 13px;
    color: #35445a;
    font-weight: 650
}

.summary .summary-total {
    border-top: 1px solid #e1e7f0;
    margin-top: 6px;
    padding-top: 15px;
    color: #34455f
}

.summary-total strong {
    font-size: 18px;
    color: #2563eb
}

.field-label {
    font-size: 12px
}

.filename-field {
    display: flex;
    align-items: center;
    gap: 8px
}

.filename-field input {
    min-width: 0
}

.filename-field span {
    color: #8390a2;
    font-size: 13px
}

.export-note {
    background: #fffaf0;
    border: 1px solid #f7e8c8;
    border-radius: 10px;
    padding: 13px;
    margin: 20px 0
}

.export-note strong {
    font-size: 12px;
    color: #8c6421
}

.export-note ul {
    padding-left: 17px;
    margin: 8px 0 0;
    color: #8b7959;
    font-size: 11px;
    line-height: 1.9
}

.export-button {
    width: 100%;
    padding: 14px 16px;
    background: #2563eb;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px
}

.export-button:disabled {
    opacity: .5;
    cursor: not-allowed
}

.export-button span {
    font-size: 19px
}

.status {
    margin-top: 13px;
    font-size: 12px;
    line-height: 1.6;
    color: #7d899a;
    text-align: center
}

.status.error {
    color: #c24141
}

.status.success {
    color: #15803d
}

.download-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    border-radius: 9px;
    background: #eaf8ef;
    color: #147d43;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 12px
}

footer {
    text-align: center;
    padding: 22px 0 0;
    color: #9aa5b4;
    font-size: 11px
}

@media(max-width:1000px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr) 285px;
        gap: 14px
    }

    .app {
        padding: 0 16px 20px
    }

    .preview-panel,
    .cuts-panel,
    .export-panel {
        padding: 18px
    }

    .cut-row {
        gap: 8px
    }
}

@media(max-width:760px) {
    .workspace {
        grid-template-columns: 1fr
    }

    .export-panel {
        position: static
    }

    .topbar {
        height: 72px;
        margin-bottom: 16px
    }

    .back,
    .version {
        min-width: 0;
        font-size: 12px
    }

    .brand small {
        display: none
    }

    .brand-icon {
        width: 36px;
        height: 36px
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .upload-button {
        align-self: stretch;
        text-align: center
    }

    .cut-row {
        grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 34px;
        padding: 10px 8px
    }

    .seek-row {
        flex-wrap: wrap
    }

    .seek-row input[type=range] {
        order: 5;
        flex-basis: 100%
    }

    .drop-zone {
        aspect-ratio: 16/10;
        min-height: 190px
    }

    h1 {
        font-size: 20px
    }
}



/* =========================================================
   Tutorial Studio · Video Cut
   多片段、单轨道、双手柄简易剪辑时间轴
========================================================= */

.cut-card {
    display: flex;
    flex-direction: column;
    gap: 17px;
    padding: 18px;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #dce5f0;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgb(31 52 80 / 4%);
}

.cut-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cut-card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cut-card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #eaf2ff;
    color: #1769d2;
    font-size: 14px;
    font-weight: 800;
}

.cut-card-title {
    color: #172b4d;
    font-size: 15px;
    font-weight: 750;
}

.cut-card-remove {
    padding: 8px 11px;
    border: 1px solid #f1cccc;
    border-radius: 9px;
    background: #fff6f6;
    color: #c23d3d;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.cut-card-remove:hover {
    border-color: #e7a8a8;
    background: #ffe9e9;
}

.cut-card-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cut-time-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cut-time-box span {
    color: #718096;
    font-size: 12px;
    font-weight: 600;
}

.cut-time-box strong {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.cut-time-start strong {
    color: #1769d2;
}

.cut-time-end strong {
    color: #d44841;
}

/* 一段删除区间只有一条轨道 */
.cut-timeline {
    padding: 14px 0 10px;
    user-select: none;
}

.cut-timeline-rail {
    position: relative;
    height: 12px;
    margin: 0 12px;
    border-radius: 999px;
    background: #dfe7f1;
}

/* 红色区域代表即将删除的内容 */
.cut-timeline-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 3px;
    background: #efaaa5;
    pointer-events: none;
}

/* 两个手柄共用同一条轨道 */
.cut-handle {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 24px;
    height: 34px;
    padding: 0;
    border: 3px solid #ffffff;
    border-radius: 8px;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgb(25 40 65 / 22%);
    cursor: ew-resize;
    touch-action: none;
    transition:
        width 0.12s ease,
        height 0.12s ease,
        box-shadow 0.12s ease;
}

.cut-handle::after {
    content: "";
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 8px;
    width: 2px;
    border-radius: 2px;
    background: #ffffff;
}

.cut-handle-start {
    background: #1677ff;
}

.cut-handle-end {
    background: #d44841;
}

.cut-handle:hover,
.cut-handle.is-dragging {
    width: 28px;
    height: 38px;
    box-shadow: 0 3px 10px rgb(25 40 65 / 30%);
}

.cut-handle:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

.cut-timeline-axis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 7px;
    color: #77869b;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.cut-card-hint {
    padding: 10px 12px;
    border-radius: 9px;
    background: #f4f7fb;
    color: #64748b;
    font-size: 12px;
    line-height: 1.7;
}

.empty-cuts {
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .cut-card {
        gap: 15px;
        padding: 14px;
        border-radius: 12px;
    }

    .cut-card-title {
        font-size: 14px;
    }

    .cut-card-remove {
        padding: 7px 9px;
    }

    .cut-time-box strong {
        font-size: 19px;
    }

    .cut-timeline-rail {
        margin: 0 9px;
    }

    .cut-handle {
        width: 22px;
        height: 31px;
    }

    .cut-card-hint {
        font-size: 12px;
    }
}