/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

main {
    flex: 1;
}

footer {
    text-align: center;
    padding: 20px 0;
    border-top: 2px solid #f0f0f0;
    margin-top: 30px;
    font-size: 0.9rem;
    color: #777;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.primary-btn {
    background-color: #3498db;
    color: white;
}

.primary-btn:hover {
    background-color: #2980b9;
}

.nav-btn {
    background-color: #ecf0f1;
    color: #333;
}

.nav-btn:hover {
    background-color: #bdc3c7;
}

.nav-btn:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

/* 欢迎页面 */
.welcome {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.welcome h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.welcome p {
    margin-bottom: 15px;
}

.welcome button {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* 测试区域 */
.test-area {
    padding: 1rem;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.test-title {
    margin: 0.5rem 0 1rem 0;
    font-size: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.progress {
    height: 100%;
    background-color: #2ecc71;
    width: 0%;
    transition: width 0.3s;
}

.test-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.test-navigation {
    display: flex;
    justify-content: space-between;
}

/* 结果区域 */
.results {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.results h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

#score-display {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 20px 0;
    color: #2c3e50;
}

#result-details {
    margin: 20px 0;
    text-align: left;
}

/* 测试题目样式 */
.question {
    margin-bottom: 30px;
}

.question-title {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.question-description {
    margin-bottom: 20px;
}

.options-container {
    margin-top: 15px;
}

.option {
    display: block;
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.option:hover {
    background-color: #e9ecef;
}

.option.selected {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.visual-test {
    text-align: center;
    margin: 20px 0;
}

.visual-test img {
    max-width: 100%;
    border: 1px solid #ddd;
}

.canvas-container {
    border: 1px solid #ddd;
    margin: 20px auto;
    background-color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .test-container {
        padding: 20px;
    }
    
    .btn {
        padding: 8px 16px;
    }
    
    .trail-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .trail-container {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .trail-button {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .trail-container {
        height: 300px;
    }
}

/* 绘图测试区域 */
#drawing-canvas {
    border: 1px solid #ccc;
    display: block;
    margin: 20px auto;
    background-color: white;
}

/* 结果表格样式 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-table th, 
.result-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.result-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.result-table tbody tr:hover:not(.question-detail) {
    background-color: rgba(0,0,0,0.03);
    cursor: pointer;
}

/* 结果部分中表格行的激活状态 */
.result-table tbody tr.active {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2196f3;
}

/* 确保问题详情行的样式正确 */
.question-detail {
    display: none;
    background-color: #f8f8f8;
}

.question-detail td {
    padding: 0 !important;
}

.question-info {
    padding: 1rem;
    font-size: 0.9rem;
    border-left: 3px solid #ccc;
    margin: 0.5rem 0;
}

.question-info p {
    margin: 0.5rem 0;
}

/* 分析和建议部分样式 */
.interpretation {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.interpretation h3 {
    color: #2c3e50;
    margin: 15px 0 10px;
}

.analysis, .recommendation {
    margin: 15px 0;
}

.analysis p, .recommendation p {
    margin-bottom: 10px;
}

.analysis strong, .recommendation strong {
    color: #2c3e50;
}

.interpretation ul {
    margin-left: 20px;
    padding-left: 0;
}

.interpretation li {
    margin-bottom: 5px;
}

.disclaimer {
    margin-top: 20px;
    padding: 10px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* 结果部分样式优化 */
.result-section {
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.result-section h3 {
    margin: 0;
    padding: 1rem;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

/* 添加JS代码来处理点击事件 */
/* 这将在页面加载完成后添加到脚本.js文件中 */

.user-drawing {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
    margin-top: 0.5rem;
}

/* 字母识别测试样式 */
.letters-display {
    margin: 20px 0;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    position: relative;
}

.letter {
    display: inline-block;
    opacity: 1;
    transition: opacity 0.2s;
    margin: 0 10px;
    font-weight: bold;
}

.letter.faded {
    opacity: 0.3;
}

.letter.correct-tap {
    color: #28a745;
}

.letter.false-tap {
    color: #dc3545;
}

.test-result {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #6c757d;
}

.test-result ul {
    margin-top: 10px;
    padding-left: 20px;
}

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

/* 计时器样式 */
.memory-timer, .delay-timer {
    margin: 15px auto;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.memory-timer {
    color: #0275d8;
    border-left: 4px solid #0275d8;
}

.delay-timer {
    color: #6c757d;
    border-left: 4px solid #6c757d;
}

.recall-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.recall-word {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* 交互式连线测试样式 */
.interactive-trail-question {
    margin: 20px 0;
}

.trail-instruction {
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

.trail-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.trail-connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.trail-button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.trail-button:hover {
    transform: scale(1.1);
    background-color: #2980b9;
}

.trail-button.selected {
    background-color: #27ae60;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.7);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

.trail-instruction {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
}

.trail-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.trail-sequence {
    font-size: 16px;
    color: #2c3e50;
}

.trail-result {
    margin-top: 15px;
    font-weight: bold;
    font-size: 18px;
}

.trail-result.correct {
    color: #27ae60;
}

.trail-result.incorrect {
    color: #e74c3c;
}

.template-image {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.template-image img {
    max-width: 100%;
    border: 1px solid #ddd;
    max-height: 300px;
    object-fit: contain;
}

.template-load-status {
    font-size: 0.8rem;
    margin-top: 5px;
    height: 20px;
}

/* 动物命名题目样式 */
.image-naming-question {
    margin: 20px 0;
}

.images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.naming-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

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

.image-container {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
}

.animal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.animal-image:hover {
    transform: scale(1.05);
}

.naming-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.naming-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.naming-input.correct {
    border-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
}

.naming-input.incorrect {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

/* 评分小贴士 */
.scoring-tips {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.scoring-tips h3 {
    margin-top: 0;
    color: #2e7d32;
}

.scoring-tips ul {
    padding-left: 1.5rem;
}

.scoring-tips li {
    margin-bottom: 0.5rem;
}

/* 音频测试样式 */
.audio-response-question {
    text-align: center;
    margin: 20px 0;
}

.audio-controls {
    margin: 15px 0;
}

.letters-display {
    font-size: 3rem;
    font-weight: bold;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.audio-test-result {
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 句子重复测试样式 */
.audio-replay-question {
    margin: 20px 0;
}

.sentence-item {
    background-color: #f8f9fa;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.sentence-text {
    font-style: italic;
    margin: 10px 0;
    font-size: 1.1rem;
}

.sentence-repeat {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.play-sentence {
    margin: 10px 0;
}

/* 延迟回忆样式 */
.memory-recall-question {
    margin: 20px 0;
}

.recall-instructions {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 10px 15px;
    margin: 15px 0;
    font-size: 14px;
}

.recall-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.recall-word {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.recall-word:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    outline: none;
}

.recall-word.correct-word {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.word-recall-feedback {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
    background-color: #f8f9fa;
    min-height: 50px;
}

.perfect-recall {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

.hint {
    color: #f57c00;
    font-style: italic;
}

.delay-timer {
    background-color: #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 10px 0;
    font-size: 14px;
    color: #495057;
}

/* 记忆单词样式优化 */
.memory-words {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.memory-words-instruction {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    font-weight: bold;
    text-align: center;
}

.memory-words-display {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    transition: opacity 0.5s ease;
}

.memory-word {
    padding: 15px 25px;
    background-color: #4a90e2;
    color: white;
    font-size: 24px;
    font-weight: bold;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.memory-word:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    background-color: #357ad6;
}

.instruction {
    text-align: center;
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 20px 0;
    padding: 10px;
    background-color: #fffde7;
    border-radius: 6px;
    border-left: 4px solid #ffd600;
}

.memory-timer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.timer-label {
    font-size: 14px;
    color: #6c757d;
}

.timer-value {
    font-size: 28px;
    font-weight: bold;
    color: #495057;
    width: 40px;
    text-align: center;
}

.timer-unit {
    font-size: 14px;
    color: #6c757d;
}

.progress-container {
    flex: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-left: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #4a90e2;
    transition: width 1s linear, background-color 0.5s ease;
}

.timer-ending {
    animation: blink 1s infinite;
    color: #dc3545;
}

.time-up-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
    animation: fade-in 0.5s ease;
    font-size: 18px;
    font-weight: bold;
    border-left: 5px solid #dc3545;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 5px solid #dc3545;
}

.error-message h3 {
    margin-top: 0;
    color: #dc3545;
}

.error-message button {
    margin-top: 15px;
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.error-message button:hover {
    background-color: #0a58ca;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
} 