/* 基础样式：统一全局字体 + 重置默认样式 */
html { 
    overflow-x: hidden; 
    font-family: "Microsoft Yahei", Arial, sans-serif; 
}
a { 
    text-decoration: none; 
    color: inherit; 
}
/* 移除冗余的a标签样式重复定义 */

body{
    display: flex;
    flex-direction: column;
    background: linear-gradient(rgb(31, 98, 100), rgb(30, 53, 59));
    color: #dadada;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 16px;
}

/* 导航栏优化：适配移动端 */
.headbox{
    display: flex;
    background: linear-gradient(to top, rgba(48, 47, 47, 0.212), rgba(7, 1, 82, 0.349));
    backdrop-filter: blur(50px);
    justify-content: center;
    align-items: center; /* 元素垂直居中 */
    width: 100%;
    gap: 35px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 101;
    font-family: inherit;
}

.loayao-logo img {
    width: 50px;
    border-radius: 25px;
    /* 其他样式... */
}

/* 导航文字优化：增加点击区域 */
.headbox span{
    line-height: 60px;
    font-size: .9rem;
    cursor: pointer;
    padding: 0 8px; /* 扩大点击区域 */
}
.headbox span.active { color: #0ABAB5; }

/* 节拍器样式 */
.metronome {
    position: fixed;
    bottom: env(safe-area-inset-bottom);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 12px calc(15px + env(safe-area-inset-right)) 12px calc(15px + env(safe-area-inset-left));
    box-shadow: 0 3px 20px rgba(0,0,0,0.4);
    border-radius: 15px 15px 0 0; /* 底部无边框视觉效果 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 35px;
    backdrop-filter: blur(50px);
    background: rgb(30, 53, 59);
}

/* 节拍动画 */
@keyframes firstBeatBackground {
    0% { background: #34445c; }
    80% { background: #0056b3; box-shadow: 0 0 15px rgba(0, 86, 179, 0.5); }
}

@keyframes mainBeatBackground {
    0% { background: #1a1a1a; }
    80% { background: #0ABAB5; box-shadow: 0 0 10px rgba(10, 186, 181, 0.5); }
}

.first-beat-bg { animation: firstBeatBackground 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.main-beat-bg { animation: mainBeatBackground 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* 节拍器控制组 */
.metronome-controls {
    display: flex;
    align-items: center;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 3px;
}

.control-group {
    flex:auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 3px;
}

.select-group {
    text-align: center;
    width: 90%;
    color: white;
    border: none;
}

/* BPM控制 */
.bpm-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 1.3rem;
}

.bpm-display::-webkit-outer-spin-button,
.bpm-display::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bpm-display {
    width: 30px;
    text-align: center;
    background-color: transparent;
    color: #f1c40f;
    border: none;
    font-size: 1.2rem;
    padding: 0;
}

/* 统一select和按钮样式 */
select, .metronome button {
    background-color: rgb(30, 53, 59); 
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 20px;
    outline: none;
    touch-action: manipulation;
    appearance: none;
    padding: 6px 12px;
}

select:hover, .metronome button:hover {
    transform: translateY(-1px);

}

/* 页脚链接 */
.loayao-link{
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    flex-wrap: wrap;
    margin-bottom: 60px; /* 避免被节拍器遮挡 */
}

/* 新增：加载状态样式 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #0ABAB5;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}