#welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 9999;
  transition: opacity 0.8s ease;
}

.logo-box {
  position: relative;
  margin-bottom: 40px;
  cursor: pointer;
  transition: transform 0.2s;
}

.logo-box:active {
  transform: scale(0.95);
}

.welcome-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  animation: float 3s ease-in-out infinite;
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 167, 38, 0.5) 0%, rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%);
  animation: breathe-glow 3s infinite ease-in-out;
  z-index: 1;
}

.voice-tip {
  position: absolute;
  top: -15px;
  right: -35px;
  background: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #e65100;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: bounce 2s infinite;
  z-index: 3;
  pointer-events: none;
}

.voice-tip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 15px;
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #fff transparent transparent;
}

.welcome-title {
  font-size: 38px;
  color: #e65100;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: 3px;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.6);
  opacity: 0;
  animation: slideUp 0.8s ease-out 0.2s forwards;
}

.welcome-slogan {
  font-size: 18px;
  color: #8d6e63;
  margin-bottom: 60px;
  font-weight: bold;
  letter-spacing: 1px;
  opacity: 0;
  animation: slideUp 0.8s ease-out 0.4s forwards;
}

.btn-start {
  background: linear-gradient(to right, #ff9800, #ef6c00);
  color: white;
  border: none;
  padding: 16px 80px;
  font-size: 22px;
  border-radius: 50px;
  font-weight: bold;
  box-shadow: 0 10px 25px rgba(239, 108, 0, 0.35);
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.6s forwards;
}

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

.btn-start::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  animation: shine 3s infinite;
}

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

@keyframes breathe-glow {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0.8;
  }
}

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

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

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

@keyframes shine {
  0% {
    left: -100%;
  }
  20% {
    left: 200%;
  }
  100% {
    left: 200%;
  }
}

#homeScreen.legacy-home {
  padding: 20px;
  overflow-y: auto;
  background: #f5f1e8;
  font-family: "PingFang SC", "Microsoft YaHei", "KaiTi", sans-serif;
}

#homeScreen.legacy-home .home-header {
  margin-bottom: 20px;
  text-align: center;
}

#homeScreen.legacy-home .home-header > div {
  position: relative;
  display: block !important;
  min-height: 60px;
}

#homeScreen.legacy-home .app-title {
  font-size: 28px;
  color: #e65100;
  font-weight: 800;
  letter-spacing: 2px;
  white-space: nowrap;
  line-height: 60px;
}

#homeScreen.legacy-home .app-subtitle {
  font-size: 14px;
  color: #8d6e63;
  margin-top: 5px;
}

#homeScreen.legacy-home .panda-icon {
  position: absolute;
  top: 0;
  left: calc(50% + 118px);
  width: 60px;
  height: 60px;
  object-fit: contain;
}

@media screen and (max-width: 380px) {
  #homeScreen.legacy-home .panda-icon {
    left: auto;
    right: 12px;
    width: 54px;
    height: 54px;
  }
}

#homeScreen.legacy-home .course-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 40px;
}

#homeScreen.legacy-home .course-card {
  background: #fff;
  border-radius: 16px;
  padding: 15px 20px;
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.08);
  border-left: 6px solid #ff9800;
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#homeScreen.legacy-home .course-card > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

#homeScreen.legacy-home .course-card:active {
  transform: scale(0.98);
}

#homeScreen.legacy-home .course-idx {
  font-size: 32px;
  font-weight: bold;
  color: #ffe0b2;
  margin-right: 15px;
  font-family: Arial, sans-serif;
}

#homeScreen.legacy-home .course-info {
  flex: 1;
  min-width: 0;
}

#homeScreen.legacy-home .course-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  line-height: 1.35;
  text-align: left;
}

#homeScreen.legacy-home .course-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
}

#homeScreen.legacy-home .course-arrow {
  color: #ffcc80;
  font-size: 20px;
}

.legacy-beian {
  margin: 10px 0 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #999;
}

.legacy-beian a {
  text-decoration: none;
  color: #999;
}

#levelScreen.legacy-lesson {
  position: relative;
  background: var(--paper);
}

#levelScreen.legacy-lesson #lessonTitle {
  word-spacing: 0.18em;
}

#levelScreen.legacy-lesson .lesson-back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 30;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(62, 39, 35, 0.08);
  color: var(--ink);
  font-size: 26px;
  line-height: 30px;
  text-align: center;
  padding: 0;
}

#levelScreen.legacy-level {
  background: #f5f1e8;
  font-family: "PingFang SC", "Microsoft YaHei", "KaiTi", sans-serif;
}

#levelScreen.legacy-level .nav-bar {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
  width: 100%;
  flex-shrink: 0;
}

#levelScreen.legacy-level .nav-back {
  font-size: 24px;
  padding: 0 15px 0 5px;
  color: #555;
  cursor: pointer;
  background: transparent;
}

#levelScreen.legacy-level .nav-title {
  font-size: 18px;
  font-weight: bold;
  flex: 1;
  text-align: center;
  padding-right: 40px;
  line-height: 1.35;
}

#levelScreen.legacy-level .char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 15px;
  overflow-y: auto;
  flex: 1;
}

#levelScreen.legacy-level .char-card {
  background: #fff;
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffe0b2;
  position: relative;
  cursor: pointer;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
}

#levelScreen.legacy-level .char-card:active {
  transform: scale(0.98);
}

#levelScreen.legacy-level .char-card-text {
  font-family: "KaiTi", serif;
  font-size: 38px;
  color: #333;
  line-height: 1;
}

#levelScreen.legacy-level .char-card-pinyin {
  font-size: 12px;
  color: #888;
  margin-bottom: -5px;
  min-height: 14px;
}

#levelScreen.legacy-level .mi-grid {
  position: absolute;
  width: 75%;
  height: 75%;
  border: 1px dashed #ffcc80;
  pointer-events: none;
}

#levelScreen.legacy-level .mi-grid::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #ffcc80;
}

#levelScreen.legacy-level .mi-grid::after {
  content: "";
  position: absolute;
  left: 50%;
  height: 100%;
  width: 1px;
  background: #ffcc80;
}

@media screen and (max-width: 480px) {
  #levelScreen.legacy-level .char-grid {
    gap: 10px;
    padding: 12px;
  }

  #levelScreen.legacy-level .char-card-text {
    font-size: 32px;
  }

  #levelScreen.legacy-level .char-card-pinyin {
    font-size: 11px;
  }

  #levelScreen.legacy-level .mi-grid {
    width: 70%;
    height: 70%;
  }
}

@media screen and (max-width: 360px) {
  #levelScreen.legacy-level .char-grid {
    gap: 8px;
    padding: 10px;
  }

  #levelScreen.legacy-level .char-card-text {
    font-size: 28px;
  }

  #levelScreen.legacy-level .char-card-pinyin {
    font-size: 10px;
  }

  #levelScreen.legacy-level .mi-grid {
    width: 65%;
    height: 65%;
  }
}
