/* ========================================
   数上岸 · 山东专升本数学刷题平台 - 样式表
   架构参考专业课项目，内容自己来
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 主色：深蓝渐变（记忆里要求蓝色背景） */
  --primary: #2E7FFF;
  --primary-dark: #14305C;
  --primary-light: #9CC4E8;
  --bg-gradient-start: #0D2244;
  --bg-gradient-end: #14305C;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-dark: #0D2244;
  --text-gray: #666;
  --text-light: #999;
  --success: #1F9D4C;
  --error: #EF4444;
  --warning: #F59E0B;
  /* 数学特色：橙色点缀 */
  --orange: #EF7A2D;
  --orange-soft: #FDE8D7;
  /* 热力图 */
  --heat-free: #9CC4E8;
  --heat-locked: #CBD5E1;
  --heat-unlocked: #2E7FFF;
  --heat-vip: #EF7A2D;
  --heat-current: #FFD23F;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

/* ========================================
   动态高斯头像背景
   ======================================== */
.gauss-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gauss-avatar {
  position: absolute;
  opacity: 0.12;
  fill: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 80vw);
  filter: blur(0.5px);
  animation: floatSlow 20s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-48%, -52%) scale(1.03); }
}

/* 装饰性浮动数学符号 */
.math-symbols {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.math-symbols span {
  position: absolute;
  color: rgba(255, 255, 255, 0.06);
  font-family: Georgia, serif;
  font-size: 80px;
  font-weight: bold;
  user-select: none;
}

.math-symbols .s1 { top: 10%; left: 5%; font-size: 120px; animation: drift1 25s ease-in-out infinite; }
.math-symbols .s2 { top: 60%; right: 8%; font-size: 90px; animation: drift2 30s ease-in-out infinite; }
.math-symbols .s3 { bottom: 15%; left: 15%; font-size: 70px; animation: drift3 22s ease-in-out infinite; }
.math-symbols .s4 { top: 30%; right: 20%; font-size: 60px; animation: drift1 28s ease-in-out infinite reverse; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) rotate(-5deg); } 50% { transform: translate(15px, 20px) rotate(3deg); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) rotate(8deg); } 50% { transform: translate(-20px, -10px) rotate(-3deg); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) rotate(-10deg); } 50% { transform: translate(10px, -15px) rotate(5deg); } }

/* ========================================
   主应用布局
   ======================================== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* 顶部标题栏 */
.app-header {
  padding: 20px 20px 16px;
  color: #fff;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.app-header p {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}

/* ========================================
   底部导航栏
   ======================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.nav-item {
  flex: 1;
  text-align: center;
  cursor: pointer;
  padding: 6px 0;
  color: var(--text-light);
  transition: color 0.3s;
  user-select: none;
}

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

.nav-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.nav-label {
  font-size: 12px;
}

/* ========================================
   页面容器
   ======================================== */
.page {
  display: none;
  padding: 0 16px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* ========================================
   倒计时卡片
   ======================================== */
.countdown-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.countdown-label {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 12px;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.countdown-unit {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  min-width: 70px;
}

.countdown-num {
  font-size: 26px;
  font-weight: 700;
  display: block;
  line-height: 1;
}

.countdown-text {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 4px;
}

.countdown-target {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}

/* ========================================
   卡片通用样式
   ======================================== */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 20px 4px 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: #fff;
  border-radius: 2px;
}

/* 卡片组件 */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ========================================
   每日一题热力图
   ======================================== */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  font-family: inherit;
  position: relative;
}

.heat-cell:active { transform: scale(0.93); }

.heat-cell .cell-num {
  font-size: 20px;
  line-height: 1;
}

.heat-cell .cell-label {
  font-size: 10px;
  margin-top: 3px;
  opacity: 0.8;
}

/* 状态色 */
.heat-free {
  background: var(--heat-free);
  color: var(--primary-dark);
}
.heat-free:hover { box-shadow: 0 4px 12px rgba(46,127,255,0.3); }

.heat-locked {
  background: var(--heat-locked);
  color: #888;
  cursor: not-allowed;
}

.heat-unlocked {
  background: linear-gradient(135deg, var(--heat-unlocked), var(--primary-dark));
  color: #fff;
}
.heat-unlocked:hover { box-shadow: 0 4px 16px rgba(20,48,92,0.4); }

.heat-vip {
  background: linear-gradient(135deg, var(--heat-vip), #D9651F);
  color: #fff;
}
.heat-vip:hover { box-shadow: 0 4px 12px rgba(239,122,45,0.4); }

/* ========================================
   做题页面
   ======================================== */
.question-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-gradient-start);
  z-index: 10;
  overflow-y: auto;
  padding-bottom: 80px;
}

.question-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

.question-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  font-family: inherit;
}

.question-header {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.question-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.question-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 24px 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.question-badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: #E6F0FF;
  color: var(--primary);
  margin-right: 8px;
}

.question-badge.level-基础 { background: #E8F9EC; color: var(--success); }
.question-badge.level-进阶 { background: #FFF7D6; color: var(--warning); }
.question-badge.level-压轴 { background: #FDE8D7; color: var(--orange); }

.question-text {
  font-size: 16px;
  color: #333;
  line-height: 2;
  margin-bottom: 12px;
  font-weight: 500;
}

.answer-section {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
  border-left: 4px solid var(--primary);
}

.answer-section .ans-label {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 6px;
}

.answer-section .ans-content {
  font-size: 16px;
  font-weight: 600;
  color: var(--success);
}

.analysis-block {
  background: #FFFBEB;
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
  border-left: 4px solid var(--warning);
}

.analysis-block h4 {
  font-size: 14px;
  color: var(--warning);
  margin-bottom: 8px;
}

.method-block {
  background: #F0FDF4;
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
  border-left: 4px solid var(--success);
}

.method-block h4 {
  font-size: 14px;
  color: var(--success);
  margin-bottom: 8px;
}

/* 展开/收起按钮 */
.btn-toggle {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s;
  margin-top: 10px;
}
.btn-toggle:active { transform: scale(0.98); }

.btn-toggle.show-answer {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.btn-toggle.show-analysis {
  background: #FFF7D6;
  color: #854D0E;
  border: 1.5px solid #FFD23F;
}

/* 操作按钮组 */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.15s;
  text-align: center;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

/* ========================================
   定价区（核心转化区：独立白色大面板）
   ======================================== */
.pricing-panel {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F8FF 100%);
  border-radius: 22px;
  padding: 26px 20px 24px;
  margin-top: 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
}

.pricing-head {
  text-align: center;
  margin-bottom: 6px;
}

.pricing-title {
  font-size: 24px;
  font-weight: 800;
  color: #0D2244;
  letter-spacing: 1px;
}

.pricing-subtitle {
  font-size: 13px;
  color: #8A94A6;
  margin-top: 6px;
}

.pricing-buy-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 14px;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
  padding-top: 12px;
}

.price-card {
  background: #fff;
  border: 1.5px solid #E8EEF7;
  border-radius: 16px;
  padding: 24px 16px 18px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(13,34,68,0.06);
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  background: #fff;
  border: 3px solid var(--orange);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(239,122,45,0.35);
}

.price-card .rec-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--orange), #D9651F);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 18px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(239,122,45,0.45);
}

.price-card .tier-name {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #0D2244;
}

.price-card .tier-tagline {
  font-size: 12px;
  color: #8A94A6;
  margin-bottom: 12px;
  min-height: 17px;
}

.price-card .tier-price {
  font-size: 40px;
  font-weight: 800;
  color: #0D2244;
  line-height: 1.1;
}

.price-card.featured .tier-price {
  color: var(--orange);
}

.price-card .tier-price .yuan {
  font-size: 19px;
  vertical-align: top;
  margin-right: 2px;
}

.price-card .tier-price .per {
  font-size: 13px;
  color: #8A94A6;
  font-weight: 500;
}

.price-card .tier-orig {
  font-size: 13px;
  color: #AAB3C2;
  text-decoration: line-through;
  margin: 5px 0 14px;
}

.price-card .tier-feats {
  border-top: 1px dashed #E4E9F2;
  padding-top: 12px;
  margin-top: auto;
  text-align: left;
}

.price-card .feat {
  font-size: 13px;
  padding: 5px 0;
  line-height: 1.5;
}

.price-card .feat .ic {
  font-weight: 700;
  margin-right: 7px;
}

.price-card .feat-yes { color: #1F9D4C; }
.price-card .feat-no  { color: #B7BEC9; }

/* ========================================
   收藏功能（我的收录）
   ======================================== */
.collect-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-gray);
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.collect-btn:hover {
  background: #F1F5F9;
}

.collect-btn.collected {
  color: var(--orange);
  font-weight: 600;
}

/* 题目卡片右上角的收录按钮 */
.collect-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(255,255,255,0.9);
  border: 1px solid #DCE4F0;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: #64748B;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.collect-corner.collected {
  background: #FFF3E8;
  border-color: var(--orange);
  color: var(--orange);
}

/* 收录列表 */
.collection-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.9);
}

.collection-empty p { font-size: 15px; margin-top: 12px; }

.collection-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.collection-card .collect-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* ========================================
   视频区域
   ======================================== */
.video-wrap {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-wrap iframe {
  width: 100%;
  height: 200px;
  border: none;
  display: block;
}

.video-locked {
  background: linear-gradient(135deg, #1a237e, #0D2244);
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  border-radius: 12px;
  margin-top: 14px;
}

.video-locked .lock-icon { font-size: 36px; margin-bottom: 10px; }

/* ========================================
   微信弹窗
   ======================================== */
.vx-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vx-modal-backdrop.hidden { display: none; }

.vx-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 85%;
  max-width: 360px;
  text-align: center;
}

.vx-modal h3 {
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.vx-modal img.vx-qr {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  margin: 14px auto;
  display: block;
  border: 1px solid #eee;
}

.vx-id {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 10px 0;
  letter-spacing: 1px;
}

.vx-copy-btn {
  background: linear-gradient(135deg, #07C160, #06AD56);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
}

.vx-modal-close {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 16px;
  cursor: pointer;
}

/* ========================================
   升级引导弹窗
   ======================================== */
.upgrade-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.upgrade-modal-backdrop.hidden { display: none; }

.upgrade-modal {
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px;
  width: 88%;
  max-width: 340px;
  text-align: center;
}

.upgrade-modal .emoji { font-size: 40px; margin-bottom: 10px; }
.upgrade-modal h3 { font-size: 18px; color: var(--text-dark); margin-bottom: 12px; }
.upgrade-modal p { font-size: 14px; color: var(--text-gray); margin-bottom: 18px; line-height: 1.6; }

.upgrade-btn {
  background: linear-gradient(135deg, var(--orange), #D9651F);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 700px) {
  .pricing-panel { padding: 22px 14px 20px; }
  .pricing-title { font-size: 20px; }
  .price-grid { grid-template-columns: 1fr; gap: 20px; }
  .price-card.featured { transform: none; }
  .price-card .tier-price { font-size: 36px; }
  .heatmap-grid { grid-template-columns: repeat(5, 1fr); }
  .countdown-unit { min-width: 56px; padding: 10px 8px; }
  .countdown-num { font-size: 20px; }
}

.hidden { display: none !important; }

/* MathJax 友好样式 */
.MathJax { font-size: 1.1em !important; }
