/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Rounded MT Bold', 'Arial', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 3px solid #6c5ce7;
}

header h1 {
    color: #6c5ce7;
    font-size: 2.2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#student-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6c5ce7;
}

/* 仪表盘样式 */
.dashboard {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(108, 92, 231, 0.2);
}

.stat-item h3 {
    color: #6c5ce7;
    font-size: 1rem;
    margin-bottom: 8px;
}

.stat-item p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3436;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.question-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: relative;
}

.level-indicator {
    position: absolute;
    top: -15px;
    right: 20px;
}

#level-badge {
    background-color: #6c5ce7;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(108, 92, 231, 0.3);
}

.question h2 {
    font-size: 2rem;
    text-align: center;
    margin: 20px 0;
    color: #2d3436;
    transition: transform 0.3s;
}

.question h2:hover {
    transform: scale(1.05);
}

.answer-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

#answer-input {
    width: 150px;
    padding: 12px 15px;
    font-size: 1.2rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#answer-input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.feedback {
    text-align: center;
    min-height: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    transition: all 0.3s;
}

.feedback.correct {
    background-color: #55efc4;
    color: #00b894;
}

.feedback.incorrect {
    background-color: #ff7675;
    color: #d63031;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#start-btn, #next-btn {
    background-color: #6c5ce7;
    color: white;
}

#start-btn:hover, #next-btn:hover {
    background-color: #5649c0;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(108, 92, 231, 0.3);
}

#hint-btn {
    background-color: #fdcb6e;
    color: #2d3436;
}

#hint-btn:hover {
    background-color: #f7b731;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(253, 203, 110, 0.3);
}

#change-name-btn, #show-level-info {
    background-color: #74b9ff;
    color: white;
}

#change-name-btn:hover, #show-level-info:hover {
    background-color: #0984e3;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(116, 185, 255, 0.3);
}

#submit-btn {
    background-color: #00b894;
    color: white;
}

#submit-btn:hover {
    background-color: #00a884;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 184, 148, 0.3);
}

/* 进度部分 */
.progress-section {
    margin-bottom: 30px;
}

.progress-section h2 {
    color: #2d3436;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.progress-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.progress-bar {
    height: 20px;
    background-color: #dfe6e9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.level-markers {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.level-marker {
    font-size: 0.9rem;
    color: #b2bec3;
    position: relative;
    transition: all 0.3s;
}

.level-marker.active {
    color: #6c5ce7;
    font-weight: bold;
}

.level-marker.active::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: #6c5ce7;
    border-radius: 50%;
}

/* 历史记录部分 */
.history-section {
    margin-bottom: 30px;
}

.history-section h2 {
    color: #2d3436;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* 学习分析报告部分 */
.report-section {
    margin-bottom: 30px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.report-title {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-cards {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.time-card {
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
}

.correct-card {
    background: linear-gradient(135deg, #00b894, #55efc4);
}

.wrong-card {
    background: linear-gradient(135deg, #d63031, #ff7675);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.card-label {
    font-size: 1rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.card-value {
    font-size: 2rem;
    font-weight: bold;
}

.report-charts {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-container h3 {
    color: #2d3436;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-wrapper {
    height: 250px;
    position: relative;
}

.knowledge-section {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.knowledge-section h3 {
    color: #2d3436;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.knowledge-item {
    padding: 15px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.knowledge-question {
    font-weight: bold;
    color: #2d3436;
}

.knowledge-description {
    color: #636e72;
    font-size: 0.9rem;
    margin-top: 5px;
}

.knowledge-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-mastered {
    color: #00b894;
}

.status-weak {
    color: #d63031;
}

/* 图标样式 */
.icon-chart::before {
    content: '📊';
}

.icon-time::before {
    content: '⏱️';
}

.icon-check::before {
    content: '✅';
}

.icon-close::before {
    content: '❌';
}

.icon-pie::before {
    content: '🍩';
}

.icon-bar::before {
    content: '📊';
}

.icon-book::before {
    content: '📚';
}

.icon-mastered::before {
    content: '✓';
}

.icon-weak::before {
    content: '✗';
}

.history-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #dfe6e9;
    transition: background-color 0.3s;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background-color: #f8f9fa;
}

.history-question {
    font-weight: bold;
    color: #2d3436;
}

.history-answer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-answer span {
    font-weight: bold;
}

.history-answer.correct span {
    color: #00b894;
}

.history-answer.incorrect span {
    color: #d63031;
}

.history-time {
    color: #636e72;
    font-size: 0.9rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #b2bec3;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #2d3436;
}

#modal-title {
    color: #6c5ce7;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#name-input {
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#name-input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

#save-name-btn {
    align-self: flex-end;
}

/* 难度等级说明模态框 */
.level-info {
    max-width: 700px;
}

.level-descriptions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.level-desc {
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border-left: 4px solid #6c5ce7;
}

.level-desc h3 {
    color: #6c5ce7;
    margin-bottom: 10px;
}

.level-desc p {
    margin-bottom: 10px;
    color: #636e72;
}

.example {
    font-family: 'Courier New', monospace;
    background-color: #dfe6e9;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    color: #2d3436;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #636e72;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats {
        flex-direction: column;
    }
    
    .answer-container {
        flex-direction: column;
        align-items: center;
    }
    
    #answer-input {
        width: 100%;
        max-width: 300px;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
    
    .report-cards {
        flex-direction: column;
    }
    
    .report-charts {
        flex-direction: column;
    }
    
    .chart-wrapper {
        height: 200px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s;
}

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

.fade-in {
    animation: fadeIn 0.5s;
}
