/* CME AI Writer TTS Reader v10.62A */
.cme-tts-reader {
  position: fixed;
  right: 18px;
  bottom: 96px;
  z-index: 2147483000;
  width: min(330px, calc(100vw - 28px));
  box-sizing: border-box;
  padding: 10px 12px 10px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .18);
  backdrop-filter: blur(10px);
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
.cme-tts-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.cme-tts-title-button {
  appearance:none;
  border:0 !important;
  background:transparent !important;
  color:#334155 !important;
  padding:0 !important;
  border-radius:8px !important;
  font-size:13px !important;
  font-weight:850 !important;
  line-height:1.2 !important;
  cursor:pointer;
}
.cme-tts-minimize {
  min-width:34px;
  height:28px;
  padding:0 9px !important;
}
.cme-tts-body {
  display:block;
}
.cme-tts-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cme-tts-row + .cme-tts-row {
  margin-top: 8px;
}
.cme-tts-reader button {
  appearance: none;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
}
.cme-tts-reader button:hover:not(:disabled) {
  background: #f8fafc;
}
.cme-tts-reader button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.cme-tts-reader .cme-tts-start {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.cme-tts-reader .cme-tts-start:hover:not(:disabled) {
  background: #15803d;
}
.cme-tts-small {
  font-size: 12px;
  color: #64748b;
  justify-content: space-between;
}
.cme-tts-reader select {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #fff;
  color: #0f172a;
}
.cme-tts-status {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* v10.61B：缩小后只占一个小胶囊，不再遮挡文章底部浮动栏。 */
.cme-tts-reader.is-collapsed {
  width: auto;
  max-width: calc(100vw - 28px);
  padding: 7px 9px;
  border-radius: 999px;
  bottom: 88px;
}
.cme-tts-reader.is-collapsed .cme-tts-head {
  margin-bottom:0;
}
.cme-tts-reader.is-collapsed .cme-tts-body {
  display:none;
}
.cme-tts-reader.is-collapsed .cme-tts-title-button {
  padding: 3px 2px !important;
}
.cme-tts-reader.is-collapsed .cme-tts-minimize {
  height:26px;
}

@media (max-width: 640px) {
  .cme-tts-reader {
    right: 10px;
    bottom: 92px;
    width: min(330px, calc(100vw - 20px));
    border-radius: 16px;
  }
  .cme-tts-reader.is-collapsed {
    right: 10px;
    bottom: 88px;
    width: auto;
  }
}
@media print {
  .cme-tts-reader { display: none !important; }
}


/* v10.61G：手机、iPad 和电脑文章页都把朗读入口合并到底部工具栏。 */
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
  min-width: 44px;
  height: 44px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.on {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.is-paused {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.cme-tts-reader.is-article-docked {
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  max-height: min(60vh, 420px);
  overflow: auto;
}
.cme-tts-reader.is-article-docked.is-collapsed {
  display: none !important;
}

/* 手机文章页进一步压缩统一底栏。 */
@media (max-width: 760px) {
  html.cme-article-unified-mobile-dock .floatbar,
  body.cme-article-unified-mobile-dock .floatbar {
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
  html.cme-article-unified-mobile-dock .floatbar-inner.cme-unified-article-dock,
  body.cme-article-unified-mobile-dock .floatbar-inner.cme-unified-article-dock {
    width: calc(100% - 16px);
    max-width: 620px;
    padding: 7px 8px;
    gap: 4px;
  }
  .floatbar-inner.cme-unified-article-dock .float-left {
    min-width: 30px;
    gap: 4px;
  }
  .floatbar-inner.cme-unified-article-dock .float-logo {
    width: 30px;
    height: 30px;
    border-radius: 999px;
  }
  .floatbar-inner.cme-unified-article-dock .float-actions {
    min-width: 0;
    gap: 4px;
    justify-content: space-evenly;
  }
  .floatbar-inner.cme-unified-article-dock .float-right:empty {
    display: none !important;
  }
  .floatbar-inner.cme-unified-article-dock .symbtn {
    min-width: 40px;
    height: 40px;
    padding: 7px 8px;
    gap: 4px;
    flex: 0 1 auto;
    box-sizing: border-box;
  }
  .floatbar-inner.cme-unified-article-dock .symbtn svg {
    width: 19px;
    height: 19px;
  }
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.on {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
  }
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.is-paused {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
  }
  .cme-tts-reader.is-article-docked {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    width: min(330px, calc(100vw - 20px));
    max-height: min(50vh, 340px);
    overflow: auto;
  }
  .cme-tts-reader.is-article-docked.is-collapsed {
    display: none !important;
  }
  html.cme-article-unified-mobile-dock .bottom-safe-space,
  body.cme-article-unified-mobile-dock .bottom-safe-space {
    height: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 390px) {
  .floatbar-inner.cme-unified-article-dock .symbtn {
    min-width: 37px;
    height: 38px;
    padding: 6px 7px;
  }
  .floatbar-inner.cme-unified-article-dock .symcount {
    font-size: 12px;
  }
}

/* v10.61G：底部工具栏显示明确的“朗读/暂停/继续”文字，触控后直接启动或控制朗读。 */
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
  gap: 5px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-label {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.is-unsupported {
  opacity: .62;
  background: #f8fafc;
  color: #64748b;
}
.cme-tts-reader .cme-tts-status {
  min-width: 88px;
}
.cme-tts-reader[aria-busy="true"] {
  cursor: progress;
}
@media (max-width: 430px) {
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
    min-width: 48px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-label {
    font-size: 11px;
  }
}
@media (max-width: 350px) {
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
    min-width: 38px;
  }
}


/* v10.61G：朗读期间通过 Screen Wake Lock 保持屏幕常亮。 */
.cme-tts-wake-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.cme-tts-wake-status[data-state="active"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.cme-tts-wake-status[data-state="pending"] {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}
.cme-tts-wake-status[data-state="error"],
.cme-tts-wake-status[data-state="unsupported"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.cme-tts-wake-status[data-state="idle"] {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}
@media (max-width: 760px) {
  .cme-tts-reader .cme-tts-small {
    align-items: center;
    justify-content: flex-start;
  }
  .cme-tts-status {
    max-width: 100%;
    flex: 1 1 130px;
  }
}


/* v10.62B：朗读按钮图案与 CME 标识等高；与点赞计数及 PWA 返回按钮统一尺寸。 */
.floatbar-inner.cme-unified-article-dock .symbtn,
.floatbar-inner.cme-unified-article-dock .cme-article-pwa-back-button {
  min-width:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  flex:0 0 auto !important;
  box-sizing:border-box !important;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
  width:auto !important;
  min-width:0 !important;
  height:34px !important;
  padding:0 !important;
  gap:0 !important;
  border:0 !important;
  background:transparent !important;
  color:inherit !important;
  box-shadow:none !important;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button .cme-tts-dock-art {
  width:auto;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button .cme-article-toolbar-art {
  width:auto !important;
  height:var(--cme-dock-art-height,28px) !important;
  max-width:74px !important;
  display:block;
  object-fit:contain;
  pointer-events:none;
  transition:transform .16s ease, filter .16s ease, opacity .16s ease;
  filter:drop-shadow(0 4px 8px rgba(37,99,235,.12));
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-label { display:none !important; }
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button:hover .cme-article-toolbar-art {
  transform:translateY(-1px) scale(1.018);
  filter:drop-shadow(0 6px 10px rgba(37,99,235,.20));
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button:active .cme-article-toolbar-art { transform:scale(.965); }
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.on,
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.is-paused {
  background:transparent !important;
  border-color:transparent !important;
  color:inherit !important;
}
.floatbar-inner.cme-unified-article-dock .cme-tts-dock-button.is-unsupported .cme-article-toolbar-art {
  opacity:.48;
  filter:grayscale(.25) drop-shadow(0 4px 7px rgba(100,116,139,.12));
}
@media (max-width:760px) {
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
    width:auto !important;
    height:36px !important;
  }
}
@media (max-width:390px) {
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button {
    height:34px !important;
  }
  .floatbar-inner.cme-unified-article-dock .cme-tts-dock-button .cme-article-toolbar-art {
    max-width:64px !important;
  }
}
