/* ═══════════════════════════════════════════════════
   雅智生物 - 前端样式 v2（主色：#247CFF）
   医疗科技 · 赛博全息 · 太空舱
   ═══════════════════════════════════════════════════ */

:root {
  --primary: #14b9ca;
  --primary-rgb: 20, 185, 202;
  --primary-dim: rgba(20, 185, 202, 0.08);
  --primary-glow: rgba(20, 185, 202, 0.3);
  --primary-glow-strong: rgba(20, 185, 202, 0.5);
  --primary-light: #3fcfcf;
  --primary-dark: #0ea0af;
  --accent: #fa2209;
  --accent-rgb: 250, 34, 9;

  --bg-deep: #f0f5f5;
  --bg-mid: #eaf2f2;
  --bg-surface: rgba(255, 255, 255, 0.92);
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 0.96);

  --text-primary: #333333;
  --text-secondary: #666666;
  --text-dim: #999999;

  --danger: #fa2209;
  --danger-glow: rgba(250, 34, 9, 0.4);

  --font-display: 'Orbitron', 'Courier New', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ═══════════════════════════════════════
   BACKGROUND — Deep Space Medical
   ═══════════════════════════════════════ */

.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(var(--primary-rgb), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none; z-index: 0;
  animation: gridPulse 8s ease-in-out infinite alternate;
}
@keyframes gridPulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

.bg-ambient {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(var(--primary-rgb), 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(124, 77, 255, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(0, 229, 255, 0.03) 0%, transparent 50%);
}

.bg-orb {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 0;
  filter: blur(80px);
}
.bg-orb-1 {
  width: 300px; height: 300px;
  background: rgba(var(--primary-rgb), 0.08);
  top: -10%; left: -5%;
  animation: orbFloat1 12s ease-in-out infinite alternate;
}
.bg-orb-2 {
  width: 200px; height: 200px;
  background: rgba(124, 77, 255, 0.04);
  bottom: 10%; right: -5%;
  animation: orbFloat2 15s ease-in-out infinite alternate;
}
@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.3); }
}
@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, -40px) scale(1.2); }
}

/* ═══════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════ */

.front-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; overflow: hidden;
  padding: 0 clamp(12px, 4vw, 32px);
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}

.nav-left { display: flex; align-items: center; gap: 12px; }

.nav-logo-wrap {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo { height: 32px; width: auto; }

.nav-brand {
  font-size: 15px; font-weight: 600;
  color: var(--primary);
  letter-spacing: 2px;
}
.nav-brand::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 10px;
  box-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow);
  vertical-align: middle;
  animation: navDotPulse 2s ease-in-out infinite;
}
@keyframes navDotPulse { 50% { box-shadow: 0 0 20px var(--primary-glow-strong); } }

.nav-toggle:hover { background: rgba(var(--primary-rgb), 0.1); }

.nav-toggle { display: none; background: none; border: 1px solid rgba(var(--primary-rgb), 0.2); color: var(--primary); font-size: 20px; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.nav-toggle:hover { background: rgba(var(--primary-rgb), 0.1); }

.nav-right { display: flex; align-items: center; gap: 6px; }

.nav-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 20px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  font-size: 13px; color: var(--text-secondary);
  color: var(--text-primary);
}
.user-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 0 8px var(--primary-glow);
  display: inline-block;
}

.nav-link {
  position: relative;
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  padding: 8px 18px; border-radius: 8px;
  transition: all 0.25s; letter-spacing: 0.5px;
  overflow: hidden;
}
.nav-link::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.nav-link:hover::before { opacity: 1; }
.nav-link:hover { color: var(--primary-light); text-decoration: none; }
.nav-logout:hover { color: var(--danger); }
.nav-logout:hover::before { background: linear-gradient(135deg, rgba(255, 23, 68, 0.08), transparent); }

/* ═══════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════ */

.front-main {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  width: 100%; overflow: hidden;
  padding: clamp(16px, 4vw, 40px) clamp(12px, 3vw, 28px) 70px;
}

/* ═══════════════════════════════════════════════
   SPACE POD — Full Sci-fi Capsule
   ═══════════════════════════════════════════════ */

.pod-section {
  display: flex; justify-content: center;
  margin-bottom: clamp(28px, 5vw, 48px);
  padding-top: 10px;
}

.pod-container {
  position: relative;
  width: clamp(260px, 60vw, 380px);
  height: clamp(340px, 74vw, 500px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 50% 50% 50% 50% / 30% 30% 30% 30%;
}

/* Halo */
.pod-halo {
  position: absolute;
  width: 130%; height: 130%;
  top: -15%; left: -15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.03) 40%, transparent 70%);
  animation: haloPulse 4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes haloPulse {
  0% { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Orbital rings */
.pod-ring {
  position: absolute; border-radius: 50%;
  border-style: solid; pointer-events: none;
}
.pod-ring-1 {
  width: 108%; height: 108%; top: -4%; left: -4%;
  border-width: 1.5px; border-color: rgba(var(--primary-rgb), 0.12);
  border-style: dashed;
  animation: ringSpin 10s linear infinite;
  box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.03), inset 0 0 40px rgba(var(--primary-rgb), 0.03);
}
.pod-ring-2 {
  width: 118%; height: 118%; top: -9%; left: -9%;
  border-width: 1px; border-color: rgba(0, 229, 255, 0.07);
  border-style: dotted;
  animation: ringSpin 16s linear infinite reverse;
}
.pod-ring-3 {
  width: 125%; height: 125%; top: -12.5%; left: -12.5%;
  border-width: 0.5px; border-color: rgba(124, 77, 255, 0.06);
  animation: ringSpin 22s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* Main capsule */
.pod-capsule {
  position: relative; width: 100%; height: 100%;
  border-radius: 50% 50% 50% 50% / 28% 28% 28% 28%;
  background: linear-gradient(180deg,
    rgba(200, 225, 255, 0.25) 0%, rgba(230, 242, 255, 0.45) 30%,
    rgba(240, 248, 255, 0.6) 55%, rgba(220, 235, 255, 0.35) 100%);
  border: 2px solid rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 0 80px rgba(var(--primary-rgb), 0.1), 0 0 150px rgba(var(--primary-rgb), 0.05),
    inset 0 0 100px rgba(var(--primary-rgb), 0.06), inset 0 0 40px rgba(var(--primary-rgb), 0.03);
  overflow: hidden;
}

/* Animated border */
.pod-capsule::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px;
  background: conic-gradient(transparent, rgba(var(--primary-rgb), 0.3), rgba(0,229,255,0.2),
    rgba(var(--primary-rgb), 0.1), transparent, rgba(124,77,255,0.15), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: borderGlow 6s linear infinite; pointer-events: none;
}
@keyframes borderGlow { to { transform: rotate(360deg); } }

/* Top energy dome */
.pod-energy-top {
  position: absolute; top: -25%; left: 5%; width: 90%; height: 45%;
  background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
  animation: energyPulse 3s ease-in-out infinite alternate;
  pointer-events: none;
}
.pod-energy-top::after {
  content: ''; position: absolute; top: 20%; left: 30%; width: 40%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.3), transparent);
  filter: blur(1px);
  animation: energyLine 2.5s ease-in-out infinite;
}
@keyframes energyPulse { 0% { opacity: 0.5; transform: scale(1); } 100% { opacity: 1; transform: scale(1.08); } }
@keyframes energyLine { 0%,100% { opacity: 0; } 50% { opacity: 1; transform: translateY(30px); } }

/* Scanning beam */
.pod-scan-beam {
  position: absolute; left: -8%; width: 116%; height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--primary-rgb), 0.1) 15%,
    rgba(var(--primary-rgb), 0.6) 40%, rgba(0,229,255,0.7) 50%,
    rgba(var(--primary-rgb), 0.6) 60%, rgba(var(--primary-rgb), 0.1) 85%, transparent 100%);
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3), 0 0 40px rgba(var(--primary-rgb), 0.1);
  animation: scanBeam 3.5s ease-in-out infinite;
  pointer-events: none; z-index: 3; opacity: 0.7;
}
@keyframes scanBeam {
  0% { top: 3%; opacity: 0.15; }
  15% { opacity: 0.8; }
  45% { top: 78%; opacity: 0.9; }
  70% { opacity: 0.5; }
  85% { top: 3%; opacity: 0.8; }
  100% { top: 3%; opacity: 0.15; }
}

/* Side vents */
.pod-vent-left, .pod-vent-right {
  position: absolute; top: 30%; width: 4px; height: 40%;
  pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(var(--primary-rgb), 0.08), transparent);
  opacity: 0.5; animation: ventPulse 2s ease-in-out infinite alternate;
}
.pod-vent-left { left: -6px; border-radius: 2px; }
.pod-vent-right { right: -6px; border-radius: 2px; animation-delay: 1s; }
@keyframes ventPulse { 0% { opacity: 0.2; } 100% { opacity: 0.7; } }

/* Particles */
.pod-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.pod-particle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.7), rgba(0,229,255,0.2));
  box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.3), 0 0 12px rgba(var(--primary-rgb), 0.1);
  animation: podFloat ease-in-out infinite alternate;
}
@keyframes podFloat {
  0% { transform: translate(0,0) scale(1); opacity: 0.3; }
  33% { transform: translate(12px,-15px) scale(1.3); opacity: 0.8; }
  66% { transform: translate(-8px,10px) scale(0.8); opacity: 0.5; }
  100% { transform: translate(-6px,-8px) scale(1.1); opacity: 0.7; }
}

/* Light pillar */
.pod-light-pillar {
  position: absolute; top: 15%; left: 50%; transform: translateX(-50%);
  width: 2px; height: 70%;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.05) 50%, transparent);
  pointer-events: none; z-index: 0;
  animation: pillarPulse 4s ease-in-out infinite alternate;
}
@keyframes pillarPulse { 50% { opacity: 0.4; } }

/* ═══ HOLOGRAPHIC DISPLAY ═══ */

.pod-holo-display {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; z-index: 5; width: 85%; padding: 16px 0;
}
.pod-holo-display::before {
  content: ''; position: absolute; inset: -10px;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px,
    rgba(var(--primary-rgb), 0.015) 2px, rgba(var(--primary-rgb), 0.015) 4px);
  pointer-events: none; border-radius: 12px;
}

.holo-label {
  font-size: clamp(10px, 1.8vw, 13px);
  color: rgba(var(--primary-rgb), 0.6);
  letter-spacing: 6px; text-transform: uppercase;
  margin-bottom: 14px; text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
}

.holo-days { margin-bottom: 4px; }

.holo-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(52px, 13vw, 88px);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 20%, var(--primary-light) 50%, var(--primary) 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1; letter-spacing: 6px;
  filter: drop-shadow(0 0 30px rgba(var(--primary-rgb), 0.3)) drop-shadow(0 0 60px rgba(var(--primary-rgb), 0.1));
}

.holo-unit {
  font-size: clamp(11px, 2vw, 14px);
  color: var(--text-secondary); letter-spacing: 6px;
  display: block; margin-top: 4px; text-transform: uppercase;
}

.holo-time { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 10px; }
.holo-t-block { text-align: center; padding: 0 4px; }

.holo-t-num {
  font-family: var(--font-display);
  font-size: clamp(24px, 5.5vw, 38px);
  font-weight: 700; color: var(--text-primary);
  text-shadow: 0 0 15px rgba(var(--primary-rgb), 0.25), 0 0 30px rgba(var(--primary-rgb), 0.1);
  letter-spacing: 3px;
}

.holo-t-label {
  display: block; font-size: 9px; color: var(--text-dim);
  letter-spacing: 2px; margin-top: 2px; text-transform: uppercase;
}

.holo-t-sep {
  font-family: var(--font-display);
  font-size: clamp(20px, 4.5vw, 30px);
  color: var(--primary); text-shadow: 0 0 10px var(--primary-glow);
  margin: 0 6px; animation: sepBlink 1s steps(1) infinite;
}
@keyframes sepBlink { 50% { opacity: 0.2; } }

.countdown-warn .holo-num {
  background: linear-gradient(135deg, #ff6b6b, var(--danger), #ff1744);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(255,23,68,0.3)) drop-shadow(0 0 60px rgba(255,23,68,0.1));
  animation: warnFlash 1.5s ease-in-out infinite;
}
@keyframes warnFlash { 50% { filter: drop-shadow(0 0 50px rgba(255,23,68,0.5)); } }
.countdown-warn .holo-t-num { color: var(--danger); text-shadow: 0 0 15px var(--danger-glow); }

.holo-expired {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 44px); font-weight: 900;
  color: var(--danger);
  text-shadow: 0 0 30px var(--danger-glow), 0 0 60px var(--danger-glow);
  letter-spacing: 6px;
  animation: expiredFlash 1s ease-in-out infinite alternate;
}
@keyframes expiredFlash { 50% { text-shadow: 0 0 50px var(--danger-glow), 0 0 80px var(--danger-glow); } }

.holo-period {
  font-size: 10px; color: var(--text-dim);
  margin-top: 16px; letter-spacing: 2px; font-family: var(--font-display);
}

/* ── Status Bar ── */
.pod-status-bar {
  position: absolute; bottom: 12%; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 24px; z-index: 5;
}
.pod-status-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 4px;
  background: rgba(255,255,255,0.5); border: 1px solid rgba(var(--primary-rgb), 0.12);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; position: relative;
}
.status-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid transparent; }
.status-dot.active {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow), 0 0 20px var(--primary-glow);
  animation: dotPulse 1.5s ease-in-out infinite;
}
.status-dot.active::after { border-color: rgba(var(--primary-rgb), 0.2); }
.status-dot.warn { background: var(--danger); box-shadow: 0 0 8px var(--danger-glow); animation: dotPulse 0.8s ease-in-out infinite; }
@keyframes dotPulse { 50% { box-shadow: 0 0 20px var(--primary-glow-strong); opacity: 0.5; } }
.status-text { font-size: 9px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; }

/* ── Bottom glow ── */
.pod-glow-bottom {
  position: absolute; bottom: -18%; left: 15%; width: 70%; height: 35%;
  background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.06) 0%, transparent 70%);
  pointer-events: none; animation: bottomGlow 4s ease-in-out infinite alternate;
}
@keyframes bottomGlow { 50% { opacity: 0.5; transform: scaleX(0.8); } }

/* ── Data Ring ── */
.pod-data-ring {
  position: absolute; top: -14%; right: -14%;
  width: 110px; height: 110px;
  display: flex; align-items: center; justify-content: center;
  animation: dataRingFloat 4s ease-in-out infinite alternate;
}
@keyframes dataRingFloat { 50% { transform: translateY(-5px); } }

.pod-ring-svg { position: absolute; width: 100%; height: 100%; transform: rotate(-90deg); }
.pod-ring-bg-circle { fill: none; stroke: rgba(var(--primary-rgb), 0.06); stroke-width: 2; }

.pod-progress-ring {
  fill: none; stroke: url(#progressGrad); stroke-width: 2.5; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(var(--primary-rgb), 0.4)) drop-shadow(0 0 12px rgba(var(--primary-rgb), 0.2));
  transition: stroke-dasharray 0.8s ease;
  animation: progressPulse 3s ease-in-out infinite;
}
@keyframes progressPulse { 50% { filter: drop-shadow(0 0 10px rgba(var(--primary-rgb), 0.6)); } }

.pod-data-text { text-align: center; position: relative; z-index: 1; }
.pod-data-pct {
  display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; filter: drop-shadow(0 0 6px rgba(var(--primary-rgb), 0.2));
}
.pod-data-label { font-size: 7px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; display: block; margin-top: 2px; }

/* ═══════════════════════════════════════
   ACTION BUTTONS
   ═══════════════════════════════════════ */

.actions-section {
  display: flex; gap: clamp(12px, 2.5vw, 24px);
  justify-content: center; flex-wrap: wrap;
  margin-bottom: clamp(28px, 5vw, 44px);
}

.btn-action {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: clamp(14px, 2.5vw, 18px) clamp(32px, 6vw, 56px);
  border-radius: 30px; font-size: clamp(14px, 2.5vw, 17px);
  font-weight: 600; text-decoration: none;
  transition: all 0.3s; border: none; cursor: pointer; letter-spacing: 2px; overflow: hidden;
}
.btn-action:hover { text-decoration: none; transform: translateY(-3px); }

.btn-renew {
  background: linear-gradient(135deg, var(--primary), #1a5ccc);
  color: #fff; box-shadow: 0 4px 24px rgba(var(--primary-rgb), 0.35);
}
.btn-renew::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.6s;
}
.btn-renew:hover::before { transform: translateX(100%); }
.btn-renew:hover { box-shadow: 0 6px 40px rgba(var(--primary-rgb), 0.5); }

.btn-health {
  background: transparent; color: var(--primary-light);
  border: 1.5px solid rgba(var(--primary-rgb), 0.25);
  backdrop-filter: blur(4px);
}
.btn-health:hover {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: var(--primary); box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.15);
}

.btn-icon, .btn-text { position: relative; z-index: 1; }
.btn-icon { font-size: 18px; }

.btn-pulse {
  animation: pulseBtn 1.5s ease-in-out infinite;
  box-shadow: 0 4px 24px var(--danger-glow) !important;
}
@keyframes pulseBtn {
  0%,100% { box-shadow: 0 4px 24px var(--danger-glow); }
  50% { box-shadow: 0 4px 50px var(--danger-glow), 0 0 80px var(--danger-glow); }
}

/* ═══════════════════════════════════════
   PROFILE CARD
   ═══════════════════════════════════════ */

.profile-section {
  margin-top: 8px;
}

.profile-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 16px rgba(var(--primary-rgb), 0.06);
  transition: all 0.3s;
}
.profile-card:hover {
  border-color: rgba(var(--primary-rgb), 0.25);
  box-shadow: 0 4px 24px rgba(var(--primary-rgb), 0.1);
}

.profile-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.2);
  flex-shrink: 0;
}
.profile-avatar-text {
  font-size: 22px; font-weight: 700; color: #fff;
}

.profile-info { flex: 1; min-width: 120px; }
.profile-name {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 600; color: var(--text-primary);
}
.profile-account {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}

.profile-divider {
  width: 1px; height: 48px;
  background: linear-gradient(180deg, transparent, rgba(var(--primary-rgb), 0.15), transparent);
  flex-shrink: 0;
}

.profile-meta {
  display: flex; gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
}

.profile-meta-item {
  text-align: center;
  min-width: 70px;
}
.pm-label {
  display: block;
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 4px;
}
.pm-value {
  display: block;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}

/* ═══════════════════════════════════════
   HEALTH PAGE
   ═══════════════════════════════════════ */

.health-header {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 28px; padding: 22px 28px;
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.06);
}

.health-header-icon {
  font-size: 26px; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(124,77,255,0.08));
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  color: var(--primary-light);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.06);
}

.health-title {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700; letter-spacing: 2px;
  color: var(--primary);
}
.health-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 16px;
}

.record-card {
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.06);
  transition: border-color 0.2s;
}
.record-card:hover { border-color: rgba(var(--primary-rgb), 0.3); }

.record-card-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  background: rgba(var(--primary-rgb), 0.04);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.06);
}

.record-date-badge {
  font-size: 13px; font-weight: 600;
  color: var(--primary-light); letter-spacing: 1px;
  font-family: var(--font-display);
}

.record-card-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.15), transparent);
}

.record-card-body { padding: 12px 20px 16px; }
.record-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }

.record-field {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.04);
}
.rf-label {
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rf-label small { font-size: 10px; color: var(--text-dim); margin-left: 4px; }
.rf-value { font-size: 13px; font-weight: 500; color: var(--text-primary); text-align: right; white-space: nowrap; }

.record-empty { font-size: 13px; color: var(--text-dim); text-align: center; padding: 16px 0; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: clamp(40px, 8vw, 80px) 20px;
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.06);
}
.empty-icon { font-size: 48px; color: var(--primary); margin-bottom: 16px; text-shadow: 0 0 20px var(--primary-glow); }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-dim); }

/* ── SVG gradient defs ── */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ═══════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════ */

.front-login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #d4ecec 0%, #f0f8f8 50%, #e6f2f2 100%);
  overflow: hidden;
}

.login-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 400px;
  margin: 20px;
  padding: 40px 32px 28px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(20,185,202,0.15);
  box-shadow: 0 8px 40px rgba(20,185,202,0.1), 0 0 80px rgba(20,185,202,0.04);
  text-align: center;
}

.front-logo { margin-bottom: 28px; position: relative; }
.logo-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(20,185,202,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.logo-img { height: 48px; margin-bottom: 8px; }
.front-logo h1 {
  font-size: 24px; font-weight: 700;
  color: var(--primary); letter-spacing: 4px;
  margin-bottom: 4px;
}
.logo-sub { font-size: 13px; color: var(--text-secondary); letter-spacing: 2px; }

.alert-error {
  background: rgba(250,34,9,0.06);
  border: 1px solid rgba(250,34,9,0.15);
  color: #c62828;
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

.input-group {
  display: flex; align-items: center;
  background: #f5f5f5;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px; padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20,185,202,0.1);
  background: #fff;
}
.input-icon { font-size: 16px; margin-right: 10px; opacity: 0.5; }
.input-group input {
  flex: 1; border: none; outline: none;
  background: transparent;
  padding: 14px 0; font-size: 14px;
  color: var(--text-primary);
}
.input-group input::placeholder { color: #999999; }

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3fcfcf, #14b9ca);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  letter-spacing: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(20,185,202,0.3);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(20,185,202,0.4);
}
.btn-login:active { transform: translateY(0); }

.login-footer {
  margin-top: 24px; font-size: 11px;
  color: var(--text-dim); letter-spacing: 1px;
}

#particle-canvas {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-right {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
    padding: 8px 0;
  }
  .nav-right.open { display: flex; }
  .nav-user { margin: 8px 16px; }
  .nav-link { padding: 12px 16px; border-radius: 0; width: 100%; text-align: center; }
  .profile-divider { display: none; }
  .profile-card { flex-direction: column; text-align: center; gap: 12px; }
  .profile-meta { justify-content: center; }
  .pod-container { width: clamp(240px, 55vw, 320px); height: clamp(300px, 68vw, 420px); }
  .ha-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .health-gauge { width: 88px; height: 88px; }
}

@media (max-width: 480px) {
  .front-nav { height: 52px; }
  .nav-brand { display: none; }
  .nav-logo-wrap { width: 30px; height: 30px; }
  .nav-logo { height: 26px; }
  .actions-section { flex-direction: column; align-items: center; }
  .btn-action { width: 100%; justify-content: center; }
  .profile-meta { flex-direction: column; align-items: center; }
  .pod-data-ring { width: 70px; height: 70px; top: -8%; right: -8%; }
  .pod-data-pct { font-size: 13px; }
  .ha-metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ha-metric-card { padding: 12px; }
  .hm-value { font-size: 18px; }
  .health-gauge-wrap { gap: 12px; }
  .health-gauge { width: 80px; height: 80px; }
  .gauge-num { font-size: 20px; }
  .ha-tl-body { grid-template-columns: 1fr; }
  .health-app-title { font-size: 22px; }
  .pa-stats-row { padding: 14px 8px; }
  .pa-stat-num { font-size: 18px; }
}

/* ═══════════════════════════════════════
   HEALTH APP — Mobile-first health dashboard
   ═══════════════════════════════════════ */

/* ── Header ── */
.health-app-header {
  position: relative; z-index: 2;
  width: 100%; overflow: hidden;
  padding: 16px 16px 12px;
  background: linear-gradient(180deg, rgba(20,185,202,0.04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(20,185,202,0.06);
}

.health-app-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.health-app-title {
  font-size: 26px; font-weight: 700; color: var(--text-primary);
  letter-spacing: 1px; line-height: 1.3;
}
.health-app-date {
  font-size: 14px; color: var(--text-secondary); margin-top: 2px;
}
.health-app-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.15);
  cursor: pointer; flex-shrink: 0;
}
.ha-avatar-text {
  font-size: 18px; font-weight: 600; color: #fff;
}

/* ── Gauge ── */
.health-gauge-wrap {
  display: flex; align-items: center; gap: 20px;
  padding: 4px 0 2px;
}
.health-gauge {
  position: relative; width: 100px; height: 100px; flex-shrink: 0;
}
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-progress {
  filter: drop-shadow(0 0 6px rgba(20,185,202,0.3));
  transition: stroke-dasharray 0.8s ease;
}
.gauge-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  text-align: center;
}
.gauge-num {
  display: block; font-size: 26px; font-weight: 700;
  color: var(--primary); line-height: 1.1;
}
.gauge-label {
  display: block; font-size: 9px; color: var(--text-dim);
  letter-spacing: 1px; text-transform: uppercase;
}

.gauge-info {
  display: flex; align-items: center; gap: 16px; flex: 1;
  padding: 8px 0;
}
.gi-item { text-align: center; flex: 1; }
.gi-value {
  display: block; font-size: 16px; font-weight: 600;
  color: var(--text-primary); line-height: 1.3;
}
.gi-label {
  display: block; font-size: 11px; color: var(--text-dim);
  margin-top: 2px; letter-spacing: 0.5px;
}
.gi-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-dim); flex-shrink: 0;
}

/* ── Main content area ── */
.health-app-main {
  position: relative; z-index: 2;
  width: 100%; max-width: 100%; overflow-x: hidden;
  padding: 16px 16px 76px;
}

.ha-section { margin-bottom: 24px; }
.ha-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.ha-section-title {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
  letter-spacing: 0.5px;
}
.ha-section-more {
  font-size: 13px; color: var(--primary); text-decoration: none;
  font-weight: 500;
}
.ha-section-more:hover { text-decoration: underline; }

/* ── Metrics grid ── */
.ha-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ha-metric-card {
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ha-metric-card:hover {
  border-color: rgba(var(--primary-rgb), 0.2);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.04);
}

.hm-label {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 8px; letter-spacing: 0.3px;
}
.hm-value-row { display: flex; align-items: baseline; gap: 6px; }
.hm-value {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  line-height: 1.1;
}
.hm-unit {
  font-size: 12px; color: var(--text-dim);
}

/* ── Empty state ── */
.ha-empty {
  text-align: center; padding: 40px 20px;
}
.ha-empty-icon { font-size: 40px; margin-bottom: 12px; }
.ha-empty h3 { font-size: 17px; color: var(--text-primary); margin-bottom: 6px; }
.ha-empty p { font-size: 13px; color: var(--text-secondary); }

/* ── Timeline ── */
.ha-timeline { display: flex; flex-direction: column; gap: 12px; }

.ha-timeline-card {
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.ha-tl-top {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(var(--primary-rgb), 0.04);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.06);
}
.ha-tl-date {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.2; flex-shrink: 0;
}
.ha-tl-d {
  font-size: 18px; font-weight: 700; color: var(--primary);
}
.ha-tl-y {
  font-size: 10px; color: var(--text-dim); letter-spacing: 1px;
}
.ha-tl-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(var(--primary-rgb),0.12), transparent);
}
.ha-tl-count {
  font-size: 11px; color: var(--text-dim); flex-shrink: 0;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(var(--primary-rgb),0.04);
}

.ha-tl-body {
  padding: 8px 16px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
}

.ha-tl-field {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.04);
}
.htf-label {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.htf-value {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  text-align: right; white-space: nowrap;
}
.htf-value small { font-size: 10px; color: var(--text-dim); margin-left: 2px; font-weight: 400; }

/* ── Bottom Tab Nav ── */
.ha-bottom-nav {
  position: fixed; bottom: 0; left: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-around;
  width: 100%;
  max-width: 100vw;
  height: 56px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(20,185,202,0.08);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.ha-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 12px;
  text-decoration: none; color: var(--text-dim);
  transition: color 0.2s;
  min-width: 64px;
}
.ha-nav-item:hover { text-decoration: none; }
.ha-nav-item.active {
  color: var(--primary);
}
.ha-nav-icon { font-size: 20px; line-height: 1; display: inline-block; }
.ha-nav-label {
  font-size: 10px; letter-spacing: 0.5px;
  font-weight: 500;
}
.ha-nav-item.active .ha-nav-label {
  font-weight: 600;
}

/* ═══════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════ */

.profile-app-header {
  position: relative; z-index: 2;
  padding: 0 0 16px;
}

.profile-cover {
  height: 100px;
  background: linear-gradient(135deg, rgba(20,185,202,0.06), rgba(63,207,207,0.04));
  border-bottom: 1px solid rgba(20,185,202,0.06);
}

.profile-user-wrap {
  display: flex; align-items: center; gap: 14px;
  margin-top: -32px;
  padding: 0 16px;
  width: 100%; overflow: hidden;
}

.profile-user-avatar {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.2);
  flex-shrink: 0;
}
.pua-text {
  font-size: 26px; font-weight: 700; color: #fff;
}

.profile-user-name {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 2px; letter-spacing: 0.5px;
}
.profile-user-account {
  font-size: 13px; color: var(--text-secondary);
}

/* ── Main ── */
.profile-app-main {
  position: relative; z-index: 2;
  width: 100%; max-width: 100%; overflow-x: hidden;
  padding: 8px 16px 76px;
}

.pa-stats-row {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 16px;
  padding: 18px 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.pa-stat-item {
  flex: 1; text-align: center;
}
.pa-stat-num {
  display: block; font-size: 22px; font-weight: 700;
  color: var(--primary); line-height: 1.2;
}
.pa-stat-label {
  display: block; font-size: 11px; color: var(--text-dim);
  margin-top: 2px; letter-spacing: 0.5px;
}
.pa-stat-divider {
  width: 1px; height: 36px;
  background: rgba(var(--primary-rgb), 0.1);
  flex-shrink: 0;
}

.pa-section { margin-bottom: 24px; }
.pa-section-title {
  font-size: 15px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 10px; letter-spacing: 0.5px;
}

.pa-info-card {
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.pa-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.05);
}
.pa-info-row:last-child { border-bottom: none; }
.pai-label {
  font-size: 14px; color: var(--text-secondary);
}
.pai-value {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  text-align: right;
}
.pai-danger { color: var(--danger); }

/* ── Quick Actions ── */
.pa-actions {
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.pa-action-item {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.05);
  text-decoration: none; color: var(--text-primary);
  transition: background 0.15s;
}
.pa-action-item:last-child { border-bottom: none; }
.pa-action-item:hover {
  background: rgba(var(--primary-rgb), 0.03);
  text-decoration: none;
}

.pa-action-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.pa-icon-renew {
  background: rgba(var(--primary-rgb), 0.08); color: var(--primary);
}
.pa-icon-health {
  background: rgba(var(--primary-rgb), 0.08); color: var(--primary);
}
.pa-icon-logout {
  background: rgba(250,34,9,0.06); color: var(--danger);
}

.pa-action-text { flex: 1; font-size: 14px; font-weight: 500; }
.pa-text-danger { color: var(--danger); }
.pa-action-arrow {
  font-size: 18px; color: var(--text-dim);
}