/* 英语绘本 · 伴读页样式（Read Along 风：浅色绘本底 + 大封面 + 全屏阅读器）
   页面强制 data-theme="light"，并覆盖 style.css 里写死深色的 .header */

.rb-page {
  background: linear-gradient(180deg, #eef3ff 0%, #f9fbff 240px, #ffffff 100%);
  background-attachment: fixed;
  color: #16204a;
  user-select: text;
}

/* ══════════════ 顶栏 ══════════════ */
.rb-header {
  background: rgba(255, 255, 255, 0.82) !important;
  border-bottom: 1px solid rgba(22, 32, 74, 0.07);
  backdrop-filter: blur(14px);
}
.rb-brand-title {
  background: none !important;
  -webkit-text-fill-color: #16204a !important;
  color: #16204a !important;
}
.rb-header .home-pill {
  background: #fff;
  border-color: rgba(22, 32, 74, 0.1);
  color: #4a5578;
}
.rb-header .brand-icon {
  border-radius: 12px;
}

.rb-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

/* ══════════════ 故事墙 ══════════════ */
.rb-hero { padding: 14px 4px 20px; }
.rb-hero-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #16204a;
}
.rb-hero-sub {
  margin-top: 6px;
  font-size: 15px;
  color: #6b7699;
}

/* 继续阅读 */
.rb-continue {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 22px;
  background: #fff;
  border: 1px solid rgba(22, 32, 74, 0.06);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(30, 50, 120, 0.09);
}
.rb-continue-cover {
  width: 108px;
  height: 80px;
  object-fit: cover;
  border-radius: 14px;
  background: #eef2fb;
  flex: none;
}
.rb-continue-body { flex: 1; min-width: 0; }
.rb-continue-label {
  font-size: 12px;
  font-weight: 800;
  color: #9aa4c2;
  letter-spacing: 0.4px;
}
.rb-continue-title {
  display: block;
  margin: 2px 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #16204a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rb-progress {
  height: 7px;
  border-radius: 99px;
  background: #e8edf9;
  overflow: hidden;
  max-width: 320px;
}
.rb-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #4285f4, #7baaf7);
  transition: width 0.3s ease;
}
.rb-continue-meta {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: #8b95b5;
}
.rb-continue-go {
  flex: none;
  padding: 12px 22px;
  border: none;
  border-radius: 99px;
  background: #16204a;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.rb-continue-go:hover { background: #1a73e8; transform: translateY(-2px); }

/* 等级标签 */
.rb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}
.rb-tab {
  padding: 9px 17px;
  border: 1.5px solid rgba(22, 32, 74, 0.1);
  border-radius: 99px;
  background: #fff;
  color: #55608a;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-tab:hover { border-color: #4285f4; color: #1a73e8; }
.rb-tab.active {
  background: #16204a;
  border-color: #16204a;
  color: #fff;
}
.rb-tab small {
  margin-left: 5px;
  font-weight: 700;
  opacity: 0.55;
  font-size: 12px;
}

/* 搜索 */
.rb-search {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  max-width: 460px;
}
.rb-search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  border: 1.5px solid rgba(22, 32, 74, 0.1);
  border-radius: 99px;
  background: #fff;
  color: #16204a;
  font-size: 15px;
  font-family: inherit;
}
.rb-search-input::placeholder { color: #a7b0cb; }
.rb-search-input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.13);
}
.rb-search-btn {
  padding: 0 20px;
  border: none;
  border-radius: 99px;
  background: #eef3ff;
  color: #1a56b8;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.rb-status {
  margin: 4px 2px 16px;
  font-size: 13px;
  color: #8b95b5;
  min-height: 18px;
}

/* 封面网格 */
.rb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 20px;
}
.rb-card {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(30, 50, 120, 0.09);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.rb-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 34px rgba(30, 50, 120, 0.17);
}
.rb-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2fb;
}
.rb-card-scrim {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 12px;
  background: linear-gradient(180deg, rgba(10, 16, 40, 0) 0%, rgba(10, 16, 40, 0.72) 62%, rgba(10, 16, 40, 0.88) 100%);
  color: #fff;
}
.rb-card-title {
  display: block;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.rb-card-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  opacity: 0.82;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rb-card-lv {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.92);
  color: #16204a;
  font-size: 11.5px;
  font-weight: 900;
}
.rb-card-go {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 13px;
  border-radius: 99px;
  background: #1a73e8;
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.18s ease;
}
.rb-card:hover .rb-card-go { opacity: 1; transform: translateY(0); }

.rb-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}
.rb-more-btn {
  padding: 13px 30px;
  border: 1.5px solid rgba(22, 32, 74, 0.12);
  border-radius: 99px;
  background: #fff;
  color: #16204a;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-more-btn:hover { border-color: #4285f4; color: #1a73e8; }
.rb-more-label { font-size: 13px; color: #97a1bd; }

/* ══════════════ 阅读器 ══════════════ */
.rb-story {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 150px);
}
.rb-story-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.rb-story-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.rb-story-title b {
  font-size: 19px;
  font-weight: 900;
  color: #16204a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rb-story-title-zh {
  font-size: 13px;
  color: #97a1bd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rb-chip {
  flex: none;
  padding: 9px 17px;
  border: 1.5px solid rgba(22, 32, 74, 0.1);
  border-radius: 99px;
  background: #fff;
  color: #55608a;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-chip:hover { border-color: #4285f4; color: #1a73e8; }

/* 中文翻译开关：做成一盏灯，关灯=灰，开灯=暖黄发光 */
.rb-lamp {
  flex: none;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1.5px solid rgba(22, 32, 74, 0.1);
  border-radius: 50%;
  background: #fff;
  color: #97a0b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-lamp:hover { border-color: #f0a820; color: #c98a12; }
.rb-lamp-rays { opacity: 0; transition: opacity 0.15s ease; }
.rb-lamp.on {
  background: #fff6e0;
  border-color: rgba(240, 168, 32, 0.5);
  color: #b4790c;
  box-shadow: 0 0 0 4px rgba(255, 190, 60, 0.16), 0 2px 10px rgba(240, 168, 32, 0.26);
}
.rb-lamp.on .rb-lamp-rays { opacity: 1; }

.rb-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 4px 0 8px;
}
.rb-art {
  width: 100%;
  max-width: 760px;
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(22, 32, 74, 0.06);
  box-shadow: 0 18px 46px rgba(30, 50, 120, 0.14);
}
.rb-art img {
  display: block;
  width: 100%;
  max-height: 52vh;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f4f7ff;
}

/* 正文：整页居中，逐句成行，当前句点亮 */
.rb-text {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.rb-sline {
  font-size: clamp(21px, 3.1vw, 30px);
  font-weight: 800;
  line-height: 1.62;
  letter-spacing: -0.2px;
  color: #7b849f;
  cursor: pointer;
  transition: color 0.2s ease;
}
.rb-sline:hover { color: #4a5578; }
.rb-sline.active { color: #16204a; }
.rb-sline.finished { color: #55608a; }
.rb-sline.no-audio { cursor: default; opacity: 0.6; }

.rb-w {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 1px;
  border-radius: 9px;
  transition: background 0.12s linear, color 0.12s linear;
}
.rb-w.read { background: rgba(66, 133, 244, 0.1); color: #1a56b8; }
.rb-w.on {
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
}

.rb-page-zh {
  width: 100%;
  max-width: 640px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #fff8e8;
  border: 1px solid #f6e2b0;
  color: #6b5a2c;
  font-size: 14.5px;
  line-height: 1.8;
  text-align: left;
}

/* 底部控制条 */
.rb-bar {
  position: sticky;
  bottom: 0;
  margin-top: 18px;
  padding: 12px 0 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 42%);
}
.rb-bar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.rb-nav {
  min-width: 88px;
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid rgba(22, 32, 74, 0.12);
  border-radius: 99px;
  background: #fff;
  color: #16204a;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-nav:hover:not(:disabled) { border-color: #4285f4; color: #1a73e8; }
.rb-nav:disabled { opacity: 0.32; cursor: not-allowed; }
.rb-fab {
  width: 76px;
  height: 76px;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 27px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
}
.rb-fab:hover { transform: scale(1.05); }
.rb-fab.playing { background: #16204a; padding-left: 0; }
.rb-bar-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}
.rb-page-num {
  font-size: 13.5px;
  font-weight: 800;
  color: #8b95b5;
  letter-spacing: 0.3px;
}
/* 「自动读」胶囊开关 */
.rb-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7699;
  cursor: pointer;
  user-select: none;
}
.rb-switch input { display: none; }
.rb-switch i {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #d7deee;
  transition: background 0.18s ease;
  flex: none;
}
.rb-switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 32, 74, 0.25);
  transition: transform 0.18s ease;
}
.rb-switch input:checked ~ i { background: #1a73e8; }
.rb-switch input:checked ~ i::after { transform: translateX(16px); }
.rb-switch input:checked ~ span { color: #1a56b8; }

/* ══════════════ 窄屏 ══════════════ */
@media (max-width: 720px) {
  .rb-main { padding: 14px 13px 40px; }
  .rb-hero-title { font-size: 24px; }
  .rb-hero { padding: 6px 2px 14px; }
  .rb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 13px; }
  .rb-card { border-radius: 16px; }
  .rb-card-title { font-size: 14.5px; }
  .rb-card-go { display: none; }
  .rb-continue { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .rb-continue-cover { width: 84px; height: 62px; }
  .rb-continue-go { flex: 1 1 100%; }
  .rb-story { min-height: calc(100vh - 130px); }
  .rb-art { border-radius: 20px; }
  .rb-art img { max-height: 38vh; }
  .rb-text { gap: 8px; }
  .rb-sline { font-size: 20px; line-height: 1.7; }
  .rb-fab { width: 66px; height: 66px; font-size: 24px; }
  .rb-nav { min-width: 74px; height: 40px; padding: 0 12px; font-size: 14px; }
  .rb-bar-row { gap: 12px; }
  .rb-bar { background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 55%); }
  .rb-story-title b { font-size: 16px; }
  .rb-story-title-zh { display: none; }
}

/* ══════════════ 伴读小助手（小雅 Diya） ══════════════ */
.rb-buddy {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

/* 气泡提示 */
.rb-buddy-bubble-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.rb-buddy-bubble {
  position: absolute;
  bottom: 8px;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #dce4f7;
  color: #1a2752;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  padding: 8px 15px;
  border-radius: 18px;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(22, 32, 74, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 20;
}
.rb-buddy-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 50px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-right: 1.5px solid #dce4f7;
  border-bottom: 1.5px solid #dce4f7;
  transform: rotate(45deg);
}
.rb-buddy.show-bubble .rb-buddy-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 卡片主体 */
.rb-buddy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 最小化按钮 */
.rb-buddy-min {
  position: absolute;
  top: 4px;
  right: 0px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(22, 32, 74, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: #7b85a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease, background 0.15s ease;
  backdrop-filter: blur(8px);
}
.rb-buddy:hover .rb-buddy-min {
  opacity: 1;
}
.rb-buddy-min:hover {
  background: #1a73e8;
  color: #fff;
  transform: scale(1.1);
}

/* 头像按钮 */
.rb-buddy-avatar {
  background: none;
  border: none;
  padding: 0;
  width: 116px;
  height: 124px;
  cursor: pointer;
  filter: drop-shadow(0 10px 22px rgba(30, 50, 120, 0.15));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}
.rb-buddy-avatar:hover {
  transform: scale(1.06);
}
.rb-buddy-avatar:active {
  transform: scale(0.96);
}

/* 名字与状态胶囊 */
.rb-buddy-badge {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(22, 32, 74, 0.08);
  box-shadow: 0 4px 12px rgba(22, 32, 74, 0.08);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.rb-buddy-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34a853;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.rb-buddy-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #2e3856;
  letter-spacing: 0.2px;
}

/* 最小化形态 */
.rb-buddy.is-minimized .rb-buddy-avatar {
  transform: scale(0.55);
}
.rb-buddy.is-minimized .rb-buddy-min {
  opacity: 1;
  top: -4px;
  right: -4px;
}
.rb-buddy.is-minimized .rb-buddy-badge {
  display: none;
}
.rb-buddy.is-minimized .rb-buddy-bubble-wrap {
  display: none;
}

/* ══════════════ 动画与微表情 ══════════════ */
.rb-buddy-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.rb-head-group {
  transform-box: fill-box;
  transform-origin: 50% 88%;
  transition: transform 0.3s ease;
}
.rb-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: rbBlink 3.8s infinite;
}
@keyframes rbBlink {
  0%, 93%, 97.5%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.06); }
}

/* 呆毛轻晃 */
.rb-ahoge {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: rbAhogeSway 3.2s infinite ease-in-out;
}
@keyframes rbAhogeSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

.rb-mouth-closed {
  opacity: 1;
  transition: opacity 0.12s ease;
}
.rb-mouth-open-group {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 20%;
  transition: opacity 0.12s ease;
}

/* 说话状态：嘴巴温和轻慢张合、头柔和微倾、呆毛微晃、跳动音符与音波 */
.rb-buddy.is-speaking .rb-head-group {
  animation: rbHeadTalk 1.2s infinite alternate ease-in-out;
}
.rb-buddy.is-speaking .rb-mouth-closed {
  opacity: 0;
}
.rb-buddy.is-speaking .rb-mouth-open-group {
  opacity: 1;
  /* 慢速、温和、轻柔的说话张合（0.52s 周期，杜绝抽搐与夸张拉伸） */
  animation: rbMouthTalk 0.52s infinite ease-in-out;
}
.rb-buddy.is-speaking .rb-tongue {
  animation: rbTongueTalk 0.52s infinite ease-in-out;
}
.rb-buddy.is-speaking .rb-ahoge {
  animation: rbAhogeSway 1.1s infinite ease-in-out;
}
.rb-buddy.is-speaking .rb-audio-waves {
  opacity: 1;
}
.rb-buddy.is-speaking .rb-buddy-status-dot {
  background: #ff5277;
  box-shadow: 0 0 0 4px rgba(255, 82, 119, 0.25);
  animation: rbDotPulse 0.9s infinite alternate ease;
}

@keyframes rbDotPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* 柔和轻缓的头部摆动，像认真讲绘本 */
@keyframes rbHeadTalk {
  0% { transform: rotate(-1.2deg) translateY(0); }
  100% { transform: rotate(1.2deg) translateY(-1.6px); }
}

/* 温和自然、慢速的小口型张合（幅度适中、平滑轻软，不夸张） */
@keyframes rbMouthTalk {
  0% {
    transform: scale(0.94, 0.45);
  }
  24% {
    transform: scale(1.02, 0.88);
  }
  48% {
    transform: scale(0.96, 0.60);
  }
  72% {
    transform: scale(1.03, 0.82);
  }
  100% {
    transform: scale(0.94, 0.45);
  }
}

@keyframes rbTongueTalk {
  0%, 100% { transform: translateY(0.8px); }
  45% { transform: translateY(-1.2px) scale(1.03); }
}

/* 伴读小音符与音波动效 */
.rb-audio-waves {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.rb-note {
  animation: rbNoteFloat 1.4s infinite ease-in-out;
}
.rb-note-2 {
  animation-delay: 0.6s;
}
@keyframes rbNoteFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  50% { transform: translateY(-3.5px) rotate(6deg); opacity: 1; }
}
.rb-wave-bar {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: rbWave 0.6s infinite alternate ease-in-out;
}
.rb-wave-bar:nth-child(2) { animation-delay: 0.18s; }
.rb-wave-bar:nth-child(3) { animation-delay: 0.36s; }

@keyframes rbWave {
  0% { transform: scaleY(0.35); opacity: 0.4; }
  100% { transform: scaleY(1.08); opacity: 1; }
}

/* 欢呼庆祝 */
.rb-buddy.is-cheering .rb-buddy-avatar {
  animation: rbCheer 0.65s 2 ease;
}
@keyframes rbCheer {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.12) rotate(4deg); }
}

/* 移动端适配 */
@media (max-width: 720px) {
  .rb-buddy {
    right: 12px;
    bottom: 92px;
  }
  .rb-buddy-avatar {
    width: 86px;
    height: 92px;
  }
  .rb-buddy-bubble {
    right: 0;
    font-size: 12px;
    padding: 6px 11px;
    border-radius: 14px;
    max-width: 220px;
    white-space: normal;
  }
  .rb-buddy-bubble::after {
    right: 36px;
  }
  .rb-buddy-badge {
    padding: 3px 9px;
  }
  .rb-buddy-name {
    font-size: 10.5px;
  }
  .rb-buddy-min {
    opacity: 0.8;
  }
}

/* ══════════════ 阅读星星奖励 (Read Along 星星徽章) ══════════════ */
.rb-star-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 99px;
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  color: #b78103;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.rb-star-pill.bump {
  animation: rbStarBump 0.4s ease;
}
@keyframes rbStarBump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
.rb-star-icon {
  font-size: 14px;
  line-height: 1;
}

/* 语速切换按钮 */
.rb-speed-btn {
  padding: 3px 11px;
  border: 1.5px solid rgba(22, 32, 74, 0.12);
  border-radius: 99px;
  background: #fff;
  color: #4a5578;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-speed-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
}
.rb-speed-btn.slow {
  background: #e8f0fe;
  border-color: #1a73e8;
  color: #1a73e8;
}

/* 单词互动悬浮态（点词发音跟读） */
.rb-w {
  cursor: pointer;
  border-radius: 6px;
}
.rb-w:hover:not(.on) {
  background: rgba(66, 133, 244, 0.14);
  color: #1a56b8;
}

/* 飞星飘启动画 */
.rb-flying-star {
  position: fixed;
  z-index: 100;
  font-size: 20px;
  font-weight: 900;
  color: #f59e0b;
  pointer-events: none;
  animation: rbFlyStar 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  text-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
@keyframes rbFlyStar {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  25% { opacity: 1; transform: translateY(-16px) scale(1.25); }
  100% { opacity: 0; transform: translateY(-54px) scale(1); }
}


