html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  /* 禁止整页上下滚动 */
  font-family: "Hiragino Kaku Gothic Pro", Meiryo, "Yu Gothic", "Helvetica Neue", sans-serif;
  background-color: #fffefc;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.audio-container {
  position: relative;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
  clip-path: inset(0px -20px -20px -20px);
  /* 裁剪顶部阴影 */
}


#audio {
  display: block;
  margin: 10px auto 5px;
}

#controls {
  padding-left: 3px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  font-family: 'Segoe UI', sans-serif;
  padding-top: 8px;
}

#controls label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #333;
}

#controls select {
  margin-top: 5px;
  padding: 6px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f8f9fa;
  transition: border-color 0.2s ease;
  min-width: 140px;
}

#controls select:focus {
  outline: none;
  border-color: #ffd43b;
  /* background-color: #fffceb; */
}

#transcript {
  flex: 1;
  overflow-y: auto;
  padding: 30px 120px;
  max-height: 80vh;
  white-space: pre-wrap;
  font-size: 18px;
  line-height: 1.8;
}

.word {
  cursor: pointer;
  padding: 3px 1px;
}

@media screen and (min-width: 1300px) {
  #transcript {
    padding: 30px 12%;
  }
}

@media screen and (max-width: 768px) {
  #transcript {
    padding: 15px 10px 150px;
    font-size: 16px;
  }

  .word {
    padding: 0 1px;
  }

  #fabPlayToggle {
    right: 20px;
    bottom: 110px;
    transform: scale(0.8);
    opacity: 0.4;
  }

  #fabToggleFurigana {
    right: 20px;
    transform: scale(0.8);
    opacity: 0.4;
  }

  #fabToggleFurigana.toggle-on {
    opacity: 0.4 !important;
  }

  #mode-ball {
    right: 20px;
    bottom: 60px;
    transform: scale(0.8);
    opacity: 0.4;
  }

  .mode-ball.breathe {
    animation: none !important;
  }
}



.highlight {
  background-color: #fffb00;
  color: black;
  font-weight: bold;
  transition: background 0.2s ease;
}

/* 换行 + 浅色分割线 */
.line-break {
  border-top: 1px solid #dedcdc;
  margin: 4px 0;
  height: 1px;
}

/* 加粗角色标签 */
.speaker-label {
  font-weight: bold;
  font-size: 1.2em;
  margin-right: 6px;
  display: inline-block;
}

.fab-button {
  position: fixed;
  bottom: 150px;
  right: 40px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(29, 155, 240, 0.8);
  /* 推特蓝半透明 */
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  opacity: 0.6;
}

.fab-button:hover {
  background-color: rgba(29, 155, 240, 1) !important;
}

/* 图标容器 */
.fab-button .icon {
  display: inline-block;
  width: 0;
  height: 0;
}

/* ▶️ 播放图标（三角形） */
.fab-button .play {
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent white;
  margin-left: 2px;
}

/* ⏸️ 暂停图标（两条竖线） */
.fab-button .pause {
  width: 14px;
  height: 16px;
  position: relative;
}

.fab-button .pause::before,
.fab-button .pause::after {
  content: "";
  position: absolute;
  top: 0;
  width: 4px;
  height: 100%;
  background: white;
  border-radius: 1px;
}

.fab-button .pause::before {
  left: 0;
}

.fab-button .pause::after {
  right: 0;
}

.furigana-button {
  position: fixed;
  bottom: 10px;
  right: 40px;
  font-size: 1.2em;
  color: white;
  text-align: center;
}

#fabToggleFurigana.toggle-on {
  background-color: rgba(29, 155, 240, 0.8);
  opacity: 0.6;
}

#fabToggleFurigana.toggle-off {
  background-color: rgba(100, 100, 100, 0.4);
  opacity: 0.3;
}

.mode-ball {
  position: fixed;
  bottom: 80px;
  right: 40px;
  color: white;
  text-align: center;
  font-size: 16px;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* 应用于 loop 模式下的按钮 */
.mode-ball.breathe {
  animation: breathe 2.8s ease-in-out infinite;
}

ruby rt {
  font-size: 0.6em;
  color: #565656;
}

.bold-word {
  font-weight: bold;
}

.bold-word::after {
  content: " ";
  display: inline-block;
}

.countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: #9e9c9c;
  margin-bottom: 3px;
}

.countdown-number {
  min-width: 1em;
  transition: all 0.3s ease-in-out;
  opacity: 1;
  font-weight: bold;
  padding: 0 2px;
}

.countdown-number.changed {
  opacity: 0.3;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #343434;
    color: #e0e0e0;
  }

  audio {
    filter: invert(1) hue-rotate(180deg);
  }

  #controls select {
    background-color: #343434;
    color: #e0e0e0;
    border: 1px solid #555;
  }

  #controls label {
    color: #e0e0e0;
  }

  .audio-container {
    box-shadow:
      0 6px 10px rgba(255, 255, 255, 0.08),
      0 2px 4px rgba(255, 255, 255, 0.03);
  }

  ruby rt {
    font-size: 0.6em;
    color: #949494;
  }

  .line-break {
    border-top: 1px solid #433e3e;
  }

}