/* 全局样式重置 */
body,
h1,
p {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 让 padding 和 border 不会增加元素的总宽度 */
}

/* 页面整体布局 */
body {
    font-family: sans-serif; /* 使用通用的无衬线字体 */
    display: flex;
    flex-direction: column; /* 主轴方向为垂直 */
    min-height: 100vh; /* 页面最小高度为视口高度 */
    background-color: #f8f9fa; /* 设置页面背景色 */
    color: #333; /* 设置默认文字颜色 */
}

/* 页面头部样式 */
header {
    padding: 20px 40px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
}

/* Logo 标题样式 */
h1 {
    font-size: 2.5em; /* 设置标题字号 */
    color: #2c3e50;
    margin: 0;
    text-align: left;
}

/* 主要内容区域样式 */
main {
    /* flex-grow: 1;  */
    /* 让 main 区域填充剩余空间 */
    /* display: flex; */
    /* justify-content: center;  */
    /* 水平居中 */
    /* align-items: center;  */
    /* 垂直居中 */
    /* padding: 40px 20px; */

   
        flex-grow: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
        width: 100%;
        transition: transform 0.3s ease-in-out;
    
}

/* 木琴容器样式 */
.xylophone {
    display: flex;
    flex-wrap: nowrap; /* 防止换行 */
    justify-content: center;
    gap: 30px; /* 增加琴键之间的间隔 */
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
     /* 允许横向滚动 */
}


/* 琴键基本样式 */
/* .key {
    min-width: 80px;
    height: 400px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 10px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
} */

.key {
    /* min-width: 60px;  */
    /* 减小最小宽度 */
    /* height: 600px; */
     /* 增加高度 */

    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 30px 15px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    box-shadow: 0 6px 12px rgb(0, 0, 0,0.4);
    position: relative;
    overflow: hidden;
    flex: 0 0 auto; /* 防止琴键被拉伸 */
}



/* 琴键悬停效果 */
.key:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* 琴键点击效果 */
.key:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 琴键激活状态 */
.key.key-active {
    transform: translateY(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* 琴键上的音符名称 */
.key .note-name {
    /* font-size: 2em;
    margin-top: 20px; */

    font-size: 3em;
    margin-top: 40px;
}

/* 琴键下的编号 */
.key .note-number {
    /* font-size: 1.2em;
    margin-bottom: 20px; */

    font-size: 1.8em;
    margin-bottom: 40px;
}

/* 页面底部样式 */
footer {
    padding: 20px 40px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    /* border-top: 1px solid #eee; */
}

/* 页脚链接样式 */
footer a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #2980b9;
}

/* 音阶选择按钮样式 */
#scales-button {
    /* padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */

    padding: 12px 24px;
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.2s ease;
}

#scales-button:hover {
    /* background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); */

    background-color: #f8f9fa;
    border-color: #ff595e;
}

/* 音阶选择侧边菜单样式 */
#scales-menu {
    /* position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    padding: 30px;
    box-sizing: border-box;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column; */

    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: white;
    padding: 30px;
    box-sizing: border-box;
    transition: right 0.3s ease-in-out;
    z-index: 1000;

}

/* 菜单可见状态 */
#scales-menu.scales-menu-visible {
    right: 0;
}
/* 当菜单可见时，移动主要内容区域 */
#scales-menu.scales-menu-visible ~ main {
    transform: translateX(-280px);
}

#scales-menu h2 {
    /* margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 1.5em; */

    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.5em;
}

#scales-menu ul {
    /* list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; */

    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#scales-menu li {
    /* padding: 15px 20px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
    font-weight: 500; */

    padding: 15px;
    background-color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#scales-menu li:hover {
    /* background-color: #e9ecef;
    transform: translateX(5px); */

    border-color: #ff595e;
    background-color: #fff8f8;
}

#scales-menu li .scale-name {
    font-size: 1.2em;
    font-weight: 500;
}

#scales-menu li .scale-description {
    font-size: 0.9em;
    color: #666;
}

/* 不同音阶的颜色 */
#scales-menu li[data-scale="c-major"] .scale-name { color: #ff595e; }
#scales-menu li[data-scale="pentatonic"] .scale-name { color: #ff595e; }
#scales-menu li[data-scale="chromatic"] .scale-name { color: #ff9f1c; }
#scales-menu li[data-scale="g-major"] .scale-name { color: #2ec4b6; }
#scales-menu li[data-scale="a-minor"] .scale-name { color: #3d5a80; }
#scales-menu li[data-scale="d-minor"] .scale-name { color: #ff9f1c; }

/* 当前选中音阶的样式 */
#scales-menu li.active-scale {
    /* background-color: #3498db;
    color: white;
    font-weight: bold; */

    border-color: #ff595e;
    background-color: #fff8f8;
}

/* 关闭按钮样式 */
#close-menu-button {
    /* padding: 12px 24px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 20px;
    align-self: flex-end;
    transition: all 0.2s ease; */

    padding: 12px 24px;
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    margin-top: 20px;
    align-self: flex-end;
    transition: all 0.2s ease;
}

#close-menu-button:hover {
    /* background-color: #c0392b;
    transform: translateY(-2px); */

    background-color: #e9ecef;
    color: #333;
    border-color: #ff595e;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .xylophone {
        max-width: 900px;

        
    }
    
    .key {
        min-width: 70px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    h1 {
        font-size: 2em;
    }

    /* .xylophone {
        max-width: 600px;
        gap: 8px;
    } */




    /* .key {
        min-width: 50px;
        height: 200px;
        padding: 15px 8px;
    } */

    .key .note-name {
        font-size: 1.5em;
    }

    .key .note-number {
        font-size: 1em;
    }

    #scales-button {
        padding: 10px 20px;
        font-size: 1em;
    }

    #scales-menu {
        width: 250px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .xylophone {
        max-width: 100%;
        padding: 10px;
    }

    .key {
        min-width: 40px;
        height: 180px;
        padding: 10px 5px;
    }

    .key .note-name {
        font-size: 1.2em;
    }

    .key .note-number {
        font-size: 0.9em;
    }
} 


/* 为每个琴键设置不同的宽度和高度 */
.key:nth-child(1) { width: 100px; height: 680px; }
.key:nth-child(2) { width: 100px; height: 660px; }
.key:nth-child(3) { width: 100px; height: 640px; }
.key:nth-child(4) { width: 100px; height: 620px; }
.key:nth-child(5) { width: 100px; height: 600px; }
.key:nth-child(6) { width: 100px; height: 580px; }
.key:nth-child(7) { width: 100px; height: 560px; }
.key:nth-child(8) { width: 100px; height: 540px; }
.key:nth-child(9) { width: 100px; height: 520px; }
.key:nth-child(10) { width: 100px; height: 500px; }
.key:nth-child(11) { width: 100px; height: 480px; }
.key:nth-child(12) { width: 100px; height: 460px; }
.key:nth-child(13) { width: 100px; height: 440px; }

@media (max-width: 1200px) {
    .key:nth-child(1) { width: 70px; height: 600px; }
    .key:nth-child(2) { width: 65px; height: 580px; }
    .key:nth-child(3) { width: 60px; height: 560px; }
    .key:nth-child(4) { width: 55px; height: 540px; }
    .key:nth-child(5) { width: 50px; height: 520px; }
    .key:nth-child(6) { width: 45px; height: 500px; }
    .key:nth-child(7) { width: 40px; height: 480px; }
    .key:nth-child(8) { width: 35px; height: 460px; }
    .key:nth-child(9) { width: 30px; height: 440px; }
    .key:nth-child(10) { width: 25px; height: 420px; }
    .key:nth-child(11) { width: 20px; height: 400px; }
    .key:nth-child(12) { width: 15px; height: 380px; }
    .key:nth-child(13) { width: 10px; height: 360px; }
}

@media (max-width: 768px) {
    .key:nth-child(1) { width: 60px; height: 500px; }
    .key:nth-child(2) { width: 55px; height: 480px; }
    .key:nth-child(3) { width: 50px; height: 460px; }
    .key:nth-child(4) { width: 45px; height: 440px; }
    .key:nth-child(5) { width: 40px; height: 420px; }
    .key:nth-child(6) { width: 35px; height: 400px; }
    .key:nth-child(7) { width: 30px; height: 380px; }
    .key:nth-child(8) { width: 25px; height: 360px; }
    .key:nth-child(9) { width: 20px; height: 340px; }
    .key:nth-child(10) { width: 15px; height: 320px; }
    .key:nth-child(11) { width: 10px; height: 300px; }
    .key:nth-child(12) { width: 5px; height: 280px; }
    .key:nth-child(13) { width: 0px; height: 260px; }
}

@media (max-width: 480px) {
    .key:nth-child(1) { width: 50px; height: 400px; }
    .key:nth-child(2) { width: 45px; height: 380px; }
    .key:nth-child(3) { width: 40px; height: 360px; }
    .key:nth-child(4) { width: 35px; height: 340px; }
    .key:nth-child(5) { width: 30px; height: 320px; }
    .key:nth-child(6) { width: 25px; height: 300px; }
    .key:nth-child(7) { width: 20px; height: 280px; }
    .key:nth-child(8) { width: 15px; height: 260px; }
    .key:nth-child(9) { width: 10px; height: 240px; }
    .key:nth-child(10) { width: 5px; height: 220px; }
    .key:nth-child(11) { width: 0px; height: 200px; }
    .key:nth-child(12) { width: 0px; height: 180px; }
    .key:nth-child(13) { width: 0px; height: 160px; }
}

/* 内容容器样式 */
.content-container {
    width: 80%;
    margin: 50px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* 内容区块通用样式 */
.content-section {
    margin-bottom: 60px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    color: #2c3e50;
    font-size: 2.2em;
    margin-bottom: 25px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.content-section h3 {
    color: #34495e;
    font-size: 1.5em;
    margin: 20px 0 15px;
}

.content-section p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #555;
}

/* 列表样式 */
.content-section ul, 
.content-section ol {
    margin: 20px 0;
    padding-left: 25px;
}

.content-section li {
    margin-bottom: 10px;
    color: #555;
}

/* Why Love PlayXylo 部分样式 */
.love-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.love-point {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.love-point:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Features 部分样式 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-card {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .content-container {
        width: 70%;
    }
}

@media (max-width: 768px) {
    .content-container {
        width: 85%;
    }

    .content-section h2 {
        font-size: 1.8em;
    }

    .content-section h3 {
        font-size: 1.3em;
    }

    .content-section p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .content-container {
        width: 95%;
        margin: 30px auto;
    }

    .content-section {
        padding: 20px;
        margin-bottom: 40px;
    }

    .love-points,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
