/* ═══════════════════════════════════════════════
   EggTools · 界哲学工具平台
   统一样式 v1.0  |  eggos.cn
   ═══════════════════════════════════════════════ */

:root {
  --primary:      #FF6B35;      /* 蛋黄橙 — 主色 */
  --primary-light:#FFF0EA;      /* 主色浅背景 */
  --primary-dark: #E8551E;      /* 主色深 — hover */
  --deep:         #2D3047;      /* 深蓝灰 — 标题/深色文字 */
  --success:      #4CAF50;      /* 健康状态 */
  --success-bg:   #F0FFF1;
  --warning:      #FF9800;      /* 亚健康 */
  --warning-bg:   #FFF8F0;
  --danger:       #F44336;      /* 危机 */
  --danger-bg:    #FFF3F2;
  --info:         #2196F3;      /* 信息 */
  --bg:           #F8F6F0;      /* 暖米白背景 */
  --card:         #FFFFFF;
  --border:       #EDE8E1;
  --text:         #2D3047;
  --text-sub:     #7A7A8C;
  --text-muted:   #AEAEBC;
  --radius:       12px;
  --radius-lg:    20px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(255,107,53,0.15);
  --max-width:    480px;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ── 容器 ── */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 40px;
  min-height: 100vh;
}

/* ── 顶部导航 ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  max-width: 100%;
}
.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-sub);
  font-size: 14px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.back-btn:hover { background: var(--bg); }
.back-btn svg { width: 16px; height: 16px; }
.top-bar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  text-align: center;
}

/* ── 卡片 ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-sm { padding: 14px 16px; }
.card-lg { padding: 28px 24px; }

/* ── 标签 ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
}
.tag-orange  { background: var(--primary-light); color: var(--primary); }
.tag-green   { background: var(--success-bg);    color: var(--success); }
.tag-yellow  { background: var(--warning-bg);    color: var(--warning); }
.tag-red     { background: var(--danger-bg);     color: var(--danger); }
.tag-gray    { background: #F5F5F7;              color: var(--text-sub); }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .3px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover   { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-primary:active  { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover   { background: var(--primary-light); }
.btn-ghost {
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #EEECEA; }
.btn-block {
  width: 100%;
  padding: 14px;
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* ── 工具封面区 ── */
.tool-hero {
  padding: 32px 0 24px;
  text-align: center;
}
.tool-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  background: var(--primary-light);
}
.tool-tag {
  margin-bottom: 10px;
}
.tool-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 8px;
}
.tool-subtitle {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 16px;
}
.tool-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.tool-meta-item {
  font-size: 13px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 进度条 ── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .3s ease;
}
.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* ── 问卷题目 ── */
.question-block {
  animation: fadeSlideIn .25s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.question-num {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.question-dim {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.question-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--deep);
  line-height: 1.6;
  margin-bottom: 20px;
}
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--card);
}
.option-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.option-item.selected .option-circle {
  background: var(--primary);
  border-color: var(--primary);
}
.option-item.selected .option-circle::after {
  display: block;
}
.option-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: all .15s;
}
.option-circle::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
.option-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  width: 20px;
  flex-shrink: 0;
}
.option-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.option-item.selected .option-text {
  color: var(--primary-dark);
  font-weight: 500;
}

/* ── 翻页按钮区 ── */
.nav-btns {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.nav-btns .btn { flex: 1; }

/* ── 结果页 ── */
.result-header {
  text-align: center;
  padding: 24px 0 16px;
}
.result-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}
.result-level {
  font-size: 20px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 6px;
}
.result-score {
  font-size: 14px;
  color: var(--text-sub);
}

/* 维度得分表 */
.dim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dim-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.dim-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--bg);
  vertical-align: middle;
}
.dim-table tr:last-child td { border-bottom: none; }
.dim-name { font-weight: 600; color: var(--deep); }
.dim-score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dim-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.dim-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}
.dim-bar-fill.healthy  { background: var(--success); }
.dim-bar-fill.warning  { background: var(--warning); }
.dim-bar-fill.danger   { background: var(--danger); }
.dim-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
  white-space: nowrap;
}
.dim-status {
  font-size: 12px;
}

/* 建议文字块 */
.advice-block {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--deep);
}

/* 推荐工具卡片 */
.next-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all .15s;
}
.next-tool-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(2px);
}
.next-tool-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: var(--card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.next-tool-info { flex: 1; }
.next-tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep);
  margin-bottom: 2px;
}
.next-tool-desc {
  font-size: 12px;
  color: var(--text-sub);
}

/* ── 分节标题 ── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 分割线 ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── 说明文字 ── */
.tip-text {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
}

/* ── 工具库首页卡片 ── */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tool-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-decoration: none;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.tool-card-icon {
  font-size: 26px;
}
.tool-card-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .4px;
}
.tool-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  line-height: 1.4;
}
.tool-card-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}
.tool-card.locked {
  opacity: .55;
  pointer-events: none;
}
.tool-card.locked .tool-card-icon::after {
  content: '🔒';
  font-size: 14px;
  margin-left: 4px;
}

/* ── 完成动效 ── */
@keyframes popIn {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}
.pop-in { animation: popIn .35s cubic-bezier(.175,.885,.32,1.275); }

/* ── 按钮点击动效 ── */
.button-click {
  transform: scale(0.95);
  transition: transform 0.1s;
}
.button-click:active {
  transform: scale(0.9);
}

/* ── 脉冲动效 ── */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.success-pulse {
  animation: pulse 0.5s ease-in-out;
}

/* ── 鼓励语弹窗 ── */
.encouragement-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(45, 48, 71, 0.95);
  color: #fff;
  padding: 20px 30px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: popIn 0.3s ease;
}

/* ── 分步引导 ── */
.step-guide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 16px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: all 0.3s;
  flex: 1;
}
.step.active {
  opacity: 1;
}
.step.completed {
  opacity: 0.7;
}
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
  border: 2px solid var(--border);
  transition: all 0.3s;
}
.step.active .step-number {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.step.completed .step-number {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.step-title {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

/* ── 历史记录 ── */
.history-section {
  margin-top: 20px;
}
.history-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 12px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-item {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep);
}
.history-date {
  font-size: 12px;
  color: var(--text-muted);
}
.view-btn {
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.view-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ── 提醒弹窗 ── */
.reminder-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45, 48, 71, 0.95);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 300px;
  text-align: center;
}

/* ── 徽章解锁提示 ── */
.badge-unlock-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.badge-icon {
  font-size: 48px;
}
.badge-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.badge-title {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}
.badge-name {
  font-size: 20px;
  font-weight: 700;
}
.badge-desc {
  font-size: 13px;
  opacity: 0.8;
}

/* ── 积分增加提示 ── */
.points-gain-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(240, 147, 251, 0.4);
  z-index: 1000;
  animation: popIn 0.3s ease;
}

/* ── 徽章展示区域 ── */
.badges-section {
  margin-top: 20px;
}
.badges-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 12px;
}
.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: 12px;
  transition: all 0.2s;
}
.badge-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.badge-item.locked {
  opacity: 0.4;
}
.badge-emoji {
  font-size: 32px;
}
.badge-item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--deep);
  text-align: center;
}

/* ── 积分展示 ── */
.points-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.points-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.points-label {
  font-size: 12px;
  opacity: 0.8;
}
.points-value {
  font-size: 28px;
  font-weight: 700;
}
.points-rate {
  font-size: 12px;
  opacity: 0.8;
}

/* ── 个性化推荐 ── */
.recommendation-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.recommendation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.recommendation-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
}
.recommendation-info {
  flex: 1;
}
.recommendation-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 4px;
}
.recommendation-reason {
  font-size: 13px;
  color: var(--text-sub);
}

/* ── 对比分析 ── */
.comparison-section {
  margin-top: 16px;
}
.comparison-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 12px;
}
.comparison-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 12px;
}
.comparison-change {
  text-align: center;
}
.comparison-change-value {
  font-size: 28px;
  font-weight: 700;
}
.comparison-change-value.positive {
  color: var(--success);
}
.comparison-change-value.negative {
  color: var(--danger);
}
.comparison-change-label {
  font-size: 12px;
  color: var(--text-sub);
}
.comparison-dims {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comparison-dim-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
}
.comparison-dim-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep);
}
.comparison-dim-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
}
.comparison-dim-change {
  font-weight: 700;
}
.comparison-dim-change.positive {
  color: var(--success);
}
.comparison-dim-change.negative {
  color: var(--danger);
}

/* ── 滚动条（极细） ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── 安全区底部 ── */
.safe-bottom { height: env(safe-area-inset-bottom, 16px); }

/* ── top-nav 导航栏（B-02/B-12 等使用） ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-back {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #666;
  text-decoration: none;
  transition: background .2s;
  flex-shrink: 0;
}
.nav-back:hover { background: #E8E8E8; }
.nav-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.nav-tool-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── container 页面容器（B-02/B-12 等使用） ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 48px;
}
