/* === Module 3 - Light Theme Override === */
/* Uses body.module3-page selectors instead of !important */

body.module3-page {
  background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 50%, #f8f9fb 100%);
  color: var(--text-primary);
  width: 100%;
  min-height: auto;
  overflow-x: hidden;
}

/* #app container - sidebar layout */
body.module3-page #app {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--bg-secondary);
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
  margin-top: 60px;
}
body.module3-page #app::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(107,154,196,0.04), transparent 50%);
  pointer-events: none;
}

/* Title */
body.module3-page #app h1 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

/* Stats panel */
#stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}
.stat {
  background: var(--bg-card);
  border-radius: 6px;
  padding: 4px 6px;
  border: 1px solid var(--border-primary);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.stat-bar { height: 4px; background: var(--border-primary); border-radius: 2px; overflow: hidden; margin-bottom: 2px; }
.stat-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.5s ease; }
.stat-fill.mood { background: linear-gradient(90deg, #d4918f, #d4a0b8); }
.stat-fill.knowledge { background: linear-gradient(90deg, #7bb5cc, #6b9ac4); }
.stat-fill.health { background: linear-gradient(90deg, #7bab96, #a3cbb8); }
.stat-fill.skill { background: linear-gradient(90deg, #a3a0c4, #8b87b0); }
.stat-fill.research { background: linear-gradient(90deg, #7ba7b5, #a3c5c4); }
.stat-fill.workExp { background: linear-gradient(90deg, #c4a96e, #d4c49a); }
.stat-value { font-size: 12px; font-weight: bold; color: var(--text-primary); }

/* Narrative area */
#narrative {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 6px;
  line-height: 1.7;
  font-size: 14px;
  border: 1px solid var(--border-primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}
#narrative .highlight { color: var(--color-primary); font-weight: bold; }
#narrative .bad { color: var(--color-error); }
#narrative .good { color: var(--color-success); }
#narrative:empty {
  display: none;
}

/* Choice buttons */
#choices { display: flex; flex-direction: column; gap: 5px; }
.choice-btn {
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s;
  text-align: left;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
}
.choice-btn:hover {
  background: var(--color-primary-ultralight);
  border-color: var(--color-primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}
.choice-btn.selected {
  border-color: var(--color-primary);
  background: rgba(59,130,246,0.1);
}
.multi-select-counter {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 0;
  margin-bottom: 4px;
}
.confirm-btn {
  text-align: center !important;
  font-weight: 600 !important;
}

/* Tags */
.choice-btn .choice-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.choice-btn .choice-ap {
  display: inline-block;
  background: rgba(255,215,0,0.15);
  color: #d4a017;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 6px;
  font-weight: bold;
}
.tag-risk { background: rgba(196,136,136,0.10); color: var(--color-error); }
.tag-safe { background: rgba(123,171,150,0.10); color: var(--color-success); }
.tag-fun { background: rgba(196,169,110,0.10); color: var(--color-warning); }
.tag-study { background: rgba(107,154,196,0.10); color: var(--color-primary); }
.tag-code { background: rgba(155,155,184,0.10); color: var(--color-accent); }
.tag-rest { background: rgba(196,160,184,0.10); color: #a08898; }

/* Name input */
.name-input-area {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}
.name-input {
  width: 200px;
  padding: 10px 16px;
  font-size: 16px;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}
.name-input:focus {
  border-color: var(--color-primary);
}
.name-input::placeholder {
  color: var(--text-muted);
}

/* Attribute preview */
.attr-preview {
  margin: 16px auto;
  max-width: 360px;
  text-align: center;
}
.attr-preview-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.attr-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.attr-preview-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
}
.attr-preview-item.attr-locked {
  opacity: 0.5;
}
.attr-preview-item .attr-icon {
  font-size: 14px;
}
.attr-preview-item .attr-name {
  flex: 1;
  text-align: left;
}
.attr-preview-item .attr-val {
  font-weight: bold;
  color: var(--color-primary);
}
.reroll-btn {
  padding: 6px 16px;
  font-size: 13px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.reroll-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Talent preview */
#talent-preview {
  margin-top: 30px;
}
.talent-preview {
  margin: 16px auto;
  max-width: 400px;
  text-align: center;
}
.talent-preview-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.talent-row {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}
.talent-row .talent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.talent-row .talent-icon { font-size: 18px; }
.talent-row .talent-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.talent-row .talent-desc-text { font-size: 12px; color: var(--text-muted); flex: 1; }
.talent-row .talent-val { font-size: 14px; font-weight: bold; color: var(--color-primary); }
.talent-row .talent-bar-wrap { height: 10px; background: var(--border-primary); border-radius: 5px; overflow: hidden; }
.talent-row .talent-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.talent-row .talent-bar-fill.aptitude { background: linear-gradient(90deg, #7bb5cc, #6b9ac4); }
.talent-row .talent-bar-fill.resilience { background: linear-gradient(90deg, #7bab96, #a3cbb8); }
.talent-row .talent-bar-fill.eq { background: linear-gradient(90deg, #c4a0b8, #b08aa3); }
.talent-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.talent-suggestion {
  margin-top: 12px;
  padding: 10px;
  background: var(--color-primary-ultralight);
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.talent-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.talent-accept-btn {
  padding: 8px 24px;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.talent-accept-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.talent-reroll-btn {
  padding: 8px 24px;
  font-size: 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.talent-reroll-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Semester header */
.sem-header {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 10px;
  padding: 6px 12px;
  background: rgba(107, 154, 196, 0.08);
  border-radius: var(--radius-sm);
  display: block;
}

/* Major select */
.major-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.major-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.major-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.major-btn .major-icon { font-size: 20px; flex-shrink: 0; }
.major-btn .major-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.major-btn.bio:hover { border-color: var(--color-success); background: rgba(105,183,154,0.06); }
.major-desc-panel {
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--color-primary-ultralight);
  border: 1px dashed var(--color-primary);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  animation: fadeIn 0.3s ease;
}
.major-btn.chem:hover { border-color: var(--color-warning); background: rgba(212,177,106,0.06); }
.major-btn.env:hover { border-color: var(--color-secondary); background: rgba(95,179,199,0.06); }
.major-btn.mat:hover { border-color: var(--color-error); background: rgba(214,120,120,0.06); }

/* Result panel */
#result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 6px;
  line-height: 1.7;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}
#result-panel .result-text { margin-bottom: 6px; color: var(--text-primary); }
#result-panel .stat-changes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
#result-panel .stat-change { font-size: 12px; padding: 2px 8px; border-radius: 5px; background: var(--bg-tertiary); }
#result-panel .stat-change.positive { color: var(--color-success); }
#result-panel .stat-change.negative { color: var(--color-error); }
#result-panel .stat-change.zero { color: var(--text-muted); }

/* Continue button */
.continue-btn {
  display: block; width: 100%; padding: 8px;
  font-size: 13px; border: 1px solid var(--color-primary);
  border-radius: 8px; background: var(--color-primary-ultralight);
  color: var(--color-primary); cursor: pointer; transition: all 0.25s; text-align: center;
}
.continue-btn:hover { background: var(--color-primary); color: var(--text-white); box-shadow: var(--shadow-md); }

/* Title / ending screens */
#title-screen {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 20px;
  width: 100%;
  z-index: 50;
  background: var(--bg-secondary);
}
#ending-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
}
#ending { text-align: left; padding: 0; }

/* 结局卡片 */
.ending-card {
  text-align: center;
  padding: 20px 20px 24px;
  background: linear-gradient(180deg, var(--color-primary-ultralight) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-primary);
}
.ending-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.ending-major {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-primary);
}
.ending-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(107,154,196,0.08);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(107,154,196,0.2);
}
.ending-badge {
  font-size: 48px;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.ending-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.ending-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 340px;
  margin: 0 auto 16px;
}

/* 玩家标签（卡片内） */
.ending-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}
.ending-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}
.ending-tag.study { background: rgba(107,154,196,0.08); color: var(--color-primary); border-color: rgba(107,154,196,0.2); }
.ending-tag.code { background: rgba(155,155,184,0.08); color: var(--color-accent); border-color: rgba(155,155,184,0.2); }
.ending-tag.safe { background: rgba(123,171,150,0.08); color: var(--color-success); border-color: rgba(123,171,150,0.2); }
.ending-tag.risk { background: rgba(196,136,136,0.08); color: var(--color-error); border-color: rgba(196,136,136,0.2); }
.ending-tag.fun { background: rgba(196,169,110,0.08); color: var(--color-warning); border-color: rgba(196,169,110,0.2); }

/* 通用区块样式 */
.section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.section-icon {
  font-size: 14px;
}
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 数据总览 */
.ending-stats-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.stats-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  text-align: center;
}
.stat-box-icon {
  font-size: 20px;
  margin-bottom: 4px;
}
.stat-box-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.stat-box-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 你的历程 */
.ending-timeline-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline-semester {
  position: relative;
}
.timeline-sem-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  padding-left: 12px;
  position: relative;
}
.timeline-sem-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: var(--color-primary);
  border-radius: 2px;
}
.timeline-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--border-light);
  margin-left: 1px;
}
.timeline-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.timeline-event.good {
  background: rgba(123,171,150,0.06);
  border-color: rgba(123,171,150,0.2);
}
.timeline-event.bad {
  background: rgba(196,136,136,0.06);
  border-color: rgba(196,136,136,0.2);
}
.timeline-event.milestone {
  background: rgba(196,169,110,0.06);
  border-color: rgba(196,169,110,0.2);
}
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-secondary);
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-event.good .timeline-dot { background: var(--color-success); }
.timeline-event.bad .timeline-dot { background: var(--color-error); }
.timeline-event.milestone .timeline-dot { background: var(--color-warning); }
.timeline-event.normal .timeline-dot { background: var(--color-primary); }
.timeline-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

/* 操作按钮 */
.ending-actions {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ending-actions .archive-btn {
  max-width: none;
  width: 100%;
}
.ending-actions .restart-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ending-actions .restart-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* Restart button */
.restart-btn {
  padding: 11px 36px; font-size: 15px; border: none; border-radius: 8px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); color: #fff;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.restart-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease; }

/* Semester planner */
.semester-planner { margin-bottom: 6px; }
.semester-planner .plan-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding: 8px 12px;
  background: rgba(196,169,110,0.08); border: 1px solid rgba(196,169,110,0.15); border-radius: 6px;
}
.semester-planner .plan-title { color: var(--color-warning); font-weight: bold; font-size: 14px; }
.semester-planner .plan-total { color: #b09860; font-size: 13px; }

.slider-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 4px;
  background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: 6px;
}
.slider-row .slider-icon { font-size: 16px; flex-shrink: 0; }
.slider-row .slider-name { font-size: 12px; color: var(--text-primary); width: 70px; flex-shrink: 0; }
.slider-row input[type=range] {
  flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
  background: var(--border-primary); border-radius: 3px; outline: none;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--color-primary); cursor: pointer;
}
.slider-row .slider-val {
  font-size: 12px; font-weight: bold; color: var(--color-primary);
  width: 36px; text-align: right; flex-shrink: 0;
}
.slider-row.disabled { opacity: 0.35; pointer-events: none; }

.plan-input {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  background: var(--bg-card);
  color: var(--text-primary);
}

.preview-panel {
  margin-top: 8px; padding: 10px;
  background: var(--bg-tertiary); border-radius: 6px;
  border: 1px solid var(--border-primary);
  font-size: 12px; color: var(--text-secondary);
}
.preview-panel .preview-title { font-weight: bold; color: var(--color-primary); margin-bottom: 8px; }
.preview-panel .preview-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 6px 16px;
}
.preview-panel .preview-row { display: flex; justify-content: space-between; }
.preview-panel .preview-row .positive { color: var(--color-success); }
.preview-panel .preview-row .negative { color: var(--color-error); }

/* Confirm plan button */
.confirm-plan-btn {
  display: block; width: 100%; padding: 8px; font-size: 13px;
  border: 1px solid var(--color-primary); border-radius: 8px;
  background: var(--color-primary-ultralight); color: var(--color-primary);
  cursor: pointer; transition: all 0.25s; text-align: center; margin-top: 6px;
}
.confirm-plan-btn:hover { background: var(--color-primary); color: var(--text-white); box-shadow: var(--shadow-md); }
.confirm-plan-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Semester review */
.semester-review {
  background: var(--bg-card); border: 1px solid var(--border-primary);
  border-radius: 8px; padding: 12px; margin-bottom: 6px;
  line-height: 1.7; font-size: 13px; box-shadow: var(--shadow-sm); color: var(--text-primary);
}
.semester-review .review-month { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed var(--border-primary); }
.semester-review .review-month:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.semester-review .review-event { color: var(--color-warning); font-weight: bold; }
.semester-review .review-changes { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-primary); }
.semester-review .review-milestone { margin-top: 6px; color: var(--color-warning); font-size: 12px; }

/* Bottom nav */
.bottom-nav {
  display: flex;
  border-top: 1px solid var(--border-primary);
  flex-shrink: 0;
  position: relative;
  background: var(--bg-card);
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 13px;
  color: var(--text-muted);
  border-right: 1px solid var(--border-light);
  user-select: none;
}
.bottom-nav .nav-item:last-child { border-right: none; }
.bottom-nav .nav-item:hover { color: var(--text-primary); background: var(--bg-secondary); }
.bottom-nav .nav-item.active { color: var(--color-primary); background: var(--color-primary-ultralight); }
.bottom-nav .nav-item .nav-icon { font-size: 18px; display: block; margin-bottom: 2px; }
.bottom-nav .nav-item .nav-label { font-size: 11px; }

/* Game screen */
#game-screen {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  z-index: 50;
  background: var(--bg-secondary);
}
#game-screen > h1 {
  flex-shrink: 0;
  padding: 12px 20px 0;
  margin-bottom: 0;
}
.content-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 20px;
}
.content-scroll::-webkit-scrollbar { width: 3px; }
.content-scroll::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 2px; }
.tab-panel { display: none !important; }
.tab-panel.active { display: flex !important; flex-direction: column; }

/* History panel */
#history-panel {
  overflow-y: auto;
  padding: 4px 0;
}
#history-panel::-webkit-scrollbar { width: 4px; }
#history-panel::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 2px; }
.history-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-left: 3px solid var(--color-primary);
  background: var(--bg-card);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--color-primary);
}
.history-item .history-time { color: var(--text-muted); font-size: 11px; margin-bottom: 2px; }
.history-item .history-text { color: var(--text-secondary); }
.history-item.good { border-left-color: var(--color-success); }
.history-item.bad { border-left-color: var(--color-error); }
.history-item.milestone { border-left-color: var(--color-warning); background: rgba(212,177,106,0.04); }

/* History groups */
.history-group {
  margin-bottom: 16px;
}
.history-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 8px;
}
.history-group .history-item {
  padding: 6px 12px;
  border-left: 2px solid var(--border-primary);
  margin-left: 8px;
}
.history-group .history-item.good { border-left-color: var(--color-success); }
.history-group .history-item.bad { border-left-color: var(--color-error); }
.history-group .history-item.milestone { border-left-color: var(--color-warning); }

/* Attribute panel */
#attr-panel {
  padding: 8px 0;
}
.attr-section { margin-bottom: 14px; }
.attr-section-title { font-size: 13px; color: var(--color-primary); font-weight: bold; margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--color-primary); }
.attr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 2px;
}
.attr-row .attr-label { font-size: 13px; color: var(--text-secondary); width: 60px; flex-shrink: 0; }
.attr-row .attr-bar-wrap { flex: 1; height: 8px; background: var(--border-primary); border-radius: 4px; overflow: hidden; }
.attr-row .attr-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.attr-row .attr-val { font-size: 13px; font-weight: bold; width: 30px; text-align: right; flex-shrink: 0; color: var(--text-primary); }
.attr-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 13px;
}
.attr-info-row .info-label { color: var(--text-muted); }
.attr-info-row .info-val { color: var(--text-primary); font-weight: bold; }
.attr-flag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
}

/* Module 3 top nav */
.m3-top-nav {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  flex-shrink: 0;
}
.m3-top-nav a, .m3-top-nav button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.m3-top-nav a:hover, .m3-top-nav button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-ultralight);
}

/* Ending extra buttons */
.ending-extra-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 20px 20px;
  flex-wrap: wrap;
}
.ending-extra-btns a, .ending-extra-btns button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  font-size: 13px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.ending-extra-btns a:hover, .ending-extra-btns button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-ultralight);
  box-shadow: var(--shadow-md);
}

/* Event outcome indicators */
.outcome-great { color: var(--color-success); font-weight: bold; }
.outcome-normal { color: var(--text-secondary); }
.outcome-poor { color: var(--color-error); }

/* Responsive */
@media (max-width: 768px) {
  body.module3-page #app { margin-top: 50px; }
  .bottom-nav { position: relative; }
  #game-screen { top: 50px; }
  #title-screen { top: 50px; padding: 16px; }
  .content-scroll { padding: 12px; padding-bottom: 12px; }
  .major-select { gap: 6px; }
  .major-btn { padding: 12px 14px; }
  .major-btn .major-icon { font-size: 22px; }
  .major-btn .major-name { font-size: 16px; }
  #talent-preview { margin-top: 20px; }
  .talent-row { padding: 12px 14px; }
}

/* 模块三移动端适配 */
@media (max-width: 768px) {
  .module3-page .game-container {
    padding: 10px;
  }
  .module3-page .semester-plan {
    padding: 15px;
  }
  .module3-page .planner-slider {
    flex-direction: column;
    gap: 8px;
  }
  .module3-page .planner-slider input[type="range"] {
    width: 100%;
  }
  .module3-page .event-card {
    padding: 15px;
    margin: 10px 0;
  }
  .module3-page .event-options button {
    width: 100%;
    margin: 5px 0;
  }
}

@media (max-width: 480px) {
  #title-screen { padding: 12px; }
  .subtitle { font-size: 12px; }
  body.module3-page #app h1 { font-size: 18px; }
  .major-btn { padding: 10px 12px; }
  .major-btn .major-icon { font-size: 20px; }
  .major-btn .major-name { font-size: 15px; }
  .talent-row { padding: 10px 12px; }
  .talent-row .talent-name { font-size: 13px; }
  .content-scroll { padding: 10px; padding-bottom: 10px; }
  #game-screen { flex: 1; }
  #stats { gap: 2px; }
  .stat { padding: 3px 4px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 11px; }
}

/* 天坑档案样式 */
.archive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 320px;
  padding: 14px 18px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.archive-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-ultralight);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.archive-btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.archive-btn-title {
  font-weight: 600;
  color: var(--text-primary);
}
.archive-btn-stats {
  font-size: 12px;
  color: var(--text-muted);
}
.archive-btn-arrow {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.archive-btn:hover .archive-btn-arrow {
  transform: translateX(3px);
  color: var(--color-primary);
}

/* 档案弹窗 */
.archive-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.archive-modal.show {
  opacity: 1;
}
.archive-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.archive-modal.show .archive-modal-content {
  transform: scale(1);
}
.archive-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
}
.archive-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.archive-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
}
.archive-close-btn:hover {
  background: rgba(255,255,255,0.2);
}
.archive-detail-header .archive-close-btn {
  color: #999;
}
.archive-detail-header .archive-close-btn:hover {
  color: #666;
  background: rgba(0,0,0,0.08);
}
.archive-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

/* 档案卡片 */
.archive-section {
  margin-bottom: 24px;
}
.archive-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
}
.archive-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.archive-events-grid {
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
}
.archive-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 11px;
  min-height: 60px;
  transition: all 0.2s ease;
}
.archive-card.unlocked {
  background: var(--bg-secondary);
  border: 1px solid var(--color-primary);
  color: var(--text-primary);
  cursor: pointer;
}
.archive-card.unlocked:hover {
  background: var(--color-primary-ultralight);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 154, 196, 0.15);
}
.archive-card.locked {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-muted);
}
.archive-card-icon {
  font-size: 18px;
  margin-bottom: 3px;
}
.archive-card-name {
  font-weight: 500;
  line-height: 1.3;
}
.archive-card-new {
  font-size: 9px;
  padding: 1px 5px;
  background: var(--color-success);
  color: white;
  border-radius: 8px;
  margin-top: 4px;
}

/* 详情弹窗 */
.archive-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.archive-detail-modal.show {
  opacity: 1;
}
.archive-detail-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.archive-detail-modal.show .archive-detail-content {
  transform: scale(1);
}
.archive-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
}
.archive-detail-icon {
  font-size: 28px;
}
.archive-detail-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}
.archive-detail-body {
  padding: 20px;
}
.archive-detail-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.archive-detail-condition {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}
.archive-detail-condition strong {
  color: var(--color-primary);
}

/* 历程按学期归类 */
