.sg-img-player-page {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.sg-img-player-page .sg-img-player-root {
    height: 100%;
}

.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;
    vertical-align: top;
}

.sg-img-player-overlay {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    pointer-events: none;
}

/* ========== 播放器主容器 ========== */
.sg-player-body .player-page {
    padding-top: 68px;
    min-height: 100vh;
    background: var(--bg-page);
}

.player-page {
    padding-top: var(--navbar-height);
    min-height: 100vh;
    background: var(--bg-page);
}

.sg-player-body .player-wrapper {
    height: calc(100vh - 68px);
}

.player-wrapper {
    display: flex;
    height: calc(100vh - var(--navbar-height));
}

/* ========== 左侧谱面区域 ========== */
.score-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 谱面信息栏 */
.score-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-lighter);
    flex-shrink: 0;
}

.score-info-bar .score-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.score-info-bar .score-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.score-info-bar .score-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 谱面滚动容器 */
.score-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-white);
    padding: 20px;
    position: relative;
}

/* 谱面canvas */
.score-canvas {
    display: block;
    margin: 0 auto;
}

/* ========== 右侧辅助面板（抽屉式） ========== */
.side-panel {
    width: 320px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-lighter);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.side-panel.collapsed {
    transform: translateX(100%);
}

.side-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.side-panel-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 指法图区域 */
.finger-chart-section {
    margin-bottom: 24px;
}

.finger-chart-section h4 {
    font-size: var(--font-base);
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.instrument-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.instrument-selector .instrument-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-base);
    background: var(--bg-white);
    color: var(--text-regular);
    cursor: pointer;
    font-size: var(--font-sm);
    transition: var(--transition-fast);
}

.instrument-selector .instrument-btn:hover,
.instrument-selector .instrument-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

/* ========== 底部播放控制台 ========== */
.player-control-bar {
    height: 90px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-lighter);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    flex-shrink: 0;
    box-shadow: 0 -2px 12px 0 rgba(0, 0, 0, 0.04);
}

/* 左侧：播放控制按钮 */
.player-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

/* 圆形播放按钮 */
.player-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px 0 rgba(64, 158, 255, 0.3);
    flex-shrink: 0;
}

.player-play-btn:hover {
    transform: scale(1.05);
    background: var(--primary-light);
    box-shadow: 0 6px 16px 0 rgba(64, 158, 255, 0.4);
}

.player-play-btn:active {
    transform: scale(0.95);
}

.player-play-btn .play-icon,
.player-play-btn .pause-icon {
    font-size: 20px;
    line-height: 1;
}

.player-play-btn .pause-icon {
    display: none;
}

.player-play-btn.playing .play-icon {
    display: none;
}

.player-play-btn.playing .pause-icon {
    display: block;
}

/* 次要控制按钮 */
.player-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-page);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    font-size: 16px;
}

.player-icon-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.player-icon-btn.active {
    background: var(--accent);
    color: #fff;
}

/* 中间：进度条 */
.player-progress-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.player-time {
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: center;
}

/* 进度条容器 */
.player-progress-bar {
    height: 6px;
    background: var(--border-lighter);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.player-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
}

.player-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.player-progress-bar:hover .player-progress-fill::after {
    opacity: 1;
}

/* AB循环标记线 */
.player-progress-bar .ab-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--accent);
    z-index: 2;
}

.player-progress-bar .ab-marker.start {
    left: 0;
}

.player-progress-bar .ab-marker.end {
    right: 0;
}

/* 右侧：音量、速度、调号控制 */
.player-controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 280px;
    justify-content: flex-end;
}

/* 旋钮式控制器 */
.player-knob-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-knob-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.player-knob-value {
    font-size: var(--font-xs);
    color: var(--primary);
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* 音量滑条 */
.player-volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: var(--border-lighter);
    border-radius: 2px;
    outline: none;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.player-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 速度滑条 */
.player-speed-slider {
    -webkit-appearance: none;
    width: 60px;
    height: 4px;
    background: var(--border-lighter);
    border-radius: 2px;
    outline: none;
}

.player-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

/* 升降调滑条 */
.player-pitch-slider {
    -webkit-appearance: none;
    width: 60px;
    height: 4px;
    background: var(--border-lighter);
    border-radius: 2px;
    outline: none;
}

.player-pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

/* AB循环信息显示 */
.player-ab-info {
    display: none;
    font-size: var(--font-xs);
    color: var(--accent);
    background: #FDF6EC;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ========== 浮动辅助面板按钮 ========== */
.side-panel-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    background: var(--bg-card);
    border: 1px solid var(--border-lighter);
    border-right: none;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 10;
    transition: var(--transition-fast);
}

.side-panel-toggle:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

/* ========== 骨架屏 ========== */
.player-skeleton {
    padding: 20px;
}

.player-skeleton .skeleton-line {
    height: 20px;
    margin-bottom: 12px;
}

/* ========== 频谱可视化 ========== */
.visualizer-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    margin-top: 4px;
    opacity: 0.6;
}

/* ========== 长辈模式适配 ========== */
body.elder-mode .player-control-bar {
    height: 120px;
}

body.elder-mode .player-play-btn {
    width: 72px;
    height: 72px;
    font-size: 28px;
}

body.elder-mode .player-icon-btn {
    width: 52px;
    height: 52px;
    font-size: 22px;
}

body.elder-mode .player-volume-slider,
body.elder-mode .player-speed-slider,
body.elder-mode .player-pitch-slider {
    width: 120px;
    height: 8px;
}

body.elder-mode .player-volume-slider::-webkit-slider-thumb,
body.elder-mode .player-speed-slider::-webkit-slider-thumb,
body.elder-mode .player-pitch-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
}

body.elder-mode .side-panel {
    width: 400px;
}

body.elder-mode .player-progress-bar {
    height: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .side-panel {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 90px;
        z-index: 50;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .side-panel.collapsed {
        transform: translateX(100%);
    }

    .player-controls-right {
        min-width: auto;
    }

    .player-knob-group {
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .player-control-bar {
        height: auto;
        flex-direction: column;
        padding: 12px;
        gap: 8px;
    }

    .player-controls-left,
    .player-controls-right {
        width: 100%;
        justify-content: center;
    }

    .player-progress-section {
        width: 100%;
    }

    .side-panel {
        width: 100%;
        bottom: 0;
        top: auto;
        height: 50vh;
    }

    .score-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ========== 图片谱影院模式（会员发布曲谱直接播放） ========== */
.sg-player-cinema .player-page--cinema {
    background: #0a0c10;
}

.sg-player-cinema .player-wrapper {
    height: calc(100vh - 68px);
}

.sg-player-cinema .score-area {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.sg-player-cinema .player-stage-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #0a0c10;
}

.sg-player-cinema .player-stage-shell.is-fullscreen {
    width: 100%;
    height: 100%;
    background: #0a0c10;
}

.sg-player-cinema .player-stage-shell.is-fullscreen .score-scroll {
    flex: 1;
}

.player-cinema-only {
    display: none !important;
}

.sg-player-cinema .player-cinema-only {
    display: flex !important;
}

.sg-player-cinema .score-info-bar {
    background: rgba(10, 12, 16, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5eaf3;
    padding: 10px 20px;
}

.sg-player-cinema .score-info-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sg-player-cinema .score-back-link {
    color: #8a94a6;
    font-size: 13px;
    text-decoration: none;
}

.sg-player-cinema .score-back-link:hover {
    color: #409EFF;
}

.sg-player-cinema .score-title {
    color: #fff;
    font-size: 18px;
}

.sg-player-cinema .score-subtitle {
    color: #8a94a6;
    font-size: 13px;
}

.sg-player-cinema .score-meta {
    color: #8a94a6;
    font-size: 12px;
}

.sg-player-cinema .score-scroll {
    padding: 12px;
    background: #0a0c10;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    flex: 1;
}

.player-viewport {
    position: relative;
    overflow: hidden;
    background: #0a0c10;
    border-radius: 10px;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.45);
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: auto;
}

.sg-player-cinema .score-scroll {
    width: 100%;
}

.sg-player-cinema .player-viewport .sg-img-player-page,
.sg-player-cinema .player-viewport .sg-img-player-page .sg-img-player-root,
.sg-player-cinema .player-viewport .sg-img-player-scroll {
    width: 100%;
    height: 100%;
}

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

.player-stage-shell.is-fullscreen .score-info-bar {
    flex-shrink: 0;
}

.player-stage-shell.is-fullscreen .player-control-bar {
    flex-shrink: 0;
}

.player-stage-shell:fullscreen,
.player-stage-shell:-webkit-full-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0a0c10;
}

.player-stage-shell:fullscreen .score-scroll,
.player-stage-shell:-webkit-full-screen .score-scroll {
    flex: 1;
    min-height: 0;
}

.sg-player-cinema .player-legacy-only {
    display: none !important;
}

.sg-player-cinema .player-control-bar {
    background: rgba(10, 12, 16, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5eaf3;
}

.sg-player-cinema .player-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #c0c4cc;
}

.sg-player-cinema .player-progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

.sg-player-cinema .player-progress-fill {
    background: linear-gradient(90deg, #409EFF, #53a8ff);
}

.player-cinema-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    z-index: 20;
    cursor: pointer;
}

.player-cinema-play-btn {
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #409EFF, #53a8ff);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(64, 158, 255, 0.45);
    transition: transform 0.2s ease;
}

.player-cinema-play-btn:hover {
    transform: scale(1.06);
}

.player-cinema-hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}