/* ld_ipa_blocks.css — 音标分块按钮样式（拟落 backend/hotfix/ld_ipa_blocks.css）
   只使用 ld-ipa- 前缀类名，不覆盖既有 .word-ipa/.word-en 的视觉变量。
   三种块样式严格区分：
   可播放 button（默认） / 未过审静态 --static / 静音字母 --silent */

.ld-ipa-blocks {
  display: block;
  text-align: center;
  line-height: 1.4;
}

/* 整组 IPA 只加最外层一对斜杠：伪元素不可点击、不进入 DOM/复制文本。
   与 inline-flex 块同处一个行内格式上下文，换行时斜杠仍留在整组首尾。 */
.ld-ipa-blocks[data-label-mode="ipa"]::before,
.ld-ipa-blocks[data-label-mode="ipa"]::after {
  display: inline-block;
  vertical-align: middle;
  color: #2a7fae;
  font-family: "Doulos SIL", "Charis SIL", Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 30px;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.ld-ipa-blocks[data-label-mode="ipa"]::before { content: "/"; margin: 0 6px 0 2px; }
.ld-ipa-blocks[data-label-mode="ipa"]::after { content: "/"; margin: 0 2px 0 6px; }
.ld-ipa-blocks[data-label-mode="letters"]::before,
.ld-ipa-blocks[data-label-mode="letters"]::after { content: none; }

/* 英文单词字母 spans：由 JS 逐字母生成，不插入额外空格。
   white-space:pre 保证 q.en 原文（含可能的空格/连字符）不被改动。 */
.ld-ipa-letters { white-space: pre; }
.ld-ipa-letter { transition: color .12s ease, background-color .12s ease; border-radius: 4px; }
.ld-ipa-letter.is-active { color: #d4552a; background: rgba(255, 168, 116, .30); }

.ld-ipa-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  padding: 3px 8px;
  border-radius: 9px;
  border: 1px solid #b9d6e6;
  background: #eef7fc;
  color: #2a7fae;
  font-family: "Doulos SIL", "Charis SIL", Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  margin: 3px;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
button.ld-ipa-block { cursor: pointer; }
button.ld-ipa-block:active { transform: translateY(1px); }
.ld-ipa-block.is-active { border-color: #ff8a4c; background: #fff3e6; color: #d4552a; }
.ld-ipa-block.is-playing { box-shadow: 0 0 0 3px rgba(255, 138, 76, .22); }

/* 未过审/无音频：静态 IPA 文本，不发声、无按钮语义。灰蓝色、实线框。 */
.ld-ipa-block--static {
  border-color: #dde6ee;
  background: #f5f8fb;
  color: #8296a6;
  cursor: default;
}
.ld-ipa-block--static.is-audio-dead { border-style: dotted; }

/* 静音字母（magic e、listen 的 t 等）：只看不读。
   与未过审静态严格区分：浅灰底 + 灰色虚线框 + 斜体 + “静音”角标。 */
.ld-ipa-block--silent {
  border: 1px dashed #c9cfd6;
  background: #eceff1;
  color: #9aa5ad;
  font-style: italic;
  cursor: default;
  position: relative;
  padding-right: 8px;
}
.ld-ipa-block--silent::after {
  content: "静音";
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-style: normal;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  color: #a9b3ba;
  margin-left: 3px;
}
.ld-ipa-block--silent .ld-ipa-block__label { text-decoration: none; }

/* letters 模式：用系统字体显示字母组合，避免音标字体缺字形 */
.ld-ipa-blocks[data-label-mode="letters"] .ld-ipa-block__label {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-style: normal;
  letter-spacing: 0;
}

@media (max-width: 360px) {
  .ld-ipa-block { min-width: 30px; min-height: 28px; font-size: 14px; padding: 2px 6px; margin: 2px; }
  .ld-ipa-blocks[data-label-mode="ipa"]::before { margin-right: 4px; }
  .ld-ipa-blocks[data-label-mode="ipa"]::after { margin-left: 4px; }
}


/* 主页面字母/音标切换：只改显示，不改 q.en、targetIpa 或音频映射 */
.ld-ipa-mode-toggle{display:block;margin:6px auto 0;padding:4px 12px;min-height:30px;border:1px solid rgba(124,108,240,.30);border-radius:15px;background:#fff;color:#6554c0;font-size:12px;font-weight:600;line-height:20px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ld-ipa-mode-toggle:active{background:#f0edff}
button.ld-ipa-block--static,button.ld-ipa-block--static:disabled{cursor:default;opacity:.72}
