:root {
  --bg-primary: #F0F7FA;
  --bg-secondary: #F7FBFD;
  --text-primary: #1F3A47;
  --text-secondary: #2D4754;
  --text-muted: #647B88;
  --border-color: #D5E5EC;
  --card-shadow: 0 2px 16px rgba(31,58,71,0.08);
  --accent-normal: #539EBD;
  --accent-mini: #869BB3;
  --accent-major: #3A7A98;
  --accent-pink: #B8D4E0;
  --feedback-correct: #6BAE8A;
  --feedback-wrong: #D47A8A;
  --nav-bg: #FFFFFF;
  --nav-border: #D5E5EC;
  --input-bg: #FFFFFF;
  --input-border: #C2D8E1;
  --modal-overlay: rgba(31,58,71,0.35);
  --gradient-start: #539EBD;
  --gradient-end: #86C5D9;
}

[data-theme="dark"] {
  --bg-primary: #131A24;
  --bg-secondary: #1E2936;
  --text-primary: #E2E8F0;
  --text-secondary: #CBD5E1;
  --text-muted: #8892A0;
  --border-color: #2A3544;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.4);
  --accent-normal: #4A9D7C;
  --accent-mini: #6292C8;
  --accent-major: #5AAF8F;
  --accent-pink: #6292C8;
  --feedback-correct: #4A9D7C;
  --feedback-wrong: #C97A86;
  --nav-bg: #1E2936;
  --nav-border: #2A3544;
  --input-bg: #1E2936;
  --input-border: #2A3544;
  --modal-overlay: rgba(0,0,0,0.7);
  --gradient-start: #4A9D7C;
  --gradient-end: #6292C8;
}

.home-page {
  --bg-primary: #F0F7FA;
  --bg-secondary: #E3EFF5;
  --text-primary: #1F3A47;
  --text-secondary: #3E6275;
  --text-muted: #7A96A5;
  --border-color: #D5E5EC;
  --card-shadow: 0 2px 16px rgba(31,58,71,0.08);
  --accent-normal: #539EBD;
  --accent-mini: #86C5D9;
  --accent-major: #3A7A98;
  --accent-pink: #86C5D9;
  --feedback-correct: #6BAE8A;
  --feedback-wrong: #D47A8A;
  --input-border: #C2D8E1;
  --modal-overlay: rgba(31,58,71,0.3);
  --gradient-start: #539EBD;
  --gradient-end: #86C5D9;
  background: #F0F7FA;
  min-height: 100%;
  margin: -16px;
  padding: 16px;
}

[data-theme="dark"] .home-page {
  --bg-primary: #131A24;
  --bg-secondary: #1E2936;
  --text-primary: #E2E8F0;
  --text-secondary: #CBD5E1;
  --text-muted: #8892A0;
  --border-color: #2A3544;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.4);
  --accent-normal: #4A9D7C;
  --accent-mini: #6292C8;
  --accent-major: #5AAF8F;
  --accent-pink: #6292C8;
  --feedback-correct: #4A9D7C;
  --feedback-wrong: #C97A86;
  --input-bg: #1E2936;
  --input-border: #2A3544;
  --modal-overlay: rgba(0,0,0,0.7);
  --gradient-start: #4A9D7C;
  --gradient-end: #6292C8;
  background: #131A24;
}

.home-page .btn-primary {
  background: #539EBD;
  color: #FFFFFF;
}

.home-page .progress-bar-fill.normal {
  background: #539EBD;
}

.home-page .toggle-switch.active {
  background: #539EBD;
}

.home-page .card-normal,
.home-page .card-mini,
.home-page .card-major {
  border-left: 4px solid #539EBD;
}

[data-theme="dark"] .home-page .btn-primary,
[data-theme="dark"] .home-page .progress-bar-fill.normal,
[data-theme="dark"] .home-page .toggle-switch.active {
  background: #4A9D7C;
}

[data-theme="dark"] .home-page .card-normal,
[data-theme="dark"] .home-page .card-mini,
[data-theme="dark"] .home-page .card-major {
  border-left-color: #4A9D7C;
}

.history-page .card-normal,
.history-page .card-mini,
.history-page .card-major {
  border-left: 4px solid #539EBD;
}

[data-theme="dark"] .history-page .card-normal,
[data-theme="dark"] .history-page .card-mini,
[data-theme="dark"] .history-page .card-major {
  border-left-color: #4A9D7C;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

#page-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 72px;
  transition: opacity 0.2s ease;
}

#page-container.page-leave {
  opacity: 0;
}

#page-container.page-enter {
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

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

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (min-width: 600px) {
  html, body { font-size: 17px; }
  #app { max-width: 560px; }
  #bottom-nav { max-width: 560px; height: 60px; }
  #page-container { padding: 20px; padding-bottom: 80px; }
  .card { padding: 22px; border-radius: 18px; }
  .word-title { font-size: 32px; }
  .btn { padding: 14px 28px; font-size: 16px; }
  .level-circle { width: 72px; height: 72px; font-size: 22px; }
  .review-modal { max-width: 520px; }
  .home-page { margin: -20px; padding: 20px; }
}

@media (min-width: 900px) {
  html, body { font-size: 18px; }
  #app { max-width: 680px; }
  #bottom-nav { max-width: 680px; height: 64px; }
  #page-container { padding: 24px; padding-bottom: 88px; }
  .card { padding: 24px; }
  .word-title { font-size: 36px; }
  .level-circle { width: 80px; height: 80px; font-size: 24px; }
  .review-modal { max-width: 600px; max-height: 85vh; }
  .home-title { font-size: 26px; }
  .home-page { margin: -24px; padding: 24px; }
}

@media (min-width: 900px) and (orientation: landscape) {
  #app { max-width: 760px; }
  #bottom-nav { max-width: 760px; }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 12px;
  min-width: 44px;
  min-height: 44px;
  transition: color 0.2s;
  border-radius: 8px;
}

.nav-item.active {
  color: var(--accent-normal);
  background: rgba(108,180,176,0.08);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.nav-label {
  font-size: 11px;
}

.card {
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}

.card-normal { border-left: 4px solid var(--accent-normal); }
.card-mini { border-left: 4px solid var(--accent-mini); }
.card-major { border-left: 4px solid var(--accent-major); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #FFFFFF;
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-success {
  background: linear-gradient(135deg, #7BC67E, #56B4A9);
  color: #FFFFFF;
}

.btn-warning {
  background: linear-gradient(135deg, #B8D4E0, #539EBD);
  color: #FFFFFF;
}

.btn-danger {
  background: linear-gradient(135deg, #647B88, #1F3A47);
  color: #FFFFFF;
}

.btn:disabled {
  background: #D5E5EC;
  color: #8892A0;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  display: flex;
  width: 100%;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  background: var(--input-bg);
  color: var(--text-primary);
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-normal);
  box-shadow: 0 0 0 3px rgba(108,180,176,0.12);
}

.input-field.error {
  border-color: var(--feedback-wrong);
}

.hint-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.hint-error {
  color: var(--feedback-wrong);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-intermediate { background: #E8F1F5; color: #647B88; }
.badge-upper { background: #B8D4E0; color: #1F3A47; }
.badge-advanced { background: #539EBD; color: #F0F7FA; }

[data-theme="dark"] .badge-intermediate { background: #1F3A47; color: #E8F1F5; }
[data-theme="dark"] .badge-upper { background: #1E2936; color: #B8D4E0; }
[data-theme="dark"] .badge-advanced { background: #647B88; color: #F0F7FA; }

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar-fill.normal { background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end)); }
.progress-bar-fill.mini { background: linear-gradient(90deg, #B8D4E0, #539EBD); }
.progress-bar-fill.major { background: linear-gradient(90deg, #647B88, #1F3A47); }

.dot-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.2s;
}

.dot.active {
  background: var(--accent-normal);
  width: 20px;
  border-radius: 4px;
}

.tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border-color);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  color: var(--accent-normal);
  border-bottom-color: var(--accent-normal);
  font-weight: 500;
}

.option-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.option-btn:active {
  transform: scale(0.98);
  background: var(--bg-secondary);
}

.option-btn.correct {
  background: #EFF9F3;
  border-color: var(--feedback-correct);
  color: #2F7A57;
}

.option-btn.wrong {
  background: #FAEBED;
  border-color: var(--feedback-wrong);
  color: #9A4A55;
}

[data-theme="dark"] .option-btn.correct {
  background: #1F3D2F;
  color: #8DD3B0;
}

[data-theme="dark"] .option-btn.wrong {
  background: #3D1F25;
  color: #E0A0AB;
}

.word-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.phonetic {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 12px;
  color: var(--accent-normal);
  transition: all 0.2s;
  vertical-align: middle;
  margin-right: 2px;
}

.speak-btn:active {
  background: var(--accent-normal);
  color: #FFFFFF;
  transform: scale(0.9);
}

.voice-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.voice-btn:active {
  transform: scale(0.9);
}

.voice-btn.active {
  background: var(--accent-normal);
  border-color: var(--accent-normal);
  color: #FFFFFF;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107,191,171,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(107,191,171,0); }
}

.definition {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.usage-list {
  list-style: none;
  margin-bottom: 16px;
}

.usage-list li {
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.usage-list li::before {
  content: "- ";
  color: var(--accent-normal);
  font-weight: 600;
}

.example-card {
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 8px;
}

.examples-swipe {
  touch-action: pan-y;
  user-select: none;
}

.example-meaning-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(244,156,187,0.08);
  border-left: 3px solid var(--accent-normal);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.example-meaning-index {
  background: var(--accent-normal);
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.example-meaning-pos {
  color: var(--text-secondary);
  font-weight: 600;
  font-style: italic;
}

.example-meaning-def {
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.example-en {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.example-zh {
  font-size: 13px;
  color: var(--text-secondary);
}

.star-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.star-btn.active {
  color: #539EBD;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 18px;
  font-weight: 600;
}

.back-btn {
  font-size: 14px;
  color: var(--accent-normal);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.level-complete-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.level-complete-card {
  background: linear-gradient(135deg, #EFF9F3, #D9F0E3);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  animation: scaleIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(107,174,138,0.2);
  border: 1px solid #C5E6D3;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.level-complete-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #2F7A57;
}

.level-complete-card p {
  color: #4A8A6B;
  margin-bottom: 20px;
}

.success-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 14px 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 14px;
  border: 1px solid rgba(197,230,211,0.6);
}

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

.success-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #2F7A57;
  line-height: 1.2;
}

.success-stat-label {
  font-size: 11px;
  color: #4A8A6B;
  margin-top: 4px;
}

[data-theme="dark"] .success-stats {
  background: rgba(255,255,255,0.05);
  border-color: #3D6B54;
}

[data-theme="dark"] .success-stat-num {
  color: #9AD4B5;
}

[data-theme="dark"] .success-stat-label {
  color: #8DD3B0;
}

[data-theme="dark"] .level-complete-card {
  background: linear-gradient(135deg, #1F3D2F, #2A5140);
  border-color: #3D6B54;
}

[data-theme="dark"] .level-complete-card h2 {
  color: #9AD4B5;
}

[data-theme="dark"] .level-complete-card p {
  color: #8DD3B0;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  z-index: 200;
}

.modal {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  width: 280px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(45,55,72,0.12);
}

.modal h3 {
  margin-bottom: 12px;
}

.modal p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--border-color);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.setting-value {
  font-size: 14px;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 14px;
  margin-top: 8px;
}

.word-count {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 4px;
}

.word-count.warning {
  color: var(--accent-major);
}

.word-count.ok {
  color: var(--accent-normal);
}

.expandable {
  cursor: pointer;
}

.expandable-content {
  display: none;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 12px;
}

.expandable.open .expandable-content {
  display: block;
}

.score-display {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 20px 0;
}

.lock-icon {
  color: var(--text-muted);
  font-size: 20px;
}

.home-top-bar {
  position: sticky;
  top: -16px;
  margin: -16px -16px 12px -16px;
  padding: 16px;
  background: var(--bg-primary);
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.home-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.home-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.home-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.home-stats-inline {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.home-stats-inline b {
  color: var(--accent-normal);
  font-weight: 700;
  font-size: 14px;
  margin-right: 3px;
}

.home-notice {
  text-align: center;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.inline-svg {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}

.inline-svg svg {
  width: 20px;
  height: 20px;
}

.inline-svg-small {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 3px;
}

.inline-svg-small svg {
  width: 12px;
  height: 12px;
}

.level-num {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
}

.level-circle svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 1px 2px rgba(69,9,32,0.3));
}

.level-locked .level-circle svg {
  filter: grayscale(0.5) opacity(0.5);
}

.mascot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #FFF4ED, #FFE8E8);
  border-radius: 20px;
  border: 2px solid #B8D4E0;
  box-shadow: 0 4px 12px rgba(218,98,125,0.12);
  position: relative;
}

.mascot-card::before {
  content: "💕";
  position: absolute;
  top: -8px;
  right: 16px;
  font-size: 16px;
}

[data-theme="dark"] .mascot-card {
  background: linear-gradient(135deg, #131A24, #1E2936);
  border-color: #539EBD;
}

.mascot-avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mascotBob 3s ease-in-out infinite;
}

@keyframes mascotBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

.melody-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(218,98,125,0.2));
}

.mascot-bubble {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: 12px;
  border-top-left-radius: 4px;
  position: relative;
}

.mascot-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid var(--bg-primary);
}

.level-row {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

.level-deco {
  position: absolute;
  font-size: 24px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  animation: decoFloat 4s ease-in-out infinite;
  pointer-events: none;
}

.level-deco-left {
  left: 12px;
}

.level-deco-right {
  right: 12px;
  animation-delay: -2s;
}

@keyframes decoFloat {
  0%, 100% { transform: translateY(-50%) rotate(-10deg); }
  50% { transform: translateY(calc(-50% - 6px)) rotate(10deg); }
}

.level-milestone {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-major);
  background: var(--bg-primary);
  padding: 2px 10px;
  border-radius: 10px;
  border: 1px solid var(--accent-major);
  white-space: nowrap;
  z-index: 2;
}

.level-map {
  padding: 20px 0 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.level-row {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

.level-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s;
}

.level-node.clickable {
  cursor: pointer;
}

.level-node.clickable:active {
  transform: scale(0.94);
}

.level-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 4px solid var(--bg-primary);
  transition: box-shadow 0.2s;
}

.level-caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.level-tag {
  position: absolute;
  top: -22px;
  background: var(--bg-primary);
  color: var(--accent-normal);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  border: 2px solid var(--accent-normal);
  white-space: nowrap;
  animation: bounce 1.2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.level-normal .level-circle {
  background: linear-gradient(135deg, var(--accent-normal), #647B88);
}
.level-mini .level-circle {
  background: linear-gradient(135deg, var(--accent-mini), #539EBD);
}
.level-major .level-circle {
  background: linear-gradient(135deg, var(--accent-major), #1F3A47);
}

.home-page .level-normal .level-circle,
.home-page .level-mini .level-circle,
.home-page .level-major .level-circle {
  background: #539EBD;
}

.home-page .level-current .level-circle {
  box-shadow: 0 4px 0 rgba(31,58,71,0.2), 0 0 0 4px rgba(83,158,189,0.35), 0 0 20px rgba(83,158,189,0.55);
  animation: levelPulseBlue 2s infinite;
}

@keyframes levelPulseBlue {
  0%, 100% { box-shadow: 0 4px 0 rgba(31,58,71,0.2), 0 0 0 4px rgba(83,158,189,0.35), 0 0 20px rgba(83,158,189,0.55); }
  50% { box-shadow: 0 4px 0 rgba(31,58,71,0.2), 0 0 0 8px rgba(83,158,189,0.22), 0 0 28px rgba(83,158,189,0.7); }
}

.home-page .level-locked .level-circle {
  background: #539EBD;
  opacity: 0.55;
}

[data-theme="dark"] .home-page .level-normal .level-circle,
[data-theme="dark"] .home-page .level-mini .level-circle,
[data-theme="dark"] .home-page .level-major .level-circle {
  background: #4A9D7C;
}

[data-theme="dark"] .home-page .level-current .level-circle {
  box-shadow: 0 4px 0 rgba(0,0,0,0.25), 0 0 0 4px rgba(74,157,124,0.35), 0 0 20px rgba(74,157,124,0.55);
  animation: levelPulseBlueDark 2s infinite;
}

@keyframes levelPulseBlueDark {
  0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,0.25), 0 0 0 4px rgba(74,157,124,0.35), 0 0 20px rgba(74,157,124,0.55); }
  50% { box-shadow: 0 4px 0 rgba(0,0,0,0.25), 0 0 0 8px rgba(74,157,124,0.22), 0 0 28px rgba(74,157,124,0.7); }
}

[data-theme="dark"] .home-page .level-locked .level-circle {
  background: #4A9D7C;
  opacity: 0.4;
}

.level-completed .level-circle {
  opacity: 0.85;
  position: relative;
}

.level-completed .level-circle::after {
  content: "✓";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: var(--feedback-correct);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
  font-weight: 700;
}

.level-current .level-circle {
  box-shadow: 0 4px 0 rgba(0,0,0,0.15), 0 0 0 4px rgba(107,191,171,0.25), 0 0 20px rgba(107,191,171,0.4);
  animation: levelPulse 2s infinite;
}

@keyframes levelPulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,0.15), 0 0 0 4px rgba(107,191,171,0.25), 0 0 20px rgba(107,191,171,0.4); }
  50% { box-shadow: 0 4px 0 rgba(0,0,0,0.15), 0 0 0 8px rgba(107,191,171,0.18), 0 0 28px rgba(107,191,171,0.5); }
}

.level-locked .level-circle {
  background: #E5D3C8;
  color: #FFFFFF;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  font-size: 16px;
}

[data-theme="dark"] .level-locked .level-circle {
  background: #1E2936;
  color: #8892A0;
}

.level-locked .level-caption {
  opacity: 0.5;
}

.review-overlay {
  padding: 20px;
}

.review-modal {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.review-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  min-width: 32px;
  min-height: 32px;
}

.review-close:active {
  color: var(--accent-normal);
}

.review-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 20px 20px;
}

.review-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-normal);
  margin: 14px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border-color);
}

.review-section-title:first-child {
  margin-top: 0;
}

.review-section-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.review-word {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 10px;
}

.review-word-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.review-word-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.review-word-phonetic {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.review-word-def {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.review-word .example-card {
  background: var(--bg-primary);
  font-size: 12px;
  padding: 8px 10px;
}

.review-sentence {
  font-size: 13px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 6px;
}

.review-sentence b {
  color: var(--accent-normal);
}

.review-essay {
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.review-error {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid var(--feedback-wrong);
}

.review-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.reminder-banner {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  max-width: 92%;
  min-width: 260px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #FFFFFF;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(31,58,71,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  animation: reminder-slide-in 0.35s ease-out;
}

.reminder-banner.hide {
  animation: reminder-slide-out 0.35s ease-in forwards;
}

.reminder-banner-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.reminder-banner-action {
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
  border: none;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.reminder-banner-action:hover {
  background: rgba(255,255,255,0.3);
}

.reminder-banner-close {
  background: transparent;
  color: #FFFFFF;
  border: none;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0.85;
}

@keyframes reminder-slide-in {
  from { transform: translate(-50%, -120%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes reminder-slide-out {
  from { transform: translate(-50%, 0); opacity: 1; }
  to { transform: translate(-50%, -120%); opacity: 0; }
}

.reminder-time-input {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
}

.reminder-status-hint {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 0 12px 0;
  line-height: 1.5;
}

.reminder-status-hint.warn {
  color: var(--feedback-wrong);
}
