:root {
  --reader-yellow: #ffe269;
  --reader-yellow-strong: #ffd633;
  --reader-border: rgba(0, 0, 0, 0.08);
  --reader-muted: #86868b;
  --reader-blue: #0066cc;
  --reader-purple: #d8c2f4;
  --reader-purple-strong: #c7a4ee;
  --reader-surface: rgba(255, 255, 255, 0.76);
  --reader-shadow: 0 15px 15px rgba(12, 46, 86, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  /* Keep the requested shadow geometry on narrow screens while preserving
     the same color and inset highlight. */
  --reader-shadow-mobile: 0 15px 15px rgba(12, 46, 86, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  background: var(--bg-color);
}

body {
  overscroll-behavior: none;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.24);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  position: fixed;
  inset: 0;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  color: var(--text-primary);
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px clamp(12px, 4vw, 48px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}

.header-list-control,
.header-tools {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}

.header-tools {
  position: relative;
  justify-content: flex-end;
}

.icon-button,
.clear-button,
.text-button,
.card-action,
.word-highlight,
.queue-title {
  -webkit-appearance: none;
  appearance: none;
}

.queue-title {
  display: inline-flex;
  min-width: 116px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  text-align: center;
}

.queue-title:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.queue-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.queue-subtitle {
  color: var(--reader-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: var(--reader-muted) !important;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--text-primary) !important;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.word-favorites-toggle {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 300;
  font-synthesis: none;
  letter-spacing: 0;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.word-favorites-toggle > span {
  display: block;
}

.search-box {
  position: absolute;
  right: 42px;
  display: flex;
  width: 0;
  height: 38px;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, border-color 0.2s ease;
}

.site-shell.search-open .search-box {
  transform: scaleX(1);
  opacity: 1;
  pointer-events: auto;
  border-color: var(--reader-border);
}

.site-shell.search-open .header-tools {
  position: static;
}

.site-shell.search-open .search-box {
  inset: 0;
  width: auto;
  height: auto;
  z-index: 1;
  border-radius: 0;
  box-shadow: none;
}

.site-shell.search-open #searchToggle {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.72) !important;
}

.site-shell.search-open .clear-button {
  margin-right: 46px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 46px 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
}

.clear-button {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  margin-right: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--reader-muted) !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.page-main {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.reader-view {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.reader-summary {
  display: flex;
  min-height: 27px;
  flex: 0 0 auto;
  align-items: center;
  padding: 2px 2px 7px;
  color: var(--reader-muted);
  font-size: 11px;
}

.card-viewport {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  /* The viewport owns the full area below the header and bottom controls.
     Keep the previous insets here so the card itself does not resize. */
  padding: 16px 0 22px;
  clip-path: inset(-42px 0 -42px 0);
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.card-stage {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow: visible;
}

.card-rail {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-rail.is-instant {
  transition: none !important;
}

.card-rail-slide {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 0 0 100%;
  justify-content: center;
}

.card-surface {
  position: relative;
  display: flex;
  width: min(calc(100% - clamp(20px, 8vw, 84px)), 880px);
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--card-radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(242, 249, 255, 0.58));
  box-shadow: var(--reader-shadow);
  scrollbar-width: thin;
}

.card-bookmark svg,
.bookmark-jump-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.card-rail-slide[aria-hidden="true"] .card-surface {
  box-shadow: none;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(18px, 4vh, 30px);
}

.card-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0;
  overflow-wrap: anywhere;
}

.card-title {
  margin: 0;
  color: #000;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.45;
  white-space: nowrap;
}

.card-divider {
  flex: 0 0 auto;
  margin: 0 6px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.card-subtitle {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.star-state {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: transparent !important;
  color: var(--reader-muted);
  opacity: 0.58;
  cursor: pointer;
}

.star-state.is-starred {
  color: #d2a400;
  opacity: 1;
}

.star-state:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  opacity: 1;
}

.star-state svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.star-state.is-starred svg {
  fill: currentColor;
  filter: drop-shadow(0 1px 3px rgba(210, 164, 0, 0.24));
}

.star-state.word-star.is-starred {
  color: var(--reader-purple);
}

.star-state.word-star.is-starred:hover {
  color: var(--reader-purple-strong);
}

.star-state.word-star.is-starred svg {
  filter: drop-shadow(0 1px 3px rgba(216, 194, 244, 0.44));
}

.card-action {
  display: grid;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: var(--reader-muted) !important;
  cursor: pointer;
}

.card-action:hover,
.card-action[aria-pressed="true"] {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--text-primary) !important;
}

.card-action.drop-button:hover {
  background: rgba(255, 230, 230, 0.8) !important;
  color: #8f2c2c !important;
}

.card-icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.card-surface.is-dropping {
  overflow: hidden;
  pointer-events: none;
  animation: card-drop-away 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-drop-away {
  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  24% { opacity: 0.98; transform: translate3d(-8px, 2px, 0) rotate(-1deg) scale(1); }
  58% { opacity: 0.9; transform: translate3d(-42px, -42px, 0) rotate(-6deg) scale(0.97); }
  100% { opacity: 0; transform: translate3d(-132px, -168px, 0) rotate(-14deg) scale(0.84); }
}


.sentence-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 0;
}

.sentence-row {
  display: grid;
  gap: 4px;
}

.sentence-english,
.sentence-translation {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sentence-english {
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 2.1vw, 18px);
  line-height: 1.78;
}

.sentence-translation {
  color: #5d6570;
  font-size: 13px;
  line-height: 1.65;
}

.sentence-translation::before {
  content: "译  ";
  color: var(--reader-blue);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.translations-hidden .sentence-translation {
  display: none;
}

.word-highlight {
  --word-highlight-color: var(--reader-yellow);
  --word-highlight-hover-color: var(--reader-yellow-strong);
  display: inline;
  padding: 0 2px;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(
    to bottom,
    transparent 33.333%,
    var(--word-highlight-color) 33.333%,
    var(--word-highlight-color) 75%,
    transparent 75%
  ) !important;
  color: inherit !important;
  line-height: inherit;
  cursor: pointer;
}

.word-highlight:hover {
  background: linear-gradient(
    to bottom,
    transparent 33.333%,
    var(--word-highlight-hover-color) 33.333%,
    var(--word-highlight-hover-color) 75%,
    transparent 75%
  ) !important;
}

.word-highlight--low {
  --word-highlight-color: rgba(255, 226, 105, 0.2);
  --word-highlight-hover-color: rgba(255, 214, 51, 0.2);
}

.word-highlight--medium {
  --word-highlight-color: rgba(255, 226, 105, 0.5);
  --word-highlight-hover-color: rgba(255, 214, 51, 0.5);
}

.word-highlight--full {
  --word-highlight-color: var(--reader-yellow);
  --word-highlight-hover-color: var(--reader-yellow-strong);
}

.word-highlight.is-word-starred {
  background: linear-gradient(
    to bottom,
    transparent 33.333%,
    var(--reader-purple) 33.333%,
    var(--reader-purple) 75%,
    transparent 75%
  ) !important;
}

.word-highlight.is-word-starred:hover {
  background: linear-gradient(
    to bottom,
    transparent 33.333%,
    var(--reader-purple-strong) 33.333%,
    var(--reader-purple-strong) 75%,
    transparent 75%
  ) !important;
}

.learning-label {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(0, 102, 204, 0.08);
  color: var(--reader-blue);
  font-size: 10px;
  font-weight: 700;
}

.learning-note {
  margin-top: 18px;
  color: var(--reader-muted);
  font-size: 11px;
}

.nav-button,
.text-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--reader-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.6) !important;
  color: var(--text-primary) !important;
  font-size: 11px;
  cursor: pointer;
}

.nav-button:hover,
.text-button:hover {
  background: rgba(255, 255, 255, 0.96) !important;
}

.nav-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.reader-progress {
  color: var(--reader-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.reader-progress span + span {
  margin: 0 5px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  width: auto;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  box-sizing: border-box;
  color: var(--reader-muted);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 17px;
  font-weight: 650;
}

.empty-state p {
  margin: 0;
  font-family: inherit;
  font-size: 12px;
}

.empty-state .text-button {
  display: inline-flex;
  margin-top: 8px;
}

.card-list-panel {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: stretch;
  pointer-events: auto;
}

.card-list-scrim {
  position: absolute;
  inset: 0;
  background: rgba(25, 32, 42, 0.24);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.card-list-sheet {
  position: relative;
  z-index: 1;
  width: min(88vw, 420px);
  height: 100%;
  overflow-y: auto;
  padding: 22px 18px 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 18px 0 42px rgba(15, 42, 70, 0.14);
  animation: list-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes list-in {
  from { transform: translateX(-24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.card-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.card-list-header h2 {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.collection-search-box {
  display: grid;
  gap: 7px;
  margin: 14px 2px 0;
}

.collection-search-row {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 7px;
}

.collection-search-field {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 7px 0 11px;
  border: 1px solid rgba(13, 32, 62, 0.12);
  border-radius: 12px;
  background: rgba(245, 249, 253, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.collection-search-field:focus-within {
  border-color: rgba(0, 102, 204, 0.36);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.collection-search-field > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: #72819a;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.collection-search-field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
}

.collection-search-field .clear-button {
  margin: 0;
}

.bookmark-jump-button {
  padding: 0;
}

.bookmark-jump-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.collection-search-status {
  min-height: 14px;
  margin: 0 2px;
  color: var(--reader-muted);
  font-size: 10px;
  line-height: 1.4;
}

.card-list-items {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.card-list-item {
  position: relative;
  min-width: 0;
}

.card-list-button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 12px 42px 12px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(245, 249, 253, 0.72) !important;
  color: var(--text-primary) !important;
  text-align: left;
  cursor: pointer;
}

.card-list-button:hover,
.card-list-button[aria-current="true"] {
  border-color: rgba(0, 102, 204, 0.2);
  background: #fff !important;
}

.card-list-item-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-list-item-source {
  overflow: hidden;
  color: var(--reader-muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-list-item-preview {
  display: -webkit-box;
  overflow: hidden;
  color: #4d5661;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-list-star {
  position: absolute;
  z-index: 1;
  top: 7px;
  right: 6px;
}

.card-list-empty {
  margin: 0;
  padding: 20px;
  color: var(--reader-muted);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

.word-favorites-panel {
  position: fixed;
  z-index: 75;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.word-favorites-scrim {
  position: absolute;
  inset: 0;
  background: rgba(25, 32, 42, 0.24);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.word-favorites-sheet {
  position: relative;
  z-index: 1;
  width: min(88vw, 420px);
  height: 100%;
  overflow-y: auto;
  padding: 22px 18px 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: -18px 0 42px rgba(15, 42, 70, 0.14);
  animation: favorites-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes favorites-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.word-favorites-count {
  margin-top: 3px;
  color: var(--reader-muted);
  font-size: 10px;
  line-height: 1.4;
}

.word-favorites-search-box {
  display: grid;
  gap: 7px;
  margin: 14px 2px 0;
}

.word-favorites-search-field {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 7px 0 11px;
  border: 1px solid rgba(13, 32, 62, 0.12);
  border-radius: 12px;
  background: rgba(245, 249, 253, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.word-favorites-search-field:focus-within {
  border-color: rgba(0, 102, 204, 0.36);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.word-favorites-search-field > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: var(--reader-muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.word-favorites-search-field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
}

.word-favorites-search-field .clear-button {
  margin: 0;
}

.word-favorites-search-status {
  min-height: 14px;
  margin: 0 2px;
  color: var(--reader-muted);
  font-size: 10px;
}

.word-favorites-items {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.word-favorite-item {
  position: relative;
  min-width: 0;
}

.word-favorite-button {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 12px 47px 12px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(245, 249, 253, 0.72) !important;
  color: var(--text-primary) !important;
  text-align: left;
  cursor: pointer;
}

.word-favorite-button:hover,
.word-favorite-button:focus-visible {
  border-color: rgba(0, 102, 204, 0.2);
  background: #fff !important;
}

.word-favorite-spelling {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-favorite-phonetics {
  overflow: hidden;
  color: #6d7d98;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-favorite-paraphrase {
  display: -webkit-box;
  overflow: hidden;
  color: #4d5661;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.word-favorite-star {
  position: absolute;
  z-index: 1;
  top: 7px;
  right: 6px;
}

.word-favorites-empty {
  margin: 0;
  padding: 20px 8px;
  color: var(--reader-muted);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

.word-sheet {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(25, 32, 42, 0.26);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  max-height: min(84vh, 760px);
  overflow-y: auto;
  touch-action: pan-y;
  padding: 18px clamp(20px, 5vw, 42px) 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px 30px 0 0;
  background: rgba(252, 253, 255, 0.97);
  box-shadow: 0 -18px 42px rgba(15, 42, 70, 0.16);
  animation: sheet-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  scrollbar-color: rgba(116, 126, 145, 0.48) transparent;
  scrollbar-width: thin;
}

@keyframes sheet-in {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 42px;
  height: 3px;
  margin: 0 auto 20px;
  border-radius: 99px;
  background: rgba(125, 133, 148, 0.28);
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0 18px;
  border-bottom: 1px solid rgba(32, 54, 84, 0.1);
}

.detail-heading-block {
  min-width: 0;
}

.detail-headword {
  min-width: 0;
  margin: 0;
  color: #0d203e;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(38px, 8vw, 58px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.detail-phonetic {
  margin: 9px 0 0;
  color: #6d7d98;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.4;
}

.detail-actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 9px;
  padding-top: 3px;
}

.detail-score-toggle {
  display: block;
  padding: 0;
  border: 0;
  background: transparent !important;
  font: inherit;
  cursor: pointer;
}

.detail-score-toggle:hover,
.detail-score-toggle[aria-expanded="true"] {
  color: var(--reader-blue) !important;
}

.detail-score-note {
  width: 100%;
  box-sizing: border-box;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--reader-muted);
  text-align: left;
  overflow: visible;
}

.detail-score-formula {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  color: #26354e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(10px, 3vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: visible;
}

.detail-score-formula math {
  display: block;
  max-width: 100%;
  font-family: Georgia, "Times New Roman", "Songti SC", serif !important;
  font-size: inherit;
}

.detail-score-formula math * {
  font-family: Georgia, "Times New Roman", "Songti SC", serif !important;
}

.detail-score-heading {
  margin: 0 0 7px;
  color: var(--reader-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.detail-score-explanation {
  max-width: 46em;
  margin: 8px 0 0;
  color: var(--reader-muted);
  font-size: 12px;
  line-height: 1.55;
}

.detail-section {
  padding: 20px 0 21px;
  border-bottom: 1px solid rgba(32, 54, 84, 0.1);
}

.detail-section h2 {
  margin: 0 0 13px;
  color: #25456f;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.detail-occurrence {
  flex: 0 0 auto;
  margin: 0 0 4px;
  color: #62789e;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.detail-occurrence strong {
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.detail-muted {
  margin: 12px 0 0;
  color: var(--reader-muted);
  font-size: 12px;
  line-height: 1.55;
}

.detail-gloss {
  margin: 0;
  color: #26354e;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 18px;
  line-height: 1.58;
  white-space: pre-line;
}

.example-list,
.context-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  color: #2d3c56;
  font-size: 16px;
  line-height: 1.45;
  list-style: none;
}

.example-list {
  gap: 12px;
  padding-left: 22px;
  list-style: decimal;
}

.example-item {
  padding-left: 3px;
}

.example-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
  margin-bottom: 2px;
}

.example-en,
.example-cn {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}

.example-en {
  color: #26354e;
  line-height: 1.5;
}

.example-cn {
  margin-top: 2px;
  color: #6b7483;
  font-size: 14px;
  line-height: 1.48;
}

.example-cn-unavailable {
  color: #9aa1aa;
  font-size: 12px;
}

.example-heat {
  color: #8a97aa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 500;
}

.example-marker {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 102, 204, 0.08);
  color: var(--reader-blue);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.detail-section:last-child {
  border-bottom: 0;
}

.context-list {
  gap: 21px;
}

.context-item {
  margin: 0;
}

.context-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: inherit !important;
  text-align: left;
  cursor: pointer;
}

.context-link:hover .context-fragment {
  color: #0d203e;
}

.context-fragment {
  margin: 0;
  color: #2d3c56;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.56;
}

.context-highlight {
  padding: 0 2px;
  border-radius: 2px;
  background: var(--reader-yellow);
  color: inherit;
}

.context-source {
  display: block;
  margin-top: 8px;
  color: #71829f;
  font-size: 13px;
  line-height: 1.45;
}

.source-unavailable {
  margin: 0;
  color: var(--reader-muted);
  font-size: 14px;
  line-height: 1.6;
}

.detail-empty {
  padding: 26px 0 14px;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-color);
  color: var(--text-primary);
  text-align: center;
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
    gap: 6px;
    padding-inline: 9px;
  }

  .queue-title {
    min-width: 104px;
    padding-inline: 8px;
  }

  .queue-name {
    font-size: 16px;
  }

  .queue-subtitle {
    font-size: 10px;
  }

  .card-surface {
    padding: 17px 15px 20px;
    border-radius: 15px;
    box-shadow: var(--reader-shadow-mobile);
  }

  .card-header {
    margin-bottom: 17px;
  }

  .card-subtitle {
    font-size: 10px;
  }

  .sentence-english {
    font-size: 15px;
    line-height: 1.7;
  }

  .sentence-translation {
    font-size: 12px;
  }

  .sheet-panel {
    max-height: 84vh;
    border-radius: 18px 18px 0 0;
  }

  .card-list-sheet {
    width: min(92vw, 420px);
    padding: 18px 15px 26px;
  }

  .word-favorites-sheet {
    width: min(92vw, 420px);
    padding: 18px 15px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
