/* 谱表容器 */
.notation-container {
    min-height: 300px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 1rem;
    position: relative;
}

.notation-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.notation-header h6 {
    margin: 0;
    color: var(--secondary-color);
    font-weight: 600;
}

.notation-content {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* 五线谱样式 */
#staff-output svg {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

#staff-output .abcjs-note {
    cursor: pointer;
    transition: fill 0.2s ease;
}

#staff-output .abcjs-note:hover {
    fill: var(--primary-color);
}

#staff-output .abcjs-note.playing {
    fill: inherit;
    animation: none !important;
    transform: none !important;
}

/* 简谱样式 */
.numbered-notation {
    font-family: 'Times New Roman', 'SimSun', serif;
    font-size: 20px;
    line-height: 2.5;
    color: #2c3e50;
}

.key-signature, .time-signature {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 10px;
    text-align: left;
    font-weight: 500;
}

.measures-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.measure {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(248, 249, 250, 0.5);
}

/* 按拍分组 */
.beat-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.beat-group:not(:last-child) {
    margin-right: 8px;
}

.numbered-note {
    position: relative;
    display: inline-block;
    min-width: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.numbered-note:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.numbered-note.playing {
    color: #dc3545;
    font-weight: bold;
    transform: scale(1.2);
    animation: noteHighlight 0.6s ease-in-out;
}

/* 八度点 */
.high-dot, .low-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
}

.high-dot {
    top: -8px;
}

.low-dot {
    bottom: -8px;
}

/* 时值标记 */
.duration-eighth {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    text-decoration-color: #000000 !important;
}

.duration-sixteenth {
    text-decoration: underline double;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: #000000 !important;
}

.duration-half::after {
    content: " —";
    color: var(--secondary-color);
    font-weight: normal;
}

.duration-whole::after {
    content: " — — —";
    color: var(--secondary-color);
    font-weight: normal;
}

/* 延音线 */
.extend {
    color: #000000 !important;
    font-weight: normal;
    font-size: 18px;
}

/* 升降记号 */
.accidental {
    font-size: 16px;
    margin-right: 2px;
    color: #e74c3c;
}

.sharp::before { content: "♯"; }
.flat::before { content: "♭"; }
.natural::before { content: "♮"; }

/* 小节线 */
.measure-line {
    width: 2px;
    height: 40px;
    background-color: #333;
    margin: 0 8px;
}

/* 休止符 */
.rest {
    color: #000000 !important;
    font-style: normal;
}

.rest.quarter { content: "0"; }
.rest.eighth { text-decoration: underline; }
.rest.half::after { content: " —"; }
.rest.sixteenth { text-decoration: underline double; }

/* 十六分音符样式 */
.duration-sixteenth {
    position: relative;
}

.duration-sixteenth::after {
    content: "==";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #000000 !important;
}

/* 附点音符样式 */
.duration-dotted::after {
    content: " •";
    color: #000000 !important;
    font-size: 12px;
}

/* 音乐帘子遮挡层 */
.music-curtain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.curtain-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.curtain-icon {
    margin-bottom: 20px;
}

.curtain-title {
    color: white;
    margin-bottom: 15px;
    font-weight: 600;
}

.curtain-text {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    font-size: 16px;
}

.curtain-content .btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.curtain-content .btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* 帘子动画 */
.curtain-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* 节拍器显示 */
.metronome-display {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 10px 15px;
    margin-right: 10px;
}

.beat-indicator {
    text-align: center;
}

.beat-number {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.beat-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.beat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ddd;
    transition: all 0.2s ease;
}

.beat-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* 节拍跳动效果 */
.beat-flash {
    animation: beatPulse 0.1s ease-out;
}

.strong-beat-flash {
    animation: strongBeatPulse 0.2s ease-out;
}

.measure-flash {
    animation: measureHighlight 0.3s ease-out;
}

@keyframes beatPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: rgba(13, 110, 253, 0.2); }
    100% { transform: scale(1); }
}

@keyframes strongBeatPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); background-color: rgba(13, 110, 253, 0.4); }
    100% { transform: scale(1); }
}

@keyframes measureHighlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(40, 167, 69, 0.2); }
    100% { background-color: transparent; }
}

/* 音符跳动高亮 */
.numbered-note.beat-active {
    animation: noteBounce 0.3s ease-out;
    color: #dc3545;
    font-weight: bold;
}

@keyframes noteBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 节奏符头 */
.rhythm-notehead {
    font-size: 20px;
    color: #dc3545;
    font-weight: bold;
}

/* 音符颜色区分 */
.note-high {
    color: var(--note-high, #e53e3e);
    font-weight: bold;
}

.note-middle {
    color: var(--note-middle, #2d3748);
    font-weight: 600;
}

.note-low {
    color: var(--note-low, #3182ce);
    font-weight: bold;
}

/* 点击音符动画 */
.note-clicked {
    animation: noteClick 0.3s ease-out;
}

@keyframes noteClick {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); background-color: rgba(255, 212, 59, 0.8); border-radius: 50%; }
    100% { transform: scale(1); }
}

/* 动画效果 */
@keyframes noteHighlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .notation-container {
        padding: 15px;
        min-height: 250px;
    }
    
    .numbered-notation {
        font-size: 18px;
        line-height: 2.2;
    }
    
    .measures-container {
        gap: 15px;
    }
    
    .measure {
        gap: 8px;
        padding: 6px;
    }
}

@media (max-width: 576px) {
    .notation-container {
        padding: 10px;
        min-height: 200px;
    }
    
    .numbered-notation {
        font-size: 16px;
        line-height: 2;
    }
    
    .numbered-note {
        min-width: 20px;
    }
    
    .measure-line {
        height: 35px;
        margin: 0 6px;
    }
}
