.speechsec{
  position: relative;
}
.speechsec form {
  /* max-width: 480px; */
  margin: 0 auto;
}

.speechsec button,
.speechsec select {
  background-color: #fff;
  border: none;
  border-radius: 2px;
  height: 1.5rem;
}

.speechsec select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.speechsec input[type=range] {
  -moz-appearance: none;
}

.speechsec input[type=range]::-moz-range-thumb {
  background-color: #fff;
  height: 1rem;
  width: .5rem;
  border-color: #fff;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}





.speechsec input[type=range]::-moz-range-track {
  background-color: #fff;
}

/* 音量 */
.volumnbox{
  padding: 0;
  border-radius: 5px;
  background-color: #ecf2e4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0px;
  width: 45px;
}
/* 音量拿掉園區圈 拿掉的話iphone會不能滑 只能點*/
/* Chrome / Edge / Opera */
/* .speechsec .volumnbox input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
  background: transparent;
  border: none;
} */

.speechsec .volumnbox input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
}


/* Firefox */
.speechsec .volumnbox input[type="range"]::-moz-range-thumb {
  width: 0;
  height: 0;
  background: transparent;
  border: none;
}

/* IE / 舊 Edge */
.speechsec .volumnbox input[type="range"]::-ms-thumb {
  width: 0;
  height: 0;
  background: transparent;
  border: none;
}
.speechsec .volumnbox input[type="range"]{
  width: 0px;
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  display: none;
}
.speechsec .volumnbox.is-open{
  padding-right: 10px;
  width: initial;
}
.speechsec .volumnbox.is-open input[type="range"] {
  width: 70px;
  opacity: 1;
  display: inline-block;
}

#volumeshow{
  display: inline-block;
  padding: 12px 15px;
}
  

.speecharg {
  height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.speecharg label {
  width: 55px;
  display: inline-block;
}

.speecharg input,
.speecharg select {
  width: calc(100% - 100px);
  display: inline-block;
  margin: 0;
}

.speecharg select {
  border: 1px solid #ccc;
}

.speecharg button {
  width: 25px;
  height: 25px;
  margin-left: 20px;
  padding: 0;
}

.speecharg button:hover {
  background-color: #eee;
}

.bottom {
  margin: 15px 0;
  display: flex;
  gap: 10px;
}

.bottom button {
  width: 44px;
  height: 40px;
  border-radius: 5px;
  /* border: 1px solid #ccc; */
  font-size: 16px;
  background-color: #ecf2e4;
}

.bottom button:hover {
  background-color: #8bbf61;
  color: #fff;
}

#textarea {
  width: 100%;
  /* height: 8rem; */
  margin-bottom: 1rem;
  border-radius: 5px;
  position: relative;
  background-color: #fff;
  transition:
  background-color 100ms ease;
  border: 1px solid #333;
  
}

.speaking #textarea {
  background-color: #333;
}

#textarea>* {
  position: absolute;
  display: block;
  border: none;
  resize: none;
  top: 0;
  left: 0;
  width: calc(100% - 1rem);
  height: calc(100% - 1rem);
  padding: 10px;
  white-space: pre-wrap;
  line-height: 1.1rem;
  background-color: transparent;
  font-size: 12px;
  font-family: monospace;
}

#textbeingspoken {
  color: #aaa;
  visibility: hidden;
  opacity: 0;
  overflow: auto;
  transition: all 100ms ease;
  /* display: none; */
}
#marker {
    position: absolute;
    border: 1px solid orange;
    visibility: hidden;
    pointer-events: none;
    transition: top 0.1s, left 0.1s, width 0.1s, height 0.1s;
    padding: 0px;
}

#marker.moved {
    visibility: visible;
}

.voiceselect {
  border: 1px solid #666;
  padding: 0 5px;
  font-size: 13px;
}

.playbtn_speechargbtn {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.speechargbtn button {
  height: 40px;
  padding: 5px 15px;
  border-radius: 5px;
  /* border: 1px solid #ccc; */
  font-size: 16px;
  background-color: #ecf2e4;
}

.speechargbtn button:hover {
  background-color: #8bbf61;
  color: #fff;
}

.morespeecharg {
  display: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 15px;
  background-color: #fff;
  
  width: 100%;
  margin-bottom: 20px;
}
.morespeecharg.active {
  display: block;
}
.speechbox {
  position: relative;
}

/* range */
input[type=range] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* width: 100%; */
  height: 5px;
  border-radius: 30px;
  background: linear-gradient(to right, #8bbf61 50%, #e6e6e6 50%);
  outline: none;
  border: none;
  touch-action: pan-x; /* 讓 iOS 可以水平拖曳 */

}

/* Chrome / Safari / Edge Chromium */
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #8bbf61;
  border-radius: 50%;
  border: none;
  margin-top: -3px;
}

/* Firefox */
input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #8bbf61;
  border-radius: 50%;
  border: none;
}

input[type=range]::-moz-range-progress {
  background: #8bbf61;
}

input[type=range]::-moz-range-track {
  background: #e6e6e6;
  border-radius: 999px;
}

/* IE / Edge Legacy */
input[type=range]::-ms-thumb {
  width: 18px;
  height: 18px;
  background: #8bbf61;
  border-radius: 50%;
  border: none;
}

input[type=range]::-ms-fill-lower {
  background: #8bbf61;
  border-radius: 999px;
}

input[type=range]::-ms-fill-upper {
  background: #e6e6e6;
  border-radius: 999px;
}

#selectspeakitem{
  height: 40px;
  border-radius: 5px;
  font-size: 16px;
  background-color: #ecf2e4;
  appearance: revert;
  padding: 0px 10px;
}



/* 進度條 */
.tts-time {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
  text-align: right;
}
.tts-progress-wrap{
  flex: 1;
  padding: 0 10px;
}
.tts-progress {
  width: 100%;
  height: 8px;
  background: #e6e6e6;
  border-radius: 4px;
  position: relative;
  /* overflow: hidden; */
  touch-action: pan-x;
}

.tts-progress-bar {
  height: 100%;
  width: 0%;
  background: #8bbf61;
  transition: 0s;
  border-radius: 4px 0 0 4px;
}
/* 圓形拖曳點 */
.tts-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 15px;
  height: 15px;
  background: #8bbf61;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; /* 點擊事件仍交給整條進度條 */
  /* transition: left 0.1s linear; */
  transition: 0s;
}

/* 拖曳中更明顯 */
.tts-progress.dragging .tts-progress-thumb {
  width: 18px;
  height: 18px;
}



@media (max-width: 768px) { 
  .voicebox{
    opacity: 0;
    height: 0px;
    display: none;
  }
}

@media (max-width: 640px) {
  .speechsec{
    margin-bottom: 15px;
  }
  #selectspeakitem {
    font-size: 15px;
    padding: 0px 6px;
  } 
  .bottom {
    margin: 0;
    gap: 8px;
  }
  .bottom button {
    font-size: 15px;
  }
  .playbtn_speechargbtn {
    gap: 10px;
  }
  .speechargbtn button {
    /* padding: 5px 8px; */
    font-size: 15px;
  }
  .morespeecharg{
    margin-top: 10px;
  }
  .tts-progress-wrap {
    flex: initial;
    padding: 0;
    width: 100%;
    order: 1;
    margin-bottom: 5px;
  }
  #selectspeakitem{
    order: 2;
  }
  .bottom{
    order: 3;
  }
  .volumnbox{
    order: 4;
  }
  .speechargbtn{
    order: 5;
  }
  .speechsec .volumnbox.is-open input[type="range"] {
    width: 54px;
  }
  .playbtn_speechargbtn {
    gap: 10px 5px;
  }
}


/* 隱藏stop */
#readstop{
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  display: none;
}
#line-warning-out{
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}
#line-warning {
  background: rgba(0,0,0,0.7);
  padding: 15px 10px 15px 10px;
  border-radius: 8px;
  text-align: center;
  width: 100%;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease; /* 加入淡入效果 */
  
}

#line-warning.show {
  opacity: 1;
  
}

#line-warning  p {
  color: #fff;
  font-size: 15px;
  line-height: 2;
}

#line-warning .open-chrome {
  display: none;
  padding: 0px 10px;
  background: #fb8e6f;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}
#line-warning.show .open-chrome{
 display: inline-block;
}

.notebox{
  font-size: 15px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
 .notebox{
  margin-top: 15px;
} 
}