/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #0f1923;
  color: #e0e6ed;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ===== 主题 ===== */
:root {
  --primary: #00d4aa;
  --primary-dark: #00b894;
  --danger: #ff6b6b;
  --warning: #ffd93d;
  --good: #6bcb77;
  --bg-dark: #0f1923;
  --bg-card: #1a2a3a;
  --bg-card-hover: #1f3144;
  --text: #e0e6ed;
  --text-dim: #8899aa;
  --border: #2a3a4a;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* ===== 页面容器 ===== */
.page {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  animation: fadeIn 0.4s ease;
}
.page.active { display: flex; flex-direction: column; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes glow {
  0%,100% { box-shadow: 0 0 8px rgba(0,212,170,0.3); }
  50% { box-shadow: 0 0 24px rgba(0,212,170,0.6); }
}
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  15% { transform: scale(1.1); }
  30% { transform: scale(1); }
  45% { transform: scale(1.05); }
  60% { transform: scale(1); }
}

/* ===== 滚动条 ===== */
.page::-webkit-scrollbar { width: 4px; }
.page::-webkit-scrollbar-track { background: transparent; }
.page::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== 体检大厅 ===== */
#page-lobby {
  background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 50%, #0f1923 100%);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lobby-content {
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.lobby-logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

.lobby-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.lobby-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.lobby-checkup-sheet {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  text-align: left;
}

.checkup-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.checkup-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px;
  color: var(--text-dim);
}
.checkup-item:last-child { border-bottom: none; }
.checkup-item .icon { font-size: 18px; margin-right: 10px; width: 24px; text-align: center; }
.checkup-item .status {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}
.checkup-item.done { color: var(--text); }
.checkup-item.done .status { color: var(--good); }

.lobby-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-dim);
}
.lobby-stats span { text-align: center; }
.lobby-stats strong { display: block; font-size: 20px; color: var(--primary); margin-bottom: 2px; }

.btn-start {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  animation: glow 2s ease-in-out infinite;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,212,170,0.4); }
.btn-start:active { transform: scale(0.98); }

.lobby-footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== 体检站通用 ===== */
.station-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-dark);
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.station-progress {
  font-size: 12px;
  color: var(--text-dim);
}
.station-progress strong { color: var(--primary); }

.station-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.station-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  min-height: 60vh;
}

.station-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: float 2s ease-in-out infinite;
}

.station-question {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.5;
  max-width: 320px;
}

.station-hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 20px;
}

/* ===== 滑块通用 ===== */
.slider-container {
  width: 100%;
  max-width: 300px;
  position: relative;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--danger), var(--warning), var(--good));
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,212,170,0.4);
  transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

.slider-value {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
}
.slider-value.danger { color: var(--danger); }
.slider-value.warning { color: var(--warning); }
.slider-value.good { color: var(--good); }

/* ===== 点击交互 ===== */
.tap-area {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.tap-area:active { transform: scale(0.92); }
.tap-area .tap-count {
  position: absolute;
  bottom: 12px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ===== 温度计 ===== */
.thermometer {
  width: 40px;
  height: 200px;
  background: linear-gradient(to top, var(--danger), var(--warning), var(--good));
  border-radius: 20px;
  position: relative;
  margin: 0 auto;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
}
.thermometer-bulb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--danger);
  position: absolute;
  bottom: -30px;
  left: -10px;
  box-shadow: 0 4px 16px rgba(255,107,107,0.4);
}

/* ===== 树苗浇水 ===== */
.tree-container {
  text-align: center;
}
.tree-emoji { font-size: 72px; transition: all 0.5s; display: block; margin-bottom: 16px; }
.water-btn {
  padding: 12px 32px;
  font-size: 16px;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  margin: 4px;
}
.water-btn:active { transform: scale(0.95); }

/* ===== 人际星座 ===== */
.relations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  width: 100%;
}
.relation-item {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 13px;
  color: var(--text-dim);
}
.relation-item .relation-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.relation-item.active {
  border-color: var(--primary);
  background: rgba(0,212,170,0.1);
  color: var(--text);
  animation: glow 1.5s ease-in-out;
}
.relation-item.active .relation-icon { animation: pulse 1s ease-in-out; }

/* ===== 按钮 ===== */
.btn {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-block { width: 100%; max-width: 300px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 底部操作区 ===== */
.station-actions {
  padding: 16px 20px 24px;
  text-align: center;
}

/* ===== 报告页面 ===== */
#page-report {
  background: var(--bg-dark);
}
.report-header {
  background: linear-gradient(135deg, #1a2a3a, #0f1923);
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.report-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 8px 0;
}
.report-rating {
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}
.report-rating.good { background: rgba(107,203,119,0.2); color: var(--good); }
.report-rating.warning { background: rgba(255,217,61,0.2); color: var(--warning); }
.report-rating.danger { background: rgba(255,107,107,0.2); color: var(--danger); }

.report-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

.report-body { padding: 20px; }

/* 维度卡片 */
.dimension-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.dimension-card .d-icon { font-size: 24px; margin-right: 12px; width: 32px; text-align: center; }
.dimension-card .d-info { flex: 1; }
.dimension-card .d-name { font-size: 14px; font-weight: 600; }
.dimension-card .d-bar {
  height: 6px;
  border-radius: 3px;
  margin-top: 6px;
  position: relative;
  background: rgba(255,255,255,0.06);
}
.dimension-card .d-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.dimension-card .d-bar-fill.good { background: linear-gradient(90deg, var(--good), #4ecdc4); }
.dimension-card .d-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #f7a440); }
.dimension-card .d-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #ee5a24); }
.dimension-card .d-score {
  margin-left: 10px;
  font-size: 18px;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}
.dimension-card .d-score.good { color: var(--good); }
.dimension-card .d-score.warning { color: var(--warning); }
.dimension-card .d-score.danger { color: var(--danger); }

.dimension-card.locked { opacity: 0.5; }
.dimension-card.locked .d-bar-fill { opacity: 0.3; }

/* 付费墙 */
.pay-wall {
  text-align: center;
  padding: 24px 20px;
  background: linear-gradient(135deg, #1a2a3a, #0f1923);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}
.pay-wall .lock-icon { font-size: 32px; margin-bottom: 8px; }
.pay-wall .pay-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pay-wall .pay-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.pay-wall .pay-price { font-size: 36px; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.pay-wall .pay-price small { font-size: 16px; color: var(--text-dim); font-weight: 400; }
.btn-pay {
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  animation: glow 2s ease-in-out infinite;
}
.btn-pay:hover { transform: translateY(-2px); }
.btn-pay:active { transform: scale(0.98); }

.pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 12px;
}
.pay-divider::before, .pay-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.share-unlock-btn {
  padding: 12px 24px;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s;
}
.share-unlock-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 二维码弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  border: 1px solid var(--border);
}
.modal h3 { margin-bottom: 8px; font-size: 18px; }
.modal p { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.modal .qrcode-placeholder {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: 8px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}
.modal .close-modal {
  padding: 10px 32px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

/* ===== 矛盾诊断卡片 ===== */
.pattern-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border-left: 3px solid var(--border);
}
.pattern-card.danger { border-left-color: var(--danger); }
.pattern-card.warning { border-left-color: var(--warning); }
.pattern-card .pattern-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.pattern-card .pattern-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ===== 综合建议 ===== */
.suggestion-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border);
}
.suggestion-card .s-icon { margin-right: 6px; }

/* ===== 分享弹窗 ===== */
.share-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.share-overlay.active { display: flex; }
.share-overlay-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
}
.share-panel {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  z-index: 1;
}

/* ===== Section 标题 ===== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 雷达图容器 ===== */
.chart-container {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

/* ===== 解锁码输入 ===== */
.code-input-group {
  display: flex;
  gap: 8px;
  max-width: 280px;
  margin: 12px auto;
}
.code-input-group input {
  flex: 1;
  padding: 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.code-input-group input:focus {
  outline: none;
  border-color: var(--primary);
}
.code-input-group button {
  padding: 12px 20px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

/* ===== 成功/解锁页面 ===== */
.success-page {
  text-align: center;
  padding: 40px 20px;
}
.success-page .big-icon { font-size: 72px; margin-bottom: 16px; }
.success-page h2 { font-size: 24px; margin-bottom: 8px; color: var(--good); }
.success-page p { color: var(--text-dim); margin-bottom: 24px; }

/* ===== 加载动画 ===== */
.loading-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ===== 响应式 ===== */
@media (max-width: 400px) {
  .lobby-title { font-size: 24px; }
  .station-question { font-size: 18px; }
  .relations-grid { gap: 8px; }
  .relation-item { padding: 12px; }
}

/* ===== 消息提示 ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  animation: fadeIn 0.3s ease;
  max-width: 320px;
  text-align: center;
}
.toast.success { background: rgba(107,203,119,0.9); color: white; }
.toast.error { background: rgba(255,107,107,0.9); color: white; }
.toast.info { background: rgba(0,212,170,0.9); color: white; }
