/* ========================================
   数学故事岛 - 主样式表 v1.0
   ======================================== */

/* 引入重置 */
@import url('reset.css');

/* ========================================
   CSS 变量
   ======================================== */
:root {
  /* 主色调 */
  --color-primary: #FF6B35;
  --color-primary-hover: #E55A2B;
  --color-secondary: #4ECDC4;
  --color-background: #FFF8F0;
  --color-text: #2D3436;
  --color-text-secondary: #636E72;
  --color-text-light: #B2BEC3;

  /* 反馈色 */
  --color-success: #00B894;
  --color-warning: #FDCB6E;
  --color-error: #E17055;

  /* 中性色 */
  --color-white: #FFFFFF;
  --color-gray-100: #F8F9FA;
  --color-gray-200: #DFE6E9;
  --color-gray-300: #B2BEC3;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-button: 0 2px 8px rgba(255, 107, 53, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* 字体大小 */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;

  /* 布局 */
  --header-height: 56px;
  --max-width: 480px;
}

/* ========================================
   全局样式
   ======================================== */
html {
  scroll-padding-top: calc(var(--header-height) + 8px);
}

body {
  background: var(--color-background);
  color: var(--color-text);
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  position: relative;
}

/* ========================================
   页面容器
   ======================================== */
.page {
  min-height: 100vh;
  padding: 0 var(--space-lg);
  animation: fadeIn 0.3s ease-out;
}

.page--with-header {
  padding-top: var(--header-height);
}

/* 故事页特殊处理：允许滚动，顶部为固定导航栏腾出空间 */
.page--story-page {
  padding-top: calc(var(--header-height) + 4px);
  min-height: 100vh;
}

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

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}

/* ========================================
   顶部导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-gray-200);
}

.navbar__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

.navbar--story {
  justify-content: flex-start;
  gap: var(--space-sm);
}

.navbar__story-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-right: 40px;
}

.navbar__back {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  padding: var(--space-sm);
  margin-left: calc(var(--space-sm) * -1);
  flex-shrink: 0;
}

.navbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.navbar__btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: var(--text-xl);
  transition: background 0.2s;
}

.navbar__btn:active {
  background: var(--color-gray-200);
}

/* ========================================
   按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: 600;
  transition: all 0.2s ease;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-button);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn--secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn--full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================================
   卡片
   ======================================== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.card--hoverable:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   Toast 提示
   ======================================== */
#toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: none;
  max-width: var(--max-width);
  width: 90%;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  animation: slideUp 0.3s ease-out;
  pointer-events: auto;
}

.toast--info { border-left: 4px solid var(--color-secondary); }
.toast--success { border-left: 4px solid var(--color-success); }
.toast--warning { border-left: 4px solid var(--color-warning); }
.toast--error { border-left: 4px solid var(--color-error); }

/* ========================================
   引导页
   ======================================== */
.onboarding {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-2xl);
  text-align: center;
}

.onboarding__emoji {
  font-size: 80px;
  margin-bottom: var(--space-xl);
  animation: scaleIn 0.5s ease-out;
}

.onboarding__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.onboarding__desc {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-2xl);
}

.onboarding__dots {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.onboarding__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gray-300);
  transition: all 0.3s;
}

.onboarding__dot--active {
  width: 24px;
  border-radius: 4px;
  background: var(--color-primary);
}

.onboarding__skip {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-sm) var(--space-md);
}

/* ========================================
   首页
   ======================================== */
.home {
  padding-top: var(--header-height);
  padding-bottom: var(--space-xl);
}

.home__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
}

.home__logo {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
}

.home__welcome {
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

/* 继续学习卡片 */
.continue-card {
  background: linear-gradient(135deg, #FF6B35, #FF8F5E);
  color: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  cursor: pointer;
  transition: transform 0.2s;
}

.continue-card:active {
  transform: scale(0.98);
}

.continue-card__label {
  font-size: var(--text-sm);
  opacity: 0.9;
  margin-bottom: var(--space-sm);
}

.continue-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.continue-card__progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.continue-card__bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.continue-card__fill {
  height: 100%;
  background: var(--color-white);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.continue-card__text {
  font-size: var(--text-sm);
  opacity: 0.9;
}

.continue-card__btn {
  background: var(--color-white);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  padding: 10px 24px;
  font-weight: 600;
  font-size: var(--text-md);
  display: inline-block;
}

/* 开始探索卡片 */
.start-card {
  background: linear-gradient(135deg, #4ECDC4, #44B3AA);
  color: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.start-card:active {
  transform: scale(0.98);
}

.start-card__emoji {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.start-card__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.start-card__desc {
  font-size: var(--text-md);
  opacity: 0.9;
}

/* 分类网格 */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.category-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s;
}

.category-card:active {
  transform: scale(0.96);
}

.category-card__icon {
  font-size: 32px;
  margin-bottom: var(--space-sm);
}

.category-card__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.category-card__count {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

/* 成就预览 */
.achievement-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.achievement-preview:active {
  transform: scale(0.98);
}

.achievement-preview__icon {
  font-size: 28px;
}

.achievement-preview__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ========================================
   故事阅读页
   ======================================== */

/* 故事内容滚动容器 */
.story-content {
  padding-bottom: var(--space-2xl);
}

/* 故事进度条 */
.story-progress {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 99;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 4px;
  background: var(--color-gray-200);
}

.story-progress__fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

/* 故事内容区块 */
.story-content {
  padding-top: var(--space-lg);
}

.narrative-block {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s ease-out;
}

.narrative-block__text {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--color-text);
}

/* 题目配图 */
.question-image {
  text-align: center;
  margin-bottom: var(--space-md);
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-gray-100);
}

.question-image svg {
  max-width: 100%;
  max-height: 200px;
  display: inline-block;
}

/* 答题区 */
.question-block {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s ease-out;
}

.question-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.question-block__number {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-block__text {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

/* 选项 */
.options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.option-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-gray-200);
  background: var(--color-white);
  font-size: var(--text-md);
  text-align: left;
  transition: all 0.2s;
  min-height: 48px;
}

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

.option-btn__letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.option-btn--selected {
  border-color: var(--color-primary);
  background: #FFF0E8;
}

.option-btn--selected .option-btn__letter {
  background: var(--color-primary);
  color: var(--color-white);
}

.option-btn--correct {
  border-color: var(--color-success);
  background: #E6FFF8;
}

.option-btn--correct .option-btn__letter {
  background: var(--color-success);
  color: var(--color-white);
}

.option-btn--wrong {
  border-color: var(--color-error);
  background: #FFF0ED;
}

.option-btn--wrong .option-btn__letter {
  background: var(--color-error);
  color: var(--color-white);
}

.option-btn--disabled {
  pointer-events: none;
}

/* 提交按钮 */
.submit-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* 反馈区 */
.feedback {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  animation: slideUp 0.3s ease-out;
}

.feedback--correct {
  background: #E6FFF8;
  border-left: 4px solid var(--color-success);
}

.feedback--wrong {
  background: #FFF8E1;
  border-left: 4px solid var(--color-warning);
}

.feedback__label {
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.feedback--correct .feedback__label {
  color: var(--color-success);
}

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

.feedback__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* 跳过按钮 */
.skip-btn {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  text-align: center;
  padding: var(--space-sm);
  cursor: pointer;
}

.skip-btn:active {
  color: var(--color-text-secondary);
}

/* 继续故事按钮 */
.continue-story-btn-wrapper {
  padding: var(--space-md) 0 var(--space-2xl);
  animation: slideUp 0.3s ease-out;
}

/* ========================================
   完成弹窗
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: fadeIn 0.3s ease-out;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.3s ease-out;
}

.modal__emoji {
  font-size: 56px;
  margin-bottom: var(--space-lg);
}

.modal__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.modal__subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.modal__score {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
}

.modal__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.modal__next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-gray-200);
  color: var(--color-secondary);
  font-weight: 600;
  font-size: var(--text-md);
  cursor: pointer;
}

.modal__next:active {
  opacity: 0.7;
}

/* 反馈弹窗 */
.modal--feedback {
  max-width: 400px;
  text-align: left;
  padding: var(--space-xl);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: var(--text-md);
  color: var(--color-text-light);
  transition: background 0.2s;
}

.modal__close:active {
  background: var(--color-gray-200);
}

.feedback-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.feedback-type-btn {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-gray-200);
  background: var(--color-white);
  font-size: var(--text-sm);
  text-align: center;
  transition: all 0.2s;
}

.feedback-type-btn:active {
  transform: scale(0.97);
}

.feedback-type-btn--active {
  border-color: var(--color-primary);
  background: #FFF0E8;
  color: var(--color-primary);
  font-weight: 600;
}

.feedback-textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.feedback-input {
  width: 100%;
  padding: 12px var(--space-md);
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.feedback-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ========================================
   截图上传
   ======================================== */
.screenshot-upload__btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-lg);
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-md);
  background: var(--color-gray-100);
  cursor: pointer;
  transition: all 0.2s;
  font-size: var(--text-md);
  color: var(--color-text-secondary);
}

.screenshot-upload__btn:active {
  border-color: var(--color-primary);
  background: #FFF0E8;
}

.screenshot-upload__icon {
  font-size: 24px;
}

.screenshot-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--color-gray-200);
  background: var(--color-gray-100);
}

.screenshot-preview__img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  background: var(--color-gray-100);
}

.screenshot-preview__remove {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: var(--color-white);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.screenshot-preview__remove:active {
  background: rgba(0, 0, 0, 0.8);
}

.screenshot-hint {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-top: var(--space-sm);
}

/*
========================================
错题本
======================================== */
.wrong-answers-page {
  padding: var(--space-lg);
  max-width: 600px;
  margin: 0 auto;
}

.wrong-answers__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.wrong-answers__count {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

.wrong-answers__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.wrong-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border-left: 4px solid var(--color-error);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wrong-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.wrong-item__story {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.wrong-item__time {
  font-size: 11px;
  color: var(--color-gray-400);
}

.wrong-item__question {
  font-size: var(--text-base);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.wrong-item__your-answer,
.wrong-item__correct-answer {
  font-size: var(--text-sm);
  line-height: 1.8;
}

.wrong-item__label {
  color: var(--color-gray-500);
  margin-right: 4px;
}

.wrong-item__text--wrong {
  color: var(--color-error);
  font-weight: 600;
  text-decoration: line-through;
}

.wrong-item__text--correct {
  color: var(--color-success);
  font-weight: 600;
}

.wrong-item__meta {
  font-size: 11px;
  color: var(--color-gray-400);
  margin-top: var(--space-xs);
}

/* ========================================
   知识点地图
   ======================================== */
.map-page {
  padding-top: var(--header-height);
  padding-bottom: var(--space-xl);
}

.grade-tabs {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
}

.grade-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  transition: all 0.2s;
}

.grade-tab--active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.map-progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.map-progress__bar {
  flex: 1;
  height: 6px;
  background: var(--color-gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.map-progress__fill {
  height: 100%;
  background: var(--color-success);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.story-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.story-node {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s;
}

.story-node:active {
  transform: scale(0.98);
}

.story-node--locked {
  opacity: 0.6;
  cursor: default;
}

.story-node--locked:active {
  transform: none;
}

.story-node__icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.story-node__info {
  flex: 1;
  min-width: 0;
}

.story-node__title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-node__point {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.story-node__badge {
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-white);
  flex-shrink: 0;
}

.story-node__stars {
  font-size: var(--text-xs);
  color: var(--color-warning);
  flex-shrink: 0;
}

.map-legend {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
  justify-content: center;
}

.map-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

/* ========================================
   个人中心
   ======================================== */
.profile-page {
  padding-top: var(--header-height);
  padding-bottom: var(--space-xl);
}

.profile__header {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.profile__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto var(--space-md);
}

.profile__name {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.profile__days {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.profile__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.profile__stat {
  text-align: center;
  padding: var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.profile__stat-icon {
  font-size: 20px;
  margin-bottom: var(--space-xs);
}

.profile__stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.profile__stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.profile__section {
  margin-bottom: var(--space-xl);
}

.profile__section-title {
  font-size: var(--text-md);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.achievement-item {
  text-align: center;
  padding: var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.achievement-item--locked {
  filter: grayscale(1);
  opacity: 0.5;
}

.achievement-item__icon {
  font-size: 28px;
  margin-bottom: var(--space-xs);
}

.achievement-item__name {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.profile__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.profile__action {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.profile__action:active {
  transform: scale(0.98);
}

.profile__action-icon {
  font-size: 20px;
}

.profile__action-text {
  flex: 1;
  font-size: var(--text-md);
  text-align: left;
}

.profile__action-arrow {
  color: var(--color-text-light);
  font-size: var(--text-lg);
}

/* ========================================
   加载/错误/空状态
   ======================================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--space-lg);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  gap: var(--space-md);
  color: var(--color-text-light);
}

.empty-state__icon {
  font-size: 48px;
}

.empty-state__text {
  font-size: var(--text-md);
}

/* ========================================
   工具类
   ======================================== */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.p-lg { padding: var(--space-lg); }

/* ========================================
   自适应
   ======================================== */
@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--color-gray-200);
    border-right: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-lg);
  }
}

@media (max-width: 320px) {
  .profile__stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .achievement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
