
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
font-family: 'Roboto', 'Noto Sans SC', sans-serif;
}

/* 容器布局 - 参考自由练习页面 */
.container {
position: relative;
width: 100vw;
height: 100vh;
overflow: hidden;
}

#div-main {
position: relative;
width: 100%;
height: 100%;
}

#loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}


#options {
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}

.btn-box {
width: 100%;
display: flex;
align-items: center;
position: relative;
}



/* 挑战信息头 */
.challenge-header {
position: absolute;
top: 20px;
left: 20px;
display: flex;
align-items: center;
gap: 15px;
z-index: 100;
}

.header-item {
background: rgba(255, 255, 255, 0.9);
padding: 6px 12px;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 500;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
display: flex;
align-items: center;
gap: 5px;
backdrop-filter: blur(10px);
}

.score-item {
color: #3f51b5;
}

.progress-item {
color: #4caf50;
}

.difficulty-item {
padding: 4px 12px;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 500;
}

.difficulty-1 { background-color: #4caf50; color: white; }
.difficulty-2 { background-color: #8bc34a; color: white; }
.difficulty-3 { background-color: #ffc107; color: black; }
.difficulty-4 { background-color: #ff9800; color: white; }
.difficulty-5 { background-color: #f44336; color: white; }

/* 开始挑战遮罩层 */
#daily-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.96);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.daily-box {
background-color: white;
border-radius: 12px;
padding: 30px;
max-width: 500px;
width: 90%;
text-align: center;
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.daily-box h2 {
margin-top: 0;
color: #333;
margin-bottom: 20px;
font-size: 1.8rem;
}

.daily-info {
margin-bottom: 25px;
text-align: left;
}

.daily-info p {
margin: 10px 0;
font-size: 1rem;
color: #555;
}


.daily-info b {
color: #333;
margin-right: 10px;
font-weight: 600;
}

/* 排行榜遮罩层 */
#leaderboard-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
backdrop-filter: blur(5px);
}

.leaderboard-box {
background-color: white;
border-radius: 12px;
padding: 30px;
max-width: 600px;
width: 90%;
max-height: 80vh;
overflow-y: auto;
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {

.challenge-header {
top: 10px;
left: 20px;
flex-wrap: wrap;
gap: 8px;
}

.header-item {
font-size: 0.8rem;
padding: 4px 8px;
}

.daily-box {
padding: 20px;
}

.daily-box h2 {
font-size: 1.5rem;
}

.daily-info p {
font-size: 0.9rem;
}
}

@media (max-width: 480px) {

#question {
margin-bottom: 12px;
}

.btn {
height: 44px;
}

.daily-box {
padding: 15px;
}

}

/* 初始页面加载动画 */
#initial-loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 2000;
transition: opacity 0.5s ease;
}

.loading-spinner {
width: 60px;
height: 60px;
border: 4px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: white;
animation: spin 1s ease-in-out infinite;
margin-bottom: 20px;
}

@keyframes spin {
to { transform: rotate(360deg); }
}

.loading-text {
color: white;
font-size: 1.2rem;
font-weight: 500;
}



/* 优化初始页面样式 */
.daily-box {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.challenge-stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 15px;
margin: 25px 0;
}

.stat-item {
background: rgba(255, 255, 255, 0.8);
border-radius: 12px;
padding: 15px;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-value {
font-size: 1.8rem;
font-weight: 700;
color: #3f51b5;
display: block;
margin-bottom: 5px;
}

.stat-label {
font-size: 0.9rem;
color: #666;
font-weight: 500;
}

/* 难度徽章优化 */
.difficulty-badge {
display: inline-block;
padding: 6px 15px;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.difficulty-badge.easy { background: linear-gradient(135deg, #4CAF50, #8BC34A); color: white; }
.difficulty-badge.medium { background: linear-gradient(135deg, #2196F3, #03A9F4); color: white; }
.difficulty-badge.hard { background: linear-gradient(135deg, #FF9800, #FFB74D); color: white; }
.difficulty-badge.expert { background: linear-gradient(135deg, #F44336, #FF5722); color: white; }
.difficulty-badge.hell { background: linear-gradient(135deg, #9C27B0, #673AB7); color: white; }

/* 优化排行榜样式 */
.leaderboard-box {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.leaderboard-title {
background: linear-gradient(135deg, #3f51b5, #2196F3);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 25px;
font-size: 2rem;
}

.leaderboard-table {
border-collapse: separate;
border-spacing: 0;
width: 100%;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.leaderboard-table thead {
background: linear-gradient(135deg, #3f51b5, #2196F3);
}

.leaderboard-table th {
padding: 18px 15px;
color: white;
font-weight: 600;
text-align: center;
border: none;
font-size: 1rem;
}

.leaderboard-table td {
padding: 16px 15px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
text-align: center;
font-size: 0.95rem;
}

.leaderboard-table tbody tr {
transition: all 0.3s ease;
background: white;
}

.leaderboard-table tbody tr:hover {
background: #f8f9ff;
transform: translateX(5px);
}

/* 特殊排名字体 */
.rank-medal {
font-size: 1.5rem;
}

.rank-1 .rank-cell {
background: linear-gradient(135deg, #FFD700, #FFC107);
color: white;
font-weight: bold;
}

.rank-2 .rank-cell {
background: linear-gradient(135deg, #C0C0C0, #BDBDBD);
color: white;
font-weight: bold;
}

.rank-3 .rank-cell {
background: linear-gradient(135deg, #CD7F32, #A1887F);
color: white;
font-weight: bold;
}

.rank-cell {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
margin: 0 auto;
}

/* 当前用户高亮 */
.current-user {
background: linear-gradient(135deg, #E3F2FD, #F3E5F5);
font-weight: 600;
border-left: 4px solid #3f51b5;
}

.current-user td:first-child {
border-left: none;
}

/* 分数颜色 */
.score-cell {
font-weight: 700;
font-size: 1.1rem;
}

.score-100 { color: #4CAF50; }
.score-90-99 { color: #8BC34A; }
.score-80-89 { color: #CDDC39; }
.score-70-79 { color: #FFC107; }
.score-60-69 { color: #FF9800; }
.score-50-59 { color: #FF5722; }
.score-below-50 { color: #F44336; }

/* 日期选择器样式 */
.date-picker-container {
margin: 20px 0;
padding: 15px;
background: rgba(255, 255, 255, 0.9);
border-radius: 12px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}


.date-input {
width: 94%;
padding: 12px 15px;
border: 2px solid #e0e0e0;
border-radius: 8px;
font-size: 1rem;
transition: all 0.3s ease;
background: white;
}

.date-input:focus {
outline: none;
border-color: #3f51b5;
box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
}

/* 按钮样式优化 */
.btn-action {
background: linear-gradient(135deg, #3f51b5, #2196F3);
color: white;
border: none;
border-radius: 10px;
padding: 15px 30px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
}

.btn-action:hover {
transform: translateY(-3px);
box-shadow: 0 10px 20px rgba(63, 81, 181, 0.3);
}

.btn-action:active {
transform: translateY(-1px);
}

.btn-action .material-icons {
font-size: 1.3rem;
}

.btn-secondary {
background: linear-gradient(135deg, #757575, #9E9E9E);
}

.btn-success {
background: linear-gradient(135deg, #4CAF50, #8BC34A);
}

/* 响应式设计优化 */
@media (max-width: 768px) {
.challenge-stats {
grid-template-columns: 1fr;
}

.stat-item {
padding: 12px;
}

.stat-value {
font-size: 1.5rem;
}

.leaderboard-table th,
.leaderboard-table td {
padding: 12px 10px;
font-size: 0.9rem;
}

.leaderboard-title {
font-size: 1.5rem;
}

.loading-spinner {
width: 50px;
height: 50px;
}

.loading-text {
font-size: 1rem;
}
}


/* 结果容器样式 */
#result-container {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-score {
    font-size: 2.6rem;
    font-weight: 800;
    color: #3f51b5;
    margin: 10px 0;
    text-shadow: 0 4px 10px rgba(63, 81, 181, 0.2);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 10px 0;
}

.result-stat-item {
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.result-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.result-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.result-stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.result-rank {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    border-left: 4px solid #3f51b5;
}

.rank-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #3f51b5;
    margin: 10px 0;
}

.rank-label {
    font-size: 1rem;
    color: #666;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.btn-result-action {
    min-width: 140px;
    border-radius: 10px;
    padding: 12px 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-result-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn-result-action {
        width: 100%;
    }
    
    .result-score {
        font-size: 2.8rem;
    }
}

/* 确保结果页面的按钮不冲突 */
#daily-start-overlay .btn-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 挑战状态指示器 */
.status-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-not-started {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
}

.status-in-progress {
    background: linear-gradient(135deg, #2196F3, #03A9F4);
    color: white;
}

.status-completed {
    background: linear-gradient(135deg, #9C27B0, #673AB7);
    color: white;
}

/* 隐藏原来的结果弹窗样式（如果有冲突） */
.mdui-dialog-actions {
    display: flex;
    justify-content: center;
}