body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #f0f0f0;
}
.container {
  text-align: center;
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#currentWord {
  font-size: 2rem;
  margin-bottom: 1rem;
}
#instructions {
  color: #666;
  font-style: italic;
}
#wordList {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background-color: white;
  padding: 20px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
  transform: translateX(100%);
  box-sizing: border-box;
}
#wordList.open {
  transform: translateX(0);
}
#toggleWordList {
  /* position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1002; */
  background-color: #007bff;
  color: white;
  border: none;
  /* padding: 10px; */
  cursor: pointer;
  border-radius: 5px;
}
#wordListContent {
  padding: 0;
  margin: 0;
  list-style-type: none;
}
#wordListContent li {
  margin-bottom: 10px;
}
#unitSelector {
  margin-bottom: 20px;
  padding: 5px;
  width: 100%;
}
#repeatSelector {
  margin-top: 10px;
  padding: 5px;
}
#progressBar {
  width: 100%;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 10px;
  margin-top: 20px;
  overflow: hidden;
}
#progressFill {
  height: 100%;
  background-color: #4caf50;
  width: 0%;
  transition: width 0.3s ease-in-out;
}
#completionModal {
  display: none;
  position: fixed;
  z-index: 1003;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 10px;
  text-align: center;
}
.modal-button {
  margin: 10px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#autoModeControls {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
#autoModeControls select,
#autoModeControls button {
  margin: 5px;
}
#intervalSelector {
  margin-right: 10px;
}
#startButton {
  display: block;
  margin: 0 auto 20px;
  transition: opacity 0.3s ease-out;
}
#startButton.hidden {
  opacity: 0;
  pointer-events: none;
}
#unitSelector {
  margin-bottom: 10px;
  text-align: left;
}
#unitSelector label {
  margin-left: 5px;
  display: inline-block;
  margin-right: 10px;
}
#applyUnitSelection {
  margin-bottom: 20px;
  padding: 5px 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#applyUnitSelection:hover {
  background-color: #0056b3;
}

select,
button {
  padding: 5px 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  margin-right: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

select:focus,
button:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

button {
  background-color: #007bff;
  color: white;
  border: none;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #0056b3;
}
#customWordsModal {
  display: none;
  position: fixed;
  z-index: 1003;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  overflow-y: auto;
}

#customWordsModal .modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#customWordsInput {
  width: calc(100% - 20px);
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  min-height: 200px;
  font-family: Arial, sans-serif;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.modal-description {
  color: #666;
  margin: 10px 0;
  font-size: 14px;
}

#wordList {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background-color: white;
  padding: 20px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1001;
}

#wordList.open {
  transform: translateX(0);
}

#wordListContent {
  padding: 0;
  margin: 0;
  list-style-type: none;
  width: 100%;
}

#wordListContent li {
  margin-bottom: 10px;
  word-wrap: break-word;
  white-space: normal;
}

#unitSelector {
  margin-bottom: 15px;
  width: 100%;
}

#unitSelector label {
  display: inline-block;
  margin: 8px 0;
  word-wrap: break-word;
  white-space: normal;
}

#wordList h2 {
  margin: 15px 0;
  font-size: 1.2em;
}

#wordList button {
  width: 100%;
  margin: 10px 0;
}

/* 确保模态框内容不会溢出 */
.modal-content {
  max-width: calc(100vw - 40px);
  word-wrap: break-word;
}

.button-group {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button-group button {
  margin: 0;
  white-space: nowrap;
}

#wordList {
  z-index: 1001;
}
.modal-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.modal-buttons-right {
  display: flex;
  gap: 10px;
}

.modal-button-danger {
  background-color: #dc3545;
}

.modal-button-danger:hover {
  background-color: #c82333;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 2000;
  font-size: 14px;
  display: none;
  animation: fadeInOut 3s ease;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
