/* ============================================================
   Clause Player & Timeline Progress Bar Styles
   (分句精读、整句连续播放与带锚点进度条通用样式组件)
   ============================================================ */

:root {
  --cp-brand: #0891b2;
  --cp-brand-dark: #155e75;
  --cp-brand-soft: #cffafe;
  --cp-gold: #d97706;
  --cp-gold-soft: #fef3c7;
  --cp-active-bg: #fef08a;
  --cp-active-border: #eab308;
  --cp-active-text: #713f12;
  --cp-ink: #1e293b;
  --cp-muted: #64748b;
  --cp-border: #e2e8f0;
  --cp-card-bg: #ffffff;
  --cp-radius-lg: 18px;
  --cp-radius-md: 12px;
}

/* 模式切换工具栏 (Mode Switcher) */
.clause-mode-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px 6px;
  border-radius: 22px;
  margin: 6px auto 10px;
  width: fit-content;
  max-width: 100%;
  border: 1.5px solid #e2e8f0;
}

.clause-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--cp-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.clause-mode-btn.active {
  background: #ffffff;
  color: var(--cp-brand-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.clause-mode-btn:active {
  transform: scale(0.96);
}

/* 分句展示区 (Clause Flow Wrap) */
.clause-pills-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.clause-pills-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--cp-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.clause-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
}

.clause-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 18px;
  font-weight: 800;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #bae6fd;
  color: var(--cp-ink);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
  user-select: none;
  -webkit-user-select: none;
}

.clause-pill:hover {
  border-color: var(--cp-brand);
  background: #f0fdf4;
  transform: translateY(-1px);
}

.clause-pill.active {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  border-color: var(--cp-active-border);
  color: var(--cp-active-text);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(234, 179, 8, 0.35);
}

.clause-pill .pill-speaker-ico {
  font-size: 13px;
  margin-left: 5px;
  opacity: 0.6;
}

.clause-pill.active .pill-speaker-ico {
  opacity: 1;
  animation: cpSpeakerBounce 0.8s infinite alternate;
}

@keyframes cpSpeakerBounce {
  from { transform: scale(1); }
  to { transform: scale(1.25); }
}

/* 当前精读分句聚焦卡片 (Active Clause Focus Card) */
.clause-focus-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffdf5 100%);
  border: 2px solid #fde047;
  border-radius: var(--cp-radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.15);
  width: 100%;
  margin-top: 6px;
  text-align: center;
  transition: all 0.2s ease;
}

.clause-focus-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--cp-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.clause-focus-py {
  font-size: 15px;
  font-weight: 800;
  color: var(--cp-brand-dark);
  min-height: 20px;
}

.clause-focus-zh {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.4;
}

.clause-focus-trans {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.clause-focus-en {
  font-size: 12px;
  color: var(--cp-muted);
}

.clause-focus-jp {
  font-size: 12px;
  color: #7c3aed;
}

.clause-focus-ko {
  font-size: 12px;
  color: #059669;
}

/* 音频进度条与播放控制器 (Scrub Bar & Player Controls) */
.clause-player-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--cp-radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.clause-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--cp-muted);
}

.clause-status-txt {
  color: var(--cp-brand-dark);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.clause-timer-display {
  color: #475569;
  font-weight: 800;
}

/* 进度条轨道 (Scrub Track with Anchor Ticks) */
.clause-scrub-container {
  position: relative;
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.clause-scrub-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  position: relative;
  overflow: visible;
}

.clause-scrub-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #0891b2);
  border-radius: 999px;
  width: 0%;
  transition: width 0.05s linear;
}

.clause-scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 3px solid #0891b2;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: grab;
  transition: left 0.05s linear;
  z-index: 10;
}

.clause-scrub-thumb:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.18);
}

/* 分句吸附锚点 (Clause Markers / Ticks) */
.clause-tick-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #f59e0b;
  z-index: 5;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clause-tick-mark:hover {
  transform: translate(-50%, -50%) scale(1.5);
  background: #fef08a;
  border-color: #b45309;
}

.clause-tick-mark.passed {
  border-color: #0284c7;
  background: #bae6fd;
}

/* 控制按钮栏 (Player Buttons Row) */
.clause-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.clause-ctrl-left,
.clause-ctrl-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #bae6fd;
  background: #ffffff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
  transition: transform 0.08s, background 0.15s;
  color: var(--cp-ink);
}

.cp-icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.cp-icon-btn.primary {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-color: #0284c7;
  font-size: 20px;
  box-shadow: 0 4px 0 #075985;
}

.cp-tag-btn {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: var(--cp-ink);
  transition: all 0.15s;
  white-space: nowrap;
}

.cp-tag-btn:hover {
  background: #f1f5f9;
}

.cp-tag-btn.active-loop {
  background: #fef08a;
  border-color: #f59e0b;
  color: #78350f;
  box-shadow: 0 0 0 2.5px rgba(245, 158, 11, 0.35);
}

/* 全文阅读页分句高亮 (Full Text Clause Enhancement) */
.full-clause-item {
  display: inline;
  padding: 1px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.full-clause-item:hover {
  background: #e0f2fe;
}

.full-clause-item.playing-clause {
  background: #fde047;
  color: #713f12;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.4);
}

/* 移动端窄屏适配 */
@media (max-width: 480px) {
  .clause-mode-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
  .clause-pill {
    font-size: 16px;
    padding: 5px 9px;
  }
  .clause-focus-zh {
    font-size: 21px;
  }
  .clause-focus-py {
    font-size: 14px;
  }
  .clause-player-box {
    padding: 10px 12px;
  }
  .cp-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .cp-icon-btn.primary {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .cp-tag-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}
