@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=ZCOOL+KuaiLe&display=swap');

:root {
  --primary: #1c523c;
  --primary-light: #2d7756;
  --primary-bg: #e8f4ed;
  --secondary: #cda851;
  --secondary-bg: #f9f5eb;
  --danger: #c62828;
  --danger-bg: #ffebee;
  --text-dark: #202d26;
  --text-muted: #62756a;
  --bg-gradient: linear-gradient(135deg, #e8f4ed 0%, #f7f5ef 100%);
  --white: #ffffff;
  
  --shadow-sm: 0 4px 10px rgba(28, 82, 60, 0.05);
  --shadow-md: 0 8px 20px rgba(28, 82, 60, 0.08);
  --shadow-lg: 0 16px 36px rgba(28, 82, 60, 0.12);
  
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  
  --font-zh: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
  --font-en: 'Outfit', sans-serif;
  --font-title: 'ZCOOL KuaiLe', sans-serif;
}

/* ------------------------------
   BASE CONFIGURATION
------------------------------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body {
  font-family: var(--font-zh);
  background: #f0f3f1;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* H5 Mobile Container Frame */
.h5-container {
  width: 100%;
  max-width: 412px;
  height: 100vh;
  max-height: 840px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  .h5-container {
    border-radius: var(--radius-lg);
    border: 8px solid #202d26;
    height: 92vh;
  }
}

/* Bamboo Top Decor Ornament */
.bamboo-bg-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px;
  background: linear-gradient(180deg, rgba(28,82,60,0.12) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  z-index: 0;
}
.bamboo-bg-decor::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 15px;
  width: 80px;
  height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' opacity='0.25'%3E%3Cpath d='M30,10 Q50,40 10,70 Q40,60 50,20 Q60,60 90,70 Q50,40 70,10' fill='%231c523c'/%3E%3C/svg%3E") no-repeat center/contain;
}

.bamboo-bg-decor.mini {
  height: 90px;
}

/* ------------------------------
   ROUTING VIEW STATES
------------------------------ */
.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 20px;
  padding-bottom: 76px; /* space for bottom nav */
  background: #fbfbf9;
  z-index: 1;
  overflow-y: auto;
  box-sizing: border-box;
}

.view.active {
  display: flex;
  animation: slideIn 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

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

/* Views without bottom navigation have normal padding */
#view-cover, #view-login, #view-register, #view-quiz, #view-completed, #view-leaderboard, #view-study-records, #view-wrong-questions, #view-achievements, #view-settings {
  padding-bottom: 20px;
}

/* ------------------------------
   BUTTON STYLES
------------------------------ */
button {
  font-family: inherit;
}

.btn-forest {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn-forest:active {
  transform: scale(0.97);
}

.btn-outline-forest {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn-outline-forest:active {
  transform: scale(0.97);
}

.btn-danger-red {
  background: linear-gradient(135deg, var(--danger) 0%, #e53935 100%);
  color: var(--white);
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.btn-danger-red:active {
  transform: scale(0.97);
}

.full-width {
  width: 100%;
}

.back-btn {
  background: var(--primary-bg);
  color: var(--primary);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}
.back-btn:active {
  transform: scale(0.9);
}

/* ------------------------------
   1. COVER VIEW
------------------------------ */
#view-cover {
  justify-content: space-between;
  padding: 40px 24px;
  background: var(--bg-gradient);
}

.cover-header {
  text-align: center;
  margin-top: 30px;
}

.main-title {
  font-family: var(--font-title);
  font-size: 38px;
  color: var(--primary);
  letter-spacing: 3px;
  text-shadow: 2px 2px 0px var(--white);
}

.sub-slogan {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 5px;
  margin-top: 10px;
}

.cover-mascot-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
}

.stage-glow {
  position: absolute;
  width: 220px;
  height: 80px;
  background: radial-gradient(circle, rgba(28, 82, 60, 0.25) 0%, rgba(255,255,255,0) 70%);
  bottom: 30px;
  z-index: 0;
}

.stage-mascots {
  max-width: 92%;
  max-height: 280px;
  object-fit: contain;
  z-index: 1;
  animation: floatMascots 4s ease-in-out infinite;
}

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

.cover-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ------------------------------
   2 & 3. LOGIN & REGISTER VIEWS
------------------------------ */
.sub-header-bar {
  display: flex;
  align-items: center;
  height: 48px;
}

.auth-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
  z-index: 5;
  margin-top: -30px;
}

.auth-main-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.auth-sub-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-item {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.input-item input {
  width: 100%;
  padding: 14px 16px;
  padding-left: 42px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(28, 82, 60, 0.15);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--white);
  transition: all 0.2s;
}

.input-item input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 82, 60, 0.1);
}

.eye-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 24px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.checkmark {
  position: absolute;
  left: 0;
  height: 16px;
  width: 16px;
  background-color: var(--white);
  border: 1.5px solid rgba(28, 82, 60, 0.3);
  border-radius: 4px;
}
.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary);
}
.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}
.checkmark::after {
  content: "";
  position: absolute;
  display: none;
}
.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}
.checkbox-container .checkmark::after {
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-pwd-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.terms-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
}

.submit-btn {
  margin-top: 10px;
}

.auth-footer-link {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-footer-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

/* Character standing on the bottom right */
.auth-side-mascot {
  position: absolute;
  bottom: 0;
  right: 0;
  max-height: 180px;
  width: auto;
  pointer-events: none;
  z-index: 1;
}

/* ------------------------------
   4. HOME VIEW
------------------------------ */
.home-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.user-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--primary-bg);
  object-fit: contain;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.user-text {
  display: flex;
  flex-direction: column;
}

.home-username {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.home-user-slogan {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.home-score-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary-bg);
  border: 1.5px solid rgba(205,168,81,0.3);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.coin-icon {
  font-size: 15px;
}

.points-val {
  font-family: var(--font-en);
  font-weight: 800;
  color: #a47e24;
  font-size: 14px;
}

/* Banner Card */
.home-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--white);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  overflow: hidden;
}

.banner-texts {
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.banner-texts h4 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.banner-texts h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.banner-btn {
  background: var(--white);
  color: var(--primary);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  transition: all 0.2s;
}
.banner-btn:active {
  transform: scale(0.95);
}

.banner-mascot {
  position: absolute;
  right: -5px;
  bottom: -15px;
  height: 125%;
  width: auto;
  object-fit: contain;
  z-index: 1;
}

/* Quick Menu Grid */
.home-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.menu-item-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.menu-item-card:active {
  transform: scale(0.95);
}

.menu-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--white);
  margin-bottom: 8px;
}

.menu-icon-circle.green {
  background: linear-gradient(135deg, #43a047, #66bb6a);
  box-shadow: 0 4px 10px rgba(67, 160, 71, 0.25);
}
.menu-icon-circle.gold {
  background: linear-gradient(135deg, #f57c00, #ffb74d);
  box-shadow: 0 4px 10px rgba(245, 124, 0, 0.25);
}
.menu-icon-circle.purple {
  background: linear-gradient(135deg, #7b1fa2, #ba68c8);
  box-shadow: 0 4px 10px rgba(123, 31, 162, 0.25);
}

.menu-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

/* Progress card */
.home-progress-section {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.home-ranking-card {
  margin-bottom: 16px;
  padding: 15px 15px 12px;
  border: 1px solid rgba(21,83,68,.08);
  border-radius: 20px;
  background: rgba(255,253,248,.86);
  box-shadow: var(--shadow-sm);
}

.home-ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.home-ranking-header h4 {
  margin-top: 2px;
  color: var(--primary-deep);
  font-size: 14px;
  letter-spacing: .03em;
}

.home-ranking-crown {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(200,164,93,.35);
  border-radius: 50% 50% 10px 50%;
  color: var(--secondary-deep);
  background: var(--secondary-bg);
  font-family: var(--font-title);
  font-size: 13px;
  transform: rotate(7deg);
}

.home-ranking-top3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  transition: opacity .2s ease;
}

.home-ranking-top3.loading { opacity: .52; }

.home-rank-mini {
  position: relative;
  min-width: 0;
  padding: 11px 6px 9px;
  border: 1px solid rgba(21,83,68,.07);
  border-radius: 15px;
  background: #f5f4ed;
  text-align: center;
  overflow: hidden;
}

.home-rank-mini.first {
  border-color: rgba(200,164,93,.38);
  background: linear-gradient(145deg, #fff8e8, #f6ecd1);
}

.home-rank-mini.second { background: linear-gradient(145deg, #f4f7f5, #e8efeb); }
.home-rank-mini.third { background: linear-gradient(145deg, #fbf2ec, #f1e3da); }

.home-rank-number {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 7px 7px 7px 2px;
  color: #fff;
  background: var(--primary);
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 800;
}

.home-rank-mini.first .home-rank-number { color: #5d4312; background: #e2bf69; }
.home-rank-mini.third .home-rank-number { background: #a76e49; }

.home-rank-mini img {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 5px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  outline: 1px solid rgba(21,83,68,.13);
  object-fit: contain;
  background: #edf3ef;
  mix-blend-mode: multiply;
}

.home-rank-mini strong,
.home-rank-mini > span:last-child {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-rank-mini strong { color: var(--text-dark); font-size: 10px; }
.home-rank-mini > span:last-child { margin-top: 2px; color: var(--primary); font-family: var(--font-en); font-size: 9px; font-weight: 800; }
.home-ranking-hint { margin-top: 9px; color: var(--text-muted); font-size: 8px; text-align: center; letter-spacing: .04em; }

.progress-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.progress-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.progress-days strong {
  color: var(--primary);
  font-family: var(--font-en);
  font-size: 15px;
}

.progress-ratio {
  font-family: var(--font-en);
  font-weight: 800;
  color: var(--primary);
}

.home-progress-bar-container {
  height: 8px;
  background: #f0f2f0;
  border-radius: 4px;
  overflow: hidden;
}

.home-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ------------------------------
   16. STUDY EXPECT VIEW
------------------------------ */
.top-title-bar {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(28, 82, 60, 0.08);
  margin-bottom: 24px;
}
.top-title-bar.centered {
  text-align: center;
}

.view-title-main {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.expect-center-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.expect-mascot {
  max-width: 160px;
  height: auto;
  animation: bounceSlow 3s ease-in-out infinite;
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.expect-text {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ------------------------------
   5. CHAPTER SELECTION VIEW
------------------------------ */
.chapters-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chapter-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 5px solid var(--primary-light);
}

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

.chapter-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 14px;
}

.chapter-info {
  flex: 1;
}

.chapter-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.chapter-card-prog {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ------------------------------
   6. QUESTION VIEW
------------------------------ */
.top-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.quiz-progress-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.quiz-timer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f1f3f1;
  padding: 6px 14px;
  border-radius: 20px;
  align-self: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.timer-value {
  font-family: var(--font-en);
  font-weight: 800;
  color: var(--text-dark);
  font-size: 13px;
}

.quiz-question-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-header-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px dashed rgba(28, 82, 60, 0.2);
}

.quiz-question-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.6;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-option-card:hover {
  border-color: rgba(28, 82, 60, 0.3);
}

.quiz-option-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.opt-prefix-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0f2f0;
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 13px;
}

.quiz-option-card.selected .opt-prefix-badge {
  background: var(--primary);
  color: var(--white);
}

.opt-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.quiz-bottom-row {
  margin-top: 20px;
  z-index: 10;
}

.submit-ans-btn {
  width: 100%;
}
.submit-ans-btn.disabled {
  background: #bdc8c1;
  box-shadow: none;
  cursor: not-allowed;
}

.quiz-side-mascot {
  position: absolute;
  bottom: 68px;
  right: 6px;
  width: 72px;
  height: 148px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.quiz-side-mascot img {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 148px;
  width: auto;
  max-width: none;
}

/* ------------------------------
   7 & 8. QUIZ FEEDBACK OVERLAYS
------------------------------ */
.feedback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(32, 45, 38, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
}

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

.feedback-card {
  width: 100%;
  max-width: 340px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popScale 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

.feedback-card.correct {
  border: 4px solid var(--primary-light);
}

.feedback-card.incorrect {
  border: 4px solid var(--danger);
}

@keyframes popScale {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.feedback-indicator-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--white);
  margin-bottom: 12px;
}

.feedback-indicator-badge.correct {
  background: var(--primary-light);
}

.feedback-indicator-badge.incorrect {
  background: var(--danger);
}

.feedback-header {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 14px;
}

.feedback-header.correct { color: var(--primary); }
.feedback-header.incorrect { color: var(--danger); }

.feedback-mascot-wrapper {
  position: relative;
  width: 82px;
  height: 180px;
  flex: 0 0 82px;
  overflow: hidden;
}

.feedback-mascot {
  position: absolute;
  left: -20px;
  bottom: 0;
  height: 180px;
  max-height: none;
  width: auto;
  max-width: none;
}

.incorrect-teaching-stage {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 4px 0 16px;
}

.incorrect-teaching-stage .blackboard-box {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 166px;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.explanation-box {
  background: #f6f8f6;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
}

.explanation-ans-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.explanation-ans-desc {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
  font-weight: 600;
}

.continue-btn {
  width: 100%;
}

/* ------------------------------
   9. QUIZ COMPLETED VIEW
------------------------------ */
#view-completed {
  justify-content: space-between;
  padding: 40px 24px;
  background: var(--bg-gradient);
}

.completed-congrats-header {
  text-align: center;
  margin-top: 20px;
}

.congrats-title {
  font-family: var(--font-title);
  font-size: 30px;
  color: var(--primary);
  letter-spacing: 2px;
}

.completed-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin: 30px 0;
}

.completed-mascot-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.completed-medal {
  max-width: 90px;
  height: auto;
  animation: pulseRotate 3s infinite ease-in-out;
}

@keyframes pulseRotate {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(4deg); }
}

.completed-char {
  max-height: 120px;
  width: auto;
}

.completed-stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1.5px dashed rgba(28, 82, 60, 0.15);
  padding-top: 18px;
}

.completed-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-num {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.stat-num.correct {
  color: var(--primary-light);
}

.stat-num.incorrect {
  color: var(--danger);
}

.completed-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.completed-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.completed-secondary-actions .btn-outline-forest,
.btn-ranking {
  min-height: 48px;
  padding: 10px 12px;
}

.btn-ranking {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid rgba(164,126,36,.54);
  border-radius: 14px;
  color: #72521b;
  background: linear-gradient(145deg, #fff8e7, #f3e2b8);
  box-shadow: 0 8px 18px rgba(164,126,36,.12);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn-ranking:active { transform: scale(.98); }

/* ------------------------------
   10. LEADERBOARD VIEW
------------------------------ */
.view-title-center {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
}

.leaderboard-podium-section {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 200px;
  margin-bottom: 20px;
  padding: 0 10px;
  border-bottom: 1.5px solid rgba(28, 82, 60, 0.08);
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30%;
}

.podium-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.podium-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: var(--primary-bg);
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.gold-crown {
  position: absolute;
  top: -16px;
  font-size: 18px;
  transform: rotate(-10deg);
}

.podium-badge {
  position: absolute;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--white);
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.podium-badge.first { background: #ffd700; color: #5c4308; }
.podium-badge.second { background: #c0c0c0; color: #3c3c3c; }
.podium-badge.third { background: #cd7f32; color: #503114; }

.podium-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dark);
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.podium-score {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 11px;
  color: var(--primary);
  margin-bottom: 6px;
}

/* Podium pedestal blocks */
.podium-bar {
  width: 100%;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.podium-bar.first {
  height: 60px;
  background: linear-gradient(180deg, rgba(205,168,81,0.2) 0%, rgba(205,168,81,0.02) 100%);
  border-top: 4px solid var(--secondary);
}
.podium-col.first .podium-avatar {
  width: 60px;
  height: 60px;
  border-color: var(--secondary);
}

.podium-bar.second {
  height: 40px;
  background: linear-gradient(180deg, rgba(28,82,60,0.15) 0%, rgba(28,82,60,0.02) 100%);
  border-top: 4px solid var(--primary-light);
}

.podium-bar.third {
  height: 28px;
  background: linear-gradient(180deg, rgba(164,126,36,0.12) 0%, rgba(164,126,36,0.02) 100%);
  border-top: 4px solid #a47e24;
}

.leaderboard-list-wrapper {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.leaderboard-row {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.leaderboard-row.me {
  background: #fdfaf0;
  border: 1.5px solid rgba(205, 168, 81, 0.4);
}

.rank-lbl-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f0f2f0;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 11px;
  margin-right: 12px;
}

.leaderboard-row.me .rank-lbl-badge {
  background: var(--secondary);
  color: var(--white);
}

.rank-row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-bg);
  object-fit: contain;
  margin-right: 12px;
}

.rank-row-name {
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-row-score {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
}

.leaderboard-footer-text {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  font-weight: bold;
}

/* ------------------------------
   11. PROFILE / MINE VIEW
------------------------------ */
.mine-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  margin-bottom: 10px;
}

.settings-gear-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.settings-gear-btn:active {
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.mine-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  background: var(--primary-bg);
  object-fit: contain;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.profile-meta {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.profile-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: bold;
  font-family: var(--font-en);
  margin-top: 2px;
}

.mine-stats-bar {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30%;
  cursor: pointer;
}

.stat-val {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: bold;
  margin-top: 4px;
}

.divider-line {
  width: 1px;
  height: 32px;
  background: rgba(28, 82, 60, 0.12);
}

/* Menu Row items */
.mine-menu-list {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}

.menu-row {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1.2px solid rgba(28, 82, 60, 0.06);
  cursor: pointer;
}
.menu-row:last-child {
  border-bottom: none;
}
.menu-row:active {
  opacity: 0.7;
}

.menu-icon {
  font-size: 18px;
  margin-right: 14px;
}

.menu-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.menu-val-desc {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: bold;
  margin-right: 8px;
}

.chevron-arrow {
  color: rgba(28, 82, 60, 0.4);
  display: flex;
  align-items: center;
}

/* ------------------------------
   12. STUDY RECORDS VIEW
------------------------------ */
.records-calendar-row {
  display: flex;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 12%;
}

.day-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: bold;
  margin-bottom: 4px;
}

.day-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 12px;
  color: var(--text-dark);
}

.cal-day.active .day-num {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
}

.record-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}

.record-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.record-icon-badge.ch-1 { background: #e8f5e9; color: #2e7d32; }
.record-icon-badge.ch-2 { background: #f3e5f5; color: #7b1fa2; }
.record-icon-badge.ch-3 { background: #fff3e0; color: #e65100; }
.record-icon-badge.ch-4 { background: #efebe9; color: #5d4037; }

.record-body {
  flex: 1;
}

.record-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.record-detail {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.record-time-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: bold;
  text-align: right;
  align-self: flex-start;
  margin-top: 2px;
}

/* ------------------------------
   13. MY WRONG QUESTIONS VIEW
------------------------------ */
.wrong-tabs-bar {
  display: flex;
  background: rgba(28, 82, 60, 0.08);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 18px;
}

.wrong-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 17px;
  cursor: pointer;
  transition: all 0.2s;
}

.wrong-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.wrong-questions-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wrong-q-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--danger);
}

.wrong-q-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: bold;
  margin-bottom: 8px;
}

.err-count-badge {
  color: var(--danger);
}

.wrong-q-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 12px;
}

.wrong-choice-row {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wrong-choice-row.red { color: var(--danger); }
.wrong-choice-row.green { color: var(--primary-light); }

.wrong-actions-footer {
  padding-top: 14px;
}

/* ------------------------------
   14. MY ACHIEVEMENTS VIEW
------------------------------ */
.achievements-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 18px 0 12px 0;
}

.achievements-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.badge-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s;
}

.badge-item.locked {
  opacity: 0.45;
  background: #f4f6f4;
  box-shadow: none;
}

.badge-icon-hex {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--white);
  font-size: 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.badge-icon-hex.green { background: linear-gradient(135deg, #2e7d32, #4caf50); }
.badge-icon-hex.purple { background: linear-gradient(135deg, #7b1fa2, #9c27b0); }
.badge-icon-hex.gold { background: linear-gradient(135deg, #ff8f00, #ffc107); }

.badge-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.badge-desc {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: bold;
}

.achievements-progress-list {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ach-progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ach-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: bold;
  color: var(--text-muted);
}

.ach-label {
  color: var(--text-dark);
}

.ach-ratio {
  font-family: var(--font-en);
  color: var(--primary);
  font-weight: 800;
}

.ach-bar-track {
  height: 8px;
  background: #f0f2f0;
  border-radius: 4px;
  overflow: hidden;
}

.ach-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ------------------------------
   15. SETTINGS VIEW
------------------------------ */
.settings-menu-list {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.settings-logout-wrapper {
  margin-top: auto;
}

/* ------------------------------
   PERSISTENT BOTTOM TAB BAR
------------------------------ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(28, 82, 60, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 20%;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-tab-btn.active {
  color: var(--primary);
}

.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.nav-tab-btn.active .tab-icon {
  transform: translateY(-2px) scale(1.1);
}

.tab-text {
  font-size: 10px;
  font-weight: 800;
}

/* ------------------------------
   OVERLAY DIALOG MODALS
------------------------------ */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(32, 45, 38, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
}

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

.modal-card {
  width: 100%;
  max-width: 320px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--primary);
  display: flex;
  flex-direction: column;
  max-height: 80%;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  text-align: center;
}

.modal-body {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.6;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-body.scrollable {
  overflow-y: auto;
  max-height: 250px;
  padding-right: 4px;
}

.modal-body p {
  margin-bottom: 8px;
}

.modal-close-btn {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* Avatar grid selection */
.avatar-select-grid {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin: 10px 0 20px 0;
}

.avatar-option-card {
  background: #fbfbf9;
  border: 2px solid rgba(28, 82, 60, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  width: 45%;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-option-card img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: contain;
  margin-bottom: 6px;
}

.avatar-option-card p {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.avatar-option-card.active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.avatar-option-card.active p {
  color: var(--primary);
}

.modal-action-row {
  display: flex;
  gap: 12px;
}
.modal-action-row button {
  flex: 1;
}

/* ------------------------------
   DESKTOP PREVIEW STUFF
------------------------------ */
.desktop-qr-box {
  display: none;
  position: absolute;
  left: -200px;
  top: 100px;
  width: 170px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-md);
  border: 2.5px solid var(--primary);
  text-align: center;
  z-index: 1000;
  animation: float 4s ease-in-out infinite;
}

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

@media (min-width: 900px) {
  .desktop-qr-box {
    display: block;
  }
}

.desktop-qr-box canvas {
  width: 130px !important;
  height: 130px !important;
  margin-bottom: 8px;
}

.desktop-qr-box p {
  font-size: 12px;
  font-weight: bold;
  color: var(--primary);
}

/* Toggle Switch Style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Classroom Blackboard Style */
.blackboard-box {
  background: #143520; /* Dark chalkboard forest-green */
  border: 7px solid #7c4b22; /* Wooden frame color */
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 12px rgba(0,0,0,0.8), var(--shadow-sm);
  padding: 14px 16px;
  color: #ebf6ec; /* Chalk white/cream */
  font-family: 'Courier New', Courier, monospace, 'Microsoft YaHei';
  position: relative;
  margin: 14px 0;
  text-align: left;
  line-height: 1.45;
  box-sizing: border-box;
  width: 100%;
}
.blackboard-box::after {
  content: "";
  position: absolute;
  bottom: 3px;
  right: 14px;
  width: 22px;
  height: 5px;
  background: rgba(255,255,255,0.7); /* Chalk piece */
  border-radius: 1px;
}
.blackboard-ans-title {
  color: #ffd859; /* yellow chalk for title */
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.25);
  padding-bottom: 4px;
}
.blackboard-ans-desc {
  font-size: 13px;
  font-weight: 500;
}

/* ==============================================================
   2026 VISUAL REFRESH · 清风入卷
   A unified editorial Chinese-inspired skin for every app view.
============================================================== */
:root {
  --primary: #155344;
  --primary-deep: #0d3a31;
  --primary-light: #2c8065;
  --primary-soft: #dfeee7;
  --primary-bg: #e9f3ed;
  --secondary: #c8a45d;
  --secondary-deep: #8c6727;
  --secondary-bg: #f6eedc;
  --accent-red: #b9543f;
  --danger: #b84b43;
  --danger-bg: #fff0ec;
  --text-dark: #18342c;
  --text-muted: #708178;
  --paper: #f7f3e9;
  --paper-deep: #eee7d8;
  --white: #fffdf8;
  --bg-gradient: linear-gradient(155deg, #edf4ef 0%, #f8f4e9 52%, #e7efe9 100%);
  --shadow-sm: 0 5px 16px rgba(17, 65, 53, 0.07);
  --shadow-md: 0 12px 30px rgba(17, 65, 53, 0.12);
  --shadow-lg: 0 26px 70px rgba(9, 47, 39, 0.2);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
}

html {
  background: #dfe8e1;
}

body {
  background:
    radial-gradient(circle at 16% 16%, rgba(255,255,255,.86) 0 5%, transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(200,164,93,.12), transparent 25%),
    linear-gradient(135deg, #e3ece6 0%, #d6e1da 100%);
  color: var(--text-dark);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(21,83,68,.09);
  border-radius: 50%;
  pointer-events: none;
}

body::before { top: -155px; left: -120px; box-shadow: 0 0 0 28px rgba(21,83,68,.025); }
body::after { right: -150px; bottom: -150px; box-shadow: 0 0 0 34px rgba(185,84,63,.025); }

.h5-container {
  background: var(--paper);
  isolation: isolate;
}

@media (min-width: 480px) {
  .h5-container {
    border: 7px solid #153a31;
    border-radius: 34px;
    box-shadow: 0 32px 90px rgba(15,55,46,.26), inset 0 0 0 1px rgba(255,255,255,.4);
  }
}

.view {
  padding: 22px 20px 82px;
  background:
    linear-gradient(rgba(255,253,248,.82), rgba(255,253,248,.82)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(21,83,68,.023) 31px 32px),
    var(--paper);
  scrollbar-width: thin;
  scrollbar-color: rgba(21,83,68,.2) transparent;
}

.view::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(21,83,68,.055);
  border-radius: 22px;
  pointer-events: none;
  z-index: -1;
}

.view.active { animation: pageEnter .42s cubic-bezier(.2,.82,.2,1) both; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px) scale(.992); }
  to { opacity: 1; transform: none; }
}

.bamboo-bg-decor {
  height: 180px;
  background: linear-gradient(180deg, rgba(37,112,87,.15), rgba(247,243,233,0));
}

.bamboo-bg-decor::before {
  content: "";
  position: absolute;
  left: -24px;
  top: -20px;
  width: 120px;
  height: 180px;
  opacity: .28;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 150'%3E%3Cg fill='none' stroke='%23155344' stroke-width='3'%3E%3Cpath d='M25 150Q32 90 55 10'/%3E%3Cpath d='M37 92Q12 78 8 56Q31 61 43 78M46 64Q70 51 82 28Q57 32 48 52M29 119Q8 111 2 94Q21 96 33 108'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}

.bamboo-bg-decor::after {
  top: 4px;
  right: 4px;
  width: 105px;
  height: 105px;
  opacity: .55;
}

button, .menu-item-card, .chapter-card, .menu-row, .record-card, .wrong-q-card {
  -webkit-user-select: none;
  user-select: none;
}

.btn-forest,
.btn-outline-forest,
.btn-danger-red {
  min-height: 50px;
  border-radius: 14px;
  letter-spacing: .08em;
  box-shadow: 0 8px 20px rgba(21,83,68,.14);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-forest {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #103f35 0%, #28745c 100%);
}

.btn-forest::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  pointer-events: none;
}

.btn-outline-forest {
  color: var(--primary-deep);
  background: rgba(255,253,248,.76);
  border-color: rgba(21,83,68,.7);
  box-shadow: none;
}

.btn-forest:hover, .btn-outline-forest:hover { transform: translateY(-1px); }
.btn-forest:active, .btn-outline-forest:active { transform: translateY(1px) scale(.985); }

.back-btn {
  width: 40px;
  height: 40px;
  color: var(--primary-deep);
  background: rgba(233,243,237,.86);
  border: 1px solid rgba(21,83,68,.12);
  box-shadow: var(--shadow-sm);
}

/* Cover — editorial poster */
#view-cover {
  justify-content: flex-start;
  padding: 24px 24px 22px;
  background:
    radial-gradient(circle at 50% 39%, rgba(255,255,255,.94), transparent 32%),
    linear-gradient(160deg, #e4f0e9 0%, #f8f3e7 58%, #edf2eb 100%);
}

#view-cover::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(21,83,68,.14);
  border-radius: 22px;
  pointer-events: none;
}

.cover-topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .24em;
  opacity: .82;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--accent-red);
  border-radius: 5px;
  color: var(--accent-red);
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 0;
  transform: rotate(-4deg);
}

.cover-header { margin-top: 24px; position: relative; z-index: 2; }

.cover-kicker,
.auth-kicker,
.section-eyebrow {
  color: var(--accent-red);
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.cover-kicker { margin-bottom: 8px; }

.main-title {
  font-size: clamp(38px, 10vw, 46px);
  line-height: 1.1;
  letter-spacing: .12em;
  color: var(--primary-deep);
  text-shadow: 0 2px 0 rgba(255,255,255,.9);
}

.main-title::before,
.main-title::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  margin: 0 8px 10px;
  background: linear-gradient(90deg, transparent, var(--secondary));
}
.main-title::after { background: linear-gradient(90deg, var(--secondary), transparent); }

.sub-slogan {
  margin-top: 11px;
  color: #60786e;
  font-size: 12px;
  letter-spacing: .34em;
}

.cover-mascot-stage {
  flex: 1 1 auto;
  min-height: 330px;
  height: auto;
  margin: 18px 0 16px;
  border-radius: 160px 160px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(242,237,224,.94)),
    var(--paper);
  border: 1px solid rgba(21,83,68,.12);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.45), var(--shadow-md);
  overflow: hidden;
}

.cover-mascot-stage::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(200,164,93,.26);
  border-radius: 150px 150px 18px 18px;
  pointer-events: none;
  z-index: 3;
}

.stage-glow {
  width: 86%;
  height: 44%;
  bottom: 44px;
  background: radial-gradient(ellipse, rgba(43,128,101,.16), transparent 70%);
}

.stage-mascots {
  width: 92%;
  max-width: 340px;
  max-height: 245px;
  margin-top: -44px;
  border-radius: 18px;
  mix-blend-mode: multiply;
  filter: saturate(.96) contrast(1.02);
}

.stage-seal {
  position: absolute;
  top: 26px;
  right: 30px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(185,84,63,.7);
  border-radius: 50%;
  color: var(--accent-red);
  font-family: var(--font-title);
  font-size: 12px;
  writing-mode: vertical-rl;
  letter-spacing: .12em;
  transform: rotate(8deg);
  background: rgba(255,253,248,.74);
}

.stage-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 10px;
  text-align: center;
  border-top: 1px solid rgba(21,83,68,.12);
}

.stage-caption strong { color: var(--primary-deep); font-size: 13px; letter-spacing: .12em; }
.stage-caption span { color: var(--text-muted); font-size: 9px; letter-spacing: .04em; }

.cover-actions { position: relative; z-index: 5; gap: 10px; }
.cover-safe-tip { text-align: center; color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: .05em; margin-top: 2px; }
.cover-safe-tip span { color: var(--secondary-deep); margin-right: 4px; }

/* Auth pages */
#view-login,
#view-register {
  background:
    radial-gradient(circle at 105% 90%, rgba(44,128,101,.17), transparent 34%),
    linear-gradient(155deg, #f1f5ef, #f8f2e5);
}

.auth-box {
  flex: 0 1 auto;
  margin: 34px 0 auto;
  padding: 28px 22px;
  justify-content: flex-start;
  background: rgba(255,253,248,.82);
  border: 1px solid rgba(21,83,68,.1);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.auth-kicker { margin-bottom: 8px; }
.auth-main-title { color: var(--primary-deep); font-size: 28px; letter-spacing: .04em; }
.auth-sub-desc { margin-bottom: 24px; }

.input-item {
  min-height: 52px;
  background: rgba(247,243,233,.78);
  border: 1px solid rgba(21,83,68,.13);
  border-radius: 14px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.input-item:focus-within {
  background: #fffefa;
  border-color: rgba(21,83,68,.55);
  box-shadow: 0 0 0 4px rgba(44,128,101,.09);
}

.input-item input { background: transparent; font-size: 14px; }
.input-item input:focus { box-shadow: none; }
.input-icon { color: var(--primary-light); }
.auth-footer-link { position: relative; z-index: 5; }

.auth-side-mascot {
  max-height: 155px;
  right: -18px;
  opacity: .24;
  filter: saturate(.7);
  mix-blend-mode: multiply;
}

/* Shared headers */
.top-title-bar,
.top-header-nav {
  position: relative;
  z-index: 3;
}

.top-title-bar { border-bottom-color: rgba(21,83,68,.1); }
.view-title-main, .view-title-center { color: var(--primary-deep); letter-spacing: .06em; }

/* Study records — header left-aligned, pushed below capsule */
#view-study-records .top-header-nav {
  justify-content: flex-start;
  gap: 12px;
  margin-top: 44px;
  margin-bottom: 16px;
}
#view-study-records .top-header-nav > div[style] { display: none; }
#view-study-records .view-title-center { text-align: left; }
.view-title-sub { margin-top: 6px; color: var(--text-muted); font-size: 11px; letter-spacing: .04em; }

/* Home */
#view-home {
  background:
    radial-gradient(circle at 102% 0%, rgba(44,128,101,.2), transparent 30%),
    linear-gradient(180deg, #edf3ed 0%, #faf6ec 42%, #f7f3e9 100%);
}

.home-user-header { margin: 2px 0 18px; position: relative; z-index: 2; }
.user-info-group { gap: 11px; }
.home-avatar {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255,255,255,.9);
  outline: 1px solid rgba(21,83,68,.35);
  background: #e7f2ec;
  box-shadow: 0 7px 18px rgba(21,83,68,.13);
  mix-blend-mode: multiply;
}

.home-greeting { color: var(--accent-red); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.home-username { color: var(--primary-deep); font-size: 17px; line-height: 1.35; }
.home-user-slogan { font-size: 10px; letter-spacing: .08em; }

.home-score-card {
  padding: 7px 11px;
  background: rgba(255,250,237,.88);
  border-color: rgba(200,164,93,.42);
  box-shadow: var(--shadow-sm);
}

.home-banner {
  min-height: 218px;
  margin-bottom: 18px;
  padding: 23px 20px;
  align-items: flex-start;
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 24%, rgba(255,255,255,.13) 0 10%, transparent 11%),
    linear-gradient(145deg, #0f4337 0%, #226f57 66%, #39886a 100%);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 18px 36px rgba(15,67,55,.22);
}

.home-banner::before,
.home-banner::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
}
.home-banner::before { width: 150px; height: 150px; right: -62px; top: -70px; }
.home-banner::after { width: 100px; height: 100px; right: -28px; top: -45px; }

.banner-texts { width: 58%; }
.banner-kicker {
  align-self: flex-start;
  margin-bottom: 17px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  color: #f6dfaa;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
}

.banner-texts h4 { margin-bottom: 2px; color: #d9e9df; font-size: 12px; letter-spacing: .25em; }
.banner-texts h3 { margin-bottom: 5px; font-family: var(--font-title); font-size: 27px; letter-spacing: .08em; }
.banner-desc { margin-bottom: 15px; color: rgba(255,255,255,.68); font-size: 9px; line-height: 1.5; }
.banner-btn { padding: 9px 15px; color: var(--primary-deep); background: #f8edcf; box-shadow: 0 8px 18px rgba(0,0,0,.14); }

.banner-mascot {
  right: -56px;
  bottom: -23px;
  height: 194px;
  width: 230px;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: .96;
  filter: contrast(1.08) saturate(.94);
}

.banner-seal {
  position: absolute;
  right: 17px;
  top: 18px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(246,223,170,.62);
  color: #f6dfaa;
  font-family: var(--font-title);
  font-size: 11px;
  writing-mode: vertical-rl;
  letter-spacing: .08em;
  transform: rotate(6deg);
}

.home-menu-grid { gap: 10px; margin-bottom: 16px; }
.menu-item-card {
  position: relative;
  min-height: 112px;
  padding: 15px 8px 12px;
  border: 1px solid rgba(21,83,68,.08);
  border-radius: 18px;
  background: rgba(255,253,248,.78);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.menu-item-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(21,83,68,.06);
  border-radius: 50%;
}

.menu-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 4px;
  margin-bottom: 10px;
}
.menu-icon-circle.green { background: linear-gradient(145deg, #236d56, #3a9a76); }
.menu-icon-circle.gold { background: linear-gradient(145deg, #ad7d32, #d7b25f); }
.menu-icon-circle.purple { background: linear-gradient(145deg, #755270, #9b718e); }
.menu-label { color: var(--primary-deep); font-size: 12px; letter-spacing: .03em; }

.home-progress-section {
  padding: 17px 18px 19px;
  border: 1px solid rgba(21,83,68,.08);
  background: rgba(255,253,248,.84);
  box-shadow: var(--shadow-sm);
}
.progress-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.section-eyebrow { color: var(--secondary-deep); font-size: 7px; }
.progress-section-title { margin: 2px 0 0; color: var(--primary-deep); font-size: 15px; }
.progress-leaf {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: var(--font-title);
  font-size: 14px;
  transform: rotate(-8deg);
}
.progress-meta-row { margin-bottom: 10px; }
.home-progress-bar-container, .ach-bar-track { height: 7px; background: #e8e5da; }
.home-progress-bar-fill, .ach-bar-fill { background: linear-gradient(90deg, #b78839, #2d8065); }

/* Chapters and content cards */
.chapters-list-container { gap: 13px; }
.chapter-card {
  min-height: 88px;
  padding: 16px;
  border: 1px solid rgba(21,83,68,.09);
  border-left: 0;
  border-radius: 18px;
  background: rgba(255,253,248,.84);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.chapter-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(var(--secondary), var(--primary-light));
}
.chapter-card::after {
  content: "课";
  position: absolute;
  right: 14px;
  bottom: -10px;
  color: rgba(21,83,68,.045);
  font-family: var(--font-title);
  font-size: 54px;
}
.chapter-num-badge {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px 12px 12px 4px;
  background: var(--primary-deep);
  box-shadow: 0 6px 12px rgba(21,83,68,.16);
}
.chapter-card-title { color: var(--primary-deep); font-size: 14px; }

/* Quiz */
#view-quiz { background: linear-gradient(180deg, #edf3ed, #faf6ec 38%); }
.quiz-progress-text { color: var(--primary-deep); font-size: 14px; letter-spacing: .04em; }
.quiz-timer-bar {
  background: rgba(255,253,248,.76);
  border: 1px solid rgba(21,83,68,.1);
  box-shadow: var(--shadow-sm);
}
.question-header-card {
  position: relative;
  padding: 24px 20px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, #174b3e, #2a765d);
  box-shadow: 0 14px 30px rgba(21,83,68,.18);
  overflow: hidden;
}
.question-header-card::after {
  content: "问";
  position: absolute;
  right: 10px;
  bottom: -24px;
  color: rgba(255,255,255,.08);
  font-family: var(--font-title);
  font-size: 86px;
}
.quiz-question-text { position: relative; z-index: 2; color: #fffdf6; font-size: 16px; line-height: 1.75; }
.quiz-options-list { gap: 10px; }
.quiz-option-card {
  min-height: 58px;
  padding: 13px 14px;
  border: 1px solid rgba(21,83,68,.1);
  border-radius: 16px;
  background: rgba(255,253,248,.88);
  box-shadow: var(--shadow-sm);
}
.quiz-option-card:hover { transform: translateY(-1px); border-color: rgba(21,83,68,.28); }
.quiz-option-card.selected {
  border-color: var(--primary-light);
  background: #e3f0e8;
  box-shadow: 0 8px 20px rgba(21,83,68,.12), inset 4px 0 0 var(--primary-light);
}
.opt-prefix-badge { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; background: #edf0eb; }
.quiz-option-card.selected .opt-prefix-badge { background: var(--primary-deep); }
.quiz-side-mascot { opacity: .8; mix-blend-mode: multiply; }

.feedback-overlay, .modal-overlay { background: rgba(8,35,29,.76); backdrop-filter: blur(9px); }
.feedback-card, .modal-card {
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.3);
  background: #fffaf0;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.feedback-card.incorrect { border-top: 5px solid var(--danger); }
.blackboard-box { background: #133a30; border-color: #8d6131; }

/* Completion */
#view-completed { background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.95), transparent 30%), var(--bg-gradient); }
.congrats-title { color: var(--primary-deep); }
.completed-card {
  border: 1px solid rgba(21,83,68,.1);
  background: rgba(255,253,248,.85);
  box-shadow: var(--shadow-lg);
}
.completed-stat-card { padding: 7px 2px; border-radius: 12px; background: rgba(233,243,237,.55); }

/* Leaderboard */
#view-leaderboard { background: linear-gradient(180deg, #e7f0e9 0%, #f8f3e9 45%); }
.leaderboard-podium-section {
  height: 230px;
  margin: 4px -4px 18px;
  padding: 18px 13px 0;
  border: 1px solid rgba(21,83,68,.08);
  border-radius: 24px;
  background: radial-gradient(circle at 50% 18%, rgba(255,255,255,.95), rgba(255,253,248,.48) 50%, transparent 72%);
}
.podium-avatar { border-width: 3px; box-shadow: 0 8px 20px rgba(21,83,68,.15); mix-blend-mode: multiply; }
.podium-bar { position: relative; overflow: hidden; border-radius: 10px 10px 0 0; }
.podium-bar.first { background: linear-gradient(#e6c779, #c69d4e); border-top: 0; }
.podium-bar.second { background: linear-gradient(#94b3a7, #6d9585); border-top: 0; }
.podium-bar.third { background: linear-gradient(#c98a5b, #a66b44); border-top: 0; }
.leaderboard-row {
  border: 1px solid rgba(21,83,68,.07);
  border-radius: 15px;
  background: rgba(255,253,248,.86);
}
.leaderboard-row.me { background: #fbf1d8; border-color: rgba(200,164,93,.45); }

/* Profile and lists */
#view-mine { background: linear-gradient(160deg, #e4efe8 0 29%, #f7f3e9 29%); }
.mine-top-bar { margin-bottom: 4px; }
.settings-gear-btn {
  width: 38px;
  height: 38px;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(21,83,68,.1);
}
.mine-profile-card {
  margin: 4px 0 18px;
  padding: 8px 5px 12px;
}
.profile-avatar {
  width: 76px;
  height: 76px;
  border: 3px solid #fffdf8;
  outline: 1px solid rgba(21,83,68,.4);
  box-shadow: 0 10px 24px rgba(21,83,68,.15);
  mix-blend-mode: multiply;
}
.profile-name { color: var(--primary-deep); font-size: 22px; }
.mine-stats-bar {
  padding: 18px 10px;
  border: 1px solid rgba(21,83,68,.09);
  background: rgba(255,253,248,.9);
  box-shadow: var(--shadow-md);
}
.stat-val { color: var(--primary-deep); }
.mine-menu-list, .settings-menu-list, .records-calendar-row, .achievements-progress-list {
  border: 1px solid rgba(21,83,68,.08);
  background: rgba(255,253,248,.86);
  box-shadow: var(--shadow-sm);
}
.mine-menu-list, .settings-menu-list { padding: 5px 15px; border-radius: 20px; }
.menu-row { min-height: 54px; padding: 14px 0; }
.menu-row:active { opacity: 1; transform: translateX(2px); }
.menu-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 11px;
  border-radius: 11px;
  background: var(--primary-bg);
  font-size: 16px;
}

.record-card, .wrong-q-card, .badge-item, .ach-progress-row {
  border: 1px solid rgba(21,83,68,.08);
  background: rgba(255,253,248,.86);
  box-shadow: var(--shadow-sm);
}
.record-card { border-radius: 16px; }
.wrong-q-card { border-left: 4px solid var(--danger); border-radius: 16px; }
.wrong-tabs-bar { background: rgba(21,83,68,.1); }
.wrong-tab.active { background: #fffdf8; }
.badge-item { border-radius: 18px; }
.badge-item.locked { background: #edece5; }

/* Navigation */
.bottom-nav {
  left: 12px;
  bottom: 10px;
  width: calc(100% - 24px);
  height: 62px;
  padding: 0 18px;
  border: 1px solid rgba(21,83,68,.12);
  border-radius: 22px;
  background: rgba(255,253,248,.9);
  box-shadow: 0 12px 30px rgba(15,55,46,.16);
  backdrop-filter: blur(18px);
}
.nav-tab-btn { width: 30%; gap: 3px; }
.nav-tab-btn.active { color: var(--primary-deep); }
.nav-tab-btn.active .tab-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px 12px 12px 4px;
  color: #fff;
  background: var(--primary-deep);
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(21,83,68,.22);
}
.tab-text { font-size: 9px; letter-spacing: .08em; }

/* Modal, toggles and desktop QR */
.modal-card { border-top: 5px solid var(--primary); }
.modal-title { color: var(--primary-deep); font-size: 18px; }
.avatar-option-card { background: #f6f1e6; border-radius: 16px; }
.avatar-option-card.active { background: var(--primary-soft); }
.slider { background: #b9c4bd; }
input:checked + .slider { background: var(--primary-light); }

.desktop-qr-box {
  border: 1px solid rgba(21,83,68,.2);
  background: rgba(255,253,248,.9);
  box-shadow: var(--shadow-lg);
}

@media (max-height: 720px) {
  .cover-header { margin-top: 14px; }
  .cover-mascot-stage { min-height: 275px; margin: 12px 0; }
  .stage-mascots { max-height: 205px; margin-top: -32px; }
  .stage-caption { bottom: 13px; }
  .cover-safe-tip { display: none; }
  .home-banner { min-height: 190px; }
}

@media (max-width: 350px) {
  .view { padding-left: 15px; padding-right: 15px; }
  #view-cover { padding-left: 18px; padding-right: 18px; }
  .main-title { font-size: 35px; letter-spacing: .08em; }
  .main-title::before, .main-title::after { width: 12px; margin-inline: 4px; }
  .cover-mascot-stage { min-height: 300px; }
  .banner-mascot { right: -80px; }
  .home-menu-grid { gap: 7px; }
  .menu-item-card { min-height: 106px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* 小程序同款登录与首页视觉 */
#view-cover, #view-login { background: radial-gradient(circle at 50% 25%, rgba(255,255,255,.95), transparent 34%), linear-gradient(155deg,#e7f1eb,#f8f2e5 62%,#edf2eb); }
#view-cover::after, #view-login::after { content: ''; position:absolute; inset:28px; border:1px solid rgba(21,83,68,.14); border-radius:22px; pointer-events:none; }
.cover-topline { letter-spacing:.28em; color:#155344; }
.cover-header { margin-top:28px; text-align:center; }
.cover-kicker, .auth-kicker { color:#b9543f; letter-spacing:.22em; font-weight:800; }
.main-title, .auth-main-title { color:#0d3a31; font-family:Georgia,'Times New Roman',serif; letter-spacing:.12em; }
.sub-slogan, .auth-sub-desc { color:#708178; letter-spacing:.08em; }
.cover-mascot-stage { min-height:300px; margin:20px 12px 8px; }
.cover-mascot-stage .stage-glow { background:radial-gradient(ellipse,rgba(255,255,255,.96),rgba(223,238,231,.78) 48%,rgba(223,238,231,0) 72%); }
.auth-box { border:1px solid rgba(21,83,68,.1); border-radius:20px; background:rgba(255,253,248,.92); box-shadow:0 24px 60px rgba(17,65,53,.13); }
.auth-box .input-item { border-color:rgba(21,83,68,.13); border-radius:12px; background:rgba(247,243,233,.84); }
.auth-box .submit-btn, .cover-actions .btn-forest { border-radius:12px; background:linear-gradient(145deg,#0f4337,#226f57); }
.auth-footer-link { color:#708178; }
#view-home { background:radial-gradient(circle at 102% 0%,rgba(44,128,101,.2),transparent 30%),linear-gradient(180deg,#edf3ed 0%,#faf6ec 42%,#f7f3e9 100%); }
#view-home .home-user-header { margin-bottom:28px; }
#view-home .home-avatar { border-color:rgba(255,255,255,.9); outline:1px solid rgba(21,83,68,.35); }
#view-home .home-banner { border-radius:28px; background:linear-gradient(145deg,#faf5e6,#f4ecd6 62%,#ece0c2); border-color:rgba(15,67,55,.1); box-shadow:0 36px 72px rgba(120,100,60,.16); }
#view-home .home-banner::before, #view-home .home-banner::after { border-color:rgba(15,67,55,.08); }
#view-home .banner-texts { position:relative; z-index:4; width:42%; }
#view-home .banner-kicker { color:#9a7326; border-color:rgba(15,67,55,.32); }
#view-home .banner-texts h4 { color:#3a7460; }
#view-home .banner-texts h3 { color:#0f4337; }
#view-home .banner-desc { color:rgba(15,67,55,.62); }
#view-home .banner-btn { color:#f8edcf; background:linear-gradient(145deg,#0f4337,#226f57); box-shadow:0 5px 12px rgba(15,67,55,.22); }
#view-home .banner-seal { color:#9a7326; border-color:rgba(154,115,38,.55); }
#view-home .banner-glow { position:absolute; right:-2px; bottom:2px; z-index:2; width:204px; height:172px; border-radius:22px; background:radial-gradient(150% 130% at 50% 46%,rgba(255,251,240,.7) 0%,rgba(250,245,230,.4) 52%,rgba(250,245,230,0) 100%); filter:blur(5px); pointer-events:none; }
#view-home .banner-mascot { right:-3px; bottom:-1px; z-index:3; width:200px; height:160px; border-radius:0; object-fit:contain; mix-blend-mode:normal; opacity:1; filter:drop-shadow(0 4px 9px rgba(6,34,27,.24)); }
#view-home .home-menu-grid { gap:12px; }
#view-home .menu-item-card, #view-home .home-ranking-card, #view-home .home-progress-section { border-radius:18px; background:rgba(255,253,248,.84); border-color:rgba(21,83,68,.08); }
@media (max-width: 600px) { #view-cover::after, #view-login::after { inset:14px; } .cover-mascot-stage { min-height:260px; } }
