:root {
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bg-color: #0a0a0a;
  --card-bg: #1c1c1e;
  --primary-color: #00c853;
  --water-1: rgba(0, 230, 118, 0.9);
  --water-2: rgba(105, 240, 174, 0.5);
  --water-3: rgba(0, 200, 83, 0.3);
  --text-main: #ffffff;
  --text-sub: #8e8e93;
  --danger: #ff453a;
  --success: #30d158;
  --search-color: #bf5af2;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100dvh;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  background: var(--bg-color);
  overflow-y: auto;
}

.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.header-bar {
  height: 40px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.header-btn {
  position: absolute;
  top: 0;
  border: 0;
  background: transparent;
  color: var(--text-sub);
  padding: 4px;
}

.header-btn.left {
  left: 0;
}

.header-btn.right {
  right: 0;
}

.bank-switch-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 190px;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

#current-bank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.essay-bank-home .stats-row,
.essay-bank-home .bottom-grid,
.essay-bank-home #continueBtn {
  display: none;
}

.essay-bank-home .dashboard {
  justify-content: center;
  gap: 22px;
  padding-bottom: calc(32px + var(--safe-bottom));
}

.essay-bank-home .water-container {
  margin: 16px 0 22px;
}

.essay-bank-home .app-version-badge {
  margin-top: 4px;
}

.essay-home-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.essay-orb {
  display: none;
}

.essay-orb-value {
  color: #fff;
  font-size: 62px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.45);
}

.essay-orb-value span {
  font-size: 24px;
  margin-left: 3px;
}

.essay-orb-label {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.essay-home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(320px, 90%);
}

.essay-home-stats div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 14px 10px;
  text-align: center;
}

.essay-home-stats strong {
  display: block;
  color: #fff;
  font-size: 26px;
}

.essay-home-stats span {
  color: var(--text-sub);
  font-size: 12px;
}

.btn-main-action.essay-start {
  width: min(320px, 86%);
}

.water-container {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, #004d26 0%, #002e12 100%);
  position: relative;
  overflow: hidden;
  margin: 30px 0 50px;
  box-shadow: 0 0 30px rgba(0, 200, 83, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.wave {
  position: absolute;
  width: 200%;
  height: 200%;
  left: 50%;
  top: 200%;
  border-radius: 40% 45%;
  transform: translate(-50%, -50%);
  animation: rotate linear infinite;
  transition: top 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.wave.one {
  background: var(--water-1);
  animation-duration: 8s;
  z-index: 10;
}

.wave.two {
  background: var(--water-2);
  animation-duration: 10s;
  animation-direction: reverse;
  z-index: 11;
}

.wave.three {
  background: var(--water-3);
  animation-duration: 6s;
  z-index: 12;
}

@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.circle-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.circle-percent {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
}

.circle-percent span {
  font-size: 24px;
  font-weight: 400;
  margin-left: 2px;
}

.circle-label {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.stats-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}

.stat-item {
  min-width: 0;
  min-height: 80px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: center;
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.clickable-stat {
  width: 100%;
  max-width: 120px;
  justify-self: center;
  background: rgba(255, 69, 58, 0.1);
}

.stat-val {
  font-size: 24px;
  font-weight: 700;
}

.stat-val.mastery {
  font-size: 18px;
  line-height: 36px;
}

.danger-text {
  color: var(--danger);
}

.stat-label {
  margin-top: 4px;
  color: var(--text-sub);
  font-size: 12px;
}

.spacer {
  flex: 1;
}

.btn-main-action {
  width: 80%;
  min-height: 56px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, #187a3e 0%, #0f4d28 100%);
  color: white;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-main-action.submit {
  width: 100%;
}

.bottom-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 4px;
  padding: 30px 0;
}

.grid-item {
  border: 0;
  background: transparent;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-box {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--card-bg);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.icon-box.red {
  color: #ff6b6b;
}

.icon-box.yellow {
  color: #feca57;
}

.icon-box.blue {
  color: #54a0ff;
}

.icon-box.purple {
  color: var(--search-color);
}

.icon-box.green {
  color: var(--primary-color);
}

.icon-box.cyan {
  color: #64d2ff;
}

.icon-box.pink {
  color: #ff9fbd;
}

.grid-label {
  color: var(--text-sub);
  font-size: 11px;
  white-space: nowrap;
}

.app-version-badge {
  margin: -14px 0 calc(10px + var(--safe-bottom));
  color: rgba(142, 142, 147, 0.72);
  font-size: 11px;
  line-height: 1;
}

.top-nav {
  width: 100%;
  display: grid;
  grid-template-columns: 96px 1fr 96px;
  align-items: center;
  margin-bottom: 20px;
  color: var(--text-sub);
  font-size: 14px;
}

.top-nav > :nth-child(2) {
  text-align: center;
}

.top-nav > :nth-child(3) {
  text-align: right;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--text-sub);
  font-size: 16px;
}

.question-text {
  margin-bottom: 30px;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 500;
}

.speech-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  min-height: 34px;
}

.speech-btn {
  border: 1px solid rgba(0, 200, 83, 0.45);
  border-radius: 17px;
  background: rgba(0, 200, 83, 0.12);
  color: var(--primary-color);
  padding: 7px 12px;
  font-size: 13px;
}

.speech-btn.muted {
  border-color: #333;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-sub);
}

#speech-status {
  min-width: 0;
  overflow: hidden;
  color: var(--text-sub);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-type {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 200, 83, 0.2);
  color: var(--primary-color);
  font-size: 12px;
  vertical-align: 2px;
}

.rich img,
.question-text img,
.option-item img,
.wrong-item img,
.search-result-item img,
.feedback-content img {
  max-width: 100%;
  max-height: 260px;
  margin: 8px 0;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  vertical-align: middle;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.option-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  border: 1px solid #333;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 18px;
  text-align: left;
}

.option-item.selected {
  border-color: var(--primary-color);
  background: rgba(0, 200, 83, 0.1);
}

.option-item.correct {
  border-color: var(--success);
  background: rgba(48, 209, 88, 0.2);
}

.option-item.wrong {
  border-color: var(--danger);
  background: rgba(255, 69, 58, 0.2);
}

.option-letter {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  border-radius: 50%;
  background: #333;
  color: #888;
  font-size: 14px;
  font-weight: 700;
}

#action-area,
#fill-blank-area,
.answer-box,
.self-judge-btns,
.wrong-summary {
  display: none;
}

#action-area.active {
  display: block;
  padding-top: 20px;
}

#fill-blank-area.active {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 14px;
}

#fill-input,
#search-input-box {
  width: 100%;
  border: 1px solid #333;
  border-radius: 12px;
  background: var(--card-bg);
  color: white;
  padding: 15px;
  outline: none;
}

#search-input-box {
  border-radius: 25px;
  margin-bottom: 20px;
}

.btn-reveal {
  width: 100%;
  border: 1px solid #555;
  border-radius: 12px;
  background: #333;
  color: white;
  padding: 15px;
}

.answer-box.visible {
  display: block;
  width: 100%;
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  background: rgba(0, 200, 83, 0.1);
  color: var(--primary-color);
  padding: 18px;
}

.self-judge-btns.visible {
  display: flex;
  gap: 15px;
}

.btn-judge {
  flex: 1;
  border: 0;
  border-radius: 12px;
  color: white;
  padding: 15px;
  font-weight: 700;
}

.btn-judge.correct {
  background: var(--success);
}

.btn-judge.wrong {
  background: var(--danger);
}

.feedback-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  width: min(480px, 100%);
  max-height: min(52vh, 420px);
  overflow-y: auto;
  transform: translate(-50%, 100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background: #2c2c2e;
  padding: 25px 25px calc(25px + var(--safe-bottom));
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.feedback-sheet.show {
  transform: translate(-50%, 0);
}

.feedback-status {
  font-size: 18px;
  font-weight: 700;
}

.status-correct {
  color: var(--success);
}

.status-wrong {
  color: var(--danger);
}

.feedback-content {
  margin: 15px 0 20px;
  max-height: 30vh;
  overflow-y: auto;
  color: #ccc;
  font-size: 14px;
  line-height: 1.6;
}

#quiz-screen.answer-open {
  padding-bottom: calc(300px + var(--safe-bottom));
}

.btn-next {
  width: 100%;
  border: 0;
  border-radius: 30px;
  background: var(--primary-color);
  color: white;
  padding: 15px;
  font-weight: 700;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex;
}

.bank-list-card {
  width: 85%;
  max-width: 400px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--card-bg);
  padding: 20px;
}

.bank-list-title {
  margin-bottom: 15px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.bank-list-content {
  flex: 1;
  overflow-y: auto;
}

.bank-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  padding: 15px;
  margin-bottom: 10px;
  text-align: left;
}

.bank-item.active {
  border-color: var(--primary-color);
  background: rgba(0, 200, 83, 0.1);
}

.bank-name {
  font-size: 16px;
  font-weight: 500;
}

.bank-count {
  margin-top: 3px;
  color: #666;
  font-size: 12px;
}

.btn-close-modal {
  width: 100%;
  margin-top: 15px;
  border: 0;
  border-radius: 10px;
  background: #333;
  color: white;
  padding: 12px;
}

.btn-refresh-bank {
  width: 100%;
  margin-top: 15px;
  border: 1px solid rgba(0, 200, 83, 0.45);
  border-radius: 10px;
  background: rgba(0, 200, 83, 0.12);
  color: var(--primary-color);
  padding: 12px;
  font-weight: 700;
}

.btn-refresh-bank + .btn-close-modal {
  margin-top: 10px;
}

.announcement-overlay {
  z-index: 230;
  padding: 20px;
}

.announcement-card {
  width: min(400px, 100%);
  max-height: 72vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 200, 83, 0.18);
  border-radius: 18px;
  background: #1c1c1e;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.announcement-label {
  width: fit-content;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(0, 200, 83, 0.14);
  color: var(--primary-color);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.announcement-card h2 {
  margin: 0 0 12px;
  color: var(--text-main);
  font-size: 20px;
  line-height: 1.35;
}

.announcement-content {
  color: #d1d1d6;
  font-size: 14px;
  line-height: 1.7;
}

.announcement-content p {
  margin: 0 0 10px;
}

.announcement-content p:last-child {
  margin-bottom: 0;
}

.announcement-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.announcement-btn {
  min-height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
}

.announcement-btn.secondary {
  border: 1px solid #3a3a3c;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.announcement-btn.primary {
  border: 0;
  background: var(--primary-color);
  color: white;
}

.list-area {
  width: 100%;
  padding-bottom: 50px;
}

.muted-center {
  margin-top: 50px;
  color: #666;
  text-align: center;
}

.wrong-item,
.search-result-item,
.all-question-item,
.essay-item {
  width: 100%;
  border-radius: 10px;
  background: var(--card-bg);
  padding: 15px;
  margin-bottom: 10px;
}

.rank-filter {
  width: 100%;
  display: grid;
  grid-template-columns: auto 72px auto 72px;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--card-bg);
  padding: 12px;
  color: var(--text-sub);
  font-size: 14px;
}

.rank-filter input {
  width: 100%;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  color: white;
  padding: 8px;
  text-align: center;
}

.rank-filter button {
  border: 0;
  border-radius: 8px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  font-weight: 700;
}

.rank-count {
  color: var(--danger);
  font-weight: 700;
}

.search-result-item,
.all-question-item,
.essay-item {
  border: 1px solid transparent;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.search-result-item.expanded,
.all-question-item.expanded,
.essay-item:active {
  border-color: var(--search-color);
  background: rgba(191, 90, 242, 0.05);
}

.essay-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 12px;
}

.essay-status {
  border-radius: 999px;
  background: rgba(0, 200, 83, 0.16);
  color: var(--primary-color);
  padding: 3px 8px;
}

.bubble-screen {
  gap: 12px;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.bubble-question {
  width: 100%;
  border-left: 3px solid var(--primary-color);
  padding: 8px 0 8px 12px;
  color: var(--text-main);
  font-size: 17px;
  line-height: 1.55;
}

.bubble-toolbar {
  width: 100%;
  order: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 30;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(22, 22, 24, 0.86);
  padding: 8px;
  backdrop-filter: blur(14px);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.38);
}

.bubble-toolbar button {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 700;
}

.bubble-toolbar #bubbleSelectBtn {
  display: none !important;
}

.bubble-toolbar button.primary {
  background: var(--primary-color);
  color: #fff;
}

.bubble-screen.recite-mode .bubble-toolbar {
  grid-template-columns: 1fr;
}

.bubble-hint {
  width: 100%;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.5;
}

.bubble-answer-editor,
.bubble-recite {
  width: 100%;
  flex: 1;
  min-height: 48vh;
  border: 1px solid #2f2f33;
  border-radius: 12px;
  background: #111112;
  padding: 18px;
  color: var(--text-main);
  font-size: 21px;
  line-height: 2.18;
  overflow-y: auto;
}

.bubble-answer-editor {
  user-select: text;
  -webkit-user-select: text;
  white-space: pre-wrap;
}

.bubble-mark {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06) 52%, rgba(255, 255, 255, 0.13)),
    var(--bubble-color);
  color: rgba(248, 252, 255, 0.96);
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 18px rgba(255, 255, 255, 0.08),
    0 7px 18px rgba(0, 0, 0, 0.12);
  line-height: inherit;
}

.bubble-recite.hidden,
.hidden {
  display: none !important;
}

.memory-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.32em;
  height: 1.42em;
  margin: 0 0.12em 0.58em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  padding: 0 0.26em;
  background: var(--bubble-color);
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.38), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04) 48%, rgba(255, 255, 255, 0.12)),
    var(--bubble-color);
  color: transparent;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
  line-height: 1;
  font: inherit;
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.16),
    0 0 16px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  -webkit-backdrop-filter: blur(14px) saturate(1.22);
  backdrop-filter: blur(14px) saturate(1.22);
  filter: saturate(1.06);
  transition: transform 0.18s ease, color 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  cursor: pointer;
  white-space: pre;
  touch-action: manipulation;
}

.memory-bubble::before {
  content: "";
  position: absolute;
  inset: 1px 2px auto 2px;
  height: 48%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent);
  opacity: 0.72;
  pointer-events: none;
}

.memory-bubble::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0;
  background: rgba(255, 255, 255, 0.64);
  box-shadow:
    -18px -10px 0 rgba(255, 255, 255, 0.34),
    17px -9px 0 rgba(255, 255, 255, 0.3),
    -13px 13px 0 rgba(255, 255, 255, 0.26),
    20px 12px 0 rgba(255, 255, 255, 0.24),
    3px -20px 0 rgba(255, 255, 255, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.35);
}

.memory-bubble.revealed {
  color: rgba(20, 24, 28, 0.82);
  animation: bubble-pop 0.34s ease both;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.48),
    0 9px 22px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.memory-bubble.bursting::after {
  animation: bubble-shatter 0.48s ease-out both;
}

@keyframes bubble-pop {
  0% {
    transform: scale(1);
    filter: saturate(1);
  }
  42% {
    transform: scale(1.12) rotate(-1deg);
    filter: saturate(1.28) brightness(1.08);
  }
  58% {
    transform: scale(0.97) rotate(1deg);
  }
  100% {
    transform: scale(1.04);
  }
}

@keyframes bubble-shatter {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }
  34% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.5) rotate(24deg);
  }
}

.memory-text {
  color: rgba(255, 255, 255, 0.92);
  white-space: pre-wrap;
}

.bubble-recite {
  font-size: 21px;
  line-height: 2.18;
  padding: 18px;
}

@media (max-width: 390px) {
  .bubble-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.s-type {
  display: inline-block;
  margin-right: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  padding: 2px 6px;
  font-size: 12px;
}

.s-question {
  color: white;
  font-size: 15px;
  line-height: 1.5;
}

.s-answer-area {
  display: none;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 14px;
  line-height: 1.6;
}

.s-answer-area.show {
  display: block;
}

.s-ans-line {
  margin: 8px 0;
  color: var(--success);
  font-weight: 700;
}

.btn-delete-sm {
  float: right;
  border: 1px solid #444;
  border-radius: 4px;
  background: transparent;
  color: #666;
  padding: 2px 8px;
  font-size: 12px;
}

.result-screen {
  width: 100%;
  min-height: 100dvh;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.result-score {
  margin: 28px 0;
  color: var(--primary-color);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
}

.result-msg {
  color: var(--text-sub);
  margin: 0 auto 26px;
  max-width: 320px;
  line-height: 1.6;
}

.result-screen h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.wrong-summary.active {
  display: block;
  width: 100%;
  max-width: 440px;
  max-height: 46vh;
  overflow-y: auto;
  text-align: left;
  margin-bottom: 20px;
}
