@font-face {
    font-family: 'Facon'; 
    src: url('../fonts/Facon-4pK4.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Hanyi'; 
    src: url('../fonts/Hanyi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Facon', 'Hanyi', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    min-height: 100vh;
    position: relative;
}

/* 添加半透明背景层 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(125deg, #000000 0%, #120054 100%),
        url('../img/background.jpg') center/cover no-repeat;
    background-blend-mode: soft-light;
    opacity: 0.8;
    z-index: -1;
    animation: backgroundPulse 10s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(30deg) brightness(1.1); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面标题 */
.page-title {
    font-size: 1em;
    text-align: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 3em;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}

.page-title .key-hint {
    opacity: 0.6;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    transition: opacity 0.3s ease;
}

.page-title .key-hint:hover {
    opacity: 1;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(45deg, #0055ff, #0099cc);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 204, 255, 0.3),
        inset 0 2px 2px rgba(255, 255, 255, 0.3);
}

.btn:hover {
    background: linear-gradient(45deg, #00ddff, #00aadd);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 204, 255, 0.4),
        inset 0 2px 2px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background-color: #555;
    color: rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
    background-color: #777;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #444;
    background-color: #222;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00ccff;
    box-shadow: 0 0 5px rgba(0, 204, 255, 0.5);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 30px 0;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.upload-area.dragover {
    border-color: #00ccff;
    background-color: rgba(0, 204, 255, 0.1);
}

.upload-area .icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.upload-area .text {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: none;
}

/* 游戏区域 */
.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 20, 40, 0.8) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    box-shadow: 
        0 0 20px rgba(0, 204, 255, 0.3),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    animation: containerPulse 2s ease-in-out infinite;
    backdrop-filter: blur(5px);
}

@keyframes containerPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 204, 255, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 204, 255, 0.5); }
}

.game-lanes {
    position: relative;
    display: flex;
    height: 100%;
    width: 400px;  /* 4个轨道，每个100px */
}

.game-lane {
    position: relative;
    width: 100px;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    background: linear-gradient(to bottom, 
        rgba(0, 204, 255, 0.1),
        rgba(0, 204, 255, 0.05) 30%,
        rgba(0, 204, 255, 0) 70%
    );
    transition: background 0.3s ease;
}

.game-lane:last-child {
    border-right: none;  /* 最后一个轨道不需要右边框 */
}

.game-lane:hover {
    background: linear-gradient(to bottom,
        rgba(0, 204, 255, 0.2),
        rgba(0, 204, 255, 0.1) 30%,
        rgba(0, 204, 255, 0) 70%
    );
}

/* 判定线波动效果 */
.judge-line-ripple {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 204, 255, 0.2);
    border: 2px solid rgba(0, 204, 255, 0.4);
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.5s ease-out;
    pointer-events: none;
    z-index: 6;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.3),
                inset 0 0 5px rgba(0, 204, 255, 0.3);
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
        border-width: 2px;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
        border-width: 1px;
    }
}

/* 修改判定线样式，增加overflow以显示波动效果 */
.judge-line {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(0, 204, 255, 0) 0%,
        rgba(0, 204, 255, 1) 20%,
        rgba(0, 204, 255, 1) 80%,
        rgba(0, 204, 255, 0) 100%
    );
    box-shadow: 
        0 0 10px rgba(0, 204, 255, 0.8),
        0 0 20px rgba(0, 204, 255, 0.4);
    z-index: 5;
    overflow: visible;
    animation: judgeLine 2s ease-in-out infinite;
}

@keyframes judgeLine {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 204, 255, 0.8);
        height: 2px;
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 204, 255, 1);
        height: 3px;
    }
}

.hit-area {
    position: absolute;
    bottom: 50px;
    width: 100px;
    height: 100px;
    box-sizing: border-box;
    z-index: 15;
}

.hit-area-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
}

.hit-area-inner.active {
    transform: translate(-50%, -50%) scale(1.2);
    background-color: rgba(0, 204, 255, 0.3);
    border-color: rgba(0, 204, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.8),
                inset 0 0 10px rgba(0, 204, 255, 0.5);
    animation: hitEffect 0.2s ease-out;
}

@keyframes hitEffect {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0px rgba(0, 204, 255, 0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 30px rgba(0, 204, 255, 1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 20px rgba(0, 204, 255, 0.8);
    }
}

/* 音符样式 */
.note {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
    transition: filter 0.2s ease;
    backdrop-filter: blur(2px);
}

.note:not(.processed) {
    animation: noteGlow 1s ease-in-out infinite;
}

@keyframes noteGlow {
    0%, 100% {
        filter: brightness(100%) drop-shadow(0 0 5px currentColor);
    }
    50% {
        filter: brightness(120%) drop-shadow(0 0 8px currentColor);
    }
}

.note.tap {
    background-color: rgba(0, 255, 255, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.9);
}

.note.hold {
    background-color: rgba(255, 255, 0, 0.8);
    border: 2px solid rgba(255, 255, 0, 0.9);
    color: rgba(255, 255, 0, 0.8);
}

.note.slide {
    background-color: rgba(255, 0, 255, 0.8);
    border: 2px solid rgba(255, 0, 255, 0.9);
    color: rgba(255, 0, 255, 0.8);
}

.note-tail {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 20px;
    background: linear-gradient(to top, currentColor, transparent);

    /* background: currentColor; */
    transform-origin: bottom center;
    transform: translateX(-50%);
    z-index: 9;
    opacity: 0.6;
    border-radius: 5px;
    transition: filter 0.2s ease;
    backdrop-filter: blur(2px);
}

/* 判定效果 */
.judge-effect {
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 10px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 20;
    pointer-events: none;
}

.judge-effect.perfect {
    font-size: 1.8em;
    color: #00ffff;
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.4),
        0 0 30px rgba(0, 255, 255, 0.2);
    letter-spacing: 3px;
}

@keyframes perfectJudge {
    0% {
        transform: translate(-50%, 0) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -30px) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -20px) scale(1.2);
        opacity: 1;
    }
}

.judge-effect.great {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.judge-effect.good {
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.judge-effect.miss {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.judge-effect.show {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.2);
    animation: judgeShow 0.3s ease-out;
}

@keyframes judgeShow {
    0% {
        transform: translate(-50%, 0) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -25px) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -20px) scale(1.2);
        opacity: 1;
    }
}

/* 音符爆炸效果 */
.note-explosion {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 12;
}

.note-explosion::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background-color: currentColor;
    animation: explode 0.3s ease-out forwards;
}

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

/* 游戏信息和控制 */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.game-score {
    font-size: 2.2em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    letter-spacing: 2px;
}

.game-combo {
    font-size: 2em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    animation: comboScale 0.2s ease-out;
    letter-spacing: 2px;
}

@keyframes comboScale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.game-controls {
    display: flex;
    gap: 10px;
}

/* 结果界面 */
.result-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(8px);
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 20, 40, 0.85) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.result-screen.show {
    opacity: 1;
    pointer-events: auto;
}

.result-title {
    font-size: 2.8em;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    letter-spacing: 4px;
}

.result-score {
    font-size: 3.5em;
    background: linear-gradient(45deg, #00ccff, #00ffcc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 204, 255, 0.5);
}

.result-rank {
    font-size: 5em;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 0 20px;
}

.result-rank.S {
    color: #ffcc00;
}

.result-rank.A {
    color: #00ffcc;
}

.result-rank.B {
    color: #00ccff;
}

.result-rank.C {
    color: #cc00ff;
}

.result-rank.D {
    color: #ff6600;
}

.result-rank.F {
    color: #ff0000;
}

.result-stats {
    display: grid;
    grid-template-columns: auto auto;
    gap: 10px 30px;
    margin-bottom: 30px;
}

.result-stats .label {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}

.result-stats .value {
    text-align: left;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}

.result-actions {
    display: flex;
    gap: 20px;
}

/* 页眉样式 */
header {
    padding: 20px 0;
    background-color: rgba(0, 0, 0, 0.7);
    margin-bottom: 30px;
}

/* 页脚样式 */
footer {
    padding: 20px 0;
    background-color: rgba(0, 0, 0, 0.7);
    margin-top: 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content nav {
    display: flex;
    gap: 10px;
}

.copyright {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}

/* 游戏说明样式 */
.game-instructions {
    margin-top: 30px;
    padding: 20px;
    background-color: linear-gradient(45deg, #0055ff, #0099cc);
    border-radius: 8px;
}

.game-instructions h3 {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    margin-bottom: 15px;
}

.game-instructions p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.page-transition {
    animation: fadeIn 0.5s ease-in-out;
}

.page-transition-exit {
    animation: fadeOut 0.5s ease-in-out;
}

/* 难度选择按钮 */
.difficulty-selection {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.difficulty-btn {
    flex: 1;
    padding: 12px 24px;
    background: linear-gradient(45deg, #333, #555);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 2px 2px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(45deg, #444, #666);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 2px rgba(255, 255, 255, 0.2);
}

.difficulty-btn.selected {
    background: linear-gradient(45deg, #0055ff, #0099cc);
    box-shadow: 
        0 4px 15px rgba(0, 204, 255, 0.3),
        inset 0 2px 2px rgba(255, 255, 255, 0.3);
}

.difficulty-btn.selected:hover {
    background: linear-gradient(45deg, #00ddff, #00aadd);
    box-shadow: 
        0 6px 20px rgba(0, 204, 255, 0.4),
        inset 0 2px 2px rgba(255, 255, 255, 0.4);
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.difficulty-btn:hover::before {
    transform: scale(1);
    opacity: 0.2;
}

.difficulty-btn.selected::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
}

/* 难度按钮特殊效果 */
.difficulty-btn[data-value="easy"] {
    border-bottom: 3px solid #00cc00;
}

.difficulty-btn[data-value="normal"] {
    border-bottom: 3px solid #00ccff;
}

.difficulty-btn[data-value="hard"] {
    border-bottom: 3px solid #ff3366;
}

.difficulty-btn[data-value="easy"].selected {
    background: linear-gradient(45deg, #00aa00, #00dd00);
}

.difficulty-btn[data-value="normal"].selected {
    background: linear-gradient(45deg, #0055ff, #0099cc);
}

.difficulty-btn[data-value="hard"].selected {
    background: linear-gradient(45deg, #cc0033, #ff3366);
}

/* 如果有特定的选择器需要覆盖默认样式，可以单独设置 */
.page-title h1,
.page-title .key-hint,
.btn,
.btn-secondary,
.form-group label,
.upload-area .text,
.game-score,
.game-combo,
.result-title,
.result-score,
.result-rank,
.result-stats .label,
.result-stats .value,
.footer-content,
.game-instructions h3,
.game-instructions p {
    font-family: 'Facon', 'Hanyi', sans-serif;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.9);
}
