* {
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft JhengHei', Arial, sans-serif;
  /* font-family: 'Noto Sans TC', sans-serif; */
  background-color: #f4f4f9;
  margin: 0;
  padding: 20px;
  color: #333;
  line-height: 1.6;
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.home_button {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  text-decoration: none;
  width: 35px;
  height: 35px;
  font-size: 16px;
  cursor: pointer;
  background-color: #425baf;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  animation: slideInFromTop 0.6s ease-out;
}

.home_button:hover {
  background-color: #143191;
}

.home_button i {
  color: #ffffff;
  font-size: 24px;
  text-align: center;
}

.edu-title {
  text-align: center;
  color: #2c3e50;
  font-size: 28px;
  margin: 25px 0;
  font-weight: 700;
  animation: slideInFromTop 1s ease-out;
}

.edu-text {
  margin: 12px 0;
  font-size: 16px;
  color: #34495e;
  opacity: 0;
  animation: slideInFromTop 1.2s ease-out forwards;
}

.edu-text:nth-child(2) {
  animation-delay: 0.2s;
}

.edu-text:nth-child(3) {
  animation-delay: 0.4s;
}

.edu-text i {
  color: #425baf;
  margin-right: 8px;
}

.container {
  box-sizing: border-box;
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-top: 4px solid #425baf;
  animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.edu-img-box {
  width: 100%;
  margin-bottom: 20px;
  animation: slideInFromTop 0.8s ease-out;
}

.edu-img {
  display: block;
  width: 20%;
  margin: auto;
}

button {
  display: block;
  margin: 20px auto;
  padding: 12px 25px;
  font-size: 16px;
  cursor: pointer;
  background-color: #425baf;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover:not(:disabled):not(.report-error-btn):not(.cancel-btn) {
  background-color: #143191;
}

button:disabled {
  background-color: #e0e0e0 !important;
  cursor: not-allowed !important;
  color: #999 !important;
  box-shadow: none !important;
}

button:disabled.generateBtnTimeColor,
.generateBtnTimeColor[disabled] {
  background-color: #ff6b6b !important;
  color: #fff !important;
  cursor: no-drop !important;
}

.questions {
  margin-top: 25px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  max-height: 700px;
  overflow-y: scroll;
  overflow-x: hidden;
}

.question {
  background-color: #ffffff;
  margin: 15px 0;
  padding: 20px;
  border-radius: 8px;
  position: relative;
  border: 1px solid #ff6b6b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  padding-top: 50px;
  transition: all 0.3s ease;
}

.question:has(.option.selected) {
  border-color: #e0e0e0;
}

.question.unanswered {
  border-color: #ff6b6b;
}

.options {
  margin-top: 15px;
}

.option {
  margin-bottom: 8px;
  cursor: pointer;
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.option:hover:not(.selected):not(.correct):not(.incorrect) {
  background-color: #f8f9fa;
  border-color: #425baf;
}

.selected {
  background-color: #4caf50;
  color: white;
  border-color: #4caf50;
}

.deselected {
  background-color: #f8f9fa;
}

.incorrect {
  background-color: #ff6b6b;
  color: white;
  font-weight: bold;
  border-color: #ff6b6b;
}

.selected.correct {
  background-color: #4caf50;
  color: white;
  border-color: #4caf50;
}

.selected.incorrect {
  background-color: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
}

.correct-answer-text {
  color: #4caf50;
  font-weight: bold;
  margin-left: 10px;
  font-style: italic;
}

.input-group {
  margin-bottom: 20px;
  opacity: 0;
  animation: slideInFromTop 1.4s ease-out forwards;
}

.input-group:nth-child(2) {
  animation-delay: 0.2s;
}

.input-group label {
  font-weight: 600;
  color: #2c3e50;
  display: block;
  margin-bottom: 8px;
}

.input-group input,
.input-group select {
  width: 100%;
  height: 50px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background-color: #fff;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #425baf;
  box-shadow: 0 0 0 3px rgba(66, 91, 175, 0.1);
}

.results {
  text-align: left;
  margin-top: 30px;
  padding: 25px;
  background-color: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.results h2 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 24px;
  font-weight: 700;
}

.results p {
  margin: 12px 0;
  padding: 12px 20px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #425baf;
  font-size: 18px;
}

.results p.red-bold {
  color: #2c3e50;
  font-weight: 600;
  font-size: 18px;
}

.results p.red-bold span {
  color: #ff6b6b;
  font-weight: 700;
}

#incorrectQuestions,
#incorrectQuestionsB {
  margin-top: 20px;
  padding: 15px 20px;
  background: #fff3f3;
  border-radius: 8px;
  border-left: 4px solid #ff6b6b;
  color: #ff6b6b;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.6;
}

.warning {
  color: #ff6b6b;
  font-weight: bold;
  text-align: center;
  padding: 10px;
  margin: 15px 0;
  background-color: #fff3f3;
  border-radius: 8px;
}

.disabled {
  background-color: #e0e0e0;
  cursor: not-allowed;
}

.copyright p {
  font-size: 13px;
  text-align: center;
  color: #666;
  margin-top: 20px;
  padding-bottom: 10px;
}

.red-bold {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 24px;
}

.button-grey {
  display: none;
}

.generateBtnAll,
.paperButtonAll {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.generateBtnAll {
  opacity: 0;
  animation: slideInFromTop 1.6s ease-out forwards;
  animation-delay: 0.4s;
}

.paperButtonAll {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
}

.paperButtonAll button {
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 200px;
  background-color: #e0e0e0;
  color: #999;
  box-shadow: none;
}

.paperButtonAll button.active {
  background-color: #425baf;
  color: white;
  transform: translateY(-2px);
}

.paperButtonAll button:not(.active):hover {
  background-color: #d0d0d0;
}

.paperButtonAll button::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: #425baf;
  transition: width 0.3s ease;
}

.paperButtonAll button.active::after {
  width: 80%;
}

.paperButtonAll button i {
  margin-right: 8px;
  font-size: 18px;
}

.question-nav-buttons {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

.nav-button {
  padding: 10px 20px;
  background-color: #425baf;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.nav-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.nav-button:hover:not(:disabled) {
  background-color: #143191;
}

.question-counter {
  text-align: center;
  margin: 10px 0;
  font-size: 16px;
  color: #425baf;
  font-weight: bold;
}

.input-group-span {
  color: #e01a1a;
  font-size: 14px;
}

.report-error-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 12px;
  font-size: 14px;
  background-color: #ff6b6b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  transition: all 0.2s ease;
}

.report-error-btn:hover {
  background-color: #ff5252;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-question-details {
  text-align: left;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-size: 14px;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.report-question-details strong {
  color: #425baf;
  display: inline-block;
  margin-bottom: 5px;
}

.report-question-details::-webkit-scrollbar {
  width: 6px;
}

.report-question-details::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.report-question-details::-webkit-scrollbar-thumb {
  background: #425baf;
  border-radius: 3px;
}

.questions::-webkit-scrollbar {
  width: 8px;
}

.questions::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.questions::-webkit-scrollbar-thumb {
  background: #425baf;
  border-radius: 4px;
}

.questions::-webkit-scrollbar-thumb:hover {
  background: #143191;
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-transition-out {
  animation: slideOutLeft 0.3s ease-out forwards;
}

.question-transition-in {
  animation: slideInRight 0.3s ease-out forwards;
}

.reminder-message {
  background-color: #f0f7ff;
  border-left: 4px solid #425baf;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 8px;
  font-size: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  animation: slideInFromTop 1.8s ease-out forwards;
  opacity: 0;
  animation-delay: 0.6s;
}

.reminder-message i {
  font-size: 20px;
  color: #425baf;
}

.reminder-message-red {
  color: #ec1e1e;
}

.input-group-required {
  color: #ec1e1e;
  font-weight: 700;
  font-size: 20px;
}

video {
  width: 100%; /* 视频宽度自适应 */
  max-width: 800px; /* 最大宽度 */
  display: block; /* 去掉视频下方的空隙 */
  margin: 0 auto; /* 居中 */
  background-color: #333;
  border-radius: 10px;
}

.custom-alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.custom-alert-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  max-width: 600px;
  width: 90%;
  margin: 0 20px;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#alertMessage {
  display: block;
  font-size: 18px;
  color: #2c3e50;
  margin: 15px 0;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #425baf;
  font-weight: 600;
}

#confirmReportMessage {
  display: block;
  font-size: 18px;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 600;
}

.confirm-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 25px;
}

.confirm-btn,
.cancel-btn {
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  border: none;
  font-size: 16px;
  margin: 0;
}

.confirm-btn {
  background-color: #425baf;
  color: white;
}

.cancel-btn {
  background-color: #ff6b6b;
  color: white;
}

.confirm-btn:hover {
  background-color: #324893;
  transform: translateY(-2px);
}

.cancel-btn:hover {
  background-color: #ff5252;
  transform: translateY(-2px);
}

.Q-color {
  color: #425baf;
  font-weight: 600;
}

.alert-message-error {
  color: #ff6b6b !important;
  font-weight: 600;
  border-left: 4px solid #ff6b6b !important;
}

.alert-message-warning {
  color: #ff9800 !important;
  font-weight: 600;
  border-left: 4px solid #ff9800 !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.alert-message-warning i {
  font-size: 24px;
}

.close-alert-btn {
  background-color: #425baf;
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s ease;
}

.close-alert-btn:hover {
  background-color: #324893;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  body {
    padding: 5px;
  }

  .container {
    padding: 20px;
    /* border-radius: 5px; */
  }

  .edu-img {
    width: 60%;
  }

  .generateBtnAll,
  .paperButtonAll {
    flex-direction: column;
    gap: 10px;
  }

  .edu-title {
    font-size: 24px;
  }

  .question {
    padding: 15px;
  }

  .questions {
    padding: 10px;
  }

  .report-error-btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  .question {
    padding-top: 40px;
  }

  .option:hover:not(.selected):not(.correct):not(.incorrect) {
    border-color: #f8f9fa;
    border: 1px solid #e0e0e0;
  }

  .reminder-message {
    font-size: 14px;
    padding: 12px 15px;
  }
}

#errorQA {
  width: 100%;
  height: 100px;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  margin-right: 6px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.welcome-alert {
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border-top: 4px solid #425baf;
  max-width: 500px;
  padding: 30px;
  text-align: center;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.welcome-icon {
  font-size: 48px;
  color: #425baf;
  margin-bottom: 20px;
}

.welcome-icon i {
  animation: pulse 2s infinite;
}

.welcome-title {
  color: #2c3e50;
  font-size: 24px;
  margin: 0 0 20px 0;
  font-weight: 600;
}

#welcomeMessage {
  display: block;
  font-size: 16px;
  line-height: 1.6;
  color: #34495e;
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(66, 91, 175, 0.1);
  border-radius: 8px;
  border-left: 4px solid #425baf;
  font-weight: 600;
}

#welcomeMessage span {
  color: red;
}

#closeWelcomeAlert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  font-size: 16px;
  background-color: #425baf;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#closeWelcomeAlert:hover {
  background-color: #324893;
  transform: translateY(-2px);
}

#closeWelcomeAlert i {
  font-size: 20px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .welcome-alert {
    margin: 20px;
    padding: 20px;
  }

  .welcome-icon {
    font-size: 36px;
  }

  .welcome-title {
    font-size: 20px;
  }

  #welcomeMessage {
    font-size: 14px;
    padding: 12px;
  }
}

#customAlert {
  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: 9999;
}

.alert-message-info {
  color: #ff9e00;
  font-weight: bold;
  background-color: #fff3e0;
  padding: 10px;
  border-radius: 5px;
}

.alert-message-success {
  color: #28a745;
  font-weight: bold;
  background-color: #d4edda;
  padding: 10px;
  border-radius: 5px;
}
