/* 测试页面主要样式 */
.test-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Arial', sans-serif;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 测试简介部分 */
.test-intro {
    background-color: #f5f7fa;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.test-intro h2 {
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
}

.test-intro p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* 难度选择 */
.difficulty-selection {
    margin-bottom: 25px;
}

.difficulty-selection h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #444;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
}

.difficulty-btn {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.difficulty-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.difficulty-btn.active {
    background-color: #0066cc;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

/* 开始测试按钮 */
.start-test-container {
    text-align: center;
    margin-top: 20px;
}

#start-test-btn {
    background-color: #00acc1;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 172, 193, 0.3);
}

#start-test-btn:hover {
    background-color: #0097a7;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 151, 167, 0.4);
}

/* 测试区域 */
.test-area {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none; /* 默认隐藏 */
}

/* 测试头部 */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.test-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.question-counter {
    font-size: 16px;
    color: #555;
}

.difficulty-badge {
    background-color: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
}

.difficulty-badge.easy {
    background-color: #00897b;
    position: relative;
}

.difficulty-badge.easy::before {
    content: "•";
    margin-right: 3px;
}

.difficulty-badge.medium {
    background-color: #ff9800;
    position: relative;
}

.difficulty-badge.medium::before {
    content: "••";
    margin-right: 3px;
}

.difficulty-badge.hard {
    background-color: #5d4037;
    position: relative;
}

.difficulty-badge.hard::before {
    content: "•••";
    margin-right: 3px;
}

.test-timer {
    font-size: 16px;
    color: #555;
    font-weight: bold;
}

/* 测试内容 */
.test-content {
    margin-bottom: 30px;
}

.question-container {
    margin-bottom: 25px;
}

/* 题目样式 */
.question {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 20px;
}

.question-title {
    font-size: 18px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 选择题 */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.option:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.option input[type="radio"] {
    margin-right: 10px;
}

.option input[type="radio"]:checked + label {
    font-weight: bold;
    text-decoration: underline;
}

.option label {
    font-size: 16px;
    color: #444;
    cursor: pointer;
    flex: 1;
}

/* 填空题 */
.blank-inputs {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.blank-inputs input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    width: 100px;
}

/* 图像题 */
.question-image {
    margin: 15px 0;
    text-align: center;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.equation-input {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.equation-input input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

/* 测试导航 */
.test-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.test-navigation button {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#prev-question {
    background-color: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}

#prev-question:hover:not(:disabled) {
    background-color: #e8e8e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#prev-question:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

#next-question {
    background-color: #e0f7fa;
    color: #00838f;
}

#next-question:hover {
    background-color: #b2ebf2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#submit-test {
    background-color: #00acc1;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 172, 193, 0.3);
}

#submit-test:hover {
    background-color: #0097a7;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 151, 167, 0.4);
}

#restart-test {
    background-color: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}

#restart-test:hover {
    background-color: #e8e8e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 重新开始按钮样式 */
.restart-btn {
  background-color: #ff5722;
  color: white;
  margin-left: auto;
}

.restart-btn:hover {
  background-color: #e64a19;
}

/* 确认对话框样式 */
.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.dark-mode .confirm-dialog {
  background-color: #263238;
  color: #e0e0e0;
}

.confirm-dialog h3 {
  margin-top: 0;
  color: #f44336;
}

.dark-mode .confirm-dialog h3 {
  color: #ff7043;
}

.confirm-dialog p {
  margin-bottom: 20px;
}

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

.confirm-buttons button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.confirm-yes {
  background-color: #f44336;
  color: white;
}

.confirm-yes:hover {
  background-color: #d32f2f;
}

.confirm-no {
  background-color: #9e9e9e;
  color: white;
}

.confirm-no:hover {
  background-color: #757575;
}

.dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* 问题导航点 */
.question-navigation {
    margin-top: 30px;
}

.question-navigation h3 {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
}

.question-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.question-dot {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ddd;
    font-size: 14px;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-dot:hover {
    background-color: #d0d0d0;
}

.question-dot.active {
    background-color: #00acc1;
    color: #fff;
    border-color: #00acc1;
}

.question-dot.answered {
    border: 1px solid #00acc1;
    background-color: #e0f7fa;
    position: relative;
}

.question-dot.answered::before {
    content: "✓";
    font-size: 12px;
    color: #00acc1;
}

/* 测试结果 */
.test-results {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none; /* 默认隐藏 */
}

.test-results h2 {
    color: #333;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
}

/* 结果摘要 */
.results-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 280px;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00acc1 0%, #00897b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.score-circle::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255, 255, 255, 0.1) 8px,
        rgba(255, 255, 255, 0.1) 16px
    );
}

.score-details {
    font-size: 16px;
    color: #555;
}

.score-details p {
    margin: 5px 0;
}

.performance-summary {
    flex: 2;
    min-width: 300px;
}

.performance-summary h3 {
    font-size: 18px;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
}

.performance-summary p {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}

/* 详细结果 */
.results-details {
    margin-bottom: 40px;
}

.results-details h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

/* 结果表格 */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.results-table th, .results-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}

.results-table th {
    background-color: #f5f7fa;
    color: #333;
    font-weight: bold;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.result-status {
    font-weight: bold;
}

.result-status.correct {
    background-color: #00897b;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    position: relative;
}

.result-status.correct::before {
    content: "✓";
}

.result-status.incorrect {
    background-color: #5d4037;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    position: relative;
}

.result-status.incorrect::before {
    content: "✗";
}

/* 知识点掌握情况 */
.topic-breakdown {
    margin-top: 30px;
}

.topic-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topic-bar {
    display: flex;
    align-items: center;
}

.topic-name {
    width: 180px;
    font-size: 16px;
    color: #555;
}

.progress-container {
    flex: 1;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00897b 0%, #00acc1 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 14px;
    color: white;
    position: relative;
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    border-radius: 10px;
}

/* 建议 */
.recommendations {
    margin-bottom: 30px;
}

.recommendations h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.recommendations ul {
    list-style-type: none;
    padding: 0;
}

.recommendations li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #555;
    font-size: 16px;
    line-height: 1.5;
}

.recommendations li:last-child {
    border-bottom: none;
}

/* 结果页面的操作按钮 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.action-buttons button {
    padding: 10px 25px;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#review-test {
    background-color: #e0f7fa;
    color: #00838f;
}

#review-test:hover {
    background-color: #b2ebf2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#retry-test {
    background-color: #e8f5e9;
    color: #2e7d32;
}

#retry-test:hover {
    background-color: #c8e6c9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#share-results {
    background-color: #e3f2fd;
    color: #0277bd;
}

#share-results:hover {
    background-color: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 暗黑模式适配 */
.dark-mode .test-intro {
    background-color: #2c3e50;
    color: #e0e0e0;
}

.dark-mode .test-intro h2,
.dark-mode .test-intro p,
.dark-mode .difficulty-selection h3 {
    color: #e0e0e0;
}

.dark-mode .difficulty-btn {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

.dark-mode .difficulty-btn:hover {
    background-color: #4a4a4a;
}

.dark-mode .difficulty-btn.active {
    background-color: #0077cc;
    color: white;
}

.dark-mode .test-area,
.dark-mode .test-results {
    background-color: #263238;
    color: #e0e0e0;
}

.dark-mode .question {
    background-color: #1e272e;
}

.dark-mode .question-title {
    color: #e0e0e0;
}

.dark-mode .option {
    background-color: #2c3e50;
    border-color: #546e7a;
}

.dark-mode .option:hover {
    background-color: #34495e;
}

.dark-mode .option label {
    color: #e0e0e0;
}

.dark-mode .question-counter,
.dark-mode .test-timer {
    color: #b0bec5;
}

.dark-mode .results-table th {
    background-color: #2c3e50;
    color: #e0e0e0;
}

.dark-mode .results-table td {
    border-bottom-color: #546e7a;
}

.dark-mode .topic-name {
    color: #b0bec5;
}

.dark-mode .progress-container {
    background-color: #37474f;
}

.dark-mode .recommendations li {
    color: #b0bec5;
    border-bottom-color: #546e7a;
}

.dark-mode #prev-question {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

.dark-mode #prev-question:hover:not(:disabled) {
    background-color: #4a4a4a;
}

.dark-mode #prev-question:disabled {
    opacity: 0.5;
    background-color: #3a3a3a;
}

.dark-mode #next-question {
    background-color: #006064;
    color: #e0e0e0;
}

.dark-mode #next-question:hover {
    background-color: #00838f;
}

.dark-mode #submit-test {
    background-color: #00838f;
}

.dark-mode #submit-test:hover {
    background-color: #00acc1;
}

.dark-mode #review-test,
.dark-mode #retry-test,
.dark-mode #share-results {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

.dark-mode #review-test:hover,
.dark-mode #retry-test:hover,
.dark-mode #share-results:hover {
    background-color: #4a4a4a;
}

/* 答案解释样式 */
.explanation-container {
    margin-top: 15px;
    padding: 15px;
    background-color: #f5f7fa;
    border-left: 4px solid #0066cc;
    border-radius: 3px;
    display: none; /* 默认隐藏 */
}

.dark-mode .explanation-container {
    background-color: #2c3e50;
    border-left-color: #1976d2;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .test-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .results-summary {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .question-options {
        padding-left: 0;
    }
    
    .blank-inputs {
        flex-direction: column;
    }
    
    .equation-input {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 移动设备响应式样式 */
@media screen and (max-width: 768px) {
  /* 测试容器样式优化 */
  .test-container {
    width: 100%;
    padding: 10px;
  }
  
  /* 难度选择按钮 */
  .difficulty-selector {
    flex-direction: column;
    align-items: stretch;
  }
  
  .difficulty-btn {
    margin: 5px 0;
    width: 100%;
  }
  
  /* 测试区域 */
  .test-area-header {
    flex-direction: column;
  }
  
  .test-progress {
    width: 100%;
    margin-top: 10px;
  }
  
  .timer-container {
    margin-top: 10px;
    width: 100%;
    text-align: center;
  }
  
  /* 问题导航点 */
  .question-dots {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .question-dot {
    margin: 5px;
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  
  /* 问题选项 */
  .question-options {
    flex-direction: column;
  }
  
  .option {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* 填空题输入框 */
  .blank-inputs {
    flex-direction: column;
  }
  
  .blank-inputs input {
    width: 100%;
    margin: 5px 0;
  }
  
  /* 方程输入 */
  .equation-input {
    flex-wrap: wrap;
  }
  
  .equation-input input {
    width: 60px;
    margin: 5px 2px;
  }
  
  /* 导航按钮 */
  .navigation-buttons {
    flex-direction: column;
  }
  
  .navigation-buttons button {
    width: 100%;
    margin: 5px 0;
  }
  
  /* 结果页面 */
  .results-summary {
    flex-direction: column;
  }
  
  .score-circle {
    margin-bottom: 20px;
  }
  
  .results-details {
    padding: 10px;
  }
  
  /* 结果表格 */
  .results-table {
    display: block;
    overflow-x: auto;
  }
  
  .results-table th, 
  .results-table td {
    font-size: 12px;
    padding: 5px;
  }
  
  /* 通知样式 */
  .notification {
    width: 90%;
    left: 5%;
    padding: 10px;
    font-size: 14px;
  }
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  z-index: 1000;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: opacity 0.5s;
}

.notification.fade-out {
  opacity: 0;
}

@media (max-width: 576px) {
    .test-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .test-navigation button {
        width: 100%;
    }
    
    .topic-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .topic-name {
        margin-bottom: 5px;
    }
    
    .results-table {
        font-size: 14px;
    }
    
    .results-table th, .results-table td {
        padding: 8px;
    }
}

/* 计时器样式 */
#timer {
    padding: 2px 5px;
    background-color: #fff;
    color: #000;
}

#timer.warning {
    font-weight: bold;
    background-color: #fff3e0;
    color: #ff6f00;
    position: relative;
}

#timer.warning::before {
    content: "⏱ ";
    animation: blink 1s infinite;
}

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

.dark-mode .difficulty-badge.easy {
    background-color: #26a69a;
}

.dark-mode .difficulty-badge.hard {
    background-color: #6d4c41;
}

.dark-mode .result-status.correct {
    background-color: #26a69a;
}

.dark-mode .result-status.incorrect {
    background-color: #6d4c41;
}

.dark-mode .progress-bar {
    background: linear-gradient(90deg, #26a69a 0%, #00acc1 100%);
}

.dark-mode .question-dot.answered {
    border: 1px solid #26a69a;
    background-color: rgba(38, 166, 154, 0.2);
}

.dark-mode .question-dot.answered::before {
    color: #26a69a;
}

.dark-mode #timer.warning {
    background-color: #3e2723;
    color: #ffab40;
}

.dark-mode .score-circle {
    background: linear-gradient(135deg, #00acc1 0%, #26a69a 100%);
    box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Apply min-width to specific columns to prevent excessive wrapping */
.results-table td:nth-child(2)  /* Type column */
{
    min-width: 100px; /* For terms like '选择题' */
}
.results-table td:nth-child(3)  /* Difficulty column */
{
    min-width: 80px;
}
.results-table td:nth-child(4)  /* Result column */
{
    min-width: 100px; /* For 'X错误' or '✓正确' */
}

.results-table th {
    background-color: #f5f7fa;
    color: #333;
    font-weight: bold;
}