/* 自衡算 - 低饱和度、极简、ADHD/阿斯伯格友好 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --primary: #5b8a9a;
  --primary-light: #e8f4f8;
  --accent: #7ab8a8;
  --text: #2d3748;
  --text-light: #718096;
  --correct: #68d391;
  --correct-bg: #f0fff4;
  --wrong-soft: #fed7aa;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 16px;
}

body {
  font-family: -apple-system, "Microsoft YaHei", "微软雅黑", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  padding-top: 60px;
  overflow-x: hidden;
}

/* ====== 顶部用户栏 (see bottom for full styling) ====== */

.user-bar-name {
  font-size: 0.95em;
  font-weight: 500;
  color: var(--text);
}

.btn-switch {
  background: none;
  border: 1px solid #e2e8f0;
  color: var(--text-light);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-switch:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#app {
  width: 100%;
  max-width: 500px;
  min-height: 600px;
  position: relative;
}

/* 屏幕切换 */
.screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

/* ====== 认证页 ====== */
.auth-content {
  text-align: center;
  padding: 40px 20px;
  width: 100%;
}

.auth-content h1 {
  font-size: 2.2em;
  color: var(--primary);
  margin-bottom: 8px;
}

/* ====== 品牌入口 ====== */
.brand-entrance {
  margin-bottom: 28px;
  padding: 20px 0;
}

.brand-title {
  font-size: 2.8em;
  font-weight: 300;
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, #3a5a6e 0%, #7ab8a8 40%, #5b8a9a 70%, #2d5a4e 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: brand-gradient 8s ease infinite;
  margin-bottom: 20px;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
}

@keyframes brand-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.brand-quote {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  color: var(--text-light);
  letter-spacing: 0.15em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
}

.brand-quote.quote-visible {
  opacity: 1;
  transform: translateY(0);
}

.quote-source {
  display: block;
  font-size: 0.75em;
  color: #a0aec0;
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.quote-explain {
  display: block;
  font-size: 0.7em;
  color: #718096;
  margin-top: 8px;
  letter-spacing: 0.02em;
  font-family: -apple-system, "Microsoft YaHei", sans-serif;
  font-style: normal;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.form-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px;
  font-size: 1.05em;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.form-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1em;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--primary);
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.error-text {
  color: #e53e3e;
  font-size: 0.9em;
  min-height: 1.2em;
}

.invite-help {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.invite-help p {
  color: var(--text-light);
  font-size: 0.9em;
  margin-bottom: 8px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1em;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.btn-link:hover {
  color: var(--accent);
}

.btn-small {
  padding: 8px 20px;
  font-size: 0.9em;
}

/* ====== 微信弹窗 ====== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.popup-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 24px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.popup-card h3 {
  color: var(--primary);
  margin-bottom: 20px;
}

.qr-box {
  background: #f7fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.qr-box img {
  max-width: 200px;
  width: 100%;
  border-radius: 8px;
}

.qr-note {
  color: var(--text-light);
  font-size: 0.8em;
  margin-top: 8px;
}

.wechat-id-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 1em;
}

.wechat-id {
  font-weight: 600;
  color: var(--primary);
}

.btn-small-action {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
}

.copy-success {
  color: var(--accent);
  font-size: 0.85em;
  min-height: 1.2em;
}

/* ====== 品格卡片 ====== */
.wisdom-content {
  text-align: center;
  padding: 60px 30px;
}

.wisdom-icon {
  font-size: 3em;
  margin-bottom: 20px;
}

.wisdom-text {
  font-size: 1.3em;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 500;
}

.wisdom-category {
  color: var(--text-light);
  font-size: 0.9em;
  margin-bottom: 30px;
}

.end-wisdom-card {
  margin: 20px 0;
}

.wisdom-mini {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 14px 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95em;
}

/* ====== 欢迎页 ====== */
.welcome-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.welcome-top {
  flex: 0 0 auto;
  text-align: center;
  padding: 16px 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-title-sm {
  font-size: 1.8em;
  margin-bottom: 0;
}

.welcome-quote {
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 1.5em;
  color: var(--text);
  letter-spacing: 0.12em;
  line-height: 1.6;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.welcome-quote.quote-visible {
  opacity: 1;
}

.welcome-stats-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: var(--text-light);
}

.stat-chip {
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
  color: var(--primary);
}

.stat-chip.stat-done {
  background: var(--correct-bg);
  color: #38a169;
}

.stat-chip.stat-wait {
  background: #fef3c7;
  color: #d97706;
}

.stat-chip.stat-active {
  background: #dbeafe;
  color: #2563eb;
}

.stat-divider {
  color: #cbd5e0;
}

.btn-start-big {
  width: 80%;
  max-width: 280px;
  padding: 16px 24px;
  font-size: 1.15em;
  margin-top: 8px;
}

/* ====== 底部Tabs ====== */
.welcome-tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-top: 12px;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid #edf2f7;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  font-size: 0.9em;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Tab内容样式 */
.tab-today-time {
  text-align: center;
  font-size: 0.9em;
  color: var(--text-light);
  margin-bottom: 12px;
}

.tab-today-time strong {
  color: var(--primary);
  font-size: 1.3em;
}

.tab-habit {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.tab-habit-label {
  font-size: 0.8em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.tab-habit-text {
  font-size: 0.95em;
  color: var(--text);
  margin-bottom: 8px;
}

.tab-habit-btns {
  display: flex;
  gap: 8px;
}

.tab-habit-btns button {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  border: none;
  font-size: 0.85em;
  cursor: pointer;
}

.btn-habit-done { background: var(--accent); color: white; }
.btn-habit-skip { background: #e2e8f0; color: var(--text-light); }

.tab-habit-done {
  text-align: center;
  color: var(--accent);
  font-size: 0.9em;
  padding: 8px;
}

.tab-monthly {
  margin-bottom: 12px;
}

.tab-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.85em;
}

.tab-task-row.done { opacity: 0.6; }

.tab-task-icon { width: 20px; text-align: center; }

.tab-task-text { flex: 1; color: var(--text); }

.tab-task-bar {
  width: 50px;
  height: 4px;
  background: #edf2f7;
  border-radius: 2px;
  overflow: hidden;
}

.tab-task-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.tab-task-num {
  font-size: 0.8em;
  color: var(--text-light);
  width: 40px;
  text-align: right;
}

.tab-goal {
  text-align: center;
  font-size: 0.85em;
  color: var(--primary);
  padding: 8px;
  background: var(--primary-light);
  border-radius: 8px;
  margin-top: 8px;
}

.tab-goal-set {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.85em;
  padding: 8px 0;
}

.goal-btn-sm {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: none;
  color: var(--primary);
  font-size: 0.85em;
  cursor: pointer;
}

.goal-btn-sm:hover { background: var(--primary-light); }

.tab-growth-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 16px;
}

.tab-growth-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tab-growth-num {
  font-size: 1.6em;
  font-weight: 600;
  color: var(--primary);
}

.tab-growth-label {
  font-size: 0.8em;
  color: var(--text-light);
}

.tab-growth-links {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-tab-link {
  padding: 10px 20px;
  font-size: 0.9em;
}

.subtitle {
  color: var(--text-light);
  font-size: 1.1em;
  margin-bottom: 30px;
}

/* ====== 按钮 ====== */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 1.2em;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(91,138,154,0.3);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 2px solid #e2e8f0;
  padding: 12px 30px;
  font-size: 1em;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #f7fafc;
}

/* ====== 顶部栏 ====== */
.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-bottom: 20px;
}

.phase-label {
  font-size: 0.9em;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

.combo-badge {
  font-size: 0.85em;
  color: #e53e3e;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.combo-badge.visible {
  opacity: 1;
}

/* ====== 题目区域 ====== */
.question-area {
  width: 100%;
}

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.question-prompt {
  font-size: 1.3em;
  margin-bottom: 20px;
  font-weight: 500;
  line-height: 1.5;
}

.question-display {
  font-size: 2.2em;
  margin-bottom: 30px;
  letter-spacing: 4px;
  line-height: 1.4;
  word-break: break-all;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

.btn-option {
  background: var(--primary-light);
  border: 2px solid transparent;
  padding: 16px;
  font-size: 1.4em;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
  color: var(--text);
}

.btn-option:hover:not(:disabled) {
  border-color: var(--primary);
  transform: scale(1.05);
}

.btn-option:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.btn-option.correct {
  background: var(--correct-bg);
  border-color: var(--correct);
  animation: pulse 0.3s ease;
}

.btn-option.gentle-wrong {
  background: var(--wrong-soft);
  border-color: transparent;
}

.btn-option.show-correct {
  background: var(--correct-bg);
  border-color: var(--correct);
}

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

/* ====== 教学区域 ====== */
.teach-area {
  width: 100%;
  text-align: center;
  padding: 20px 0;
}

.teach-area h2 {
  font-size: 1.4em;
  color: var(--primary);
  margin-bottom: 24px;
}

.teach-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.teach-step {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideIn 0.5s ease both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.teach-emoji {
  font-size: 1.5em;
  min-width: 80px;
  text-align: center;
}

.teach-desc {
  font-size: 1.1em;
  color: var(--text);
  text-align: left;
}

/* ====== 完成页 ====== */
.complete-content, .end-content {
  text-align: center;
  padding: 40px 20px;
}

.sticker-earned {
  font-size: 3em;
  animation: bounce 0.6s ease;
}

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

.complete-content h2, .end-content h2 {
  font-size: 1.6em;
  color: var(--primary);
  margin: 16px 0 8px;
}

#complete-buttons {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.flow-hint {
  color: var(--accent);
  font-size: 1.05em;
  font-weight: 500;
  animation: pulse 1s ease infinite;
}

.sticker {
  font-size: 1.5em;
  margin: 0 4px;
}

/* ====== 休息建议页 ====== */
.rest-content {
  text-align: center;
  padding: 50px 30px;
}

.rest-icon {
  font-size: 3em;
  margin-bottom: 20px;
}

.rest-msg {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 30px;
  color: var(--text);
}

#rest-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ====== 结束页 ====== */
.end-icon {
  font-size: 3em;
  margin-bottom: 10px;
}

.end-reminder {
  color: var(--text-light);
  margin-top: 16px;
  font-size: 1.1em;
}

/* ====== 浮动层 ====== */
.feedback-msg {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--card);
  padding: 16px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-size: 1.2em;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 100;
}

.feedback-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.feedback-msg.correct { color: #38a169; }
.feedback-msg.wrong { color: var(--text); }
.feedback-msg.end { color: var(--primary); }

.hint-area {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffbeb;
  padding: 20px 28px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-size: 1.2em;
  color: #744210;
  opacity: 0;
  transition: opacity 0.3s;
  max-width: 420px;
  width: 90%;
  text-align: center;
  z-index: 90;
  pointer-events: none;
}

.hint-area.visible {
  opacity: 1;
  pointer-events: auto;
}

.hint-text {
  font-size: 1.1em;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 14px;
}

.hint-dismiss-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: transform 0.15s;
}

.hint-dismiss-btn:hover {
  transform: scale(1.05);
}

.animation-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.star-animation {
  position: absolute;
  top: 40%;
  font-size: 2em;
  animation: starFloat 1.2s ease-out forwards;
}

@keyframes starFloat {
  0% { opacity: 1; transform: translateY(0) scale(0.5); }
  50% { opacity: 1; transform: translateY(-60px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.8); }
}

/* ====== 响应式 ====== */
@media (max-width: 400px) {
  .question-display { font-size: 1.6em; }
  .question-prompt { font-size: 1.1em; }
  .btn-option { font-size: 1.2em; padding: 14px; }
  .teach-emoji { font-size: 1.2em; min-width: 60px; }
  .popup-card { padding: 20px 16px; }
  .grade-option { padding: 14px 16px; }
  .ability-item { padding: 10px 12px; }
}

/* ====== 年级选择 ====== */
.grade-select-content {
  text-align: center;
  padding: 40px 20px;
  width: 100%;
}

.grade-select-content h2 {
  font-size: 1.6em;
  color: var(--primary);
  margin-bottom: 10px;
}

.grade-select-subtitle {
  color: var(--text-light);
  margin-bottom: 30px;
}

.grade-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.grade-option {
  background: var(--card);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.grade-option:hover {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

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

.grade-icon {
  font-size: 2em;
}

.grade-label {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--text);
}

/* ====== 诊断测试 ====== */
.assessment-content {
  width: 100%;
  text-align: center;
}

.assessment-intro-card {
  padding: 40px 20px;
}

.assessment-hero {
  font-size: 4em;
  margin-bottom: 16px;
  animation: bounce 1s ease infinite;
}

.assessment-intro-card h2 {
  font-size: 1.6em;
  color: var(--primary);
  margin-bottom: 10px;
}

.assessment-intro-card p {
  color: var(--text);
  font-size: 1.1em;
  margin-bottom: 8px;
}

.assessment-note {
  color: var(--text-light) !important;
  font-size: 0.95em !important;
  margin-bottom: 24px !important;
  line-height: 1.6;
}

.assessment-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.assessment-progress-text {
  font-size: 0.85em;
  color: var(--text-light);
  white-space: nowrap;
}

.assessment-grade-tag {
  font-size: 0.8em;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.assessment-ability-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ====== 能力地图 ====== */
.ability-map-content {
  width: 100%;
  text-align: center;
  padding: 30px 10px;
}

.ability-map-content h2 {
  font-size: 1.4em;
  color: var(--primary);
  margin-bottom: 8px;
}

.ability-map-subtitle {
  color: var(--text-light);
  margin-bottom: 24px;
}

.ability-grid {
  text-align: left;
  margin-bottom: 24px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0 4px;
}

.ability-grade-group {
  margin-bottom: 16px;
}

.ability-grade-title {
  font-size: 0.9em;
  color: var(--text-light);
  margin-bottom: 8px;
  padding-left: 4px;
}

.ability-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ability-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

.ability-item.unlocked {
  border-left: 3px solid var(--correct);
}

.ability-item.familiar {
  border-left: 3px solid #f6ad55;
  opacity: 0.85;
}

.ability-item.locked {
  border-left: 3px solid #e2e8f0;
  opacity: 0.6;
}

.ability-icon {
  font-size: 1.3em;
}

.ability-name {
  flex: 1;
  font-size: 0.95em;
  font-weight: 500;
}

.ability-status {
  font-size: 1em;
}

/* ====== 用户栏更新 ====== */
.user-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--card);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.user-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-bar-avatar {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-bar-avatar svg {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.btn-logout {
  color: #e53e3e;
  border-color: #fed7d7;
}

.btn-logout:hover {
  border-color: #e53e3e;
  color: #e53e3e;
}

/* ====== 年级选择子选项 ====== */
.grade-option-group {
  display: flex;
  flex-direction: column;
}

.grade-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.grade-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.grade-sub-options {
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  animation: fadeIn 0.2s ease;
}

.sub-option-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sub-label {
  font-size: 0.85em;
  color: var(--text-light);
  min-width: 45px;
}

.sub-btn {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.15s;
}

.sub-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sub-btn:hover:not(.active) {
  border-color: var(--primary);
}

.grade-confirm-btn {
  margin-top: 8px;
  padding: 8px 20px !important;
  font-size: 0.9em !important;
}

/* ====== 学习时长统计 ====== */
.stats-row {
  display: flex;
  justify-content: space-around;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75em;
  color: var(--text-light);
}

/* ====== 日历打卡 ====== */
.calendar-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.calendar-header h3 {
  font-size: 1em;
  color: var(--text);
}

.streak-badge {
  font-size: 0.85em;
  background: #fff5f5;
  color: #e53e3e;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.calendar-message {
  font-size: 0.85em;
  color: var(--accent);
  margin-bottom: 12px;
  font-style: italic;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-day-name {
  font-size: 0.7em;
  color: var(--text-light);
  padding: 4px 0;
}

.cal-cell {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  border-radius: 50%;
  color: var(--text);
}

.cal-cell.empty {
  visibility: hidden;
}

.cal-cell.checked {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.cal-cell.today {
  border: 2px solid var(--primary);
  font-weight: 700;
}

.cal-cell.today.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ====== 微习惯卡片 ====== */
.habit-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.habit-label {
  font-size: 0.8em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.habit-text {
  font-size: 1.1em;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
}

.habit-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-habit-done {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: transform 0.15s;
}

/* 运动提醒弹窗 */
.exercise-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s;
}

.exercise-card {
  background: white;
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  animation: slideUp 0.4s;
}

.exercise-card-final {
  border: 3px solid var(--accent);
}

.exercise-complete-msg {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.exercise-title {
  font-size: 1em;
  color: var(--text-light);
  margin-bottom: 20px;
}

.today-summary {
  background: #f0f9ff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
}

.summary-title {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.85em;
  line-height: 1.5;
}

.summary-grade {
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
  min-width: 56px;
}

.summary-detail {
  color: var(--text);
}

.exercise-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

.exercise-text {
  font-size: 1.1em;
  color: var(--text);
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 0 8px;
}

.exercise-timer {
  font-size: 0.95em;
  color: var(--text-light);
  margin-bottom: 16px;
}

.exercise-timer span {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.2em;
}

.exercise-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  cursor: not-allowed;
  background: #e2e8f0;
  color: var(--text-light);
  transition: all 0.3s;
}

.exercise-btn-ready {
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.exercise-btn-ready:hover {
  transform: scale(1.05);
}

.exercise-final-msg {
  font-size: 0.95em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}

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

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

/* 每日进度状态栏 */
.daily-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--primary-light);
  border-radius: 10px;
  font-size: 0.85em;
  color: var(--primary);
}

.daily-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.daily-status-dot.flow { background: #68d391; }
.daily-status-dot.struggle { background: #fc8181; }

.btn-habit-done:hover {
  transform: scale(1.05);
}

.btn-habit-skip {
  background: transparent;
  color: var(--text-light);
  border: 1px solid #e2e8f0;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
}

.habit-done-msg {
  color: var(--accent);
  font-weight: 500;
  padding: 12px 0;
}

/* ====== 欢迎页节奏提示 ====== */
.welcome-prompt {
  color: var(--primary);
  font-size: 0.95em;
  margin: 16px 0;
  font-weight: 500;
  opacity: 0.9;
}

/* ====== 头像选择器 ====== */
.avatar-picker-card {
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.avatar-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-choice:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.avatar-choice.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.avatar-choice svg {
  width: 60px;
  height: 60px;
}

.avatar-choice span {
  font-size: 0.8em;
  color: var(--text);
}

.accessory-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  justify-content: center;
}

.accessory-btn {
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.accessory-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.avatar-preview {
  text-align: center;
  margin: 16px 0;
}

.avatar-preview svg {
  width: 80px;
  height: 80px;
}

/* ====== 注册性别+头像选择 ====== */
.gender-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.gender-label {
  font-size: 0.95em;
  color: var(--text);
}

.gender-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: var(--card);
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s;
}

.gender-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.gender-btn:hover:not(.active) {
  border-color: var(--accent);
}

.reg-avatar-area {
  padding: 8px 0;
}

.avatar-pick-label {
  font-size: 0.85em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.avatar-grid-small {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.avatar-choice-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-choice-small svg {
  width: 50px;
  height: 50px;
}

.avatar-choice-small span {
  font-size: 0.75em;
  color: var(--text-light);
}

.avatar-choice-small:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.avatar-choice-small.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ====== 注销提醒 ====== */
.inactive-notice {
  font-size: 0.75em;
  color: #a0aec0;
  text-align: center;
  margin-top: 12px;
}

/* ====== 手动输入答题区 ====== */
.input-answer-area {
  margin-top: 16px;
}

.answer-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.answer-input-field {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.4em;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  background: #f7fafc;
  outline: none;
  transition: border-color 0.2s;
}

.answer-input-field:focus {
  border-color: var(--primary);
}

.answer-input-field.input-correct {
  border-color: var(--correct);
  background: var(--correct-bg);
}

.answer-input-field.input-wrong {
  border-color: #fc8181;
  background: #fff5f5;
  font-size: 1em;
  color: #e53e3e;
}

.voice-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: white;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.voice-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.voice-btn.voice-active {
  border-color: #e53e3e;
  background: #fff5f5;
  animation: pulse 1s ease infinite;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 240px;
  margin: 0 auto 16px;
}

.numpad-key {
  padding: 14px;
  font-size: 1.3em;
  font-weight: 600;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.1s;
  color: var(--text);
}

.numpad-key:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.numpad-key:active:not(:disabled) {
  transform: scale(0.92);
}

.numpad-key:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.numpad-del {
  color: #e53e3e;
}

.btn-submit-answer {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
}

/* ====== 两步式应用题 ====== */
.step-indicator {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.step-badge {
  font-size: 0.8em;
  padding: 4px 12px;
  border-radius: 12px;
  background: #f7fafc;
  color: var(--text-light);
  font-weight: 500;
}

.step-badge.active {
  background: var(--primary);
  color: white;
}

.step-badge.done {
  background: var(--correct);
  color: white;
}

.step-hint {
  font-size: 0.95em;
  color: var(--text-light);
  margin-bottom: 14px;
}

.formula-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}

.btn-formula {
  padding: 14px 20px;
  font-size: 1.2em;
  font-weight: 600;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 2px;
}

.btn-formula:hover:not(:disabled) {
  border-color: var(--primary);
  transform: scale(1.03);
}

.btn-formula:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-formula:disabled {
  cursor: default;
  opacity: 0.7;
}

.btn-formula.formula-correct {
  background: var(--correct-bg);
  border-color: var(--correct);
}

.btn-formula.formula-wrong {
  background: var(--wrong-soft);
  border-color: transparent;
}

.step-formula-show {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

/* ====== 月度任务卡片 ====== */
.monthly-tasks-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

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

.monthly-tasks-title {
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text);
}

.monthly-tasks-progress {
  font-size: 0.85em;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 10px;
}

.monthly-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.monthly-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7fafc;
  transition: all 0.2s;
}

.monthly-task-item.done {
  background: var(--correct-bg);
}

.monthly-task-icon {
  font-size: 1.1em;
  width: 24px;
  text-align: center;
}

.monthly-task-text {
  flex: 1;
  font-size: 0.85em;
  color: var(--text);
}

.monthly-task-num {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--primary);
}

/* ====== 目标卡片 ====== */
.goal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.goal-icon {
  font-size: 1.2em;
}

.goal-text {
  flex: 1;
  font-size: 0.9em;
  color: var(--text);
  font-weight: 500;
}

.goal-progress {
  font-size: 0.9em;
  font-weight: 700;
  color: var(--primary);
}

.goal-options {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.goal-btn {
  flex: 1;
  padding: 8px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}

.goal-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ====== 积分飘字 ====== */
.points-toast {
  position: fixed;
  top: 55px;
  right: 16px;
  background: #fefcbf;
  color: #975a16;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s;
  z-index: 600;
  pointer-events: none;
}

.points-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== 目标达成庆祝 ====== */
.celebration-card {
  border: 3px solid #fbbf24;
}

.celebration-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

.celebration-title {
  font-size: 1.5em;
  color: var(--primary);
  margin-bottom: 8px;
}

.celebration-text {
  font-size: 1.1em;
  color: var(--text);
  margin-bottom: 8px;
}

.celebration-sub {
  font-size: 0.95em;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ====== 互动式教学 ====== */
.teach-interactive {
  text-align: center;
  padding: 20px 10px;
  width: 100%;
}

.teach-step-indicator {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.teach-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
}

/* "不会"按钮 */
.btn-dont-know {
  display: block;
  margin: 16px auto 0;
  padding: 10px 24px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-dont-know:hover {
  background: #e2e8f0;
  color: #475569;
  border-color: #94a3b8;
}
.btn-dont-know:active {
  transform: scale(0.97);
}

/* 变式题区域 */
.variant-intro {
  text-align: center;
  margin-bottom: 16px;
}
.variant-title {
  font-size: 16px;
  color: #475569;
  font-weight: 500;
}
.variant-success {
  text-align: center;
  padding: 30px 20px;
  animation: fadeInScale 0.4s ease;
}
.variant-success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.variant-success-text {
  font-size: 18px;
  color: #10b981;
  font-weight: 600;
}
.variant-retry {
  text-align: center;
  padding: 20px;
}
.variant-retry-text {
  font-size: 16px;
  color: #64748b;
}

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

/* fill-blank 拖拽选项样式 */
.drag-blank-area {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.drag-blank-slot {
  width: 80px;
  height: 60px;
  border: 3px dashed #94a3b8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #94a3b8;
  background: #f8fafc;
  transition: all 0.3s;
}
.drag-blank-slot.drag-success-slot {
  border-color: #10b981;
  background: #ecfdf5;
  color: #10b981;
  font-weight: bold;
}
.drag-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.drag-option-item {
  padding: 12px 24px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.drag-option-item:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: scale(1.05);
}
.drag-option-item:active {
  transform: scale(0.95);
}
.drag-option-item.drag-wrong {
  border-color: #fca5a5;
  background: #fef2f2;
}
.drag-option-item.dropped {
  border-color: #10b981;
  background: #ecfdf5;
}

/* 应用题运算符选择 */
.op-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  margin: 16px auto;
}
.btn-op {
  padding: 14px 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-op:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.btn-op.op-correct {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}
.btn-op.op-wrong {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.question-prompt-small {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
}
.wp-free-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.teach-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

.teach-dot.done {
  background: var(--correct);
}

.teach-visual-area {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: all 0.5s;
}

.teach-visual-area.animated .visual-objects {
  animation: fadeIn 0.5s ease;
}

.teach-voice-text {
  font-size: 1.2em;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.6;
}

.teach-instruction {
  font-size: 0.95em;
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 500;
}

.teach-next-btn {
  margin-top: 16px;
}

/* 视觉元素 */
.visual-objects {
  font-size: 1.8em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.obj-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 200px;
  justify-content: center;
}

.obj-plus {
  font-size: 0.8em;
  color: var(--primary);
  font-weight: 700;
}

.obj-removing {
  opacity: 0.3;
  text-decoration: line-through;
}

.merge-anim .merged {
  animation: pulse 0.5s ease;
}

.visual-groups {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.obj-group-box {
  border: 2px dashed var(--primary);
  border-radius: 10px;
  padding: 8px;
  font-size: 1.5em;
  animation: fadeIn 0.3s ease both;
}

.visual-rect {
  border: 3px solid var(--primary);
  border-radius: 4px;
  position: relative;
  margin: 20px auto;
  background: var(--primary-light);
}

.rect-label-h {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9em;
  color: var(--primary);
  font-weight: 600;
}

.rect-label-v {
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9em;
  color: var(--primary);
  font-weight: 600;
}

.visual-grid {
  display: grid;
  gap: 2px;
  margin: 10px auto;
  width: fit-content;
}

.grid-cell {
  width: 28px;
  height: 28px;
  border: 1px solid var(--primary);
  background: var(--primary-light);
  border-radius: 3px;
  animation: fadeIn 0.3s ease both;
}

.visual-fraction-bar {
  display: flex;
  height: 40px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  overflow: hidden;
  max-width: 300px;
  margin: 16px auto;
}

.fraction-part {
  flex: 1;
  border-right: 1px solid var(--primary);
  background: #f7fafc;
  transition: background 0.2s;
}

.fraction-part:last-child {
  border-right: none;
}

.fraction-part.selectable {
  cursor: pointer;
}

.fraction-part.selectable:hover {
  background: var(--primary-light);
}

.fraction-part.selected {
  background: var(--primary);
}

/* 拖拽区域 */
.teach-drag-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.drag-source {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 50px;
}

.drag-item {
  font-size: 2em;
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.drag-item:active {
  cursor: grabbing;
  transform: scale(1.2);
}

.drag-item.dragging {
  opacity: 0.5;
  transform: scale(1.1);
}

.drag-item.dropped {
  opacity: 0.3;
  cursor: default;
}

.drag-target {
  min-width: 120px;
  min-height: 60px;
  border: 3px dashed #cbd5e0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 10px;
}

.drag-target:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drag-targets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.drag-plate {
  min-width: 80px;
}

.drag-trash {
  background: #fff5f5;
  border-color: #fc8181;
}

.drag-blank-area {
  margin: 16px 0;
}

.drag-blank-slot {
  display: inline-block;
  min-width: 60px;
  min-height: 40px;
  border: 3px dashed var(--primary);
  border-radius: 8px;
  font-size: 1.3em;
  line-height: 40px;
  color: var(--text-light);
}

.drag-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

/* 竖式教学样式 */
.vertical-calc {
  display: inline-block;
  text-align: right;
  font-size: 2em;
  font-family: 'Courier New', monospace;
  padding: 16px 24px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  line-height: 1.6;
}
.vc-row { display: flex; justify-content: flex-end; gap: 4px; }
.vc-tens, .vc-ones { display: inline-block; width: 1.2em; text-align: center; }
.vc-sign { margin-right: 4px; color: var(--primary); }
.vc-op { border-bottom: none; }
.vc-line { height: 3px; background: var(--text); margin: 4px 0; border-radius: 2px; }
.vc-result { font-weight: bold; color: var(--primary); }
.vc-carry {
  position: absolute;
  top: 2px;
  right: 28px;
  font-size: 0.5em;
  color: #e53e3e;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.5s;
}
.vc-carry.show { opacity: 1; animation: carryBounce 0.5s ease; }
.vc-ones.hl { background: #fefcbf; border-radius: 4px; animation: pulse 1s infinite; }
.vc-tens.hl { background: #c6f6d5; border-radius: 4px; }
.vc-ones.hl-red { background: #fed7d7; border-radius: 4px; animation: pulse 1s infinite; }
.vc-borrow-mark {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.5em;
  color: #e53e3e;
}
.vc-borrow-mark sup { font-size: 0.9em; color: #38a169; }

@keyframes carryBounce {
  0% { transform: translateY(10px); opacity: 0; }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 口诀对比 */
.fact-contrast {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  font-size: 1.3em;
}
.fact-row {
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
}
.fact-wrong { background: #fed7d7; color: #c53030; text-decoration: line-through; }
.fact-correct { background: #c6f6d5; color: #276749; font-weight: bold; }

/* 位值教学 */
.place-value-visual { text-align: center; padding: 12px; }
.pv-number { font-size: 2.5em; font-weight: bold; color: var(--primary); margin-bottom: 12px; }
.pv-breakdown { display: flex; justify-content: center; gap: 24px; }
.pv-tens, .pv-ones { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pv-ten-block {
  display: inline-block;
  width: 36px; height: 24px;
  background: #bee3f8;
  border-radius: 4px;
  font-size: 0.7em;
  line-height: 24px;
  text-align: center;
}
.pv-one-block {
  display: inline-block;
  width: 20px; height: 20px;
  background: #fefcbf;
  border-radius: 50%;
  font-size: 0.6em;
  line-height: 20px;
  text-align: center;
}
.pv-label { font-size: 0.8em; color: var(--text-light); margin-top: 4px; }

/* quiz步骤中显示原题上下文 */
.teach-quiz-context {
  background: var(--primary-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
}
.quiz-context-prompt {
  font-size: 0.9em;
  color: var(--text);
  margin-bottom: 4px;
}
.quiz-context-display {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--primary);
}

.drag-option-item {
  padding: 10px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: grab;
  background: white;
  transition: all 0.15s;
}

.drag-option-item:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.drag-counter {
  font-size: 0.9em;
  color: var(--text-light);
  margin-top: 8px;
}

.drag-counter span {
  font-weight: 700;
  color: var(--primary);
}

.teach-drag-feedback {
  min-height: 30px;
  margin-top: 8px;
}

.drag-success {
  color: var(--correct);
  font-weight: 600;
  font-size: 1.1em;
  animation: pulse 0.5s ease;
}

.drag-progress {
  color: var(--text-light);
  font-size: 0.9em;
}

.teach-confirm-visual {
  padding: 30px 20px;
}

.teach-confirm-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

.teach-confirm-text {
  font-size: 1.2em;
  color: var(--text);
  font-weight: 500;
  line-height: 1.6;
}

.visual-placeholder {
  padding: 20px;
  font-size: 1.1em;
  color: var(--text);
}

/* ====== 教学Quiz步骤 ====== */
.teach-quiz-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0 12px;
}

.btn-quiz-option {
  padding: 12px 24px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.2em;
  font-weight: 600;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
}

.btn-quiz-option:hover:not(:disabled) {
  border-color: var(--primary);
  transform: scale(1.05);
}

.btn-quiz-option.quiz-correct {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
  animation: pulse 0.5s ease;
}

.btn-quiz-option.quiz-wrong {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  opacity: 0.5;
}

.teach-quiz-hint {
  font-size: 0.9em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.teach-quiz-feedback {
  min-height: 30px;
  margin-top: 12px;
}

.quiz-success {
  color: var(--correct);
  font-weight: 600;
  font-size: 1.1em;
  animation: pulse 0.5s ease;
}

.quiz-retry {
  color: #f59e0b;
  font-weight: 500;
}

.quiz-reveal {
  color: var(--text-light);
  font-weight: 500;
}

/* ====== 减法飞走动画 ====== */
.obj-removal-anim {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.obj-item {
  display: inline-block;
  font-size: 1.8em;
  transition: all 0.3s;
}

.obj-stay {
  opacity: 1;
}

.obj-fly-away {
  animation: flyAway 0.8s ease forwards;
  animation-delay: var(--fly-delay, 0s);
}

@keyframes flyAway {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 0.5; transform: translateY(-20px) scale(0.8); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.3); }
}

/* ====== 除法分组动画 ====== */
.split-anim .obj-group-box {
  opacity: 0;
  animation: splitAppear 0.5s ease forwards;
}

.split-anim .split-delay-0 { animation-delay: 0s; }
.split-anim .split-delay-1 { animation-delay: 0.4s; }
.split-anim .split-delay-2 { animation-delay: 0.8s; }
.split-anim .split-delay-3 { animation-delay: 1.2s; }
.split-anim .split-delay-4 { animation-delay: 1.6s; }

@keyframes splitAppear {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* ====== 数轴动画 ====== */
.number-line {
  position: relative;
  width: 80%;
  max-width: 280px;
  height: 60px;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-line-bar {
  position: absolute;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  top: 50%;
}

.nl-mark {
  position: relative;
  font-weight: 700;
  font-size: 1.1em;
  color: var(--primary);
  padding: 0 8px;
}

.nl-start {
  background: white;
  border: 2px solid var(--primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
}

.nl-jump-arrow {
  color: #f59e0b;
  font-weight: 600;
  font-size: 1em;
  animation: bounceRight 1s ease infinite;
}

.nl-jump-arrow.nl-backward {
  animation: bounceLeft 1s ease infinite;
}

.nl-result {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  color: #92400e;
}

.nl-hidden {
  opacity: 1;
}

@keyframes bounceRight {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

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

/* ====== 分数高亮 ====== */
.fraction-highlighted {
  background: var(--primary) !important;
  animation: fadeIn 0.3s ease;
}

/* ====== 方格逐个出现 ====== */
.teach-visual-area.animated .grid-cell {
  animation: fadeIn 0.3s ease both;
  animation-delay: var(--cell-delay, 0s);
}

/* ====== 分组逐个高亮 ====== */
.teach-visual-area.animated .highlight-delay-0 { animation: groupGlow 0.5s ease 0s both; }
.teach-visual-area.animated .highlight-delay-1 { animation: groupGlow 0.5s ease 0.4s both; }
.teach-visual-area.animated .highlight-delay-2 { animation: groupGlow 0.5s ease 0.8s both; }
.teach-visual-area.animated .highlight-delay-3 { animation: groupGlow 0.5s ease 1.2s both; }
.teach-visual-area.animated .highlight-delay-4 { animation: groupGlow 0.5s ease 1.6s both; }
.teach-visual-area.animated .highlight-delay-5 { animation: groupGlow 0.5s ease 2.0s both; }

@keyframes groupGlow {
  0% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.1); box-shadow: 0 0 12px rgba(99,102,241,0.4); }
  100% { transform: scale(1); box-shadow: 0 0 4px rgba(99,102,241,0.2); }
}

/* 知识地图 */
.kmap-area { padding: 16px; overflow-y: auto; max-height: calc(100vh - 60px); }
.kmap-container { max-width: 600px; margin: 0 auto; }
.kmap-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.kmap-tab { padding: 6px 12px; border-radius: 16px; border: 1px solid #ddd; background: #fff; font-size: 13px; cursor: pointer; }
.kmap-tab.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.kmap-semester { margin-bottom: 20px; }
.kmap-sem-title { font-size: 15px; color: #555; margin-bottom: 10px; padding-left: 4px; }
.kmap-nodes { display: flex; flex-direction: column; gap: 10px; }
.kmap-node { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #f8f9fa; border: 2px solid #e0e0e0; transition: all 0.2s; }
.kmap-node.mastered { border-color: #10b981; background: #ecfdf5; }
.kmap-node.in-progress { border-color: #6366f1; background: #eef2ff; }
.kmap-node.not-started { border-color: #d1d5db; background: #fff; }
.kmap-node.locked { border-color: #e5e7eb; background: #f3f4f6; opacity: 0.6; }
.kmap-node-icon { font-size: 20px; min-width: 28px; text-align: center; }
.kmap-node-title { font-size: 14px; font-weight: 500; flex: 1; }
.kmap-node-info { display: flex; flex-direction: column; flex: 1; }
.kmap-node-progress { font-size: 11px; color: #6366f1; margin-top: 2px; }
.kmap-node-progress.done { color: #10b981; font-weight: 600; }
.kmap-node-prereqs { font-size: 11px; color: #6b7280; margin-top: 2px; }
.kmap-node-locked { font-size: 11px; color: #ef4444; margin-top: 2px; }
.kmap-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 10px; background: #f8f9fa; border-radius: 8px; }
.kmap-legend-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #555; }
.kmap-dot { width: 10px; height: 10px; border-radius: 50%; }
.kmap-dot.mastered { background: #10b981; }
.kmap-dot.in-progress { background: #6366f1; }
.kmap-dot.not-started { background: #d1d5db; }
.kmap-dot.locked { background: #e5e7eb; }
.btn-back { background: none; border: none; font-size: 14px; color: #6366f1; cursor: pointer; padding: 4px 8px; }
.btn-home { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 8px; line-height: 1; }
#btn-kmap { margin-top: 8px; }

/* 前置知识提醒 */
.prereq-warning { padding: 20px; text-align: center; }
.prereq-msg { font-size: 15px; color: #333; margin-bottom: 12px; }
.prereq-list { list-style: none; padding: 0; margin: 0 0 16px 0; }
.prereq-list li { padding: 8px 14px; margin: 6px 0; background: #fef3c7; border-radius: 8px; font-size: 14px; color: #92400e; }
.prereq-hint { font-size: 13px; color: #6b7280; }

/* 周报 */
.wr-area { padding: 16px; overflow-y: auto; max-height: calc(100vh - 60px); }
.weekly-report { max-width: 500px; margin: 0 auto; }
.wr-title { text-align: center; font-size: 18px; margin-bottom: 4px; }
.wr-date { text-align: center; font-size: 12px; color: #6b7280; margin-bottom: 16px; }
.wr-stats { display: flex; justify-content: space-around; margin-bottom: 20px; padding: 14px; background: #f0fdf4; border-radius: 12px; }
.wr-stat { text-align: center; }
.wr-stat-num { display: block; font-size: 22px; font-weight: 700; color: #10b981; }
.wr-stat-label { font-size: 11px; color: #6b7280; }
.wr-mastery { margin-bottom: 20px; }
.wr-mastery h3 { font-size: 14px; margin-bottom: 8px; }
.wr-mastery-bar { height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; display: flex; }
.wr-bar-fill.mastered { background: #10b981; }
.wr-bar-fill.familiar { background: #6366f1; }
.wr-mastery-legend { display: flex; justify-content: space-between; font-size: 11px; color: #6b7280; margin-top: 4px; }
.wr-top-modules { margin-bottom: 20px; }
.wr-top-modules h3 { font-size: 14px; margin-bottom: 8px; }
.wr-module-item { display: flex; justify-content: space-between; padding: 8px 12px; background: #f8f9fa; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.wr-encourage { text-align: center; padding: 16px; background: #fef3c7; border-radius: 12px; font-size: 14px; color: #92400e; }
#btn-weekly { margin-top: 8px; }

/* 不会选择面板 */
.dontknow-choice { padding: 30px 20px; text-align: center; }
.dontknow-msg { font-size: 16px; color: #333; margin-bottom: 20px; }
.btn-choice { display: block; width: 100%; max-width: 280px; margin: 10px auto; padding: 14px; border-radius: 12px; font-size: 15px; cursor: pointer; }
.btn-choice.btn-small { font-size: 13px; padding: 10px; margin-top: 16px; }

/* ====== 微信浏览器语音提示 ====== */
.wechat-voice-tip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.wechat-voice-tip-content {
  background: white;
  border-radius: 16px;
  padding: 30px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.wechat-voice-tip-content p {
  font-size: 15px;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.5;
}

.wechat-voice-tip-action {
  color: #5b8a9a;
  font-weight: 600;
  margin-top: 12px;
}

.wechat-voice-tip-close {
  margin-top: 20px;
  padding: 10px 32px;
  border: none;
  border-radius: 20px;
  background: var(--primary);
  color: white;
  font-size: 15px;
  cursor: pointer;
}
