/**
 * editor.css - 简谱编辑器样式
 * 蜀哥动态谱专业制作平台
 */

/* ==================== 布局 ==================== */

.sg-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    z-index: 100;
}

.sg-editor-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sg-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #606266;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sg-back-btn:hover {
    background: #f5f7fa;
    color: #409EFF;
}

.sg-editor-divider {
    width: 1px;
    height: 24px;
    background: #e4e7ed;
}

.sg-editor-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-editor-title-input {
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    background: transparent;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    min-width: 200px;
}

.sg-editor-title-input:focus {
    background: #f5f7fa;
}

.sg-editor-version {
    font-size: 12px;
    color: #909399;
    background: #f0f2f5;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.sg-editor-header-center {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sg-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
}

.sg-toolbar-divider {
    width: 1px;
    height: 20px;
    background: #e4e7ed;
    margin: 0 8px;
}

.sg-tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: #606266;
    font-size: 13px;
    transition: all 0.2s;
    min-width: 32px;
    justify-content: center;
}

.sg-tool-btn:hover {
    background: #ecf5ff;
    color: #409EFF;
}

.sg-tool-btn.active {
    background: #409EFF;
    color: #fff;
}

.sg-tool-btn-accent {
    color: #E6A23C;
}

.sg-tool-btn-accent:hover {
    background: #fdf6ec;
    color: #E6A23C;
}

.sg-tool-btn-accent.playing {
    background: #E6A23C;
    color: #fff;
}

.sg-btn-label {
    font-size: 13px;
}

.sg-zoom-display {
    font-size: 12px;
    color: #909399;
    min-width: 48px;
    text-align: center;
    font-weight: 500;
}

.sg-editor-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dcdfe6;
    background: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: #606266;
    font-size: 13px;
    transition: all 0.2s;
}

.sg-header-btn:hover {
    border-color: #409EFF;
    color: #409EFF;
}

.sg-save-btn {
    background: #409EFF;
    border-color: #409EFF;
    color: #fff;
}

.sg-save-btn:hover {
    background: #66b1ff;
    border-color: #66b1ff;
    color: #fff;
}

.sg-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    color: #909399;
    transition: all 0.2s;
}

.sg-mode-toggle:hover {
    color: #409EFF;
    border-color: #409EFF;
}

.sg-mode-toggle.active {
    background: #303133;
    border-color: #303133;
    color: #fff;
}

/* ==================== 主体区域 ==================== */

.sg-editor-body {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ==================== 左侧工具栏 ==================== */

.sg-editor-sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid #e4e7ed;
    overflow-y: auto;
    flex-shrink: 0;
    padding: 16px;
}

.sg-editor-sidebar-right {
    width: 280px;
    border-right: none;
    border-left: 1px solid #e4e7ed;
}

.sg-sidebar-section {
    margin-bottom: 20px;
}

.sg-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: #909399;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 音符键盘 */
.sg-note-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sg-note-key {
    aspect-ratio: 1;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #303133;
    cursor: pointer;
    transition: all 0.15s;
}

.sg-note-key:hover {
    border-color: #409EFF;
    color: #409EFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64,158,255,0.15);
}

.sg-note-key:active {
    transform: translateY(0);
    background: #ecf5ff;
}

.sg-note-rest {
    color: #C0C4CC;
    font-size: 16px;
}

/* 时值选择网格 */
.sg-duration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sg-dur-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sg-dur-btn:hover {
    border-color: #409EFF;
}

.sg-dur-btn.active {
    border-color: #409EFF;
    background: #ecf5ff;
}

.sg-dur-icon {
    font-size: 16px;
    color: #303133;
}

.sg-dur-btn.active .sg-dur-icon {
    color: #409EFF;
}

.sg-dur-label {
    font-size: 11px;
    color: #909399;
}

.sg-dur-btn.active .sg-dur-label {
    color: #409EFF;
    font-weight: 500;
}

/* 八度控制 */
.sg-octave-controls {
    display: flex;
    gap: 6px;
}

.sg-oct-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #606266;
    transition: all 0.2s;
}

.sg-oct-btn:hover {
    border-color: #409EFF;
    color: #409EFF;
}

.sg-oct-dots {
    font-size: 18px;
    font-weight: 700;
    color: #303133;
}

/* 设置项 */
.sg-setting-item {
    margin-bottom: 10px;
}

.sg-setting-item > label {
    display: block;
    font-size: 12px;
    color: #909399;
    margin-bottom: 4px;
}

.sg-setting-select {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 13px;
    color: #303133;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.sg-setting-select:focus {
    border-color: #409EFF;
}

.sg-tempo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-tempo-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #dcdfe6;
    border-radius: 2px;
    outline: none;
}

.sg-tempo-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #409EFF;
    cursor: pointer;
    transition: transform 0.15s;
}

.sg-tempo-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.sg-tempo-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #409EFF;
    cursor: pointer;
    border: none;
}

.sg-tempo-value {
    font-size: 14px;
    font-weight: 600;
    color: #409EFF;
    min-width: 32px;
    text-align: right;
}

/* ==================== 画布区 ==================== */

.sg-editor-canvas-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f7fa;
}

.sg-canvas-container {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

#scoreCanvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    outline: none;
}

/* ==================== 状态栏 ==================== */

.sg-editor-statusbar {
    height: 32px;
    background: #fff;
    border-top: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 12px;
    color: #909399;
}

.sg-status-left,
.sg-status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-status-item {
    white-space: nowrap;
}

.sg-status-divider {
    color: #dcdfe6;
}

/* ==================== 右侧属性面板 ==================== */

.sg-prop-item {
    margin-bottom: 12px;
}

.sg-prop-item > label {
    display: block;
    font-size: 12px;
    color: #909399;
    margin-bottom: 4px;
}

.sg-prop-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 13px;
    color: #303133;
    outline: none;
    transition: border-color 0.2s;
}

.sg-prop-input:focus {
    border-color: #409EFF;
}

.sg-prop-octave {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-prop-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #303133;
    transition: all 0.2s;
}

.sg-prop-btn:hover {
    border-color: #409EFF;
    color: #409EFF;
}

.sg-prop-oct-display {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #409EFF;
}

.sg-prop-delete {
    width: 100%;
    padding: 8px;
    border: 1px solid #fbc4c4;
    background: #fef0f0;
    color: #f56c6c;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.sg-prop-delete:hover {
    background: #f56c6c;
    color: #fff;
}

/* 未选中提示 */
.sg-no-selection {
    text-align: center;
    padding: 40px 16px;
}

.sg-no-selection-icon {
    color: #C0C4CC;
    margin-bottom: 12px;
}

.sg-no-selection p {
    font-size: 13px;
    color: #909399;
    line-height: 1.6;
}

/* 乐谱信息 */
.sg-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f2f5;
}

.sg-info-item:last-child {
    border-bottom: none;
}

.sg-info-label {
    font-size: 13px;
    color: #909399;
}

.sg-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #303133;
}

/* ==================== 弹窗 ==================== */

.sg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.sg-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-modal-sm {
    width: 400px;
}

.sg-modal-lg {
    width: 700px;
}

.sg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f2f5;
}

.sg-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
    margin: 0;
}

.sg-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    color: #909399;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sg-modal-close:hover {
    background: #f5f7fa;
    color: #303133;
}

.sg-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.sg-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.sg-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #dcdfe6;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.sg-btn-default {
    color: #606266;
}

.sg-btn-default:hover {
    border-color: #409EFF;
    color: #409EFF;
}

.sg-btn-primary {
    background: #409EFF;
    border-color: #409EFF;
    color: #fff;
}

.sg-btn-primary:hover {
    background: #66b1ff;
    border-color: #66b1ff;
}

/* 文本录入弹窗 */
.sg-text-import-tips {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.sg-text-import-tips p {
    margin: 0 0 8px;
    font-size: 13px;
    color: #303133;
}

.sg-text-import-tips ul {
    margin: 0;
    padding-left: 20px;
}

.sg-text-import-tips li {
    font-size: 12px;
    color: #606266;
    line-height: 1.8;
}

.sg-text-import-tips code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #E6A23C;
    border: 1px solid #e4e7ed;
}

.sg-text-import-area {
    width: 100%;
    border: 1px solid #dcdfe6;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    font-family: "Courier New", monospace;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.sg-text-import-area:focus {
    border-color: #409EFF;
}

/* 导出选项 */
.sg-export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sg-export-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sg-export-option:hover {
    border-color: #409EFF;
    background: #ecf5ff;
}

.sg-export-option svg {
    color: #409EFF;
    flex-shrink: 0;
}

.sg-export-option div {
    display: flex;
    flex-direction: column;
}

.sg-export-option strong {
    font-size: 14px;
    color: #303133;
    margin-bottom: 2px;
}

.sg-export-option span {
    font-size: 12px;
    color: #909399;
}

.sg-export-option.active {
    border-color: #409EFF;
    background: #ecf5ff;
    box-shadow: 0 0 0 1px #409EFF inset;
}

.sg-export-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #909399;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sg-export-resolution-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.sg-export-resolution {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sg-export-resolution strong {
    font-size: 15px;
    color: #303133;
}

.sg-export-resolution span {
    font-size: 11px;
    color: #909399;
}

.sg-export-resolution:hover {
    border-color: #409EFF;
    background: #ecf5ff;
}

.sg-export-resolution.active {
    border-color: #409EFF;
    background: #ecf5ff;
    box-shadow: 0 0 0 1px #409EFF inset;
}

.sg-export-hint {
    font-size: 13px;
    color: #606266;
    margin: 0 0 16px;
    line-height: 1.5;
}

.sg-export-progress-bar {
    height: 10px;
    background: #ebeef5;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sg-export-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #409EFF, #66b1ff);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.sg-export-progress-text {
    font-size: 14px;
    color: #303133;
    margin: 0 0 4px;
    text-align: center;
}

.sg-export-progress-percent {
    font-size: 24px;
    font-weight: 600;
    color: #409EFF;
    margin: 0;
    text-align: center;
}

.sg-export-done-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #f0f9eb;
    color: #67C23A;
    font-size: 28px;
    line-height: 56px;
    text-align: center;
}

.sg-export-done-msg {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin: 0 0 8px;
    text-align: center;
}

.sg-export-done-meta {
    font-size: 12px;
    color: #909399;
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

#btnExportDownload {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 长辈极简模式 ==================== */

.sg-elderly-mode .sg-editor-header {
    height: 72px;
}

.sg-elderly-mode .sg-tool-btn,
.sg-elderly-mode .sg-header-btn {
    font-size: 18px;
    padding: 10px 16px;
}

.sg-elderly-mode .sg-tool-btn svg {
    width: 24px;
    height: 24px;
}

.sg-elderly-mode .sg-editor-sidebar {
    width: 320px;
}

.sg-elderly-mode .sg-sidebar-title {
    font-size: 18px;
}

.sg-elderly-mode .sg-note-key {
    font-size: 28px;
    aspect-ratio: 1;
}

.sg-elderly-mode .sg-dur-btn {
    padding: 12px 8px;
}

.sg-elderly-mode .sg-dur-label {
    font-size: 16px;
}

.sg-elderly-mode .sg-setting-select,
.sg-elderly-mode .sg-prop-input {
    height: 44px;
    font-size: 18px;
}

.sg-elderly-mode .sg-editor-title-input {
    font-size: 22px;
}

.sg-elderly-mode .sg-status-item {
    font-size: 16px;
}

.sg-elderly-mode .sg-info-label {
    font-size: 18px;
}

.sg-elderly-mode .sg-info-value {
    font-size: 22px;
}

.sg-elderly-mode .sg-modal-header h3 {
    font-size: 24px;
}

.sg-elderly-mode .sg-text-import-tips,
.sg-elderly-mode .sg-text-import-area {
    font-size: 18px;
}

/* ==================== 响应式 ==================== */

@media (max-width: 1200px) {
    .sg-editor-sidebar {
        width: 200px;
    }
    .sg-editor-sidebar-right {
        width: 240px;
    }
}

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

/* ==================== 滚动条美化 ==================== */

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

.sg-editor-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sg-editor-sidebar::-webkit-scrollbar-thumb {
    background: #dcdfe6;
    border-radius: 3px;
}

.sg-editor-sidebar::-webkit-scrollbar-thumb:hover {
    background: #c0c4cc;
}

.sg-canvas-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sg-canvas-container::-webkit-scrollbar-track {
    background: transparent;
}

.sg-canvas-container::-webkit-scrollbar-thumb {
    background: #c0c4cc;
    border-radius: 4px;
}

.sg-canvas-container::-webkit-scrollbar-thumb:hover {
    background: #909399;
}

.sg-modal-body::-webkit-scrollbar {
    width: 6px;
}

.sg-modal-body::-webkit-scrollbar-thumb {
    background: #dcdfe6;
    border-radius: 3px;
}

/* ==================== 动画 ==================== */

.sg-tool-btn,
.sg-header-btn,
.sg-note-key,
.sg-dur-btn,
.sg-oct-btn,
.sg-prop-btn,
.sg-setting-select,
.sg-prop-input,
.sg-export-option,
.sg-mode-toggle {
    transition: all 0.2s ease;
}

.sg-modal-overlay {
    animation: sg-fade-in 0.2s ease;
}

.sg-modal {
    animation: sg-modal-slide-up 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes sg-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 禁用长辈模式下的动画 */
.sg-elderly-mode * {
    animation: none !important;
    transition: none !important;
}

/* ==================== 图片动态谱编辑器 ==================== */

.sg-img-editor-page .sg-editor-header {
    margin-top: 68px;
}

.sg-editor-top-nav {
    z-index: 1001;
}

.sg-img-editor-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sg-img-editor-page form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-editor-header {
    flex-shrink: 0;
}

.sg-img-editor-body {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #f0f2f5;
}

.sg-img-editor-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e4e7ed;
    overflow-y: auto;
    padding: 12px 0;
    flex-shrink: 0;
}

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

.sg-img-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.sg-img-editor-main .sg-editor-statusbar {
    flex-shrink: 0;
}

.sg-img-editor-canvas-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    background: #dcdfe6;
    background-image:
        linear-gradient(45deg, #d0d3d9 25%, transparent 25%),
        linear-gradient(-45deg, #d0d3d9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d0d3d9 75%),
        linear-gradient(-45deg, transparent 75%, #d0d3d9 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.sg-img-editor-viewport {
    padding: 24px;
    box-sizing: border-box;
    will-change: transform;
}

.sg-img-editor-stage {
    position: relative;
    display: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    overflow: visible;
}

.sg-img-score {
    display: block;
    user-select: none;
    pointer-events: none;
    vertical-align: top;
}

.sg-img-frame-lines {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.sg-img-frame-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 0;
    border-left: 3px dashed #67C23A;
    display: none;
    box-sizing: border-box;
}

.sg-img-frame-line.selected {
    border-left-color: #E6A23C;
}

.sg-img-frame-line-preview {
    border-left: 2px dashed rgba(149, 212, 117, 0.9);
}

/* 触屏画横/竖线：跟随手指的预览圆点 */
.sg-touch-line-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 50%;
    background: rgba(64, 158, 255, 0.95);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.35), 0 2px 10px rgba(15, 23, 42, 0.22);
    pointer-events: none;
    z-index: 8;
    display: none;
}

@media (pointer: coarse) {
    .sg-img-frame-line {
        border-left-width: 2px;
        border-left-color: #2E7D32;
    }

    .sg-img-frame-line-preview {
        border-left-width: 1.5px;
        border-left-color: rgba(46, 125, 50, 0.95);
    }
}

.sg-img-overlay {
    position: absolute;
    left: 0;
    top: 0;
    cursor: crosshair;
    pointer-events: auto;
    z-index: 2;
}

.sg-img-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #909399;
}

.sg-img-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.sg-img-tool-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    background: #fff;
    color: #606266;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.sg-img-tool-btn:hover {
    border-color: #409EFF;
    color: #409EFF;
}

.sg-img-tool-btn.active {
    background: #ecf5ff;
    border-color: #409EFF;
    color: #409EFF;
    font-weight: 600;
}

.sg-img-tool-btn.sg-img-tool-primary {
    background: #409EFF;
    border-color: #409EFF;
    color: #fff;
    text-align: center;
}

.sg-img-tool-btn.sg-img-tool-primary:hover {
    background: #66b1ff;
}

.sg-img-tool-btn.sg-img-tool-danger {
    color: #F56C6C;
    border-color: #fbc4c4;
}

.sg-img-tool-btn.sg-img-tool-danger:hover {
    color: #fff;
    background: #F56C6C;
    border-color: #F56C6C;
}

.sg-img-tool-hint {
    font-size: 12px;
    color: #909399;
    line-height: 1.6;
    padding: 8px;
    background: #f5f7fa;
    border-radius: 8px;
    margin-top: 4px;
}

.sg-img-import-status {
    font-size: 12px;
    color: #909399;
    margin-top: 8px;
    line-height: 1.8;
}

.sg-img-import-status span {
    display: block;
}

.sg-img-row-info {
    font-size: 12px;
    color: #606266;
    line-height: 1.6;
    margin-top: 8px;
    padding: 8px;
    background: #f5f7fa;
    border-radius: 8px;
    word-break: break-all;
}

.sg-img-steps {
    font-size: 12px;
    color: #606266;
    line-height: 1.8;
    padding-left: 18px;
    margin: 0;
}

.sg-img-measure-list {
    max-height: 360px;
    overflow-y: auto;
}

.sg-img-measure-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: #f5f7fa;
}

.sg-img-measure-no {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #409EFF;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sg-img-measure-meta {
    font-size: 12px;
    color: #909399;
}

.sg-img-empty-text {
    font-size: 13px;
    color: #c0c4cc;
    text-align: center;
    padding: 24px 12px;
    margin: 0;
}

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

/* 音频对时栏 P2 */
.sg-img-audio-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #e4e7ed;
    flex-shrink: 0;
}

.sg-img-audio-btn {
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.sg-img-audio-btn:hover { border-color: #409EFF; color: #409EFF; }
.sg-img-audio-accent { background: #409EFF; color: #fff; border-color: #409EFF; }
.sg-img-audio-accent:hover { background: #66b1ff; color: #fff; }

.sg-img-audio-seek { flex: 1; min-width: 80px; }
.sg-img-audio-time { font-size: 12px; color: #909399; min-width: 48px; }
.sg-img-sync-hint { font-size: 12px; color: #606266; margin-left: auto; }

/* 小节对时列表 */
.sg-img-measure-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: #f5f7fa;
    cursor: pointer;
    font-size: 12px;
}

.sg-img-measure-row.active {
    background: #ecf5ff;
    outline: 1px solid #409EFF;
}

.sg-img-measure-row.playback {
    background: #f0f9eb;
    outline: 1px solid #67C23A;
}

.sg-img-time-input {
    width: 52px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 12px;
}

/* 播放序列 P4 */
.sg-img-flow-hint {
    font-size: 11px;
    color: #909399;
    margin: 0 0 10px;
    line-height: 1.5;
}

.sg-img-seq-row.synced .sg-img-seq-no {
    background: #67C23A;
}

.sg-img-seq-row.selected {
    outline: 2px solid #409EFF;
    background: #ecf5ff;
}

.sg-img-seq-range-label {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #303133;
}

.sg-img-seq-row .sg-img-seq-range-input {
    width: 40px;
    flex: 1;
    min-width: 36px;
    margin-bottom: 0;
    padding: 3px 4px;
    text-align: center;
}

.sg-img-seq-range-sep {
    color: #909399;
    font-size: 12px;
    flex-shrink: 0;
}

.sg-img-seq-range-meta {
    font-size: 11px;
    color: #909399;
    min-width: 36px;
    text-align: right;
}

.sg-img-sync-group-label {
    font-size: 12px;
    font-weight: 600;
    color: #409EFF;
    margin: 0 0 8px;
    padding: 6px 8px;
    background: #ecf5ff;
    border-radius: 6px;
}

.sg-img-measure-row.next {
    outline: 1px dashed #b3e19d;
    background: #f0f9eb;
}

.sg-img-measure-row .sg-img-time-input {
    flex: 1;
    min-width: 0;
}

.sg-img-measure-ref-time {
    font-size: 12px;
    color: #606266;
}

.sg-img-seq-row.active {
    outline: 2px solid #E6A23C;
    background: #fdf6ec;
}

.sg-img-seq-row.playing {
    outline: 2px solid #67C23A;
    background: #f0f9eb;
}

.sg-img-sync-actions { margin-bottom: 10px; }
.sg-img-sync-actions .sg-img-tool-btn,
#btnClearSyncTimes {
    width: 100%;
    margin-bottom: 10px;
    font-size: 12px;
    padding: 8px;
}

.sg-img-seq-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.sg-img-seq-actions .sg-img-tool-btn { margin-bottom: 0; flex: 1; font-size: 12px; padding: 8px; }

.sg-img-seq-range {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #606266;
    flex-wrap: wrap;
}

.sg-img-seq-range-input {
    width: 48px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
}

.sg-img-seq-range .sg-img-tool-btn {
    margin-bottom: 0;
    flex: 1;
    min-width: 72px;
    font-size: 12px;
    padding: 8px 6px;
}

.sg-header-btn {
    margin-right: 8px;
}

.sg-img-seq-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}

.sg-img-seq-no { font-weight: 600; color: #409EFF; min-width: 18px; }
.sg-img-seq-measure { flex: 1; min-width: 0; font-size: 11px; }
.sg-img-seq-time { width: 44px !important; }
.sg-img-seq-del {
    border: none; background: transparent; color: #F56C6C; cursor: pointer; font-size: 16px; padding: 0 4px;
}

.sg-img-setting-row {
    display: flex; align-items: center; justify-content: space-between;
    margin: 8px 0; font-size: 12px; color: #606266;
}

.sg-img-check { font-size: 12px; color: #606266; display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* 预览 overlay P3 */
.sg-img-preview-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.85);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.sg-img-preview-inner {
    width: 90vw; height: 80vh;
    background: #2c2c2c;
    border-radius: 12px;
    overflow: hidden;
}

.sg-img-preview-close {
    margin-top: 16px;
    padding: 10px 24px;
    background: #409EFF;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* image-player 样式 */
.sg-img-player-root { width: 100%; height: 100%; }
.sg-img-player-scroll {
    width: 100%; height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: #1a1a1a;
}

.sg-img-player-wrap { position: relative; margin: 0 auto; }
.sg-img-player-stage { position: relative; margin: 0 auto; max-width: 100%; }
.sg-img-player-img { display: block; user-select: none; }
.sg-img-player-overlay { position: absolute; left: 0; top: 0; pointer-events: none; }

.sg-img-sequence-list { max-height: 240px; overflow-y: auto; }