/* ============================================
   人生能量仪表盘 — 样式表
   Life Energy Dashboard — Style
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-deep: #06060f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 212, 255, 0.25);
  --accent-cyan: #00d4ff;
  --accent-purple: #a855f7;
  --accent-pink: #f472b6;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- Particle Background ---------- */
#particleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Container ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.title-icon {
  -webkit-text-fill-color: initial;
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

.title-beta {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  margin-top: 2px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 12px 0 24px;
}

.btn-all, .btn-reset {
  display: inline-block;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  margin: 6px 8px;
  letter-spacing: 0.02em;
}

.btn-all {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.3), 0 0 60px rgba(168, 85, 247, 0.15);
}

.btn-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.5), 0 0 80px rgba(168, 85, 247, 0.25);
}

.btn-reset {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-reset:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* ---------- Overall Section ---------- */
.overall-section {
  margin-bottom: 48px;
}

.overall-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  align-items: center;
  gap: 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.overall-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-cyan), transparent 40%, transparent 60%, var(--accent-purple));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ---------- Gauge ---------- */
.gauge-container {
  flex-shrink: 0;
  width: 200px; height: 200px;
}

.gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 12;
}

.gauge-fill {
  fill: none;
  stroke: url(#gaugeGradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 534.07;
  stroke-dashoffset: 534.07;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: url(#glowGauge);
}

.gauge-value {
  font-size: 2.8rem;
  font-weight: 800;
  fill: var(--text-primary);
  text-anchor: middle;
  dominant-baseline: middle;
}

.gauge-label {
  font-size: 0.8rem;
  fill: var(--text-secondary);
  text-anchor: middle;
  dominant-baseline: middle;
}

.overall-info {
  flex: 1;
  min-width: 0;
}

.status-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  border: 1px solid var(--border-card);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.status-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.status-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- Dimensions Grid ---------- */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}

.dim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 22px 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.dim-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-card);
  transition: var(--transition);
}

.dim-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.dim-card:hover::after {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 12px var(--accent-cyan);
}

.dim-card.completed {
  border-color: rgba(255,255,255,0.12);
}

.dim-card.completed::after {
  height: 3px;
}

.dim-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.dim-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.dim-score-container {
  margin-bottom: 10px;
}

.dim-score-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.dim-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dim-score-value {
  font-size: 1.4rem;
  font-weight: 800;
}

.dim-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dim-retake {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition);
}

.dim-card.completed:hover .dim-retake {
  opacity: 1;
}

/* ---------- Radar Section ---------- */
.radar-section {
  margin-bottom: 48px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.radar-container {
  display: flex;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 20px;
}

.radar-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #0f0f1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ---------- Progress Bar ---------- */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Question & Options ---------- */
.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}

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

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.5;
}

.option-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
}

.option-btn.selected {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.12);
}

.option-letter {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.option-btn.selected .option-letter {
  background: var(--accent-cyan);
  color: #000;
}

.option-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Modal Footer ---------- */
.modal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}

.btn-prev, .btn-next {
  flex: 1;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-prev {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-prev:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.btn-next {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
}

.btn-next:hover:not(:disabled) {
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.3);
}

.btn-prev:disabled, .btn-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Score Colors (JS applies these classes) ---------- */
.score-high   { color: var(--accent-green); }
.score-good   { color: var(--accent-cyan); }
.score-mid    { color: var(--accent-amber); }
.score-low    { color: var(--accent-red); }

.bar-high  { background: var(--accent-green); }
.bar-good  { background: var(--accent-cyan); }
.bar-mid   { background: var(--accent-amber); }
.bar-low   { background: var(--accent-red); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .dimensions-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .title { font-size: 1.8rem; }
  .dimensions-grid { grid-template-columns: repeat(2, 1fr); }
  .overall-card { flex-direction: column; text-align: center; gap: 24px; padding: 28px 20px; }
  .gauge-container { width: 160px; height: 160px; }
  .modal { padding: 24px 20px; width: 95%; }
}

@media (max-width: 480px) {
  .dimensions-grid { grid-template-columns: 1fr; }
  .container { padding: 24px 14px 60px; }
  .title { font-size: 1.5rem; }
}
