/* 越级挑战页面专用样式 */

.back-button {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(45deg, #d4af37, #f4e17a);
    border: 2px solid #b8942a;
    color: #2c1810;
    padding: 8px 16px; /* 恢复部分内边距 */
    border-radius: 8px;
    font-size: 1em; /* 恢复字体大小 */
    font-family: 'KaiTi', 'STKaiti', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.back-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.page-title {
    font-size: clamp(1.8em, 3.5vw, 2.8em); /* 恢复标题尺寸 */
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin: 10px 0 15px 0; /* 优化边距 */
    color: #e6c66c;
    font-family: 'LiSu', 'STXingkai', serif;
    text-align: center;
    flex-shrink: 0; /* 防止标题被压缩 */
}

.challenge-wrapper {
    display: flex;
    justify-content: center; /* 居中对齐 */
    align-items: stretch; /* 拉伸对齐 */
    width: 95%;
    max-width: 1400px;
    gap: 30px; /* 增加间距 */
    margin-top: 0;
    flex-grow: 1; /* 占据剩余的垂直空间 */
    overflow: hidden; /* 防止溢出 */
    min-height: 0; /* 解决flexbox在某些情况下的高度计算问题 */
}

.control-panel {
    flex: 1.2;
    min-width: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.character-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* 居中对齐 */
    min-width: 300px; /* 增加最小宽度 */
    height: 100%; /* 使用100%高度 */
}

/* 音效控制区样式 */
.audio-controls {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 10px; /* 减小内边距 */
    margin-bottom: 10px; /* 减小底部边距 */
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    flex-shrink: 0; /* 防止压缩 */
}

.audio-controls h2 {
    color: #e6c66c;
    font-size: 1.2em; /* 减小字体 */
    margin-bottom: 8px; /* 减小底部边距 */
    text-align: center;
    font-family: 'LiSu', 'STXingkai', serif;
}

.control-group {
    margin-bottom: 5px; /* 大幅减小间距 */
}

.control-group label {
    display: block;
    color: #f4e17a;
    font-size: 0.9em; /* 减小字体 */
    margin-bottom: 5px; /* 减小底部边距 */
    font-family: 'KaiTi', 'STKaiti', serif;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px; /* 减小间距 */
}

.audio-slider {
    flex: 1;
    height: 6px; /* 恢复高度 */
    background: linear-gradient(to right, #2c1810, #d4af37);
    border-radius: 5px;
    outline: none;
    appearance: none;
}

.audio-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px; /* 恢复尺寸 */
    height: 18px;
    background: #f4e17a;
    border: 2px solid #d4af37;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(244, 225, 122, 0.8);
}

.slider-value {
    color: #f4e17a;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    font-size: 0.8em; /* 减小字体 */
}

/* 关卡选择区样式 */
.challenge-selection {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 10px; /* 减小内边距 */
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    flex: 1; /* 占用剩余空间 */
    overflow: hidden; /* 移除内置滚动条 */
    display: flex;
    flex-direction: column;
    justify-content: space-evenly; /* 均匀分布空间 */
}

.challenge-selection h2 {
    color: #e6c66c;
    font-size: 1.2em; /* 减小字体 */
    margin-bottom: 8px; /* 优化边距 */
    text-align: center;
    font-family: 'LiSu', 'STXingkai', serif;
    flex-shrink: 0;
}

.challenge-card {
    background: rgba(20, 15, 10, 0.9);
    border: 1px solid #b8942a;
    border-radius: 10px;
    padding: 8px 12px; /* 减小内边距 */
    margin-bottom: 0; /* 由flexbox控制间距 */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.challenge-card:hover::before {
    left: 100%;
}

.challenge-card:hover {
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px); /* 恢复效果 */
}

.challenge-card h3 {
    color: #f4e17a;
    font-size: 1.1em; /* 减小字体 */
    margin-bottom: 5px; /* 减小边距 */
    font-family: 'LiSu', 'STXingkai', serif;
}

.challenge-card p {
    color: #ccc;
    margin-bottom: 8px; /* 减小边距 */
    line-height: 1.3; /* 减小行高 */
    font-size: 0.8em; /* 减小字体 */
}

/* 难度控制样式 */
.difficulty-control {
    margin: 8px 0; /* 减小边距 */
}

.difficulty-control label {
    color: #f4e17a;
    font-size: 0.9em; /* 减小字体 */
    margin-bottom: 5px; /* 减小边距 */
    display: block;
}

.level-selector {
    margin-top: 6px; /* 恢复边距 */
}

.difficulty-slider {
    width: 100%;
    height: 6px; /* 恢复高度 */
    background: linear-gradient(to right, #4a4a4a, #888);
    border-radius: 3px;
    outline: none;
    appearance: none;
    margin: 8px 0; /* 恢复边距 */
}

.difficulty-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px; /* 恢复尺寸 */
    height: 16px;
    background: #f4e17a;
    border: 2px solid #d4af37;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.difficulty-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(244, 225, 122, 0.8);
}

.level-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    font-size: 0.9em; /* 恢复字体大小 */
    margin-top: 4px; /* 恢复边距 */
}

.current-level {
    color: #f4e17a;
    font-weight: bold;
    background: rgba(212, 175, 55, 0.2);
    padding: 2px 8px; /* 恢复内边距 */
    border-radius: 4px;
    font-size: 1em;
}

/* 星级选择器样式 */
.star-selector {
    margin-top: 6px; /* 恢复边距 */
}

.stars {
    display: flex;
    gap: 4px; /* 恢复间距 */
    margin-bottom: 6px; /* 恢复边距 */
}

.star {
    font-size: 1.5em; /* 恢复尺寸 */
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star.active {
    color: #f4e17a;
    text-shadow: 0 0 8px rgba(244, 225, 122, 0.6);
}

.star:hover {
    transform: scale(1.1);
}

.star-text {
    color: #f4e17a;
    font-size: 0.9em; /* 恢复字体大小 */
    font-weight: bold;
}

/* 开始挑战按钮 */
.start-challenge {
    width: 100%;
    background: linear-gradient(45deg, #d4af37, #f4e17a);
    border: 2px solid #b8942a;
    color: #2c1810;
    padding: 8px 16px; /* 减小内边距 */
    border-radius: 8px;
    font-size: 1em; /* 恢复字体大小 */
    font-family: 'KaiTi', 'STKaiti', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px; /* 减小边距 */
}

.start-challenge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}

.start-challenge:active {
    transform: translateY(0);
}

/* 角色展示区 */
.character-image {
    width: 100%;
    max-width: 250px; /* 增大角色尺寸 */
    height: auto;
    max-height: 50%; /* 限制最大高度为父容器的一半 */
    object-fit: contain; /* 保证图片完整显示 */
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    animation: float 3s ease-in-out infinite;
    margin-bottom: 20px; /* 增加边距 */
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.power-info {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px; /* 恢复内边距 */
    text-align: center;
    min-width: 220px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.power-info h3 {
    color: #e6c66c;
    font-size: 1.2em; /* 恢复字体 */
    margin-bottom: 10px; /* 恢复边距 */
    font-family: 'LiSu', 'STXingkai', serif;
}

.power-info p {
    color: #f4e17a;
    margin: 4px 0; /* 恢复边距 */
    line-height: 1.4; /* 恢复行高 */
    font-size: 1em; /* 恢复字体 */
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .challenge-wrapper {
        flex-direction: column;
        /* height: auto; 已移除，改为flex-grow控制 */
        gap: 20px; /* 优化间距 */
    }
    
    .control-panel,
    .character-display {
        width: 100%;
        min-width: unset;
        /* height: auto; 已移除，由flexbox控制 */
    }
    
    .character-display {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
        flex: 0.5; /* 减少在垂直布局中所占的比重 */
    }
    
    .character-image {
        max-width: 180px;
        max-height: 120px; /* 响应式调整 */
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .back-button {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .page-title {
        font-size: clamp(1.5em, 4vw, 2.2em);
        margin: 10px 0 15px 0;
    }
    
    .challenge-wrapper {
        /* height: auto; 已移除 */
    }
    
    .control-panel {
        min-width: unset;
    }
    
    .audio-controls,
    .challenge-selection {
        padding: 12px;
    }
    
    .challenge-card {
        padding: 10px;
    }
    
    .stars {
        gap: 3px;
    }
    
    .star {
        font-size: 1.2em;
    }
    
    .character-image {
        max-width: 150px;
        max-height: 100px; /* 响应式调整 */
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 5px;
    }
    
    .challenge-wrapper {
        gap: 10px;
        /* height: auto; 已移除 */
    }
    
    .audio-controls,
    .challenge-selection {
        padding: 10px;
    }
    
    .control-group label {
        font-size: 0.9em;
    }
    
    .challenge-card h3 {
        font-size: 1.1em;
    }
    
    .star {
        font-size: 1em;
    }
    
    .character-image {
        max-width: 120px;
        max-height: 80px; /* 响应式调整 */
    }
    
    .power-info {
        min-width: 140px;
        padding: 8px;
    }
} 