/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* 屏幕切换 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* 首页样式 */
.home-content {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.2rem;
    color: #f0f0f0;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 按钮样式 */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    font-family: inherit;
    min-width: 150px;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: auto;
}

.btn-share {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 4px 15px rgba(68, 160, 141, 0.4);
}

/* 游戏统计 */
.game-stats {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #f0f0f0;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* 游戏界面 */
#gameScreen {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.game-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.score-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    margin-right: 0.5rem;
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ff6b6b;
}

.combo-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.combo-text {
    font-weight: 500;
    color: #333;
}

/* 游戏区域 */
#gameArea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.character {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #ff6b6b;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
    z-index: 50;
}

.character.jumping {
    transform: rotate(45deg);
}

.character.perfect {
    animation: perfectLand 0.5s ease;
}

@keyframes perfectLand {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 平台样式 */
.platform {
    position: absolute;
    background: linear-gradient(45deg, #fff, #f8f9fa);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

/* 力度条 */
.game-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
}

.power-bar {
    width: 200px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #74b9ff, #0984e3, #fd79a8);
    border-radius: 8px;
    transition: width 0.1s ease;
}

.power-label {
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 完美着陆提示 */
.perfect-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    z-index: 200;
}

.perfect-text.show {
    animation: showPerfect 1s ease;
}

@keyframes showPerfect {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* 轨迹 */
#trajectory {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
}

.trajectory-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: fadeOut 1s ease forwards;
    transition: all 0.1s ease;
    pointer-events: none;
}

/* 着陆预测标记 */
.landing-prediction {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    animation: pulse 1s infinite;
    pointer-events: none;
    z-index: 35;
}

.landing-prediction.perfect {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    border: 2px solid #4CAF50;
}

.landing-prediction.excellent {
    background: linear-gradient(45deg, #2196F3, #03DAC6);
    border: 2px solid #2196F3;
}

.landing-prediction.good {
    background: linear-gradient(45deg, #FF9800, #FFC107);
    border: 2px solid #FF9800;
}

.landing-prediction.ok {
    background: linear-gradient(45deg, #9C27B0, #E91E63);
    border: 2px solid #9C27B0;
}

.landing-prediction.miss {
    background: linear-gradient(45deg, #F44336, #E91E63);
    border: 2px solid #F44336;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* 游戏结束界面 */
.game-over-content {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 90%;
}

.game-over-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.final-stats {
    margin-bottom: 2rem;
}

.final-score {
    margin-bottom: 1rem;
}

.final-score-label {
    font-size: 1.1rem;
    color: #f0f0f0;
    margin-right: 0.5rem;
}

.final-score-value {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    color: #ff6b6b;
}

.stat-row {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.final-stat {
    text-align: center;
}

.final-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #f0f0f0;
    opacity: 0.8;
    margin-bottom: 0.3rem;
}

.final-stat-value {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.share-section {
    margin-bottom: 2rem;
}

.share-text {
    color: #f0f0f0;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.game-over-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 排行榜界面 */
.ranking-content {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 90%;
}

.ranking-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.player-info {
    margin-bottom: 2rem;
}

.player-name-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.player-name-section label {
    color: #f0f0f0;
    font-size: 0.9rem;
}

.player-name-section input {
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    max-width: 100px;
}

.player-rank {
    color: #f0f0f0;
    font-size: 1rem;
}

.ranking-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
}

.ranking-item.current-player {
    background: rgba(255, 107, 107, 0.3);
    border: 1px solid rgba(255, 107, 107, 0.5);
}

.ranking-rank {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    width: 30px;
}

.ranking-name {
    flex: 1;
    text-align: left;
    margin-left: 1rem;
}

.ranking-score {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

/* 皮肤商店 */
.skins-content {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 90%;
}

.skins-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.skins-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
}

.skin-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skin-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.skin-item.selected {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
}

.skin-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.skin-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.skin-name {
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.skin-requirement {
    color: #f0f0f0;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .home-content,
    .game-over-content,
    .ranking-content,
    .skins-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .game-header {
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .score-display,
    .combo-display {
        padding: 0.4rem 0.8rem;
    }
    
    .game-controls {
        bottom: 20px;
    }
    
    .power-bar {
        width: 150px;
        height: 15px;
    }
    
    .character {
        width: 35px;
        height: 35px;
    }
    
    .platform {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .menu-buttons {
        gap: 0.8rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .game-stats {
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .game-over-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .player-name-section {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .skins-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
}

/* 新增系统状态显示 */
.system-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #f0f0f0;
}

.status-icon {
    font-size: 1rem;
}

.status-text {
    opacity: 0.9;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #f0f0f0;
    padding: 4px 8px;
    font-size: 0.8rem;
    outline: none;
}

.language-selector select option {
    background: #333;
    color: #f0f0f0;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body p {
    color: #f0f0f0;
    text-align: center;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.nickname-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nickname-input-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 1rem;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.nickname-input-group input:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.nickname-suggestions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.suggestion-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nickname-status {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.nickname-status.success {
    color: #4ade80;
}

.nickname-status.error {
    color: #f87171;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 反作弊警告 */
.anti-cheat-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 15px;
    padding: 1.5rem;
    display: none;
    z-index: 3000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 300px;
}

.anti-cheat-alert.active {
    display: block;
    animation: alertPulse 2s infinite;
}

@keyframes alertPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.alert-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.alert-icon {
    font-size: 2rem;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.alert-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

.alert-description {
    color: #f0f0f0;
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.alert-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    animation: progressFill 3s ease-in-out infinite;
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* 存储警告 */
.storage-warning {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 10px;
    padding: 1rem;
    display: none;
    z-index: 2500;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.storage-warning.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
}

.warning-title {
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
}

.warning-description {
    color: #f0f0f0;
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.warning-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.warning-close:hover {
    opacity: 0.7;
}

/* 系统状态响应式调整 */
@media (max-width: 768px) {
    .system-status {
        top: 5px;
        right: 5px;
        padding: 8px;
        gap: 6px;
    }
    
    .status-item {
        font-size: 0.7rem;
        gap: 6px;
    }
    
    .status-icon {
        font-size: 0.9rem;
    }
    
    .language-selector select {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .nickname-suggestions {
        gap: 0.3rem;
    }
    
    .suggestion-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .anti-cheat-alert {
        min-width: 280px;
        padding: 1rem;
    }
    
    .storage-warning {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .system-status {
        flex-direction: row;
        top: auto;
        bottom: 60px;
        left: 10px;
        right: 10px;
        justify-content: space-between;
        align-items: center;
    }
    
    .status-item {
        flex-direction: column;
        text-align: center;
        gap: 2px;
    }
    
    .status-text {
        font-size: 0.6rem;
    }
    
    .language-selector {
        order: -1;
    }
    
    .language-selector select {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
}