/* 阅灵 · 英语阅读层（中英切换 MVP） */

.reader-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.reader-lang-switch[hidden] {
  display: none !important;
}

.reader-lang-switch--dock .reader-lang-switch-icon {
  font-size: 11px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.reader-lang-switch.is-en {
  color: #1b6b4a;
}

.reader-overlay.reader-lang-en .reader-page-inner {
  font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
}

.reader-para--en {
  margin-bottom: 0.35em;
}

.reader-para-trans-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 5px;
  border: none;
  border-radius: 6px;
  background: rgba(74, 144, 226, 0.12);
  color: #2f6fed;
  vertical-align: middle;
  cursor: pointer;
  transform: translateY(-1px);
  flex-shrink: 0;
}

.reader-para-trans-glyph {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.reader-para-trans-btn.active {
  background: rgba(74, 144, 226, 0.22);
}

.reader-para-trans-btn.loading {
  pointer-events: none;
  opacity: 0.55;
}

.reader-para-cn {
  font-size: 13px;
  line-height: 1.7;
  color: #6b6b70;
  margin: 0.15em 0 0.9em;
  padding: 10px 12px;
  background: rgba(245, 235, 220, 0.55);
  border-radius: 8px;
}

.reader-overlay.theme-night .reader-para-cn,
.reader-settings.theme-paper-dark ~ * .reader-para-cn {
  background: rgba(255, 255, 255, 0.08);
  color: #aeaeb2;
}

.reader-para-cn--loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.reader-en-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f6fed;
  animation: readerEnPulse 0.9s ease-in-out infinite;
}

@keyframes readerEnPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

.reader-word {
  cursor: pointer;
  padding: 0 1px;
  border-radius: 2px;
  transition: background 0.15s;
}

.reader-word--gloss {
  border-bottom: 1px dashed rgba(52, 168, 120, 0.55);
}

.reader-word:hover,
.reader-word.tapped {
  background: rgba(245, 235, 220, 0.75);
}

.reader-figure {
  margin: 16px 0 20px;
  text-align: center;
}

.reader-figure img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 52vh;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.12);
  display: inline-block;
}

/* 查词底栏 */
.reader-en-word-sheet {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.reader-en-word-sheet[hidden] {
  display: none !important;
}

.reader-en-word-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 28, 0.28);
}

.reader-en-word-sheet-card {
  position: relative;
  width: min(100%, 420px);
  margin: 0 12px 18px;
  padding: 16px 16px 14px;
  border-radius: 16px 16px 14px 14px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.reader-en-word-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.reader-en-word-term {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #1d1d1f;
}

.reader-en-word-pos {
  margin-top: 2px;
  font-size: 12px;
  color: #8e8e93;
}

.reader-en-word-close {
  border: none;
  background: rgba(0, 0, 0, 0.06);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

.reader-en-word-cn {
  font-size: 15px;
  line-height: 1.55;
  color: #2c2a26;
  margin-bottom: 8px;
}

.reader-en-word-ctx {
  font-size: 12px;
  line-height: 1.5;
  color: #8e8e93;
  margin-bottom: 14px;
}

.reader-en-word-actions {
  display: flex;
  gap: 8px;
}

.reader-en-word-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}

.reader-en-word-btn.primary {
  background: #2f6fed;
  color: #fff;
}

.reader-en-word-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.reader-en-wordbook-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.reader-en-wordbook-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 13px;
}

.reader-en-wordbook-item strong {
  font-size: 14px;
}

/* 查词 Tab */
.reader-en-dict-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
}

.reader-en-dict-tab {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b6b70;
  cursor: pointer;
}

.reader-en-dict-tab.is-active {
  background: rgba(47, 111, 237, 0.12);
  border-color: rgba(47, 111, 237, 0.28);
  color: #2f6fed;
}

.reader-en-word-cn {
  max-height: 38vh;
  overflow: auto;
  white-space: normal;
}

.reader-en-word-cn strong {
  font-weight: 700;
}

/* 生词本全页 */
.reader-en-wb-page {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(250, 247, 242, 0.98);
  display: flex;
  flex-direction: column;
}

.reader-en-wb-page[hidden] {
  display: none !important;
}

.reader-en-wb-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.reader-en-wb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.reader-en-wb-back {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.reader-en-wb-title {
  margin: 0;
  font-size: 18px;
}

.reader-en-wb-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #8e8e93;
}

.reader-en-wb-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
}

.reader-en-wb-tabs button {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #6b6b70;
  cursor: pointer;
}

.reader-en-wb-tabs button.is-active {
  background: #2f6fed;
  border-color: #2f6fed;
  color: #fff;
}

.reader-en-wb-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 0 24px;
}

.reader-en-wb-stats {
  padding: 4px 16px 10px;
  font-size: 12px;
  color: #8e8e93;
}

.reader-en-wb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px;
}

.reader-en-wb-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.reader-en-wb-item.is-mastered {
  opacity: 0.72;
}

.reader-en-wb-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.reader-en-wb-item-main strong {
  font-size: 16px;
}

.reader-en-wb-item-main span {
  font-size: 13px;
  color: #3a3a3c;
}

.reader-en-wb-item-main em {
  font-style: normal;
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.45;
}

.reader-en-wb-del {
  border: none;
  background: transparent;
  font-size: 20px;
  color: #aeaeb2;
  cursor: pointer;
  line-height: 1;
}

.reader-en-wb-empty {
  padding: 48px 24px;
  text-align: center;
  color: #6b6b70;
}

.wb-story-intro,
.wb-story-wrap {
  padding: 12px 16px 24px;
}

.wb-story-intro-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.wb-story-intro-desc {
  font-size: 14px;
  color: #6b6b70;
  margin-bottom: 12px;
  line-height: 1.55;
}

.wb-story-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.wb-story-title {
  font-size: 17px;
  font-weight: 700;
}

.wb-story-level {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(47, 111, 237, 0.12);
  color: #2f6fed;
}

.wb-story-summary {
  font-size: 13px;
  color: #8e8e93;
  margin: 8px 0 12px;
}

.wb-story-body {
  font-size: 15px;
  line-height: 1.75;
  color: #2c2a26;
}

.wb-story-body--cn {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  color: #6b6b70;
  font-size: 14px;
}

.wb-story-mark {
  background: rgba(52, 168, 120, 0.18);
  border-radius: 3px;
  padding: 0 2px;
}

.wb-story-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.wb-story-gen-status {
  text-align: center;
  padding: 40px 20px;
}

.wb-story-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 12px;
}

.wb-story-progress i {
  display: block;
  height: 100%;
  background: #2f6fed;
  width: 0;
  transition: width 0.2s;
}

.wb-story-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid rgba(47, 111, 237, 0.2);
  border-top-color: #2f6fed;
  animation: readerEnSpin 0.8s linear infinite;
}

@keyframes readerEnSpin {
  to { transform: rotate(360deg); }
}
