/**
 * editor-image.css - 图片动态谱编辑器界面美化
 * 覆盖 editor.css 中的 sg-img-* 样式
 */

.sg-img-editor-page {
    --sg-sidebar-bg: #eef1f6;
    --sg-panel-bg: #ffffff;
    --sg-panel-border: #e4e9f0;
    --sg-panel-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
    --sg-accent: #409EFF;
    --sg-accent-soft: #ecf5ff;
    --sg-text: #303133;
    --sg-text-secondary: #606266;
    --sg-text-muted: #909399;
    background: var(--sg-sidebar-bg);
}

.sg-img-editor-page .sg-editor-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e8ecf1;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.sg-img-editor-body {
    background: var(--sg-sidebar-bg);
}

/* —— 侧边栏 —— */
.sg-img-editor-sidebar {
    width: 288px;
    background: var(--sg-sidebar-bg);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sg-img-editor-sidebar-left {
    border-right: 1px solid #dde3eb;
}

.sg-img-editor-sidebar-right {
    border-left: 1px solid #dde3eb;
    border-right: none;
}

.sg-sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: #c8d0dc transparent;
}

.sg-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.sg-sidebar-scroll::-webkit-scrollbar-thumb {
    background: #c8d0dc;
    border-radius: 999px;
}

.sg-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #b0bac8;
}

/* —— 面板卡片 —— */
.sg-sidebar-panel {
    background: var(--sg-panel-bg);
    border: 1px solid var(--sg-panel-border);
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: var(--sg-panel-shadow);
    overflow: hidden;
}

.sg-sidebar-panel:last-child {
    margin-bottom: 0;
}

.sg-sidebar-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid #f0f3f7;
    background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}

.sg-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: linear-gradient(135deg, #409EFF 0%, #66b1ff 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(64, 158, 255, 0.28);
}

.sg-step-badge[data-step="2"] {
    background: linear-gradient(135deg, #67C23A 0%, #95d475 100%);
    box-shadow: 0 2px 6px rgba(103, 194, 58, 0.28);
}

.sg-step-badge[data-step="3"] {
    background: linear-gradient(135deg, #E6A23C 0%, #f0c78a 100%);
    box-shadow: 0 2px 6px rgba(230, 162, 60, 0.28);
}

.sg-step-badge[data-step="4"] {
    background: linear-gradient(135deg, #9b59b6 0%, #b07cc6 100%);
    box-shadow: 0 2px 6px rgba(155, 89, 182, 0.28);
}

.sg-step-badge[data-step="5"] {
    background: linear-gradient(135deg, #F56C6C 0%, #f89898 100%);
    box-shadow: 0 2px 6px rgba(245, 108, 108, 0.28);
}

.sg-step-badge.sg-step-badge-muted {
    background: linear-gradient(135deg, #909399 0%, #b1b3b8 100%);
    box-shadow: none;
    font-size: 10px;
}

.sg-sidebar-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sg-text);
    letter-spacing: 0.02em;
}

.sg-sidebar-panel-body {
    padding: 12px 14px 14px;
}

/* —— 按钮 —— */
.sg-img-editor-page .sg-img-tool-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    background: #fff;
    color: var(--sg-text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sg-img-editor-page .sg-img-tool-btn:last-child {
    margin-bottom: 0;
}

.sg-img-editor-page .sg-img-tool-btn:hover {
    border-color: #b3d8ff;
    color: var(--sg-accent);
    background: #fafcff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.1);
}

.sg-img-editor-page .sg-img-tool-btn.active {
    background: var(--sg-accent-soft);
    border-color: #a0cfff;
    color: var(--sg-accent);
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.12) inset;
}

.sg-img-editor-page .sg-img-tool-btn.sg-img-tool-primary {
    background: linear-gradient(135deg, #409EFF 0%, #53a8ff 100%);
    border-color: transparent;
    color: #fff;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.28);
}

.sg-img-editor-page .sg-img-tool-btn.sg-img-tool-primary:hover {
    background: linear-gradient(135deg, #66b1ff 0%, #79bbff 100%);
    color: #fff;
}

.sg-img-editor-page .sg-img-tool-btn.sg-img-tool-danger {
    color: #F56C6C;
    border-color: #fde2e2;
    background: #fffafa;
}

.sg-img-editor-page .sg-img-tool-btn.sg-img-tool-danger:hover {
    color: #fff;
    background: linear-gradient(135deg, #F56C6C 0%, #f78989 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(245, 108, 108, 0.25);
}

.sg-img-tool-btn.sg-img-tool-block {
    margin-top: 8px;
    margin-bottom: 0;
}

.sg-btn-icon {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

/* 电脑端 Editor：导入图片 / 导入音频 图标列 + 文字列对齐 */
.sg-img-editor-page .sg-editor-import-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.sg-img-editor-page .sg-editor-import-btns .sg-img-tool-btn {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 52px;
    margin-bottom: 0;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    box-sizing: border-box;
    text-align: left;
    justify-content: unset;
}

.sg-img-editor-page .sg-editor-import-btns .sg-img-tool-btn.sg-img-tool-primary {
    justify-content: unset;
    font-size: 15px;
    font-weight: 600;
}

.sg-img-editor-page .sg-editor-import-btns .sg-img-tool-btn.sg-img-tool-secondary {
    background: #fff;
    border: 1px solid #e4e9f0;
    color: var(--sg-text-secondary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sg-img-editor-page .sg-editor-import-btns .sg-img-tool-btn.sg-img-tool-secondary:hover {
    border-color: #b3d8ff;
    color: var(--sg-accent);
    background: #fafcff;
}

.sg-img-editor-page .sg-editor-import-btns .sg-btn-icon {
    width: 24px;
    font-size: 16px;
    line-height: 1;
    text-align: center;
    justify-self: center;
}

.sg-img-editor-page.sg-editor-elderly-ui .sg-editor-import-btns .sg-img-tool-btn,
.sg-img-editor-page.sg-editor-elderly-ui .sg-editor-import-btns .sg-img-tool-btn.sg-img-tool-primary {
    min-height: 52px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: normal;
}

/* —— 工具网格 —— */
.sg-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.sg-tool-grid .sg-img-tool-btn {
    margin-bottom: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 8px;
    min-height: 76px;
    gap: 6px;
}

.sg-tool-grid .sg-tool-icon {
    font-size: 20px;
    line-height: 1;
    color: var(--sg-accent);
    opacity: 0.9;
}

.sg-tool-grid .sg-tool-label {
    font-size: 11px;
    line-height: 1.35;
    color: inherit;
}

/* —— 提示与状态 —— */
.sg-img-editor-page .sg-img-tool-hint {
    font-size: 12px;
    color: var(--sg-text-muted);
    line-height: 1.65;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    margin-top: 10px;
}

.sg-img-editor-page .sg-img-import-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.sg-img-editor-page .sg-img-import-status span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 9px;
    font-size: 12px;
    color: var(--sg-text-secondary);
    transition: all 0.2s;
}

.sg-img-editor-page .sg-img-import-status span::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c0c4cc;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(192, 196, 204, 0.2);
}

.sg-img-editor-page .sg-img-import-status span.is-ready {
    background: #f0f9eb;
    border-color: #e1f3d8;
    color: #529b2e;
}

.sg-img-editor-page .sg-img-import-status span.is-ready::before {
    background: #67C23A;
    box-shadow: 0 0 0 2px rgba(103, 194, 58, 0.2);
}

.sg-img-editor-page .sg-img-row-info {
    font-size: 12px;
    color: var(--sg-text-secondary);
    line-height: 1.65;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    word-break: break-all;
}

.sg-img-editor-page .sg-setting-select {
    height: 36px;
    border-radius: 10px;
    border-color: #e4e9f0;
    background: #fafbfd;
    font-size: 13px;
}

.sg-img-editor-page .sg-setting-select:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.12);
}

/* —— 光标设置 —— */
.sg-cursor-settings {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sg-img-editor-page .sg-img-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 8px 0;
    font-size: 12px;
    color: var(--sg-text-secondary);
    border-bottom: 1px solid #f5f7fa;
}

.sg-img-editor-page .sg-img-setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sg-img-editor-page .sg-img-setting-row label {
    font-weight: 500;
}

.sg-img-setting-row-range {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

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

.sg-range-wrap input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #409EFF, #a0cfff);
    border-radius: 999px;
    outline: none;
}

.sg-range-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--sg-accent);
    box-shadow: 0 2px 6px rgba(64, 158, 255, 0.35);
    cursor: pointer;
}

.sg-color-input {
    width: 36px;
    height: 28px;
    padding: 2px;
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

.sg-img-editor-page .sg-img-range-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--sg-accent);
    min-width: 36px;
    text-align: right;
}

/* —— 主区域 —— */
.sg-img-editor-main {
    background: #e8ebf0;
}

.sg-img-editor-canvas-wrap {
    margin: 12px 12px 0;
    border-radius: 12px;
    border: 1px solid #d5dbe3;
    box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.06);
    background: #d8dce3;
    background-image:
        linear-gradient(45deg, #cfd4dc 25%, transparent 25%),
        linear-gradient(-45deg, #cfd4dc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #cfd4dc 75%),
        linear-gradient(-45deg, transparent 75%, #cfd4dc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.sg-img-editor-stage {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
    border-radius: 2px;
}

.sg-img-editor-page .sg-img-empty-text {
    font-size: 12px;
    color: #b8bec8;
    padding: 20px 12px;
    line-height: 1.6;
}

/* —— 列表容器 —— */
.sg-list-panel {
    margin-top: 12px;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    overflow: hidden;
    background: #fafbfd;
}

.sg-list-panel-head {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f3f6f9;
    border-bottom: 1px solid #eef2f6;
}

.sg-img-editor-page .sg-img-measure-list,
.sg-img-editor-page .sg-img-sequence-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: #c8d0dc transparent;
}

.sg-img-editor-page .sg-img-measure-list::-webkit-scrollbar,
.sg-img-editor-page .sg-img-sequence-list::-webkit-scrollbar {
    width: 5px;
}

.sg-img-editor-page .sg-img-measure-list::-webkit-scrollbar-thumb,
.sg-img-editor-page .sg-img-sequence-list::-webkit-scrollbar-thumb {
    background: #c8d0dc;
    border-radius: 999px;
}

/* —— 音频栏 —— */
.sg-img-editor-page .sg-img-audio-bar {
    margin: 0 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e4e9f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sg-img-audio-playback {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sg-img-audio-sync {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

@media (min-width: 769px) {
    .sg-img-editor-page .sg-img-audio-bar {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .sg-img-editor-page .sg-img-audio-playback,
    .sg-img-editor-page .sg-img-audio-sync {
        display: contents;
    }

    .sg-img-editor-page .sg-img-audio-seek-wrap {
        flex: 1;
        min-width: 80px;
    }
}

.sg-img-audio-play {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.sg-img-editor-page .sg-img-audio-btn {
    border: 1px solid #e4e9f0;
    border-radius: 9px;
    padding: 7px 12px;
    transition: all 0.18s;
    color: var(--sg-text-secondary);
}

.sg-img-editor-page .sg-img-audio-btn:hover {
    border-color: #b3d8ff;
    color: var(--sg-accent);
    background: #fafcff;
}

.sg-img-editor-page .sg-img-audio-accent {
    background: linear-gradient(135deg, #409EFF 0%, #53a8ff 100%);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.25);
}

.sg-img-editor-page .sg-img-audio-accent:hover {
    background: linear-gradient(135deg, #66b1ff 0%, #79bbff 100%);
    color: #fff;
}

.sg-img-audio-seek-wrap {
    flex: 1;
    min-width: 80px;
    padding: 0 4px;
}

.sg-img-editor-page .sg-img-audio-seek {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e4e9f0;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.sg-img-editor-page .sg-img-audio-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sg-accent);
    box-shadow: 0 1px 4px rgba(64, 158, 255, 0.4);
    cursor: pointer;
}

.sg-img-audio-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.sg-img-audio-actions .sg-img-audio-btn {
    min-width: 72px;
}

.sg-img-editor-page .sg-img-audio-time {
    color: var(--sg-text-muted);
    min-width: 44px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.sg-img-editor-page .sg-img-sync-hint {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 12px;
    color: var(--sg-text-secondary);
    line-height: 1.45;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #eef2f6;
}

/* —— 状态栏 —— */
.sg-img-statusbar {
    height: 34px;
    margin: 8px 12px 12px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    border-top: none;
}

.sg-img-statusbar .sg-status-item {
    color: var(--sg-text-muted);
    font-size: 12px;
}

/* —— 小节对时列表 —— */
.sg-img-editor-page .sg-img-measure-row {
    padding: 7px 8px;
    background: #fff;
    border: 1px solid #eef2f6;
    transition: all 0.15s;
}

.sg-img-editor-page .sg-img-measure-row:hover {
    border-color: #d9ecff;
    background: #fafcff;
}

.sg-img-editor-page .sg-img-measure-row.active {
    background: var(--sg-accent-soft);
    border-color: #b3d8ff;
    outline: none;
    box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.1) inset;
}

.sg-img-editor-page .sg-img-measure-row.next {
    outline: none;
    border-style: dashed;
    border-color: #b3e19d;
    background: #f0f9eb;
    box-shadow: 0 0 0 1px rgba(103, 194, 58, 0.18) inset;
}

.sg-img-editor-page .sg-img-measure-row.next .sg-img-measure-no {
    background: linear-gradient(135deg, #67C23A, #85ce61);
    color: #fff;
    font-weight: 700;
}

.sg-img-editor-page .sg-img-measure-row.measure-selected {
    background: #f0f9eb;
    border-color: #b3e19d;
    outline: none;
    box-shadow: 0 0 0 1px rgba(103, 194, 58, 0.18) inset;
}

.sg-img-editor-page .sg-img-measure-row.measure-selected .sg-img-measure-no {
    background: linear-gradient(135deg, #67C23A, #85ce61);
    color: #fff;
    font-weight: 700;
}

.sg-img-editor-page .sg-img-measure-row.playback {
    background: #f0f9eb;
    border-color: #c2e7b0;
    outline: none;
}

.sg-img-editor-page .sg-img-measure-no {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, #409EFF, #66b1ff);
    font-size: 11px;
}

.sg-img-editor-page .sg-img-time-input {
    border: 1px solid #e4e9f0;
    border-radius: 6px;
    padding: 4px 6px;
    background: #fafbfd;
    transition: border-color 0.15s;
}

.sg-img-editor-page .sg-img-time-input:focus {
    outline: none;
    border-color: var(--sg-accent);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

/* —— 播放序列 —— */
.sg-img-editor-page .sg-img-flow-hint {
    font-size: 12px;
    margin: 0 0 10px;
    line-height: 1.55;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #dcdfe6;
}

.sg-seq-add-box {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    margin-bottom: 8px;
}

.sg-seq-range-label {
    font-size: 12px;
    color: var(--sg-text-muted);
    font-weight: 500;
}

.sg-img-editor-page .sg-img-sync-group-label {
    margin: 0 0 10px;
    padding: 9px 12px;
    background: linear-gradient(135deg, #ecf5ff 0%, #f5f9ff 100%);
    border: 1px solid #d9ecff;
    border-radius: 10px;
}

.sg-img-editor-page .sg-img-seq-row {
    padding: 7px 8px;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
    outline: none;
}

.sg-img-editor-page .sg-img-seq-row:hover {
    border-color: #d9ecff;
    background: #fafcff;
}

.sg-img-editor-page .sg-img-seq-row.selected {
    outline: none;
    border-color: #b3d8ff;
    background: var(--sg-accent-soft);
    box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.15) inset;
}

.sg-img-editor-page .sg-img-seq-row.active {
    outline: none;
    border-color: #f5dab1;
    background: #fdf6ec;
    box-shadow: 0 0 0 1px rgba(230, 162, 60, 0.15) inset;
}

.sg-img-editor-page .sg-img-seq-row.playing {
    outline: none;
    border-color: #c2e7b0;
    background: #f0f9eb;
    box-shadow: 0 0 0 1px rgba(103, 194, 58, 0.12) inset;
}

.sg-img-editor-page .sg-img-seq-row.synced .sg-img-seq-no {
    background: linear-gradient(135deg, #67C23A, #85ce61);
}

.sg-img-editor-page .sg-img-seq-no {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: linear-gradient(135deg, #409EFF, #66b1ff);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 22px;
}

.sg-img-editor-page .sg-img-seq-range-input {
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    text-align: center;
    transition: border-color 0.15s;
}

.sg-img-editor-page .sg-img-seq-range-input:focus {
    outline: none;
    border-color: var(--sg-accent);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

.sg-img-editor-page .sg-img-seq-row .sg-img-seq-range-input {
    padding: 4px 4px;
}

.sg-img-editor-page .sg-img-seq-range-meta {
    font-weight: 500;
}

.sg-img-editor-page .sg-img-seq-del {
    opacity: 0.7;
    transition: opacity 0.15s;
    line-height: 1;
}

.sg-img-editor-page .sg-img-seq-del:hover {
    opacity: 1;
}

.sg-img-editor-page .sg-img-seq-actions .sg-img-tool-btn,
.sg-img-editor-page #btnClearSyncTimes {
    justify-content: center;
    padding: 9px;
}

.sg-img-editor-page .sg-img-seq-range {
    margin-bottom: 8px;
}

@media (max-width: 992px) {
    .sg-img-editor-sidebar-right {
        display: none;
    }

    .sg-img-editor-sidebar {
        width: 252px;
    }
}

/* —— 顶栏微调 —— */
.sg-img-editor-page .sg-header-btn {
    border-radius: 9px;
    font-weight: 500;
    transition: all 0.18s;
}

.sg-img-editor-page .sg-header-btn-preview {
    color: #409EFF;
    border: 1px solid #b3d8ff;
    background: #ecf5ff;
}

.sg-img-editor-page .sg-header-btn-preview:hover {
    background: #d9ecff;
    border-color: #409EFF;
}

.sg-img-editor-page .sg-save-btn {
    background: linear-gradient(135deg, #409EFF 0%, #53a8ff 100%);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.28);
}

.sg-img-editor-page .sg-save-btn:hover {
    background: linear-gradient(135deg, #66b1ff 0%, #79bbff 100%);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.32);
}

.sg-img-editor-page .sg-editor-version {
    background: #eef2f6;
    color: #606266;
    font-weight: 600;
}

.sg-img-editor-page .sg-tool-btn {
    border-radius: 8px;
}

.sg-img-editor-page .sg-tool-btn-accent {
    font-weight: 600;
}

/* —— 预览播放器弹层 —— */
body.sg-preview-open {
    overflow: hidden;
}

.sg-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.sg-preview-overlay.is-visible {
    animation: sg-preview-fade-in 0.22s ease;
}

@keyframes sg-preview-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sg-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, 0.72);
    backdrop-filter: blur(8px);
}

.sg-preview-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, 96vw);
    height: min(780px, 92vh);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1e2430 0%, #141820 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    overflow: hidden;
    animation: sg-preview-scale-in 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes sg-preview-scale-in {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.sg-preview-shell.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: none;
}

.sg-preview-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sg-preview-chrome-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sg-preview-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #409EFF, #53a8ff);
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.sg-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #e8edf5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-preview-chrome-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sg-preview-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #c8d2e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s;
}

.sg-preview-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.sg-preview-close-btn:hover {
    background: rgba(245, 108, 108, 0.25);
    border-color: rgba(245, 108, 108, 0.45);
    color: #ffc9c9;
}

.sg-preview-viewport {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    align-self: center;
    position: relative;
    background: #0a0c10;
    margin: 0 12px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.45);
}

.sg-preview-shell.is-fullscreen .sg-preview-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: unset;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0;
    box-shadow: none;
    background: #0a0c10;
    overflow: hidden;
    container-type: size;
}

.sg-preview-shell.is-fullscreen .sg-preview-stage {
    flex-shrink: 0;
    margin: 0 auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    box-sizing: border-box;
    width: min(100cqw, calc(100cqh * 16 / 9));
    height: min(100cqh, calc(100cqw * 9 / 16));
    max-width: 100%;
    max-height: 100%;
}

.sg-preview-stage {
    width: 100%;
    height: 100%;
}

.sg-preview-stage .sg-img-player-root {
    width: 100%;
    height: 100%;
}

.sg-preview-stage .sg-img-player-wrap {
    margin: 0 auto;
}

.sg-preview-stage .sg-img-player-scroll {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0c10;
    scrollbar-width: thin;
    scrollbar-color: #3a4250 transparent;
}

.sg-preview-stage .sg-img-player-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sg-preview-stage .sg-img-player-scroll::-webkit-scrollbar-thumb {
    background: #3a4250;
    border-radius: 999px;
}

/* 编辑器预览播放器：与曲库预览一致，避免 stage max-width 把谱面压窄 */
#sgPreviewViewport {
    box-sizing: border-box;
}

#sgPreviewViewport #sgImgPreviewInner {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    overflow: hidden;
    box-sizing: border-box;
}

#sgImgPreviewInner .sg-img-player-root,
#sgImgPreviewInner .sg-img-player-scroll,
#sgImgPreviewInner .sg-img-player-wrap {
    width: 100%;
    height: 100%;
    max-width: none !important;
    box-sizing: border-box;
}

#sgImgPreviewInner .sg-img-player-stage {
    max-width: none !important;
}

#sgImgPreviewOverlay .sg-img-player-img,
#sgPreviewViewport .sg-img-player-img {
    max-width: none !important;
}

#sgImgPreviewInner .sg-img-player-scroll {
    overflow: hidden !important;
    background: #0a0c10;
}

.sg-preview-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 16px;
    flex-shrink: 0;
}

.sg-preview-play-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #409EFF, #53a8ff);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(64, 158, 255, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.sg-preview-play-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(64, 158, 255, 0.5);
}

.sg-preview-time {
    font-size: 12px;
    color: #9aa8bc;
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    font-weight: 500;
}

.sg-preview-seek-wrap {
    flex: 1;
    min-width: 80px;
}

.sg-preview-seek {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.sg-preview-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.25);
    cursor: pointer;
}

.sg-preview-measure {
    font-size: 12px;
    color: #7d8fa8;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    flex-shrink: 0;
}

.sg-preview-controls-wrap {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
}

.sg-preview-controls-tools {
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-top: 10px;
    padding-bottom: 14px;
}

.sg-preview-knob-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sg-preview-knob-label {
    font-size: 12px;
    color: #9aa8bc;
    white-space: nowrap;
    flex-shrink: 0;
}

.sg-preview-knob {
    width: 92px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.sg-preview-knob::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #53a8ff;
    cursor: pointer;
}

.sg-preview-knob-val {
    font-size: 12px;
    color: #c5d0de;
    min-width: 34px;
    font-variant-numeric: tabular-nums;
}

.sg-preview-ab-group {
    flex-wrap: wrap;
}

.sg-preview-ab-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbe4ef;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sg-preview-ab-btn:hover,
.sg-preview-ab-btn.is-active {
    background: rgba(64, 158, 255, 0.18);
    border-color: rgba(64, 158, 255, 0.45);
    color: #fff;
}

.sg-preview-ab-clear {
    font-size: 16px;
    line-height: 1;
}

.sg-preview-ab-info {
    font-size: 12px;
    color: #8fa0b8;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .sg-preview-overlay {
        padding: 0;
    }

    .sg-preview-shell {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .sg-preview-viewport {
        margin: 0 8px;
        aspect-ratio: 16 / 9;
        align-self: center;
        width: calc(100% - 16px);
        max-width: 100%;
        flex: 1;
        min-height: 0;
        border-radius: 8px;
    }

    .sg-preview-measure {
        display: none;
    }

    .sg-preview-controls-tools {
        gap: 8px 12px;
    }

    .sg-preview-knob {
        width: 72px;
    }

    .sg-preview-ab-info {
        width: 100%;
    }
}

/* 编辑器预览：仅全屏播放视口（与动态谱展示页一致） */
#sgPreviewViewport:fullscreen,
#sgPreviewViewport:-webkit-full-screen {
    position: relative;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    aspect-ratio: unset !important;
    display: block !important;
    background: #0a0c10 !important;
    overflow: hidden !important;
}

#sgPreviewViewport:fullscreen #sgImgPreviewInner,
#sgPreviewViewport:-webkit-full-screen #sgImgPreviewInner {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    background: #0a0c10;
    overflow: hidden;
}

#sgPreviewViewport:fullscreen .sg-img-player-root,
#sgPreviewViewport:-webkit-full-screen .sg-img-player-root,
#sgPreviewViewport:fullscreen .sg-img-player-scroll,
#sgPreviewViewport:-webkit-full-screen .sg-img-player-scroll,
#sgPreviewViewport:fullscreen .sg-img-player-wrap,
#sgPreviewViewport:-webkit-full-screen .sg-img-player-wrap {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

#sgPreviewViewport:fullscreen .sg-img-player-stage,
#sgPreviewViewport:-webkit-full-screen .sg-img-player-stage {
    margin: 0 !important;
}
