/* 九宫格音乐页面样式 */

/* 九宫格容器 */
.jiugongge-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 15px;
    max-width: 500px;
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* 九宫格格子样式 */
.jiugong-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #dee2e6;
    border-radius: 12px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

/* 空格子样式（清空后的状态） */
.jiugong-cell.empty {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    color: #adb5bd;
    cursor: default;
    border-style: dashed;
}

/* 隐藏状态（问号状态 - 默认遮蔽） */
.jiugong-cell.hidden {
    background: linear-gradient(145deg, #fff8e1 0%, #ffecb3 100%);
    border: 3px solid #ff9800;
    color: #e65100;
    cursor: pointer;
    font-size: 3rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.2);
    transition: all 0.3s ease;
}

.jiugong-cell.hidden:hover {
    background: linear-gradient(145deg, #fff3c4 0%, #ffe082 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.3);
    border-color: #f57c00;
}

/* 音符格子样式 */
.jiugong-cell.has-note {
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #42a5f5;
    color: #1565c0;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.2);
}

/* 休止符格子样式 */
.jiugong-cell.rest {
    background: linear-gradient(145deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: #ff9800;
    color: #f57c00;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.2);
}

/* 悬停效果 */
.jiugong-cell.has-note:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(66, 165, 245, 0.3);
    border-color: #2196f3;
}

.jiugong-cell.rest:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.3);
    border-color: #ff8f00;
}

/* 点击动画效果 */
.jiugong-cell.playing {
    animation: notePlay 0.6s ease-out;
}

@keyframes notePlay {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(66, 165, 245, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 30px rgba(66, 165, 245, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(66, 165, 245, 0.2);
    }
}

/* 高音音符样式（带点） */
.jiugong-cell.high-note {
    background: linear-gradient(145deg, #fff3e0 0%, #ffcc02 100%);
    border-color: #ff9800;
    color: #e65100;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

/* 低音音符样式（带。号） */
.jiugong-cell.low-note {
    background: linear-gradient(145deg, #e1f5fe 0%, #81d4fa 100%);
    border-color: #0288d1;
    color: #01579b;
    box-shadow: 0 4px 15px rgba(2, 136, 209, 0.3);
}

/* 音符映射说明样式 */
.notation-mapping {
    font-size: 0.85rem;
}

.notation-mapping .col-6,
.notation-mapping .col-md-3 {
    padding: 0.25rem;
}

.notation-mapping small {
    background: rgba(13, 110, 253, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #0d6efd;
}



/* 响应式设计 */
@media (max-width: 768px) {
    .jiugongge-container {
        max-width: 350px;
        grid-gap: 10px;
        padding: 15px;
    }
    
    .jiugong-cell {
        font-size: 2rem;
        min-height: 80px;
        border-radius: 10px;
    }
    
    .jiugongge-mask .mask-content {
        padding: 15px;
    }
    
    .jiugongge-mask .mask-content h5 {
        font-size: 1.2rem;
    }
    
    .jiugongge-mask .mask-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .jiugongge-container {
        max-width: 280px;
        grid-gap: 8px;
        padding: 12px;
    }
    
    .jiugong-cell {
        font-size: 1.5rem;
        min-height: 60px;
        border-radius: 8px;
    }
}

/* 生成按钮特效 */
#generate-jiugong-btn {
    position: relative;
    overflow: hidden;
}

#generate-jiugong-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

#generate-jiugong-btn:hover::before {
    left: 100%;
}

/* 卡片优化 */
.card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 15px;
}

.card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
}

/* 音符数字的特殊样式 */
.note-number {
    position: relative;
    display: inline-block;
}

/* 为带点的高音音符添加上划线 */
.note-number.high-note::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
}