/* ========================================
   古筝模拟器 - 全局样式
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ========================================
   顶部控制栏
   ======================================== */

#header {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.title {
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(90deg, #f5d08a, #c9a66b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

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

.ctrl-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #c9a66b 0%, #8b6914 100%);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(201, 166, 107, 0.3);
}

.ctrl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 166, 107, 0.4);
}

.ctrl-btn:active {
    transform: translateY(0);
}

.ctrl-btn.small-btn {
    padding: 8px 12px;
    font-size: 16px;
    width: 42px;
    text-align: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5d08a, #c9a66b);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5d08a, #c9a66b);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================
   主内容区
   ======================================== */

#main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

#guzheng-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#guzheng-wrapper {
    position: relative;
    width: fit-content;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#guzheng-img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

/* ========================================
   琴弦层
   ======================================== */

#strings-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.string {
    position: absolute;
    cursor: pointer;
    transition: background 0.1s ease;
    /* 调试时可取消注释查看弦的位置 */
    /* background: rgba(255, 0, 0, 0.1); */
    /* border: 1px solid rgba(255, 0, 0, 0.3); */
}

.string::after {
    content: '';
    position: absolute;
    /* 发光竖条：位于音名右侧约50px处（随音名一起自适应屏宽，
       不再用百分比大偏移，避免手机端跑出屏幕外） */
    left: calc(88% - 85px);
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(90deg,
        rgba(255, 215, 0, 0) 0%,
        rgba(255, 215, 0, 0.4) 30%,
        rgba(255, 215, 0, 0.6) 50%,
        rgba(255, 215, 0, 0.4) 70%,
        rgba(255, 215, 0, 0) 100%
    );
    transform: translateX(-50%);
    pointer-events: none;
}

.string.active {
    background: radial-gradient(ellipse at center, 
        rgba(255, 215, 0, 0.4) 0%,
        rgba(255, 215, 0, 0.1) 50%,
        transparent 100%
    );
}

.string.active::after {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.9) 40%,
        rgba(255, 255, 0, 1) 50%,
        rgba(255, 255, 255, 0.9) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    width: 4px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8),
                0 0 20px rgba(255, 215, 0, 0.5);
}

/* 琴弦按压动画 */
@keyframes stringVibrate {
    0%, 100% { transform: translateX(-50%) scaleX(1); }
    25% { transform: translateX(-50%) translateX(-1px) scaleX(1.5); }
    75% { transform: translateX(-50%) translateX(1px) scaleX(1.5); }
}

.string.active::after {
    animation: stringVibrate 0.3s ease-out;
}

/* ========================================
   琴弦简谱音名标签
   数字始终居中于琴弦，音点相对数字中心延伸
   ======================================== */

.string-label {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    user-select: none;
    /* 所有音名统一左移100px（与原12弦特殊位移对齐） */
    transform: translate(calc(-50% - 100px), -50%);
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.string-label .label-num {
    font-size: 20px;
    font-weight: 700;
    color: #f5d08a;
    text-shadow:
        -1px -1px 2px rgba(0, 0, 0, 0.8),
        1px -1px 2px rgba(0, 0, 0, 0.8),
        -1px 1px 2px rgba(0, 0, 0, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 6px rgba(245, 208, 138, 0.5);
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    position: relative;
}

.string-label .label-dots-top,
.string-label .label-dots-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}

/* 上方音点：与数字间距2px */
.string-label .label-dots-top {
    margin-bottom: 3px;
}

/* 下方音点：与数字间距2px */
.string-label .label-dots-bottom {
    margin-top: 3px;
}

.string-label .dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f5d08a;
    box-shadow: 0 0 3px rgba(245, 208, 138, 0.7);
}

/* 高亮状态变化 */
.string.active .string-label .label-num {
    color: #fff;
    text-shadow:
        -1px -1px 3px rgba(0, 0, 0, 0.9),
        1px -1px 3px rgba(0, 0, 0, 0.9),
        -1px 1px 3px rgba(0, 0, 0, 0.9),
        1px 1px 3px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(255, 255, 255, 0.8);
}

/* 音名为5的弦 - 绿色标签，与琴弦绿色匹配 */
.string-label-green .label-num {
    color: #2ecc71 !important;
    text-shadow:
        -1px -1px 2px rgba(0, 0, 0, 0.8),
        1px -1px 2px rgba(0, 0, 0, 0.8),
        -1px 1px 2px rgba(0, 0, 0, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 6px rgba(46, 204, 113, 0.6) !important;
}

.string-label-green .dot {
    background: #2ecc71 !important;
    box-shadow: 0 0 3px rgba(46, 204, 113, 0.7) !important;
}

.string.active .string-label-green .label-num {
    color: #2ecc71 !important;
    text-shadow:
        -1px -1px 3px rgba(0, 0, 0, 0.9),
        1px -1px 3px rgba(0, 0, 0, 0.9),
        -1px 1px 3px rgba(0, 0, 0, 0.9),
        1px 1px 3px rgba(0, 0, 0, 0.9),
        0 0 12px rgba(46, 204, 113, 0.9) !important;
}

.string.active .string-label-green .dot {
    background: #2ecc71 !important;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.9) !important;
}

/* 1-3弦标签上移3px */
.string-label-shift-up {
    transform: translate(calc(-50% - 100px), calc(-50% - 3px));
}

/* 4-6弦标签上移2px */
.string-label-shift-up2 {
    transform: translate(calc(-50% - 100px), calc(-50% - 2px));
}

/* 16-18弦标签下移2px */
.string-label-shift-down2 {
    transform: translate(calc(-50% - 100px), calc(-50% + 2px));
}

/* 19-21弦标签下移3px */
.string-label-shift-down3 {
    transform: translate(calc(-50% - 100px), calc(-50% + 3px));
}

/* 17-21弦的低音下标点贴近数字（margin从3px减到1px） */
.string-label-dots-tight .label-dots-bottom {
    margin-top: 1px;
}

/* ========================================
   按音指示器（PC端按住Ctrl / 移动端两指同按时显示）
   位置：音名右基准(12%+30px) 再往左200px
   ======================================== */
.press-indicator {
    position: absolute;
    right: calc(12% + 230px);
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #1e3a8a;
    background: rgba(30, 58, 138, 0.3);
    color: #4d9fff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    z-index: 6;
    user-select: none;
    text-shadow: 0 0 8px rgba(77, 159, 255, 0.9),
                -1px -1px 2px rgba(0, 0, 0, 0.8),
                1px -1px 2px rgba(0, 0, 0, 0.8),
                -1px 1px 2px rgba(0, 0, 0, 0.8),
                1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 12px rgba(77, 159, 255, 0.7),
                inset 0 0 8px rgba(77, 159, 255, 0.4);
}

/* 仅在当前按压的按音弦上显示“按”字 */
.string.alt-active .press-indicator {
    display: flex;
}

/* 2弦按字上移3px（补偿高音点上浮） */
.string[data-string="2"] .press-indicator {
    top: calc(50% - 3px);
}

/* 4弦按字上移2px（补偿高音点上浮） */
.string[data-string="4"] .press-indicator {
    top: calc(50% - 2px);
}

/* 17弦按字下移2px（补偿低音点下沉） */
.string[data-string="17"] .press-indicator {
    top: calc(50% + 2px);
}

/* 19弦按字下移3px（补偿低音点下沉） */
.string[data-string="19"] .press-indicator {
    top: calc(50% + 3px);
}

.string.active .string-label .dot {
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

/* 电脑端：音名与发音光条一起右移120px（不影响手机端） */
@media (min-width: 769px) {
    .string-label {
        /* 原 -100px + 120px = +20px */
        transform: translate(calc(-50% + 20px), -50%);
    }
    .string::after {
        /* 原 -85px + 120px = +35px */
        left: calc(88% + 35px);
    }
}

/* 移动端适配 - 标签更小 */
@media (max-width: 768px) {
    .string-label .label-num {
        font-size: 16px;
    }
    .string-label .dot {
        width: 4px;
        height: 4px;
    }
    .string-label .label-dots-top,
    .string-label .label-dots-bottom {
        gap: 1px;
    }
    .string-label .label-dots-top {
        margin-bottom: 2px;
    }
    .string-label .label-dots-bottom {
        margin-top: 2px;
    }
    .string-label-dots-tight .label-dots-bottom {
        margin-top: 1px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .string-label .label-num {
        font-size: 14px;
    }
    .string-label .dot {
        width: 3px;
        height: 3px;
    }
    .string-label .label-dots-top {
        margin-bottom: 2px;
    }
    .string-label .label-dots-bottom {
        margin-top: 2px;
    }
    .string-label-dots-tight .label-dots-bottom {
        margin-top: 1px;
    }
}

/* ========================================
   跟弹提示层
   ======================================== */

#follow-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.follow-note {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 100, 100, 0.95),
        rgba(220, 50, 50, 0.9)
    );
    box-shadow: 0 4px 15px rgba(255, 80, 80, 0.6),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    z-index: 50;
    will-change: transform, left, top;
}

/* 跟弹音符内的音名数字 */
.follow-note .fn-num {
    line-height: 1;
    font-size: 1em;
    font-weight: bold;
}

/* 跟弹音符的高/低音点（绝对定位于圆圈外） */
.follow-note .fn-dots-top,
.follow-note .fn-dots-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}

.follow-note .fn-dots-top {
    bottom: calc(100% + 3px);
}

.follow-note .fn-dots-bottom {
    top: calc(100% + 3px);
}

.follow-note .fn-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

/* 绿弦（音名5）的绿色变体 */
.follow-note.follow-note-green {
    background: radial-gradient(circle at 30% 30%,
        rgba(100, 255, 100, 0.95),
        rgba(50, 200, 50, 0.9)
    );
    box-shadow: 0 4px 15px rgba(80, 255, 80, 0.6),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.follow-note.hit-zone {
    background: radial-gradient(circle at 30% 30%,
        rgba(100, 255, 100, 0.95),
        rgba(50, 200, 50, 0.9)
    );
    box-shadow: 0 4px 20px rgba(80, 255, 80, 0.8),
                inset 0 2px 5px rgba(255, 255, 255, 0.4);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

.follow-note.hit {
    background: radial-gradient(circle at 30% 30%,
        rgba(100, 255, 100, 0.95),
        rgba(50, 200, 50, 0.9)
    );
    animation: hitAnim 0.3s ease-out forwards;
}

@keyframes hitAnim {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ========================================
   跟弹控制面板
   ======================================== */

#follow-panel {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

#follow-panel.hidden {
    display: none;
}

.follow-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 8px;
}

.follow-select {
    padding: 6px 12px;
    border: 1px solid rgba(201, 166, 107, 0.5);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: #f5d08a;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.follow-select:focus {
    border-color: #c9a66b;
}

.follow-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.follow-btn.play {
    background: linear-gradient(135deg, #52c234 0%, #1a8f3f 100%);
    box-shadow: 0 2px 8px rgba(82, 194, 52, 0.3);
}

.follow-btn.pause {
    background: linear-gradient(135deg, #f0a500 0%, #d48806 100%);
    box-shadow: 0 2px 8px rgba(240, 165, 0, 0.3);
}

.follow-btn.restart {
    background: linear-gradient(135deg, #4facfe 0%, #00c6fb 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.follow-btn.exit {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.follow-btn.mute {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.follow-btn.mute.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.follow-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.follow-btn:active {
    transform: translateY(0);
}

.follow-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* —— 消音跟弹：麦克风状态徽章 —— */
.follow-mic-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}
.follow-mic-badge.pending {
    background: rgba(240, 165, 0, 0.2);
    color: #f5d08a;
    border: 1px solid rgba(240, 165, 0, 0.5);
}
.follow-mic-badge.live {
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.55);
    animation: micBlink 1.2s ease-in-out infinite;
}
.follow-mic-badge.error {
    background: rgba(231, 76, 60, 0.2);
    color: #ff7b6b;
    border: 1px solid rgba(231, 76, 60, 0.6);
}
@keyframes micBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* —— 消音跟弹：实时判定文字 —— */
.follow-judge-text {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 12px;
}
.follow-judge-text .fj-tally {
    color: #f5d08a;
}
.follow-judge-text .fj-last.ok {
    color: #3ddc84;
    font-weight: bold;
}
.follow-judge-text .fj-last.bad {
    color: #ff5c5c;
    font-weight: bold;
}
.follow-judge-text .fj-last.info {
    color: rgba(255, 255, 255, 0.75);
}

/* —— 消音跟弹：到线等待拨弦 —— */
.follow-note.judging {
    box-shadow: 0 0 0 3px rgba(245, 208, 138, 0.9),
                0 0 20px rgba(245, 208, 138, 0.85),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
    animation: pulse 0.45s ease-in-out infinite;
}

/* —— 消音跟弹：弹对=绿色 —— */
.follow-note.judge-correct {
    background: radial-gradient(circle at 30% 30%,
        rgba(80, 230, 120, 0.98),
        rgba(20, 150, 60, 0.95)
    );
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9),
                0 0 12px rgba(46, 204, 113, 0.95),
                inset 0 2px 5px rgba(255, 255, 255, 0.35);
    animation: judgePop 0.28s ease-out forwards;
}
.follow-note.judge-correct::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a8f3f;
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    text-shadow: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
@keyframes judgePop {
    0%   { transform: translate(-50%, -50%) scale(0.6); }
    60%  { transform: translate(-50%, -50%) scale(1.28); }
    100% { transform: translate(-50%, -50%) scale(1.14); }
}

/* —— 消音跟弹：弹错/漏弹=红色 —— */
.follow-note.judge-wrong {
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 70, 70, 0.98),
        rgba(150, 12, 12, 0.96)
    );
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92),
                0 0 12px rgba(255, 40, 40, 0.95),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
    animation: judgeShake 0.42s ease-out forwards;
}
.follow-note.judge-wrong::after {
    content: '✗';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #c01818;
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    text-shadow: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
/* 漏弹：略降透明度，仍为红色 */
.follow-note.judge-missed {
    opacity: 0.82;
}
@keyframes judgeShake {
    0%   { transform: translate(-50%, -50%) scale(1.14); }
    20%  { transform: translate(calc(-50% - 5px), -50%) scale(1.14); }
    40%  { transform: translate(calc(-50% + 5px), -50%) scale(1.14); }
    60%  { transform: translate(calc(-50% - 3px), -50%) scale(1.14); }
    80%  { transform: translate(calc(-50% + 3px), -50%) scale(1.14); }
    100% { transform: translate(-50%, -50%) scale(1.14); }
}

/* ========================================
   消音跟弹：曲终评分弹窗
   ======================================== */
.score-card {
    position: relative;
    width: 90%;
    max-width: 380px;
    padding: 28px 26px 24px;
    border-radius: 18px;
    text-align: center;
    color: #f5d08a;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(80, 40, 20, 0.12) 0px,
            rgba(80, 40, 20, 0.12) 1px,
            transparent 1px,
            transparent 6px
        ),
        linear-gradient(145deg, #2c2620 0%, #1c1814 100%);
    border: 1px solid rgba(201, 166, 107, 0.45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.score-title {
    margin: 0 0 16px;
    font-size: 20px;
    letter-spacing: 4px;
    color: #f5d08a;
}
.score-circle {
    width: 132px;
    height: 132px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 35% 30%, #3a332a, #211d18);
    border: 5px solid #8a8a8a;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.score-circle.s-excellent { border-color: #2ecc71; box-shadow: 0 0 26px rgba(46,204,113,.55); }
.score-circle.s-good      { border-color: #4facfe; box-shadow: 0 0 26px rgba(79,172,254,.5); }
.score-circle.s-pass      { border-color: #f0a500; box-shadow: 0 0 26px rgba(240,165,0,.5); }
.score-circle.s-low       { border-color: #e74c3c; box-shadow: 0 0 26px rgba(231,76,60,.45); }
.score-num {
    font-size: 44px;
    font-weight: bold;
    line-height: 1;
    color: #f5d08a;
}
.score-unit {
    font-size: 13px;
    color: rgba(245, 208, 138, 0.7);
    margin-top: 2px;
}
.score-rank {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #c9a66b;
}
.score-rank.s-excellent { color: #2ecc71; }
.score-rank.s-good      { color: #4facfe; }
.score-rank.s-pass      { color: #f0a500; }
.score-rank.s-low       { color: #e74c3c; }
.score-stats {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}
.score-stat {
    flex: 1;
    max-width: 100px;
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}
.score-stat b {
    display: block;
    font-size: 22px;
    color: #3ddc84;
}
.score-stat span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}
.score-stat.bad b {
    color: #ff5c5c;
}
.score-tip {
    margin: 0 0 18px;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.62);
}
.score-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.score-btn {
    padding: 10px 20px;
    border: 1px solid rgba(201, 166, 107, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #f5d08a;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.score-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}
.score-btn.primary {
    background: linear-gradient(135deg, #52c234 0%, #1a8f3f 100%);
    border-color: transparent;
    color: #fff;
}

/* ========================================
   跟练方式选择弹窗（触屏弹对 / 拾音感应）
   ======================================== */
.mode-select-card {
    position: relative;
    width: 90%;
    max-width: 360px;
    padding: 26px 22px 20px;
    border-radius: 18px;
    text-align: center;
    color: #f5d08a;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(80, 40, 20, 0.12) 0px,
            rgba(80, 40, 20, 0.12) 1px,
            transparent 1px,
            transparent 6px
        ),
        linear-gradient(145deg, #2c2620 0%, #1c1814 100%);
    border: 1px solid rgba(201, 166, 107, 0.45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.mode-select-title {
    margin: 0 0 8px;
    font-size: 20px;
    letter-spacing: 4px;
    color: #f5d08a;
}
.mode-select-tip {
    margin: 0 0 18px;
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.62);
}
.mode-select-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}
.mode-select-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 166, 107, 0.35);
    color: #f5d08a;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.mode-select-btn:hover,
.mode-select-btn:active {
    background: rgba(201, 166, 107, 0.14);
    border-color: rgba(201, 166, 107, 0.6);
    transform: translateY(-1px);
}
.mode-icon {
    font-size: 28px;
    line-height: 1;
    flex: 0 0 auto;
}
.mode-name {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #f5d08a;
}
.mode-desc {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}
.mode-select-cancel {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(201, 166, 107, 0.35);
    border-radius: 10px;
    background: transparent;
    color: rgba(245, 208, 138, 0.78);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-select-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f5d08a;
}

/* ========================================
   教程弹窗
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: linear-gradient(145deg, #2a2a45 0%, #1e1e35 100%);
    border-radius: 16px;
    border: 1px solid rgba(201, 166, 107, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
}

/* 古筝教学弹窗 - 木纹背景 */
.modal-content.guzheng-modal {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(80, 40, 20, 0.15) 0px,
            rgba(80, 40, 20, 0.15) 1px,
            transparent 1px,
            transparent 4px
        ),
        linear-gradient(180deg, #8B5A2B 0%, #6B3A1B 30%, #5C2E15 60%, #4A2410 100%);
    border: 1px solid rgba(245, 208, 138, 0.2);
}

.modal-content.guzheng-modal .modal-header h2 {
    color: #f5d08a;
    border-bottom: 1px solid rgba(245, 208, 138, 0.3);
}

.modal-content.guzheng-modal .modal-body {
    padding: 0;
    background: transparent;
}

.modal-content.guzheng-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-content.guzheng-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(245, 208, 138, 0.5);
    border-radius: 4px;
}

.modal-content.guzheng-modal .modal-close {
    background: rgba(245, 208, 138, 0.15);
    color: #f5d08a;
}

.modal-content.guzheng-modal .modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
}

/* 课时列表项 */
.lesson-item {
    border-bottom: 1px solid rgba(245, 208, 138, 0.15);
    transition: background 0.2s ease;
}

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

.lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    cursor: pointer;
    color: #f5d08a;
    font-size: 17px;
    font-weight: 500;
    transition: background 0.2s ease;
    user-select: none;
}

.lesson-header:hover {
    background: rgba(245, 208, 138, 0.08);
}

.lesson-arrow {
    font-size: 22px;
    color: rgba(245, 208, 138, 0.6);
    transition: transform 0.3s ease;
    font-weight: bold;
}

.lesson-item.open .lesson-arrow {
    transform: rotate(0deg);
    color: #f5d08a;
}

.lesson-item.open .lesson-header {
    background: rgba(245, 208, 138, 0.1);
}

.lesson-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}

.lesson-item.open .lesson-detail {
    max-height: 1000px;
}

.lesson-inner {
    padding: 16px 20px 20px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.85;
    font-size: 15px;
}

.lesson-inner p {
    margin-bottom: 10px;
    text-indent: 2em;
}

.lesson-inner p:first-child {
    text-indent: 0;
}

.lesson-inner ul {
    padding-left: 1.5em;
    margin-bottom: 12px;
}

.lesson-inner li {
    margin-bottom: 6px;
}

.lesson-inner table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13px;
}

.lesson-inner th,
.lesson-inner td {
    border: 1px solid rgba(245, 208, 138, 0.25);
    padding: 8px 10px;
    text-align: center;
}

.lesson-inner th {
    background: rgba(245, 208, 138, 0.2);
    color: #f5d08a;
    font-weight: 600;
}

.lesson-inner tr:nth-child(even) td {
    background: rgba(245, 208, 138, 0.05);
}

.lesson-inner .tip {
    background: rgba(245, 208, 138, 0.1);
    border-left: 3px solid #f5d08a;
    padding: 10px 14px;
    margin: 14px 0;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

/* 课时列表在移动端的响应式 */
@media (max-width: 768px) {
    .lesson-header {
        padding: 14px 16px;
        font-size: 15px;
    }
    .lesson-inner {
        padding: 12px 16px 16px;
        font-size: 14px;
    }
    .lesson-inner table {
        font-size: 12px;
    }
    .lesson-inner th,
    .lesson-inner td {
        padding: 6px 6px;
    }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: rotate(90deg);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 22px;
    background: linear-gradient(90deg, #f5d08a, #c9a66b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

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

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(201, 166, 107, 0.5);
    border-radius: 4px;
}

.modal-body h3 {
    color: #f5d08a;
    font-size: 18px;
    margin: 20px 0 12px;
    padding-left: 12px;
    border-left: 3px solid #c9a66b;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 10px;
    text-indent: 2em;
    font-size: 15px;
}

.modal-body .tip {
    background: rgba(201, 166, 107, 0.1);
    border-left: 3px solid #c9a66b;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.modal-body th,
.modal-body td {
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 12px;
    text-align: center;
}

.modal-body th {
    background: rgba(201, 166, 107, 0.2);
    color: #f5d08a;
    font-weight: 600;
}

.modal-body tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.modal-body ul {
    margin: 10px 0;
    padding-left: 2em;
}

.modal-body li {
    margin-bottom: 6px;
    font-size: 15px;
}

/* 使用说明中的 kbd 按键样式 */
.modal-body kbd {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #f5d08a;
    background: rgba(201, 166, 107, 0.15);
    border: 1px solid rgba(201, 166, 107, 0.4);
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    line-height: 1.4;
}

.modal-body ol {
    margin: 10px 0;
    padding-left: 2em;
}

.modal-body ol li {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.7;
}

/* ========================================
   加载遮罩
   ======================================== */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 4px solid rgba(201, 166, 107, 0.2);
    border-top-color: #c9a66b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    font-size: 15px;
}

.loading-progress {
    width: 240px;
    height: 8px;
    margin: 0 auto 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #c9a66b, #f5d08a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

#loading-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   响应式适配
   ======================================== */

/* 平板 */
@media (max-width: 1024px) {
    .title {
        font-size: 18px;
    }

    .ctrl-btn {
        padding: 7px 14px;
        font-size: 13px;
    }

    .volume-slider {
        width: 80px;
    }

    .follow-note {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    .follow-note .fn-dot {
        width: 4px;
        height: 4px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    #header {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .title {
        font-size: 16px;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }
    
    .ctrl-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .ctrl-btn.small-btn {
        padding: 6px 10px;
        width: 36px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    #main {
        padding: 10px 5px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 20px 16px 12px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-body h3 {
        font-size: 16px;
    }
    
    .modal-body p,
    .modal-body li {
        font-size: 14px;
    }
    
    #follow-panel {
        padding: 10px 12px;
    }
    
    .follow-controls {
        gap: 6px;
    }
    
    .follow-select {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .follow-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .follow-note {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    .follow-note .fn-dot {
        width: 4px;
        height: 4px;
    }
    .follow-note .fn-dots-top,
    .follow-note .fn-dots-bottom {
        gap: 1px;
    }
    .follow-note .fn-dots-top {
        bottom: calc(100% + 2px);
    }
    .follow-note .fn-dots-bottom {
        top: calc(100% + 2px);
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .controls {
        gap: 4px;
    }
    
    .ctrl-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .volume-slider {
        width: 50px;
    }
    
    .follow-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .follow-note {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    .follow-note .fn-dot {
        width: 3px;
        height: 3px;
    }
}

/* ========================================
   移动端横屏提示 + 强制横屏旋转
   ======================================== */

.rotate-hint {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.rotate-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.rotate-content {
    text-align: center;
    padding: 30px;
}

.rotate-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotatePhone 2s ease-in-out infinite;
}

.rotate-arrow {
    font-size: 48px;
    color: #f5d08a;
    margin: 10px 0;
    animation: arrowPulse 1s ease-in-out infinite;
}

.rotate-text {
    font-size: 22px;
    font-weight: 700;
    color: #f5d08a;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.rotate-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
}

.rotate-continue-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #c9a66b 0%, #8b6914 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(201, 166, 107, 0.4);
}

.rotate-continue-btn:active {
    transform: scale(0.96);
}

.rotate-cancel-btn {
    display: block;
    margin: 16px auto 0;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
}

@keyframes arrowPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* JS 强制横屏模式：左菜单 + 右面板铺满 */
body.force-landscape {
    overflow: hidden;
}

body.force-landscape #app {
    flex-direction: row;
    width: 100vw;
    height: 100vh;
}

body.force-landscape #header {
    flex-direction: column;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    height: 100vh;
    padding: 12px 8px;
    gap: 10px;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-start;
}

body.force-landscape .title {
    font-size: 13px;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    margin-bottom: 8px;
}

body.force-landscape .controls {
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

body.force-landscape .ctrl-btn {
    padding: 10px 8px;
    font-size: 13px;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
    width: 50px;
    text-align: center;
}

body.force-landscape .volume-control {
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

body.force-landscape .volume-slider {
    width: 40px;
    height: 80px;
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
}

body.force-landscape #main {
    flex: 1;
    padding: 0;
    width: calc(100vw - 70px);
    height: 100vh;
    overflow: hidden;
}

body.force-landscape #guzheng-container {
    width: 100%;
    height: 100%;
    padding: 0;
}

body.force-landscape #guzheng-wrapper {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow: hidden;
}

body.force-landscape #guzheng-img {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-width: none;
    object-fit: cover;
    /* 显示琴头一端（原图右侧），而非筝尾 */
    object-position: right center;
    display: block;
}

body.force-landscape .string-label .label-num {
    font-size: 16px;
}

body.force-landscape .string-label .dot {
    width: 4px;
    height: 4px;
}

/* 移动端竖屏优化：自动调整面板比例，适配竖屏宽度 */
@media (max-width: 768px) and (orientation: portrait) {
    #guzheng-container {
        padding: 8px;
    }
    #guzheng-wrapper {
        max-height: calc(100vh - 120px);
    }
    #header {
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .title {
        font-size: 15px;
        letter-spacing: 1px;
    }
    .ctrl-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    .volume-slider {
        width: 60px;
    }
    /* 琴弦更紧凑 */
    .string-label .label-num {
        font-size: 16px;
    }
    .string-label .dot {
        width: 4px;
        height: 4px;
    }
}

/* 移动端横屏优化：左侧菜单 + 面板铺满 */
@media (max-width: 768px) and (orientation: landscape) {
    #app {
        flex-direction: row;
    }
    #header {
        flex-direction: column;
        width: auto;
        min-width: 68px;
        padding: 10px 8px;
        gap: 12px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    .title {
        font-size: 14px;
        letter-spacing: 1px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }
    .controls {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .ctrl-btn {
        padding: 8px 12px;
        font-size: 12px;
        writing-mode: vertical-rl;
        letter-spacing: 2px;
    }
    .volume-control {
        flex-direction: column;
        gap: 6px;
    }
    .volume-slider {
        width: 40px;
        height: 60px;
        -webkit-appearance: slider-vertical;
        appearance: slider-vertical;
    }
    #main {
        flex: 1;
        padding: 0;
        min-width: 0;
        position: relative;
    }
    /* 用绝对定位铺满主区域，保证高度链确定，图片不再塌陷 */
    #guzheng-container {
        position: absolute;
        inset: 0;
        padding: 0;
    }
    #guzheng-wrapper {
        width: 100%;
        height: 100%;
    }
    #guzheng-img {
        width: 100%;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }
    /* 跟弹面板放右侧，垂直排列 */
    #follow-panel {
        display: flex;
        flex-direction: column;
        width: auto;
        min-width: 120px;
        max-width: 160px;
        padding: 8px 6px;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: center;
    }
    .follow-controls {
        flex-direction: column;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .follow-select {
        padding: 4px 6px;
        font-size: 11px;
        width: 100%;
    }
    .follow-btn {
        padding: 6px 8px;
        font-size: 11px;
        width: 100%;
    }
    .follow-progress {
        font-size: 11px;
        margin-top: 4px;
    }
    .string-label .label-num {
        font-size: 16px;
    }
    .string-label .dot {
        width: 4px;
        height: 4px;
    }
}

/* ========================================
   移动端跟弹模式（body.follow-mode 由 JS 控制）
   布局：Grid 三格 —— 左上菜单 / 左下控制条 / 右侧古筝
   ======================================== */

/* —— 移动端跟弹模式：Grid 布局 ——
   左侧列上为菜单(#header)、下为控制条(#follow-panel)，右侧为主区(#main)。
   断点与 JS（innerWidth<=1024）保持一致；不移动DOM、不依赖滚动。 */
@media (max-width: 1024px) {
    body.follow-mode #app {
        display: grid;
        grid-template-columns: 104px 1fr;
        /* 两行按比例分配(菜单1 : 控制条1.2)，均可压缩，保证任何屏幕高度下
           控制条都有自己的空间，内容超高时各自内部滚动 */
        grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr);
        grid-template-areas:
            "menu  main"
            "panel main";
        width: 100%;
        height: 100%;
    }

    /* —— 左上：菜单（竖排，超高时内部滚动） ——
       height:auto 必须显式声明：覆盖 force-landscape 的 height:100vh，
       否则菜单溢出所在格子，会遮挡正下方的控制条 */
    body.follow-mode #header {
        grid-area: menu;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow-y: auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        padding: 10px 6px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    body.follow-mode .title {
        font-size: 13px;
        letter-spacing: 2px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        margin: 0 auto;
    }
    body.follow-mode .controls {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        align-items: center;
    }
    body.follow-mode .ctrl-btn {
        padding: 8px 10px;
        font-size: 12px;
        letter-spacing: 2px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        width: auto;
    }
    body.follow-mode .ctrl-btn.small-btn {
        width: auto;
    }
    body.follow-mode .volume-control {
        flex-direction: column;
        gap: 6px;
    }
    body.follow-mode .volume-slider {
        width: 36px;
        height: 70px;
        -webkit-appearance: slider-vertical;
        appearance: slider-vertical;
        writing-mode: vertical-lr;
        direction: rtl;
    }

    /* —— 左下：控制条（竖排，位于菜单正下方） ——
       min-width/max-width/border-left 必须显式声明：覆盖
       横屏查询(≤768 landscape)里右侧面板的 min-width:120px 等，
       否则左列被撑宽、边框错位 */
    body.follow-mode #follow-panel {
        grid-area: panel;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        width: auto;
        min-width: 0;
        max-width: none;
        border-left: none;
        min-height: 0;
        overflow-y: auto;
        padding: 10px 6px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(10, 14, 26, 0.6);
    }
    body.follow-mode .follow-controls {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
        margin-bottom: 10px;
    }
    body.follow-mode .follow-select {
        width: 100%;
        padding: 7px 4px;
        font-size: 11px;
        visibility: visible;
        -webkit-appearance: none;
        appearance: none;
    }
    body.follow-mode .follow-btn {
        width: 100%;
        padding: 9px 4px;
        font-size: 11px;
        visibility: visible;
        -webkit-appearance: none;
        appearance: none;
    }
    body.follow-mode .follow-progress {
        font-size: 10px;
        margin-top: 2px;
        gap: 4px 6px;
    }
    body.follow-mode .follow-mic-badge,
    body.follow-mode .follow-judge-text {
        font-size: 10px;
    }
    body.follow-mode .follow-mic-badge {
        padding: 1px 6px;
    }

    /* —— 右侧：主区铺满 ——
       height:auto 必须显式声明：覆盖 force-landscape 的 height:100vh，
       否则主区溢出跨行，遮挡左下控制条 */
    body.follow-mode #main {
        grid-area: main;
        width: auto;
        height: auto;
        min-width: 0;
        position: relative;
        padding: 0;
    }
    body.follow-mode #guzheng-container {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 0;
    }
    body.follow-mode #guzheng-wrapper {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
    }
    body.follow-mode #guzheng-img {
        width: 100%;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }
}

/* —— 竖屏跟弹：古筝图片 cover 显示琴头一端，充分利用竖向空间 —— */
@media (max-width: 1024px) and (orientation: portrait) {
    body.follow-mode #guzheng-img {
        object-fit: cover;
        object-position: right center;
    }
}
