
:root {
    --bg: #f5f6fa;
    --card: #ffffff;
    --line: #e5e8f0;
    --line-soft: #eef0f6;
    --text: #1c2333;
    --muted: #7a8399;
    --sub: #586179;
    --primary: #4f46e5;
    --primary-dark: #4038c9;
    --primary-soft: #eef0ff;
    --accent: #0ea5a4;
    --danger: #dc4a5a;
    --shadow: 0 6px 24px rgba(30, 40, 80, .06);
}

* {
    box-sizing: border-box
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0.6em;
    padding: 1.2em;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px
}

.card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap
}

.card-head h2 {
    font-size: 14.5px;
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px
}

.step {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.hint {
    color: var(--muted);
    font-size: 12px
}

.drop {
    border: 2px dashed #d3d8e8;
    border-radius: 13px;
    padding: 34px 20px;
    text-align: center;
    background: #fafbff;
    transition: .18s;
    cursor: pointer
}

.drop:hover, .drop.over {
    border-color: var(--primary);
    background: var(--primary-soft)
}

.drop svg {
    color: var(--primary)
}

.drop-title {
    font-size: 15px;
    font-weight: 600;
    margin-top: 10px
}

.drop-sub {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 6px
}

.link {
    background: none;
    border: 0;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 3px
}

.filebar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fafbff;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 12px 14px
}

.file-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none
}

.file-name {
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 420px
}

.file-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 1px
}

.right {
    margin-left: auto
}

button {
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap
}

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

.btn {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--sub);
    border-radius: 9px;
    padding: 8px 13px;
    font-weight: 600
}

.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark)
}

.btn.soft {
    background: var(--primary-soft);
    border-color: #dfe1ff;
    color: var(--primary)
}

.btn.soft:hover:not(:disabled) {
    background: #e2e5ff
}

.btn.danger {
    color: var(--danger)
}

.btn.sm {
    padding: 5px 9px;
    font-size: 12px;
    border-radius: 7px
}

.btn.icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px
}

.btn.on {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff
}

.wave-wrap {
    position: relative;
    height: 216px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #fcfdff, #f7f9ff);
    user-select: none;
    touch-action: none
}

#wave {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair
}

.handle-label {
    position: absolute;
    top: 9px;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 3px 8px rgba(79, 70, 229, .25);
    white-space: nowrap
}

.handle-label.end {
    background: #111a30
}

.transport {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    flex-wrap: wrap
}

.time-now {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 14px;
    margin-left: 6px
}

.time-total {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 13px
}

.pill {
    background: #f2f4fa;
    border-radius: 8px;
    padding: 5px 9px;
    color: var(--sub);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: auto
}

.grid {
    display: grid;
    grid-template-columns:repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px
}

.field input, .field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 10px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: .15s;
    font-variant-numeric: tabular-nums
}

.field input:focus, .field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .1)
}

.field .with-btn {
    display: flex;
    gap: 6px
}

.field .with-btn input {
    flex: 1;
    min-width: 0
}

.field .with-btn .btn {
    padding: 0 10px
}

.range-row {
    display: flex;
    align-items: center;
    gap: 10px
}

input[type=range] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
    padding: 0;
    margin-top: 12px;
}

.range-val {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    min-width: 44px;
    text-align: right;
    font-size: 13px
}

.seg-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px
}

.seg {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line-soft);
    background: #fafbff;
    border-radius: 10px;
    padding: 9px 12px
}

.seg-idx {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none
}

.seg-time {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    font-size: 13px
}

.seg-len {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums
}

.export-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    border-top: 1px solid var(--line-soft);
    padding-top: 16px
}

kbd {
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 11px;
    color: var(--sub)
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    background: #1c2333;
    color: #fff;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(20, 30, 60, .25);
    opacity: 0;
    pointer-events: none;
    transition: .22s;
    z-index: 50;
    max-width: 88vw;
    text-align: center
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0)
}

#toast.err {
    background: #b83245
}

[hidden] {
    display: none !important
}

@media (max-width: 720px) {
    .grid {
        grid-template-columns:repeat(2, 1fr)
    }

    .badge {
        display: none
    }

    .app {
        padding: 18px 12px 40px
    }

    .file-name {
        max-width: 180px
    }

    .head-actions {
        margin-left: 0;
        width: 100%
    }
}

/* 上传区：沿用原模板 DOM 与风格 */
.item-file {
    cursor: pointer
}

.file-upload {
    border: solid 1px #ddd;
    background-color: var(--main-bg, #fafbff);
    width: 100%;
    min-height: 240px;
    line-height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    outline: none;
    font-size: 15px;
    color: #6c6c6c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px 0;
    position: relative
}

.file-upload.dragover {
    border-color: #5a4df8;
    background-color: #f0edff;
    color: #5a4df8
}

.file-upload .upload-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px 0;
    width: 100%;
    height: 100%
}

.file-upload .upload-prompt > div > p {
    text-align: center;
    margin-bottom: 0
}
