:root {
  --primary: #FF9A8B;
  --primary-dark: #FF7E6B;
  --secondary: #A8E6CF;
  --bg: #FFF8F0;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --success: #7FD8BE;
  --warning: #FFD166;
  --danger: #FF6B6B;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 24px;
  --radius-sm: 16px;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

/* Header */
.app-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  z-index: 10;
}

.app-header h1 {
  margin: 0;
  font-size: 16px;
  color: var(--primary-dark);
}

.header-btns {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Main content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
  min-height: 0;
}

/* Pages */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

#page-study.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home page */
.welcome-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.welcome-card h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
}

.welcome-card p {
  margin: 0;
  opacity: 0.95;
  font-size: 15px;
}

.task-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.task-card .number {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-dark);
  display: block;
}

.task-card .label {
  font-size: 14px;
  color: var(--text-light);
}

.big-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, background 0.2s;
  margin-bottom: 12px;
}

.big-btn:active {
  transform: scale(0.98);
  background: var(--primary-dark);
}

.big-btn.secondary {
  background: var(--secondary);
  color: #2C5E4D;
}

.big-btn.secondary:active {
  background: #8DD7B9;
}

/* Progress */
.progress-section {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.progress-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.progress-bar {
  height: 16px;
  background: #F0F0F0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 8px;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: right;
  font-size: 14px;
  color: var(--text-light);
}

/* Stage list */
.stage-list {
  display: grid;
  gap: 10px;
}

.stage-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.stage-item:active {
  transform: scale(0.99);
}

.stage-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.stage-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-light);
}

.stage-status {
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: bold;
}

/* Flashcard page */
.study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.study-header .back {
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
}

.study-title {
  text-align: center;
  flex: 1;
  font-size: 16px;
  font-weight: bold;
}

.study-count {
  font-size: 13px;
  font-weight: normal;
  color: var(--text-light);
  margin-left: 6px;
}

.quick-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F0F0F0;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  color: #999;
}

.quick-toggle.active {
  background: var(--primary);
  color: white;
}

.quick-toggle:active {
  transform: scale(0.95);
}

.study-progress {
  margin: 0 16px;
}

.study-progress.bottom-progress {
  margin: 0 0 10px 0;
}

.study-progress-bar {
  height: 8px;
  background: #F0F0F0;
  border-radius: 4px;
  overflow: hidden;
}

.study-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.study-progress-text {
  display: none;
}

.flashcard-container {
  perspective: 1000px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin-bottom: 8px;
  container-type: size;
  container-name: card;
}

.flashcard {
  background: transparent;
  border-radius: var(--radius);
  position: relative;
  cursor: pointer;
  width: min(380px, 92vw, calc(100cqh * 2 / 3));
  height: auto;
  aspect-ratio: 2 / 3;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--card-bg);
}

.flashcard-front {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flashcard-back {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #FAFAFA;
  padding: 12px;
  display: block;
}

.card-content {
  text-align: center;
  width: 100%;
}

.card-word {
  font-size: clamp(36px, 12vw, 56px);
  font-weight: bold;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.15;
}

.card-sentence {
  font-size: clamp(15px, 4.5vw, 22px);
  color: var(--text-light);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.card-word-trans {
  font-size: clamp(18px, 5.5vw, 26px);
  color: var(--primary-dark);
  margin: -6px 0 12px 0;
  font-weight: 500;
}

.card-sentence-trans {
  font-size: clamp(14px, 4.2vw, 20px);
  color: #888;
  margin: 0;
  line-height: 1.5;
}

.card-hint {
  display: none;
}

/* Rating buttons */
.rating-area {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.rating-area.two-btn {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.rating-btn {
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rating-btn:active {
  transform: scale(0.95);
}

.rating-btn.hard {
  background: #FFE5E5;
  color: var(--danger);
}

.rating-btn.fuzzy {
  background: #FFF4E0;
  color: #E6A23C;
}

.rating-btn.easy {
  background: #E8F9F1;
  color: #2C9F7A;
}

.rating-btn .emoji {
  font-size: 24px;
  line-height: 1;
}

.rating-btn .btn-text {
  line-height: 1;
}

.rating-btn .swipe-arrow {
  font-size: 16px;
  font-weight: bold;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  flex-shrink: 0;
}

.rating-btn.hard .swipe-arrow {
  color: var(--danger);
}

.rating-btn.easy .swipe-arrow {
  color: #2C9F7A;
}

/* Swipe feedback overlay */
.swipe-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.swipe-feedback.show {
  opacity: 1;
}

.swipe-feedback.hard {
  background: var(--danger);
}

.swipe-feedback.easy {
  background: var(--success);
}

/* Settings */
.settings-section {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.settings-section h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F0F0F0;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 15px;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  width: 52px;
  height: 30px;
  background: #E0E0E0;
  border-radius: 15px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle.active {
  background: var(--primary);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle.active::after {
  transform: translateX(22px);
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-btn {
  padding: 8px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.radio-btn.active {
  border-color: var(--primary);
  background: #FFF0EE;
  color: var(--primary-dark);
  font-weight: bold;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .value {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-dark);
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Weak words list */
.word-list {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.word-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #F5F5F5;
}

.word-list-item:last-child {
  border-bottom: none;
}

.word-list-word {
  font-weight: bold;
  font-size: 16px;
}

.word-list-meta {
  font-size: 13px;
  color: var(--text-light);
}

/* Stage gallery */
.stage-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 20px;
}

.gallery-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.gallery-card:active {
  transform: scale(0.97);
}

.gallery-card .gallery-img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #FAFAFA;
  display: block;
  padding: 8px;
}

.gallery-card .gallery-content {
  padding: 10px;
  text-align: center;
}

.gallery-card .gallery-word {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 4px 0;
}

.gallery-card .gallery-trans {
  font-size: 13px;
  color: var(--primary-dark);
  margin: 0 0 4px 0;
}

.gallery-card .gallery-sentence {
  font-size: 12px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card .gallery-audio {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  width: 85%;
  max-width: 360px;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h3 {
  margin: 0 0 16px 0;
}

.modal p {
  margin: 0 0 20px 0;
  color: var(--text-light);
  line-height: 1.5;
}

.modal-btns {
  display: flex;
  gap: 10px;
}

.modal-btns button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
}

.modal-btns .confirm {
  background: var(--primary);
  color: white;
}

.modal-btns .cancel {
  background: #F0F0F0;
  color: var(--text);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state .emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  margin: 0 0 8px 0;
}

.empty-state p {
  margin: 0;
  color: var(--text-light);
}

/* Celebration */
.celebration {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  z-index: 200;
  animation: pop 0.8s ease;
  pointer-events: none;
}

@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #DDD;
  border-radius: 3px;
}


::-webkit-scrollbar-thumb:hover {
  background: #CCC;
}

/* Responsive */
@media (max-width: 360px) {
  .welcome-card h2 {
    font-size: 20px;
  }

  .task-grid {
    gap: 10px;
  }

  .task-card {
    padding: 14px;
  }

  .task-card .number {
    font-size: 26px;
  }

  .rating-btn {
    font-size: 15px;
    gap: 6px;
  }

  .rating-btn .emoji {
    font-size: 22px;
  }

  .rating-btn .swipe-arrow {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
}

/* Safe area for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-header {
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  #app {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Hide elements based on settings */
body.hide-sentence .card-sentence,
body.hide-sentence-trans .card-sentence-trans {
  display: none;
}

body.hide-word .card-word,
body.hide-word-trans .card-word-trans {
  display: none;
}

body.hide-image .card-image {
  opacity: 0;
}

body.hide-sentence.hide-word-trans .flashcard-back {
  align-items: center;
  justify-content: center;
}

body.hide-sentence.hide-word-trans .card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

body.hide-sentence.hide-word-trans .card-word {
  display: block;
  margin-bottom: 0;
}

/* Parent mode */
#page-parent.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.parent-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.parent-info-card {
  background: linear-gradient(135deg, #FFF8F0, #FFF0EE);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #FFE8E0;
}

.parent-info-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--text);
}

.parent-info-card p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.parent-intervals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parent-interval {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.interval-title {
  font-weight: bold;
  color: var(--text);
}

.interval-dots {
  color: var(--text-light);
  word-break: break-all;
}

.parent-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.parent-summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}

.parent-summary-card .value {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-dark);
}

.parent-summary-card .label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  white-space: nowrap;
}

.parent-toolbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 10px 0;
  z-index: 5;
  margin-bottom: 4px;
}

.parent-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.parent-filter-bar::-webkit-scrollbar {
  display: none;
}

.parent-filter-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid #E0E0E0;
  border-radius: 20px;
  background: white;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.parent-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: bold;
}

.parent-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E0E0E0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: white;
  box-sizing: border-box;
}

.parent-search:focus {
  border-color: var(--primary);
}

.parent-word-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.parent-word-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s;
}

.parent-word-item:active {
  transform: scale(0.99);
}

.parent-word-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  cursor: pointer;
  gap: 10px;
}

.parent-word-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 70px;
}

.parent-word-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

.parent-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.parent-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.parent-badge.stage {
  background: #E8F0FE;
  color: #2B579A;
}

.parent-badge.new {
  background: #F0F0F0;
  color: #888;
}

.parent-badge.learning {
  background: #FFF3E0;
  color: #E65100;
}

.parent-badge.mastered {
  background: #E8F5E9;
  color: #2E7D32;
}

.parent-badge.weak {
  background: #FFEBEE;
  color: #C62828;
}

.parent-word-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.parent-word-meta {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

.parent-word-next {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.parent-word-next.due {
  color: var(--primary-dark);
}

.parent-word-next.overdue {
  color: #C62828;
}

.parent-word-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.parent-history-bars {
  display: flex;
  gap: 3px;
}

.parent-history-bar {
  width: 8px;
  height: 22px;
  border-radius: 2px;
  background: #E8E8E8;
}

.parent-history-bar.easy {
  background: #81C784;
}

.parent-history-bar.hard {
  background: #E57373;
}

.parent-word-detail {
  padding: 0 14px 14px 14px;
  border-top: 1px dashed #F0F0F0;
  margin-top: 4px;
}

.parent-detail-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--text);
  margin: 12px 0 8px 0;
}

.parent-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parent-timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.parent-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.parent-timeline-dot.easy {
  background: #81C784;
}

.parent-timeline-dot.hard {
  background: #E57373;
}

.parent-timeline-dot.new {
  background: #CCC;
}

.parent-timeline-date {
  color: var(--text-light);
  width: 90px;
  flex-shrink: 0;
}

.parent-timeline-result {
  font-weight: 500;
}

.parent-timeline-result.easy {
  color: #2E7D32;
}

.parent-timeline-result.hard {
  color: #C62828;
}

.parent-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
}

@media (max-width: 400px) {
  .parent-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .parent-word-header {
    flex-wrap: wrap;
  }

  .parent-word-right {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
  }

  .parent-history-bars {
    order: -1;
  }
}

/* 听音选词小游戏 */
#page-game-listen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.game-listen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 24px;
  overflow-y: auto;
}

.game-listen-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.game-listen-play {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #FF9A8B, #FF6A88);
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 106, 136, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.game-listen-play:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(255, 106, 136, 0.3);
}

.game-listen-play.playing {
  animation: pulse 0.6s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.game-listen-progress {
  font-size: 15px;
  color: var(--text-light);
  font-weight: 500;
}

.game-listen-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.game-listen-option {
  padding: 18px 12px;
  border: 2px solid #E8E8E8;
  border-radius: var(--radius-sm);
  background: white;
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-listen-option:active {
  transform: scale(0.97);
}

.game-listen-option.correct {
  border-color: #4CAF50;
  background: #E8F5E9;
  color: #2E7D32;
}

.game-listen-option.wrong {
  border-color: #EF5350;
  background: #FFEBEE;
  color: #C62828;
}

.game-listen-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.game-listen-feedback {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
  padding: 24px;
  text-align: center;
}

.feedback-icon {
  font-size: 64px;
}

.feedback-text {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
}

@media (max-width: 360px) {
  .game-listen-play {
    width: 140px;
    height: 140px;
    font-size: 16px;
  }

  .game-listen-option {
    font-size: 18px;
    padding: 16px 10px;
    min-height: 60px;
  }
}
