/* 獨立的考試布局 */
.part-a-exam-layout {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
  font-family: Arial, sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.disabled-btn {
  background-color: #cccccc !important;
  color: #666666 !important;
  cursor: not-allowed !important;
  opacity: 0.7 !important;
}

#layer{
    position: fixed;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.75);
    width: 100vw;
    height: 100vh;
    top: 0px;
    left: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3vw;
}

/* 頂部 Header */
.part-a-exam-header {
    height: 60px;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.part-a-exam-logo {
  display: flex;
  align-items: center;
}

.part-a-exam-logo img {
  height: 40px;
  margin-right: 10px;
}

.part-a-exit-button {
  padding: 0.5rem 1rem;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.part-a-exit-button:hover {
  text-decoration: underline;
}

.part-a-exit-icon {
  width: 20px;
  height: 20px;
}

/* 主要內容區域 */
.part-a-discussion-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* 左側面板樣式 */
.part-a-left-panel {
  transition: width 0.3s ease;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.part-a-left-panel.expanded {
  width: 20%;
}

.part-a-left-panel.collapsed {
  width: 50px;
  overflow: hidden;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.part-a-left-panel.collapsed h2 {
  writing-mode: vertical-rl;
  transform: translatey(60px) rotate(180deg);
  margin: 15px auto;
  white-space: nowrap;
  font-size: 1.2rem;
}

.part-a-left-panel.collapsed .part-a-timer {
  display: none;
}

/* 左側面板切換按鈕 */
.part-a-toggle-panel-btn {
  position: absolute;
  top: 10px;
  left: 6px;
  z-index: 100;
  background-color: #4169e1;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease;
}

.part-a-toggle-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.part-a-left-panel.expanded + .part-a-toggle-panel-btn {
  left: calc(20% - 15px);
}

/* 中央計時器 - 僅在左側面板折疊時顯示 */
.part-a-center-timer {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  width: 200px;
  text-align: center;
  margin: auto;
  font-size: 1.8rem;
  font-weight: bold;
  color: #0066cc;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px 15px;
  border-radius: 10px;
  z-index: 50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: none;
}

.part-a-center-timer.visible {
  display: block;
}

.part-a-exam-info {
  margin-bottom: 20px;
}

.part-a-exam-info h2 {
  margin: 0;
  color: #333;
}

.part-a-timer {
  font-size: 2rem;
  font-weight: bold;
  color: #0066cc;
  margin-bottom: 20px;
}

.part-a-topic-section {
  margin-bottom: 20px;
}

.part-a-topic-content {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
}

.part-a-topic-title {
  font-weight: bold;
  margin-bottom: 10px;
}

.part-a-passage-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.part-a-passage-content {
  font-size: 14px;
  line-height: 1.5;
}

.part-a-instructions {
  margin-bottom: 20px;
}

.part-a-instructions ul {
  padding-left: 20px;
}

.part-a-instructions li {
  margin-bottom: 5px;
}

.part-a-audio-settings {
  margin-bottom: 20px;
}

.part-a-speech-speed {
  margin-top: 10px;
}

.part-a-speed-slider-container {
  margin-top: 10px;
}

.part-a-speed-slider {
  width: 100%;
  margin-bottom: 5px;
}

.part-a-speed-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

/* 音量控制樣式 */
.part-a-volume-control {
  margin-top: 15px;
}

.part-a-volume-slider-container {
  margin-top: 10px;
}

.part-a-volume-slider {
  width: 100%;
  margin-bottom: 5px;
}

.part-a-volume-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

/* 打開右側面板按鈕 */
.part-a-open-panel-btn {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #9b59b6;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.part-a-open-panel-btn:hover {
  background-color: #9b59b6;
}

.part-a-open-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
}

/* 翻轉箭頭圖標 */
.part-a-open-icon.flipped {
  transform: rotate(180deg);
}

/* 測試按鈕區域 */
.part-a-test-buttons {
  margin-top: 20px;
  padding: 15px;
  border: 1px dashed #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.part-a-test-buttons h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.part-a-test-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.part-a-test-btn {
  padding: 6px 10px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

.part-a-test-btn:hover {
  background-color: #e0e0e0;
}

.part-a-end-exam-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  margin-top: auto;
}

.part-a-end-exam-btn:hover {
  background-color: #c0392b;
}

/* 中央區域樣式 */
.part-a-center-panel {
  flex: 1;
  position: relative;
  padding: 70px 20px 20px;
  transition: margin-left 0.3s ease;
}

.part-a-center-panel-expanded {
  margin-right: 0;
}

.part-a-center-panel-left-expanded {
  margin-left: 0;
}

.part-a-candidates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "candidate-b candidate-c candidate-d";
  gap: 6px;
  padding: 50px 40px 10px 40px;
  height: auto;
  margin-bottom: 20px;
}

.part-a-candidate-panel {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  justify-content: center;
  width: 26vh;
  height: auto;
  border-radius: 10px;
  margin: 0 auto;
  background: #fff;
}

.part-a-candidate-b-panel {
  grid-area: candidate-b;
  border: 2px solid #f39c12;
}

.part-a-candidate-c-panel {
  grid-area: candidate-c;
  border: 2px solid #9b59b6;
}

.part-a-candidate-d-panel {
  grid-area: candidate-d;
  border: 2px solid #3498db;
}

.part-a-you-panel {
  border: 2px solid #2ecc71;
  width: 300px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  margin-top: 20px;
}

.part-a-you-panel-bottom {
  position: relative;
  bottom: -10%;
}

.part-a-you-panel .part-a-candidate-info {
  position: relative;
  background: transparent;
  margin-bottom: 0px;
}

.part-a-you-panel .part-a-candidate-name {
  font-size: 1.2rem;
  margin-bottom: 0px;
}

.part-a-you-panel .part-a-candidate-status {
  font-size: 1rem;
  color: #2ecc71;
  font-weight: bold;
}

.part-a-candidate-label {
    position: absolute;
    top: -30px;
    margin: auto;
    background-color: transparent;
    text-align: center;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

/* 說話中的候選人標籤動畫 */
@keyframes speakingPulse {
  0% {
    background-color: current;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  }
  50% {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
  }
  100% {
    background-color: current;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  }
}

.part-a-candidate-label.speaking {
  animation: speakingPulse 1.5s infinite;
}

/* 為不同候選人定義不同的動畫顏色 */
.part-a-you-panel .part-a-candidate-label.speaking {
  animation-name: speakingPulseGreen;
}

.part-a-candidate-b-panel .part-a-candidate-label.speaking {
  animation-name: speakingPulseOrange;
}

.part-a-candidate-c-panel .part-a-candidate-label.speaking {
  animation-name: speakingPulsePurple;
}

.part-a-candidate-d-panel .part-a-candidate-label.speaking {
  animation-name: speakingPulseBlue;
}

@keyframes speakingPulseGreen {
  0% {
    background-color: #2ecc71;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
  }
  50% {
    background-color: #136a38;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.8);
  }
  100% {
    background-color: #2ecc71;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
  }
}

@keyframes speakingPulseOrange {
  0% {
    background-color: #f39c12;
    box-shadow: 0 0 5px rgba(243, 156, 18, 0.5);
  }
  50% {
    background-color: #e67e22;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.8);
  }
  100% {
    background-color: #f39c12;
    box-shadow: 0 0 5px rgba(243, 156, 18, 0.5);
  }
}

@keyframes speakingPulsePurple {
  0% {
    background-color: #9b59b6;
    box-shadow: 0 0 5px rgba(155, 89, 182, 0.5);
  }
  50% {
    background-color: #8e44ad;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.8);
  }
  100% {
    background-color: #9b59b6;
    box-shadow: 0 0 5px rgba(155, 89, 182, 0.5);
  }
}

@keyframes speakingPulseBlue {
  0% {
    background-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
  }
  50% {
    background-color: #2980b9;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.8);
  }
  100% {
    background-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
  }
}

.part-a-you-panel .part-a-candidate-label {
  background-color: #2ecc71;
  color: white;
  display: none;
}

.part-a-candidate-b-panel .part-a-candidate-label {
  background-color: #f39c12;
  color: white;
}

.part-a-candidate-c-panel .part-a-candidate-label {
  background-color: #9b59b6;
  color: white;
}

.part-a-candidate-d-panel .part-a-candidate-label {
  background-color: #3498db;
  color: white;
}

.part-a-avatar-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.part-a-avatar {
  width: 100%;
  object-fit: cover;
}

.part-a-speak-button {
  padding: 8px 14px;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 100%;
  cursor: pointer;
  transition: all 0.2s;
  width: 100px;
  height: 100px;
  transition: all 0.2s;
  position: relative;
  bottom: 0;
  margin-top: 10px;
}

.part-a-speak-button:hover {
  background-color: #27ae60;
}

.part-a-speak-button.speaking {
  background-color: #e74c3c;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulse 1.5s infinite;
}

  .part-a-speak-button.speaking .part-a-speak-button-text{
     font-size: .8rem;
     white-space: nowrap;
  }


.part-a-mic-icon, .part-a-speaking-icon {
  font-size: 3rem;
}

.part-a-candidate-info {
    width: 100%;
    text-align: center;
    position: absolute;
    bottom: 0;
    background: #ffffffb0;
    color: #000000;
}

.part-a-candidate-name {
  font-weight: bold;
}

.part-a-candidate-status {
  color: #431717;
  font-size: 1rem;
}

/* 右側面板樣式 */
.part-a-right-panel {
  width: 20%;
  padding: 10px;
  border-left: 1px solid #ddd;
  background-color: #fff;
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 5;
}

.part-a-right-panel-hidden {
  transform: translateX(100%);
  position: absolute;
  right: 0;
  width: 0;
  overflow: hidden;
  padding: 0;
}

/* 響應式設計 */
@media (max-width: 1200px) {
  .part-a-discussion-container {
    flex-direction: column;
    overflow-y: auto;
  }
  
  .part-a-left-panel, .part-a-center-panel, .part-a-right-panel {
    width: 100%;
    border: none;
  }
  
  .part-a-candidates-grid {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas: "candidate-b candidate-c candidate-d";
    padding: 20px 20px 10px 20px;
    gap: 6px;
  }

  .part-a-you-panel {
    width: 250px;
  }
}

@media (max-width: 768px) {
  /* 調整左側面板為彈出式面板 */
  .part-a-left-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90%;
    max-width: 400px;
    height: 80%;
    max-height: 600px;
    z-index: 1000;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
  }
  
  .part-a-left-panel.expanded {
    background-color: #ffffff;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    width: 90%;
    animation: popupAppear 0.3s forwards;
    display: flex;
    flex-direction: column;
  }
  
  .part-a-left-panel.collapsed {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    visibility: hidden;
    width: 90%;
  }
  
  /* 隱藏折疊時的垂直文字 */
  .part-a-left-panel.collapsed h2 {
    display: none;
  }
  
  /* 修改左側面板切換按鈕位置和樣式 */
  .part-a-toggle-panel-btn {
    position: fixed;
    top: 10%;
    left: 15px;
    z-index: 101;
  }
  
  /* 按鈕在展開狀態下的樣式 */
  .part-a-left-panel.expanded + .part-a-toggle-panel-btn {
    position: fixed;
    z-index: 1000;
    left: auto;
    right: 15px;
    top: 80px;
    background-color: #e74c3c;
    /*display: none;*/
  }
  
  /* 隱藏原有的箭頭圖標 */
  .part-a-left-panel.expanded + .part-a-toggle-panel-btn .part-a-toggle-icon {
    display: none;
  }
  
  /* 添加X圖標 */
  .part-a-left-panel.expanded + .part-a-toggle-panel-btn::before {
    content: "×";
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
  }
  
  /* 在面板展開時添加背景遮罩 */
  .part-a-left-panel.expanded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    z-index: -1;
  }
  
  /* 彈出動畫 */
  @keyframes popupAppear {
    0% {
      opacity: 0;
      transform: translate(-50%, -45%);
    }
    100% {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }
  
  .part-a-candidates-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "candidate-b"
      "candidate-c"
      "candidate-d";
    padding: 10px;
    gap: 10px;
  }

  /* 在手機上將候選人標籤放置在左側 */
  .part-a-candidate-label {
    top: 50%;
    left: -40px;
    transform: translateY(-50%);
    font-size: 1.5rem;
    padding: 4px 8px;
  }
  
  .part-a-candidate-panel {
    width: 180px;
    padding: 8px;
  }
  
  /* 修改用戶面板在手機上的位置，確保貼著底部 */
  .part-a-you-panel-bottom {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    margin-top: 0;
  }
  
  .part-a-center-panel {
    padding-bottom: 150px; /* 為固定在底部的用戶面板留出空間 */
    /* 調整為全屏寬度，因為左側面板現在是彈出式的 */
    width: 100%;
    margin-left: 0;
  }
  
  .part-a-speak-button {
    width: 80px;
    height: 80px;
  }
  
  .part-a-candidate-name {
    font-size: 0.9rem;
  }
  
  .part-a-candidate-status {
    font-size: 0.8rem;
  }

  .part-a-close-panel-btn {
    display: flex;
  }

  .part-a-bottom-close-btn {
    display: block;
    margin-top: auto;
    margin-bottom: 0;
    position: relative;
    bottom: 0;
    z-index: 10;
  }
}

/* 為更小的屏幕添加額外樣式 */
@media (max-width: 480px) {
  .part-a-left-panel {
    width: 95%;
    max-height: 85vh;
  }
  
  .part-a-candidate-label {
    top: -25px;
    left: auto;
    right: auto;
    transform: none;
    font-size: 1.2rem;
    padding: 3px 6px;
  }
  
  .part-a-candidate-panel {
    width: 130px;
    margin: 0;
  }
  
  .part-a-you-panel {
    width: 100%;
    background: #ffffff;
    border: none;
  }

  .part-a-you-panel.speaking   {
    width: 100%;
    left: 0;
  }

  .part-a-you-panel.speaking span{
    font-size: .65rem;
  }
  
  .part-a-you-panel-bottom {
    bottom: 5px; /* 在更小的屏幕上調整底部距離 */
  }
  
  .part-a-center-panel {
    padding-bottom: 120px; /* 為固定在底部的用戶面板在小屏幕上留出適當空間 */
  }
  
  .part-a-speak-button {
    width: 70px;
    height: 70px;
    margin: 0;
  }
  
  .part-a-mic-icon {
    width: 100%;
    height: auto;
  }

  .part-a-candidates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "candidate-b candidate-c"
      "candidate-d candidate-d";
    padding: 10px;
    gap: 15px;
    justify-items: center;
  }
  
  .part-a-candidate-d-panel {
    grid-column: 1 / span 2;
    justify-self: center;
    width: 150px;
  }
}

/* 考官對話氣泡 */
.part-a-examiner-bubble {
  position: absolute;
  top: 5%;
  left: 300px;
  transform: translateX(-50%);
  width: 80%;
  max-width: 500px;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.part-a-examiner-bubble-label {
  position: absolute;
  top: -25px;
  left: 0;
  color: #000;
  font-weight: bold;
  border-radius: 4px;
  font-size: 1rem;
  z-index: 1;
}

.part-a-examiner-bubble.show {
  opacity: 1;
  visibility: visible;
  animation: fadeInDown 0.5s ease forwards;
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.part-a-examiner-bubble-content {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
}


.part-a-examiner-bubble-message {
  font-size: 1.2rem;
  color: #333;
  line-height: 1.3;
}

/* 說話中的候選人面板波紋擴散動畫 */
@keyframes rippleEffect {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* 為不同候選人設置不同顏色的波紋擴散效果 */
@keyframes rippleEffectGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(46, 204, 113, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 30px rgba(46, 204, 113, 0);
    transform: scale(1);
  }
}

@keyframes rippleEffectOrange {
  0% {
    box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(243, 156, 18, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 30px rgba(243, 156, 18, 0);
    transform: scale(1);
  }
}

@keyframes rippleEffectPurple {
  0% {
    box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(155, 89, 182, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 30px rgba(155, 89, 182, 0);
    transform: scale(1);
  }
}

@keyframes rippleEffectBlue {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(52, 152, 219, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 30px rgba(52, 152, 219, 0);
    transform: scale(1);
  }
}

/* 添加說話時的波紋效果到相應面板 */
.part-a-you-panel.speaking {
  animation: rippleEffectGreen 2s infinite;
  z-index: 5; /* 確保放大時不被其他元素遮擋 */
}

.part-a-candidate-b-panel.speaking {
  animation: rippleEffectOrange 2s infinite;
  z-index: 5;
}

.part-a-candidate-c-panel.speaking {
  animation: rippleEffectPurple 2s infinite;
  z-index: 5;
}

.part-a-candidate-d-panel.speaking {
  animation: rippleEffectBlue 2s infinite;
  z-index: 5;
}

.part-a-discussion-history {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: start;
  margin-bottom: 20px;
  overflow-y: auto;
}

/* 背景遮罩 - 手機版左側面板使用 */
.part-a-panel-overlay {
  display: none;
}

.part-a-panel-overlay.visible {
  display: none;
}

@media (max-width: 768px) {
  .part-a-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }
  
  .part-a-panel-overlay.visible {
    display: block;
  }
}

/* 手機版關閉按鈕 */
.part-a-close-panel-btn {
  display: none;
}

@media (max-width: 768px) {
  .part-a-close-panel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background-color: #e74c3c;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 1.6rem;
    border: none;
    z-index: 1001;
  }
}

/* 手機版底部關閉按鈕 */
.part-a-bottom-close-btn {
  display: none;
  width: 100%;
  padding: 12px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
  margin-top: auto;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.part-a-bottom-close-btn:hover {
  background-color: #c0392b;
}

@media (max-width: 768px) {
  .part-a-bottom-close-btn {
    display: block;
    margin-top: auto;
    margin-bottom: 0;
    position: relative;
    bottom: 0;
    z-index: 10;
  }
}

/* 錄音相關樣式 */
.part-a-recording-section {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.part-a-recording-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.part-a-audio-player {
  width: 100%;
  margin-top: 0.5rem;
}

.part-a-audio-player audio {
  width: 100%;
  border-radius: 4px;
}


@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
  }
}

/* 錄音指示器 */
.recording-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #f44336;
  margin-right: 5px;
  animation: blink 1s infinite;
}

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

/* 添加討論消息容器樣式 */
.part-a-discussion-messages {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.part-a-no-messages {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 20px 0;
}

.part-a-message {
  padding: 6px 8px;
  border-radius: 8px;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.part-a-message.examiner {
  background-color: #f0f7ff;
  border-left: 3px solid #3b82f6;
}

.part-a-message.candidate {
  background-color: #f3f4f6;
  border-left: 3px solid #10b981;
}

.part-a-message-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.part-a-message-sender {
  font-weight: bold;
}

.part-a-message-time {
  color: #666;
  font-size: 0.75rem;
}

.part-a-message-content {
  line-height: 1.2;
}

/* 為移動設備添加考官氣泡樣式 */
@media (max-width: 768px) {
  .part-a-examiner-bubble {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
  }
  
  .part-a-examiner-bubble-message {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .part-a-examiner-bubble {
    top: 20%;
    width: 95%;
    max-width: 300px;
  }
}

/* 手機版右側面板彈出式樣式 */
@media (max-width: 768px) {
  .part-a-right-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90%;
    max-width: 400px;
    height: 80%;
    max-height: 600px;
    z-index: 1000;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    /*overflow-y: auto;*/
    border-left: none;
    padding: 15px;
  }
  
  .part-a-right-panel-hidden {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    visibility: hidden;
    width: 90%;
    position: fixed;
  }
  
  .part-a-right-panel h3 {
    text-align: center;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    position: relative;
  }
  
  .part-a-close-history {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    font-size: 24px;
    cursor: pointer;
    color: #666;
  }
  
  .part-a-close-history::after {
    content: '×';
  }
  
  /* 添加背景遮罩 */
  .part-a-right-panel:not(.part-a-right-panel-hidden)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: -1;
  }
}

/* 關閉歷史記錄按鈕樣式 */
.part-a-close-history {
  display: none;
}

/* 顯示討論歷史按鈕樣式 */
.part-a-show-history-btn {
  display: none;
  position: absolute;
  bottom: 2%;
  right: 15px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.part-a-history-icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .part-a-show-history-btn {
    display: flex;
  }
} 



/*setup*/
.part-a-setup-container {
  width: 100%;
  margin: 0 auto;
  padding: 0rem;
  border-radius: 8px;
}

.setup-section {
  margin-bottom: 0rem;
}

.setup-section h2 {
  font-size: 1.3rem;
  margin-bottom: 0rem;
  color: #333;
}

.setup-description {
  color: #666;
  margin-bottom: 0rem;
}

.topic-select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.candidates-container {
  display: block;
}

.candidate-card {
  flex: 1;
  min-width: 300px;
  border: 1px solid #eee;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.candidate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 桌面版候選人卡片 */
.candidates-desktop {
  display: none;
}

@media (min-width: 640px) {
  .candidates-desktop {
    display: flex !important;
    flex-direction: row;
    gap: 1rem;
  }
  
  .candidates-mobile {
    display: none;
  }
}

.candidates-desktop .candidate-card {
  flex: 1;
}

.candidates-desktop .candidate-avatar video {
  max-width: 120px;
  margin: 0 auto;
}

/* 移動版候選人卡片 */
.candidates-mobile .candidate-card {
  margin-bottom: 1rem;
}


.block {
  display: flex;
}

.candidate-card h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #333;
}

.candidate-option {
  margin-bottom: 1rem;
}

.candidate-option label {
  display: block;
  margin-bottom: 0rem;
  color: #555;
}

.candidate-option select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
} 

.start-exam-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.start-exam-button {
  background-color: #3366ff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.start-exam-button:hover {
  background-color: #2952cc;
}

.start-exam-button:disabled {
  background-color: #a0a0a0;
  cursor: not-allowed;
}

.topic-info-button {
  transition: all 0.2s;
}

.topic-info-button:hover {
  background-color: #e5e5e5;
}

.topic-info-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 主題信息彈出窗口樣式 */
.topic-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.topic-modal {
  width: 80%;
  max-width: 600px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.topic-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.close-modal-btn:hover {
  background-color: #e0e0e0;
}

.topic-modal-content {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.topic-passage {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 4px;
  border-left: 3px solid #3366ff;
}

.topic-questions li {
  margin-bottom: 0.5rem;
}

.candidate-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
}

.candidate-tabs button {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
}

.candidate-tabs button.active {
  border-bottom: 2px solid #3366ff;
  color: #3366ff;
}

/* 步驟導航樣式 */
/* 刪除 setup-steps-nav 樣式 */

/* 步驟導航樣式 */
.setup-steps-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem;
}

.setup-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 100px;
  margin: 0 1rem;
}

.step-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 1.3rem;
  font-weight: bold;
  color: #000;
  text-align: center;
  transition: all 0.3s ease;
}

.setup-step.active .step-indicator {
  background-color: #3b82f6;
  color: white;
}

.setup-step.active .step-label {
  color: #3b82f6;
  font-weight: 500;
}

.setup-step.completed .step-indicator {
  background-color: #10b981;
  color: white;
}

.setup-step.completed .step-indicator:after {
  content: '✓';
  position: absolute;
  font-size: 1.2rem;
}

.step-connector {
  position: absolute;
  height: 2px;
  background-color: #e5e7eb;
  top: 18px;
  left: -50%;
  right: 50%;
  z-index: -1;
}

.setup-step:first-child .step-connector {
  display: none;
}

.setup-step.active .step-connector,
.setup-step.completed .step-connector {
  background-color: #3b82f6;
}

.setup-step.completed + .setup-step .step-connector {
  background-color: #3b82f6;
}

@media (max-width: 640px) {
  .setup-steps-nav {
    padding: 0 0.5rem;
  }
  
  .setup-step {
    min-width: 70px;
    margin: 0 0.5rem;
  }
  
  .step-indicator {
    width: 30px;
    height: 30px;
    font-size: 0.875rem;
  }
  
  .step-label {
    font-size: 0.95rem;
  }
}

.setup-panel {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.setup-title {

}

.setup-summary {
  background-color: #f8fafc;
  border-left: 3px solid #3b82f6;
}

.setup-summary h3 {
  color: #2c3e50;
}

.setup-summary h4 {
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.setup-summary ul {
  margin-left: 1rem;
  list-style-type: disc;
}

.setup-summary li {
  margin-bottom: 0.25rem;
}

/* 按鈕樣式優化 */
button.active {
  font-weight: 600;
}

/* 新增統一的導航按鈕樣式 */
.navigation-buttons {

}

.navigation-buttons button {
  transition: all 0.3s ease;
  min-width: 120px;
  justify-content: center;
}

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

@media (max-width: 768px) {
  .candidates-container {
    flex-direction: column;
  }
  
  .candidate-card {
    min-width: auto;
    transform: none !important;
  }
  
  .topic-modal {
    width: 95%;
  }
  
  /* 移動端 Topbar 樣式 */
  .mobile-topbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .mobile-menu {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* 移動端標籤頁樣式 */
  .candidate-tabs {
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 1.25rem;
  }
  
  .candidate-tabs::-webkit-scrollbar {
    height: 3px;
  }
  
  .candidate-tabs::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
  }
  
  /* 按鈕觸控優化 */
  button {
    touch-action: manipulation;
  }
  
  /* 移動端主題信息按鈕 */
  .topic-info-button {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  /* 移動端開始考試按鈕 */
  .start-exam-button {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 1rem;
  }

  
  .navigation-buttons button {
    min-width: 100px;
    padding: 0.75rem 1rem;
  }
} 


.step-circle {
    font-size: 1.6rem;
    width: 50px;
    height: 50px;
}
/* setup */


.collapsed .hide_when_collapsed{
  display:none;
}

.expanded .hide_when_expanded{
  display:none;
}


.exam-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
}

.exam-logo {
  font-weight: bold;
}

.exit-button {
  padding: 0.5rem 1rem;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.exit-button:hover {
  background-color: #e5e7eb;
}

/* Support Tailwind Color*/
.text-emerald-500 {
  color: #10b981;
}

.text-gray-700 {
  color: #374151;
}


.part-b-discussion-container {
  display: flex;
  height: calc(100vh - 60px);
  background-color: #f5f7fa;
  position: relative;
}

/* 左側面板樣式 */
.left-panel {
  position: relative;
  transition: width 0.3s ease;
  width: 25%;
  padding: 20px;
  background-color: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .left-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90%;
    max-width: 400px;
    height: 80%;
    max-height: 600px;
    z-index: 1000;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    border-right: none;
    padding-bottom: 70px;
  }

  .left-panel.expanded {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    width: 90% !important;
  }

  .left-panel.collapsed {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    visibility: hidden;
    width: 90%;
  }

  /* 新增關閉按鈕 */
  .close-panel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background-color: #e74c3c;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 1.6rem;
    border: none;
    z-index: 1001;
  }

  /* 新增背景遮罩 */
  .panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .panel-overlay.visible {
    display: block;
  }

  /* 修改切換按鈕在手機上的樣式 */
  .toggle-panel-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4169e1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  /* 底部關閉按鈕 */
  .bottom-close-btn {
    display: block;
    margin-top: auto;
    margin-bottom: 15px;
  }
}

.left-panel.expanded {
  width: 25%;
}

.left-panel.collapsed {
  width: 50px;
  overflow: hidden;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.left-panel.collapsed h2 {
  writing-mode: vertical-rl;
  transform: translatey(60px) rotate(180deg);
  margin: 15px auto;
  white-space: nowrap;
  font-size: 1.2rem;
}

.left-panel.collapsed .timer {
  display: none;
}

.toggle-panel-btn {
  position: absolute;
  top: 10px;
  left: 6px;
  z-index: 100;
  background-color: #4169e1;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease;
}

.left-panel.expanded + .toggle-panel-btn {
  left: calc(25% - 15px);
}

.toggle-panel-btn.collapsed {
  left: 30px;
}

.toggle-panel-btn.expanded {
  left: calc(25% - 15px);
}

.toggle-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.left-panel h2 {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: 1.3rem;
  color: #333;
}

/* 左側面板計時器樣式 */
.timer {
  font-size: 1.8rem;
  font-weight: bold;
  color: #4169e1;
  margin-bottom: 20px;
}

/* 中央面板計時器樣式 */
.center-timer {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  width: 200px;
  text-align: center;
  margin: auto;
  font-size: 1.8rem;
  font-weight: bold;
  color: #4169e1;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px 15px;
  border-radius: 10px;
  z-index: 50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: none;
}

.center-timer.visible {
  display: block;
}

.topic-section {
  margin-bottom: 20px;
}

.topic-section h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #444;
}

.topic-box {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: white;
  min-height: 40px;
}

.instructions {
  margin-bottom: 20px;
}

.instructions h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #444;
}

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

.instructions li {
  margin-bottom: 8px;
  color: #555;
}

.end-exam-btn {
  margin-top: auto;
  padding: 12px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.end-exam-btn:hover {
  background-color: #c0392b;
}

/* 中央區域樣式 */
.center-panel {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 50px;
}

/* 調整考官和用戶區域在中央面板中的位置 */
.examiner-section {
  margin-bottom: 60px;
}

.user-section {
  margin-top: 30px;
  width: 300px;
  min-height: 280px;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  padding-bottom: 30px;
  justify-content: flex-start;
}

.examiner-section, .user-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  position: relative;
  justify-content: center;
  border-radius: 300px;
  margin-bottom: 45px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.examiner-section {
  width: 500px;
  height: 500px;
}

@media (max-width: 768px) {
  .examiner-section {
    width: 100%;
  }
}

.avatar-container {
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 10px;
}

@media (max-width: 768px) {
  .avatar-container {
    width: 100%;
  }
}

.examiner-avatar {
  width: 100%;
  height: auto;
  border-radius: 100%;
  object-fit: cover;
}

.avatar-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.candidate-label {
  position: relative;
  width: 120px;
  margin: auto;
  background-color: #2ecc71;
  color: white;
  padding: 5px;
  margin-bottom: 5px;
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: bold;
  text-align: center;
  border-radius: 4px;
}

.candidate-name {
  font-weight: bold;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .user-section .candidate-name, .examiner-section .candidate-name {
    font-size: 1.5rem;
  }
}

.avatar-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.avatar-status {
    color: #431717;
    font-size: 0.9rem;
    background: #fff;
    padding: 2px 10px;
    border-radius: 9px;
    line-height: 1.2;
}

.message-box {
  min-height: 80px;
  width: 350px;
  min-height: 150px;
  border: 1px solid #cfcfcf;
  border-radius: 15px;
  padding: 15px;
  background-color: #fff;
  text-align: left;
  position: absolute;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.5s ease-in-out;
}

.message-box.hidden {
  display: none;
}

.examiner-message {
  background-color: #fff;
  border-top-left-radius: 5px;
  left: -260px;
  top: 25%;
}

@media (max-width: 768px) {
  .examiner-message {
    left: 0;
    right: 0;
    margin: auto;
    width: 90%;
    top: 47%;
  }
}

.examiner-message:before {
  content: "";
  position: absolute;
  top: 20px;
  right: -10px;
  border-width: 10px 0 10px 10px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
}

@media (max-width: 768px) {
  .examiner-message:before {
    display: none;
  }
}

.user-message {
  background-color: #fff;
  border-top-right-radius: 5px;
  left: 350px;
  top: -20%;
  display: none;
}

.user-message:before {
  content: "";
  position: absolute;
  top: 20px;
  left: -10px;
  border-width: 10px 10px 10px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}

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

.microphone-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  margin-top: 20px;
}

.microphone-btn {
  position: relative;
  padding: 8px 14px;
  background-color: #2ecc71;
  color: white;
  border-radius: 100%;
  cursor: pointer;
  width: 80px;
  height: 80px;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  bottom: auto;
}

@media (max-width: 768px) {
  .microphone-btn {
    width: 100px;
    height: 100px;
  }
  
  .microphone-btn img {
    width: 60px;
  }
}

.microphone-btn img {
  width: 50px;
  height: 100%;
}

.microphone-btn.recording {
  background-color: #e74c3c;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.mic-label {
  margin-top: 10px;
  color: #555;
  font-size: 0.9rem;
}

/* 右側面板樣式 */
.right-panel {
  display: none;
  width: 0%;
  padding: 20px;
  background-color: white;
  border-left: 1px solid #e0e0e0;
}

.audio-settings h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: #333;
}

.setting-group {
  position: relative;
  margin-bottom: 25px;
}

.setting-group label {
  display: block;
  margin-bottom: 10px;
  color: #555;
}

.slider {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  outline: none;
  border-radius: 5px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #4169e1;
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #777;
  font-size: 0.8rem;
}

.replay-btn {
  width: 100%;
  padding: 12px;
  background-color: #4169e1;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.replay-btn:hover {
  background-color: #3151b5;
}

/* 說話中的波紋擴散動畫 */
@keyframes rippleEffectGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(46, 204, 113, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 30px rgba(46, 204, 113, 0);
    transform: scale(1);
  }
}

@keyframes rippleEffectPurple {
  0% {
    box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(155, 89, 182, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 30px rgba(155, 89, 182, 0);
    transform: scale(1);
  }
}

/* 為用戶區域添加說話時的動畫 */
.user-section.speaking {
  animation: rippleEffectGreen 2s infinite;
  z-index: 5; /* 確保放大時不被其他元素遮擋 */
}

.examiner-section.speaking {
  animation: rippleEffectPurple 2s infinite;
  z-index: 5;
}

/* 修改頭像 - 當說話時顯示不同圖片 */
.user-section.speaking .user-avatar {
  /* 在React中，public目錄中的文件可以通過絕對路徑訪問 */
  content: none; /* 不要在CSS中切換圖片 */
}

/* 新增底部關閉按鈕樣式 */
.bottom-close-btn {
  display: none;
  width: 100%;
  padding: 12px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  margin-top: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
}

.bottom-close-btn:hover {
  background-color: #c0392b;
}

@media (max-width: 768px) {
  .bottom-close-btn {
    display: block;
    margin-top: auto;
    margin-bottom: 15px;
  }
}

/* 錄音相關樣式 */
.recording-section {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recording-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.audio-player {
  width: 100%;
  margin-top: 0.5rem;
}

.audio-player audio {
  width: 100%;
  border-radius: 4px;
}

/* 麥克風按鈕 */
.mic-button {
  padding: 8px 14px;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 100%;
  cursor: pointer;
  transition: all 0.2s;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin: 0 auto 20px auto;
}

.mic-button:hover {
  background-color: #27ae60;
  transform: scale(1.05);
}

.mic-button.recording {
  animation: pulse 1.5s infinite;
  background-color: #f44336;
}

.mic-icon {
  width: 32px;
  height: 32px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
  }
}

/* 錄音指示器 */
.recording-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #fff;
  margin-bottom: 5px;
  animation: blink 1s infinite;
}

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

@media (max-width: 480px) { 

  #skip-button{
    position: absolute;
    right: 3%;
    top: 7%;
    padding: 6px 10px !important;
  }

  #mic-button{
    width: 2rem  !important;
    height: 2rem !important;    
  }

}