/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  /* 类目主题色（由JS动态注入，此处为默认值） */
  --cat-primary: #6366f1;
  --cat-secondary: #818cf8;
  --cat-gradient: linear-gradient(135deg, #6366f1, #818cf8);
  --cat-light: #eef2ff;
  --cat-primary-rgb: 99, 102, 241;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 80px;
}

/* 顶部导航 */
.header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.75), rgba(236, 72, 153, 0.75));
  color: white;
  padding: 14px 16px 16px;
  position: relative;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.header p {
  font-size: 13px;
  opacity: 0.9;
}

/* 品牌小标题栏 */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(236, 72, 153, 0.9));
  color: white;
}

/* 分类页圆角卡片横幅 */
.category-banner {
  margin: 0 16px 8px;
  padding: 10px;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(99, 102, 241, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.category-banner:active {
  transform: scale(0.98);
}

.category-banner-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.category-banner-desc {
  font-size: 11px;
  opacity: 0.9;
  line-height: 1.3;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-sub {
  font-size: 11px;
  opacity: 0.85;
}

.header-back {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
}

.header-back:hover {
  opacity: 0.8;
}

/* 类目导航 */
.category-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 14px 16px;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
  border-bottom: 3px solid rgba(99, 102, 241, 0.15);
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

/* 滚动紧凑模式 */
.category-nav.compact {
  padding: 6px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-nav.compact .category-item {
  padding: 6px 2px;
  gap: 2px;
}

.category-nav.compact .category-icon {
  display: none;
}

.category-nav.compact .category-name {
  font-size: 12px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  background: #f9fafb;
}

.category-item:active {
  transform: scale(0.95);
}

.category-item.active {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-secondary));
  color: white;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-secondary));
  color: white;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 98;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.3s ease forwards;
}

.back-to-top:active {
  transform: scale(0.9);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-icon {
  font-size: 26px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.category-item.active .category-icon {
  background: rgba(255, 255, 255, 0.25) !important;
}

.category-name {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

/* 内容区 */
.content {
  padding: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .badge {
  font-size: 11px;
  background: var(--cat-secondary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* 题库卡片 */
.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quiz-card {
  background: linear-gradient(145deg, #ffffff, #fafbfc);
  border-radius: 14px;
  padding: 10px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(99, 102, 241, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.quiz-card:active {
  transform: scale(0.97);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quiz-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cat-primary), var(--cat-secondary));
  opacity: 0.7;
}

.quiz-card-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: transform 0.3s;
}

.quiz-card:active .quiz-card-icon {
  transform: scale(0.9);
}

.quiz-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  line-height: 1.3;
}

.quiz-card-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-light);
}

.quiz-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.quiz-card-tag {
  font-size: 10px;
  background: #f1f5f9;
  color: var(--text-light);
  padding: 1px 6px;
  border-radius: 6px;
}

.mandatory-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 500;
}

.ad-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--warning);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
}

/* 细分赛道 */
.sub-category-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.sub-category-list::-webkit-scrollbar {
  display: none;
}

.sub-category-item {
  white-space: nowrap;
  padding: 4px 12px;
  background: var(--card-bg);
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid var(--border);
}

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

/* 答题页 */
.quiz-container {
  padding: 16px;
}

.progress-bar {
  background: #e2e8f0;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cat-primary), var(--cat-secondary));
  border-radius: 3px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 24px;
  text-align: center;
}

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

.question-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}

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

.option-item {
  padding: 14px 16px;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 15px;
}

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

.option-item.selected {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
  border-color: var(--cat-primary);
  color: var(--cat-primary);
  font-weight: 500;
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-secondary));
  color: white;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
}

/* 结果页 */
.result-container {
  padding: 16px;
}

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 16px;
}

.result-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.result-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.result-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-secondary));
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.result-description {
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  margin-bottom: 16px;
}

.result-personality {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.personality-tag {
  background: #f1f5f9;
  color: var(--cat-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.result-advice {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05));
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  text-align: left;
  margin-bottom: 16px;
}

.result-advice-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--cat-primary);
}

/* 广告解锁 */
.ad-lock-card {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  border: 2px dashed #f59e0b;
}

.ad-lock-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.ad-lock-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ad-lock-desc {
  font-size: 13px;
  color: #92400e;
  margin-bottom: 12px;
}

.watch-ad-btn {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

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

.ad-countdown {
  font-size: 24px;
  font-weight: 700;
  color: var(--warning);
  margin: 12px 0;
}

/* 免责声明 */
.disclaimer {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  text-align: center;
  margin-top: 16px;
}

.disclaimer-icon {
  font-size: 14px;
  margin-right: 4px;
}

/* 底部操作栏 */
.bottom-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  padding: 12px 16px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 12px;
  z-index: 100;
}

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

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--cat-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 9999;
  animation: fadeIn 0.3s;
}

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 动画 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

/* ============ 交互反馈效果 ============ */

/* 仅在支持hover的设备上启用hover效果 */
@media (hover: hover) {
  /* 题库卡片：悬停抬升 + 类目色阴影 */
  .quiz-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(var(--cat-primary-rgb), 0.18);
    border-color: var(--cat-primary);
  }

  /* 导航项：悬停背景脉冲 */
  .category-item:hover {
    background: var(--cat-light);
  }

  .category-item.active:hover {
    background: var(--cat-gradient);
  }

  /* 细分赛道标签：悬停变色 */
  .sub-category-item:hover {
    border-color: var(--cat-primary);
    color: var(--cat-primary);
  }

  .sub-category-item.active:hover {
    background: var(--cat-primary);
    color: white;
  }

  /* 答题选项：悬停高亮边框 */
  .option-item:hover {
    border-color: var(--cat-primary);
    background: rgba(var(--cat-primary-rgb), 0.05);
  }

  /* 按钮：悬停发光 */
  .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--cat-primary-rgb), 0.35);
    transform: translateY(-2px);
  }

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

  /* 回到顶部按钮：悬停放大 */
  .back-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(var(--cat-primary-rgb), 0.5);
  }
}

/* 移动端/触摸设备 :active 按下反馈 */

/* 题库卡片：按下缩放 */
.quiz-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(var(--cat-primary-rgb), 0.15);
}

/* 导航项：按下缩小回弹 */
.category-item:active {
  transform: scale(0.92);
}

/* 细分赛道标签：按下反馈 */
.sub-category-item:active {
  transform: scale(0.95);
}

/* 答题选项：按下反馈 */
.option-item:active {
  transform: scale(0.98);
}

/* 按钮：按下下沉 */
.btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* 答题选项选中态增强 */
.option-item.selected {
  border-color: var(--cat-primary);
  background: rgba(var(--cat-primary-rgb), 0.08);
  box-shadow: 0 0 0 3px rgba(var(--cat-primary-rgb), 0.15);
  position: relative;
}

.option-item.selected::after {
  content: '✓';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cat-primary);
  font-weight: bold;
  font-size: 18px;
  animation: checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
  0% { transform: translateY(-50%) scale(0); }
  100% { transform: translateY(-50%) scale(1); }
}

/* 进度条增强 */
.progress-fill {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 必做徽章微动画 */
.mandatory-badge {
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(236, 72, 153, 0); }
}

/* 结果卡片入场动画 */
.result-card {
  animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 广告锁定卡片脉冲 */
.ad-lock-card {
  animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
  0%, 100% { border-color: var(--cat-primary); }
  50% { border-color: var(--cat-secondary); }
}

/* 全局过渡统一 */
.quiz-card,
.category-item,
.sub-category-item,
.option-item,
.btn,
.category-icon,
.quiz-card-icon,
.back-to-top {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* ============ 新增动画效果 ============ */

/* 1. 题库卡片stagger入场动画 */
.quiz-card {
  opacity: 0;
  animation: cardFadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 首页题库卡片：前12张必做题库stagger，每张延迟60ms */
.quiz-card:nth-child(1) { animation-delay: 0.05s; }
.quiz-card:nth-child(2) { animation-delay: 0.10s; }
.quiz-card:nth-child(3) { animation-delay: 0.15s; }
.quiz-card:nth-child(4) { animation-delay: 0.20s; }
.quiz-card:nth-child(5) { animation-delay: 0.25s; }
.quiz-card:nth-child(6) { animation-delay: 0.30s; }
.quiz-card:nth-child(7) { animation-delay: 0.35s; }
.quiz-card:nth-child(8) { animation-delay: 0.40s; }
.quiz-card:nth-child(9) { animation-delay: 0.45s; }
.quiz-card:nth-child(10) { animation-delay: 0.50s; }
.quiz-card:nth-child(11) { animation-delay: 0.55s; }
.quiz-card:nth-child(12) { animation-delay: 0.60s; }
.quiz-card:nth-child(13) { animation-delay: 0.65s; }
.quiz-card:nth-child(14) { animation-delay: 0.68s; }
.quiz-card:nth-child(15) { animation-delay: 0.71s; }
.quiz-card:nth-child(16) { animation-delay: 0.74s; }
.quiz-card:nth-child(17) { animation-delay: 0.77s; }
.quiz-card:nth-child(18) { animation-delay: 0.80s; }
.quiz-card:nth-child(n+19) { animation-delay: 0.82s; }

@keyframes cardFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 2. 骨架屏loading动画 */
.skeleton-screen {
  padding: 16px;
}

.skeleton-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.skeleton-nav-item {
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

.skeleton-header {
  height: 100px;
  border-radius: 16px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skeleton-card {
  height: 180px;
  border-radius: 16px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 3. 答题完成庆祝粒子效果 */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s ease-in forwards;
}

.confetti:nth-child(1) { left: 5%; background: #ec4899; animation-delay: 0s; border-radius: 50%; }
.confetti:nth-child(2) { left: 10%; background: #6366f1; animation-delay: 0.1s; }
.confetti:nth-child(3) { left: 15%; background: #f59e0b; animation-delay: 0.2s; border-radius: 50%; }
.confetti:nth-child(4) { left: 20%; background: #10b981; animation-delay: 0.05s; }
.confetti:nth-child(5) { left: 25%; background: #ec4899; animation-delay: 0.15s; }
.confetti:nth-child(6) { left: 30%; background: #6366f1; animation-delay: 0.25s; border-radius: 50%; }
.confetti:nth-child(7) { left: 35%; background: #f59e0b; animation-delay: 0s; }
.confetti:nth-child(8) { left: 40%; background: #10b981; animation-delay: 0.1s; }
.confetti:nth-child(9) { left: 45%; background: #ec4899; animation-delay: 0.2s; border-radius: 50%; }
.confetti:nth-child(10) { left: 50%; background: #6366f1; animation-delay: 0.05s; }
.confetti:nth-child(11) { left: 55%; background: #f59e0b; animation-delay: 0.15s; border-radius: 50%; }
.confetti:nth-child(12) { left: 60%; background: #10b981; animation-delay: 0.25s; }
.confetti:nth-child(13) { left: 65%; background: #ec4899; animation-delay: 0s; }
.confetti:nth-child(14) { left: 70%; background: #6366f1; animation-delay: 0.1s; border-radius: 50%; }
.confetti:nth-child(15) { left: 75%; background: #f59e0b; animation-delay: 0.2s; }
.confetti:nth-child(16) { left: 80%; background: #10b981; animation-delay: 0.05s; border-radius: 50%; }
.confetti:nth-child(17) { left: 85%; background: #ec4899; animation-delay: 0.15s; }
.confetti:nth-child(18) { left: 90%; background: #6366f1; animation-delay: 0.25s; }
.confetti:nth-child(19) { left: 95%; background: #f59e0b; animation-delay: 0s; border-radius: 50%; }
.confetti:nth-child(20) { left: 98%; background: #10b981; animation-delay: 0.1s; }

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* 庆祝文字弹出 */
.celebration-text {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: bold;
  color: var(--cat-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  pointer-events: none;
  animation: celebrationPop 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes celebrationPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ============ 底部Tab栏 ============ */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.3s;
  padding: 8px 0;
}

.tab-item:active {
  transform: scale(0.92);
}

.tab-item.active .tab-icon {
  font-size: 24px;
  filter: none;
}

.tab-item.active .tab-label {
  color: var(--cat-primary);
  font-weight: 600;
}

.tab-icon {
  font-size: 22px;
  filter: grayscale(0.3);
  transition: all 0.3s;
}

.tab-label {
  font-size: 11px;
  color: var(--text-light);
  transition: all 0.3s;
}

/* 给主内容区留出底部Tab高度（仅在有底部Tab栏时生效） */
body:has(.bottom-tab-bar) .content {
  padding-bottom: 80px;
}

/* ============ 我的页面 - 个人资料头部卡片 ============ */
.mine-profile-header {
  position: relative;
  margin: 12px 16px 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(99, 102, 241, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

.mine-profile-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 70px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
}

.mine-profile-bg::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.mine-profile-bg::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.mine-profile-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  z-index: 1;
}

.mine-avatar-wrap {
  flex-shrink: 0;
}

.mine-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
}

.mine-user-meta {
  flex: 1;
  min-width: 0;
}

.mine-nickname {
  font-size: 17px;
  font-weight: 700;
  color: white;
  margin-bottom: 3px;
  cursor: pointer;
}

.mine-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.mine-logout-btn {
  font-size: 13px;
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  color: white;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.mine-logout-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

/* 统计数据 - 白色浮层卡片 */
.mine-profile-stats {
  position: relative;
  display: flex;
  background: white;
  border-radius: 16px;
  margin: 0 10px 10px;
  padding: 16px 0;
  z-index: 2;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(99, 102, 241, 0.06);
}

.mine-stat-item {
  flex: 1;
  text-align: center;
}

.mine-stat-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.mine-stat-num {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 3px;
}

.mine-stat-label {
  font-size: 11px;
  color: var(--text-light);
}

/* ============ 我的菜单 - 高级质感卡片 ============ */
.mine-section {
  margin-bottom: 14px;
}

.mine-section-title {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  padding-left: 4px;
  font-weight: 600;
}

.mine-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(145deg, #ffffff, #fafbfc);
  padding: 14px 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(99, 102, 241, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.mine-menu-item:active {
  transform: scale(0.98);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.mine-menu-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mine-menu-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.mine-menu-badge {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.mine-badge-new {
  background: linear-gradient(135deg, #ec4899, #f472b6) !important;
  font-size: 9px !important;
}

.mine-menu-arrow {
  color: #cbd5e1;
  font-size: 18px;
}

.mine-compliance {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.6;
}

/* ============ 测评记录卡片 ============ */
.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.history-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--cat-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
}

.history-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.history-result {
  font-size: 13px;
  color: var(--cat-primary);
  margin-bottom: 2px;
}

.history-time {
  font-size: 11px;
  color: var(--text-light);
}

.history-action {
  padding: 6px 14px;
  background: var(--cat-light);
  color: var(--cat-primary);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
}

.history-action:active {
  transform: scale(0.95);
}

/* ============ 报告卡片 ============ */
.report-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--cat-primary);
}

.report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

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

.report-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.report-unlocked {
  font-size: 11px;
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
}

.report-result {
  font-size: 14px;
  color: var(--cat-primary);
  margin-bottom: 4px;
}

.report-time {
  font-size: 11px;
  color: var(--text-light);
}

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-text {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-light);
}

/* ============ 表单 ============ */
.feedback-form {
  background: white;
  border-radius: 16px;
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--cat-primary);
  background: white;
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--cat-primary);
  background: white;
}

.form-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ============ 设置项 ============ */
.settings-section {
  margin-bottom: 16px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.settings-item:first-child {
  border-radius: 12px 12px 0 0;
}

.settings-item:last-child {
  border-radius: 0 0 12px 12px;
  border-bottom: none;
}

.settings-item:active {
  background: var(--cat-light);
}

.settings-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
}

.settings-text {
  flex: 1;
  font-size: 15px;
  color: var(--text);
}

.settings-arrow {
  color: var(--text-light);
  font-size: 18px;
}

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

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-large {
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 20px;
}

.modal-tips {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

.modal-tips p {
  margin: 2px 0;
}

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

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

.modal-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 16px;
}

.compliance-rules {
  margin-top: 12px;
}

.compliance-rule-item {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 4px;
}

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

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============ 功能金刚位 ============ */
.kingkong-bar {
  display: flex;
  justify-content: space-around;
  background: white;
  border-radius: 16px;
  padding: 18px 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.kingkong-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  flex: 1;
}

.kingkong-item:active {
  transform: scale(0.92);
}

.kingkong-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.kingkong-item:active .kingkong-icon {
  transform: scale(0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.kingkong-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

/* ============ 分享面板 ============ */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.share-panel {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.share-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.share-close {
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
}

.share-preview {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.share-preview-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.share-preview-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
}

.share-channels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.share-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}

.share-channel:active {
  transform: scale(0.92);
}

.share-channel-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-channel-label {
  font-size: 11px;
  color: var(--text);
}

@keyframes slideUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* ============ 海报预览弹窗 ============ */
.poster-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s;
}

.poster-preview-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.poster-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.poster-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  text-align: center;
}

.poster-image {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.poster-preview-tips {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 8px 20px;
}

.poster-preview-actions {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.poster-preview-actions .btn {
  flex: 1;
}
