/* ============================================================
   语音朗读条 —— 配合 assets/js/article-reader.js
   类名必须与 JS 里写死的一致：
   .reader-bar / __btn / __btn--play / __ico / __txt / __sel / __pos
   以及正文段落的 .is-reading
   ============================================================ */

.reader-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  margin-bottom: 26px;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 12px;
  background: rgba(8, 12, 22, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px -12px rgba(0, 0, 0, .8);
}

.reader-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, .3);
  background: rgba(34, 211, 238, .1);
  color: #22d3ee;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.reader-bar__btn:hover { background: rgba(34, 211, 238, .2); border-color: #22d3ee; }
.reader-bar__btn:active { transform: translateY(1px); }
.reader-bar__btn:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }

.reader-bar__btn--play {
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  border-color: transparent;
  color: #05070d;
  font-weight: 600;
}
.reader-bar__btn--play:hover { filter: brightness(1.1); background: linear-gradient(135deg, #22d3ee, #a78bfa); }
.reader-bar__ico { font-size: 13px; line-height: 1; }

.reader-bar__sel {
  display: inline-flex;
  align-items: center;
}
.reader-bar__sel select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, .24);
  background: #0a0e1a;
  color: #e6edf7;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}
.reader-bar__sel select:focus { outline: none; border-color: #22d3ee; }

.reader-bar__pos {
  margin-left: auto;
  font-family: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", monospace;
  font-size: 12.5px;
  color: var(--muted, #8b97ad);
  white-space: nowrap;
}

/* 正在朗读的段落 */
#main .is-reading {
  background: rgba(34, 211, 238, .12);
  box-shadow: inset 3px 0 0 #22d3ee;
  border-radius: 3px;
  padding-left: 12px;
  margin-left: -12px;
  transition: background .2s, box-shadow .2s;
}

/* 不支持 Web Speech API 时给出说明 */
.reader-bar--unsupported {
  border-color: rgba(251, 191, 36, .4);
  background: rgba(251, 191, 36, .08);
}
.reader-bar--unsupported .reader-bar__btn { opacity: .45; cursor: not-allowed; }

@media (max-width: 560px) {
  .reader-bar { padding: 10px 12px; gap: 8px; }
  .reader-bar__pos { margin-left: 0; width: 100%; }
  .reader-bar__btn { padding: 6px 12px; font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  #main .is-reading { transition: none; }
}
