/* Set the width of the scrollbar to 10px and the color to red */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

/* Set the color of the scrollbar slider to green */
::-webkit-scrollbar-thumb {
  background-color: #69696910;
  border-radius: 8px;
}

/* Set the color of the scrollbar track to blue */
::-webkit-scrollbar-track {
  background-color: #181c31;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #69696920 0%, #69696910 100%);
}

body {
  width: 100vw;
  height: 100vh;
  background-color: black;
  color: white;
  font-family: Arial, sans-serif;
  text-align: center;
  overflow: hidden;
  padding: 0;
  margin: 0;
  user-select: none;
}

button {
  color: white;
  border: 0;
  border-radius: 6px;
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

#CountdownTimer {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#timer {
  font-size: 130px;
  font-weight: bold;
  margin-bottom: 20px;
}

button {
  padding: 10px 20px;
  margin: 5px;
  font-size: 16px;
  cursor: pointer;
}

#message {
  height: 28px;
  font-size: 24px;
  color: orange;
}

/* Existing styles */
#settingsBtn {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0;
  font-size: 16px;
  background-color: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#settingsBtn img {
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* 确保图片不会阻止按钮的点击事件 */
}

#settingsPanel {
  position: fixed;
  top: 0;
  right: -260px;
  width: 260px;
  height: 100%;
  background-color: #111;
  color: white;
  padding: 20px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
  transition: right 0.35s ease-in-out;
  z-index: 1000;
  overflow-y: auto;
  box-sizing: border-box;
}

#settingsPanel.open {
  right: 0;
}

.setting-item {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px dashed #696969;
  border-radius: 8px;
}

.setting-item label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  text-align: left;
  color: #696969;
  font-size: 12px;
}

.reset-btn {
  padding: 2px 4px;
  font-size: 10px;
  background: #696969;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  position: relative;
}

.reset-btn:hover {
  background: orange;
}

.reset-btn::after {
  content: "Reset";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  margin-bottom: 5px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.reset-btn::before {
  content: "";
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.reset-btn:hover::after,
.reset-btn:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.preset-btn-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}

.preset-btn {
  flex-grow: 1;
  margin: 0;
  margin-bottom: 5px;
  padding: 5px;
  cursor: pointer;
  background: #696969;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: border-color 0.3s ease;
}

.preset-btn.selected {
  background: orange;
}

.customTime {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.customTime input[type="number"] {
  width: 100%;
  padding: 5px;
  color: white;
  background: #696969;
  border: 0;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.customTime input[type="number"].custom-time-active {
  background: #ff8c00;
  box-shadow: 0 0 5px rgba(255, 140, 0, 0.5);
}

.customTime input[type="number"]:focus {
  outline: none;
  background: #ff8c00;
  box-shadow: 0 0 5px rgba(255, 140, 0, 0.5);
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #696969;
  border-radius: 34px;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 5px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}

input:checked+.slider {
  background-color: orange;
}

input:focus+.slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
  transform: translateX(32px);
}

input:checked+.slider .slider-text {
  color: white;
  transform: translateX(-10px);
}

input:focus+.slider {
  box-shadow: 0 0 1px #2196F3;
}

/* 新增：定位文字在 switch 内部右侧 */
.slider-text {
  position: absolute;
  top: 52%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease, color 0.3s ease;
}

.slider-text.checked {
  left: 10px;
  right: auto;
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

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

button#saveSettings {
  width: 100%;
  height: 50px;
  border-radius: 50px;
  background: #2196F3;
}

button#start,
button#reset {
  background: #696969;
}

button#start:hover,
button#reset:hover {
  background: orange;
}

/* 字体大小控制器样式 */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fontSize {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  background: #696969;
  border-radius: 3px;
  outline: none;
}

#fontSize::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: orange;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

#fontSize::-webkit-slider-thumb:hover {
  background: #ff8c00;
}

#fontSizeValue {
  min-width: 50px;
  text-align: right;
  color: #696969;
  font-size: 14px;
}

/* 颜色选择器样式 */
.color-picker-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#timeColor {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

#timeColor::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 8px;
}

#timeColor::-webkit-color-swatch {
  border: 2px solid #696969;
  border-radius: 8px;
}

#colorValue {
  color: #696969;
  font-size: 14px;
  min-width: 70px;
  text-align: right;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-control input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  background: #696969;
  border-radius: 2px;
  outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: orange;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
  background: #ff8c00;
}

.volume-control #volumeValue {
  min-width: 45px;
  text-align: right;
  color: #696969;
  font-size: 12px;
}