/* ===== 基础重置与全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #07000f;
  color: #fff;
}

/* 粒子背景 */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.app-container {
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* ===== 毛玻璃卡片 ===== */
.glass-card {
  background: rgba(138, 43, 226, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(138, 43, 226, 0.18);
  border-radius: 18px;
}

/* ===== 屏幕切换 ===== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(170deg, #07000f 0%, #150025 40%, #0d001a 100%);
}

.screen.active { display: flex; }
.screen.slide-in-right { display: flex; animation: slideInRight 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.screen.slide-out-left { display: flex; animation: slideOutLeft 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.screen.slide-in-left { display: flex; animation: slideInLeft 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.screen.slide-out-right { display: flex; animation: slideOutRight 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0.5; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutLeft { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-30%); opacity: 0; } }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0.5; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(30%); opacity: 0; } }

.screen::-webkit-scrollbar { width: 0; }

/* ===== 欢迎页 ===== */
.welcome-content { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 24px; text-align: center; position: relative; z-index: 1; }
.floating-symbols { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.float-sym { position: absolute; color: rgba(138, 43, 226, 0.2); font-size: 20px; animation: floatSym 8s ease-in-out infinite; }
.float-sym.s1 { top: 10%; left: 10%; animation-delay: 0s; font-size: 16px; }
.float-sym.s2 { top: 15%; right: 15%; animation-delay: 1s; font-size: 24px; }
.float-sym.s3 { top: 30%; left: 5%; animation-delay: 2s; font-size: 18px; }
.float-sym.s4 { top: 8%; right: 8%; animation-delay: 0.5s; font-size: 14px; }
.float-sym.s5 { bottom: 30%; left: 8%; animation-delay: 3s; font-size: 22px; }
.float-sym.s6 { bottom: 25%; right: 12%; animation-delay: 1.5s; font-size: 18px; }
.float-sym.s7 { bottom: 15%; left: 20%; animation-delay: 2.5s; font-size: 16px; }
.float-sym.s8 { top: 50%; right: 5%; animation-delay: 4s; font-size: 20px; }
@keyframes floatSym { 0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.2; } 50% { transform: translateY(-20px) rotate(180deg); opacity: 0.5; } }

.logo-aura { width: 130px; height: 130px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 28px; position: relative; }
.aura-ring { position: absolute; border-radius: 50%; border: 1.5px solid rgba(138, 43, 226, 0.3); }
.aura-ring.ring1 { width: 130px; height: 130px; animation: ringPulse 2.5s ease-in-out infinite; }
.aura-ring.ring2 { width: 155px; height: 155px; animation: ringPulse 2.5s ease-in-out 0.4s infinite; border-color: rgba(138, 43, 226, 0.2); }
.aura-ring.ring3 { width: 180px; height: 180px; animation: ringPulse 2.5s ease-in-out 0.8s infinite; border-color: rgba(138, 43, 226, 0.1); }
@keyframes ringPulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.08); opacity: 0.3; } }

.palm-icon { font-size: 60px; filter: drop-shadow(0 0 25px rgba(138, 43, 226, 0.8)); animation: palmFloat 3s ease-in-out infinite; z-index: 1; }
@keyframes palmFloat { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.05); } }

.title-glow { font-size: 38px; font-weight: 800; background: linear-gradient(135deg, #e0b0ff, #8A2BE2, #ff69b4, #d4a5ff); background-size: 200% 200%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 14px; letter-spacing: 6px; animation: gradientShift 4s ease infinite; }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.subtitle { font-size: 14px; color: rgba(255, 255, 255, 0.55); margin-bottom: 14px; letter-spacing: 3px; }
.slogan-text { font-size: 15px; color: rgba(212, 165, 255, 0.75); margin-bottom: 16px; letter-spacing: 2px; font-style: italic; position: relative; padding: 8px 20px; }
.slogan-text::before, .slogan-text::after { content: ''; position: absolute; top: 50%; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(138, 43, 226, 0.5), transparent); }
.slogan-text::before { left: -16px; }
.slogan-text::after { right: -16px; }
.desc-text { font-size: 13px; color: rgba(255, 255, 255, 0.35); line-height: 1.9; margin-bottom: 24px; }

/* ===== 模式选择卡片 ===== */
.mode-selection { display: flex; gap: 12px; width: 100%; margin-bottom: 8px; }
.mode-card { flex: 1; padding: 20px 14px 16px; text-align: center; cursor: pointer; transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1); position: relative; overflow: hidden; }
.mode-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(138, 43, 226, 0.25); border-color: rgba(138, 43, 226, 0.4); }
.mode-card:active { transform: translateY(-2px) scale(0.98); }
.mode-icon { font-size: 40px; margin-bottom: 8px; display: block; }
.mode-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 10px; font-weight: 700; background: rgba(138, 43, 226, 0.15); color: #a78bfa; border: 1px solid rgba(138, 43, 226, 0.25); margin-bottom: 8px; letter-spacing: 1px; }
.mode-badge.premium { background: linear-gradient(135deg, rgba(255, 105, 180, 0.15), rgba(138, 43, 226, 0.15)); color: #ff69b4; border-color: rgba(255, 105, 180, 0.3); }
.mode-card h3 { font-size: 16px; font-weight: 700; color: #d4a5ff; margin-bottom: 6px; }
.mode-desc { font-size: 11px; color: rgba(255, 255, 255, 0.4); line-height: 1.6; margin-bottom: 10px; }
.mode-features { list-style: none; text-align: left; margin-bottom: 14px; }
.mode-features li { font-size: 11px; color: rgba(255, 255, 255, 0.5); padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.mode-features li i { color: #a78bfa; font-size: 9px; }
#mode-fusion .mode-features li i { color: #ff69b4; }

.btn-mode { width: 100%; padding: 10px 16px; border-radius: 25px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.3s; }
.btn-mode-traditional { background: linear-gradient(135deg, #9333ea, #7c3aed); color: #fff; box-shadow: 0 2px 12px rgba(138, 43, 226, 0.3); }
.btn-mode-fusion { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; box-shadow: 0 2px 12px rgba(236, 72, 153, 0.3); }
.btn-mode:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4); }

.trust-indicators { display: flex; align-items: center; gap: 24px; margin-top: 32px; padding: 14px 24px; background: rgba(138, 43, 226, 0.06); border-radius: 16px; border: 1px solid rgba(138, 43, 226, 0.12); }
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trust-num { font-size: 20px; font-weight: 700; color: #d4a5ff; }
.trust-label { font-size: 11px; color: rgba(255, 255, 255, 0.35); }
.trust-divider { width: 1px; height: 30px; background: rgba(138, 43, 226, 0.2); }

/* ===== 通用按钮 ===== */
.btn-primary { background: linear-gradient(135deg, #9333ea, #7c3aed, #8b5cf6); color: #fff; border: none; padding: 15px 40px; border-radius: 50px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 24px rgba(138, 43, 226, 0.35); position: relative; overflow: hidden; justify-content: center; }
.btn-primary::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%); transition: all 0.5s; transform: translateX(-100%); }
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(138, 43, 226, 0.5); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary:disabled::after { display: none; }
.btn-full { width: 100%; }
.btn-arrow { margin-left: 4px; font-size: 12px; transition: transform 0.3s; }
.btn-primary:not(:disabled):hover .btn-arrow { transform: translateX(4px); }
.btn-secondary { background: transparent; color: #d4a5ff; border: 1.5px solid rgba(138, 43, 226, 0.4); padding: 13px 28px; border-radius: 50px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn-secondary:hover { background: rgba(138, 43, 226, 0.12); border-color: rgba(138, 43, 226, 0.6); }
.pulse-btn { animation: btnPulse 2.5s ease-in-out infinite; }
@keyframes btnPulse { 0%, 100% { box-shadow: 0 4px 24px rgba(138, 43, 226, 0.35); } 50% { box-shadow: 0 4px 48px rgba(138, 43, 226, 0.6), 0 0 80px rgba(138, 43, 226, 0.2); } }

/* ===== 页面头部 ===== */
.screen-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; position: sticky; top: 0; z-index: 10; background: rgba(7, 0, 15, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(138, 43, 226, 0.08); }
.screen-header h2 { font-size: 17px; font-weight: 600; color: #d4a5ff; display: flex; align-items: center; gap: 6px; }
.header-step { font-size: 12px; color: rgba(255, 255, 255, 0.35); background: rgba(138, 43, 226, 0.12); padding: 4px 10px; border-radius: 10px; }
.btn-back { background: rgba(138, 43, 226, 0.15); border: 1px solid rgba(138, 43, 226, 0.25); color: #d4a5ff; width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; font-size: 13px; }
.btn-back:hover { background: rgba(138, 43, 226, 0.3); transform: translateX(-2px); }

/* ===== 用户信息页 ===== */
.info-content { padding: 12px 20px 40px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; }
.info-card { padding: 20px; }
.card-header-line { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-icon { font-size: 28px; }
.info-card h3 { font-size: 15px; font-weight: 600; color: #d4a5ff; }
.zodiac-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.zodiac-item { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; border: 1.5px solid rgba(138, 43, 226, 0.15); background: rgba(138, 43, 226, 0.04); cursor: pointer; transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.zodiac-item .emoji { font-size: 26px; margin-bottom: 4px; transition: transform 0.3s; }
.zodiac-item:active { transform: scale(0.95); }
.zodiac-item.selected { border-color: #8A2BE2; background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(168, 85, 247, 0.15)); color: #fff; box-shadow: 0 0 20px rgba(138, 43, 226, 0.25), inset 0 0 15px rgba(138, 43, 226, 0.1); transform: scale(1.02); }
.zodiac-item.selected .emoji { transform: scale(1.15); }
.constellation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.constellation-item { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; border: 1.5px solid rgba(138, 43, 226, 0.15); background: rgba(138, 43, 226, 0.04); cursor: pointer; transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.constellation-item .emoji { font-size: 24px; margin-bottom: 4px; transition: transform 0.3s; }
.constellation-item:active { transform: scale(0.95); }
.constellation-item.selected { border-color: #8A2BE2; background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(168, 85, 247, 0.15)); color: #fff; box-shadow: 0 0 20px rgba(138, 43, 226, 0.25), inset 0 0 15px rgba(138, 43, 226, 0.1); transform: scale(1.02); }
.constellation-item.selected .emoji { transform: scale(1.15); }
.name-input { width: 100%; background: rgba(138, 43, 226, 0.08); border: 1.5px solid rgba(138, 43, 226, 0.2); border-radius: 14px; padding: 13px 16px; color: #fff; font-size: 15px; outline: none; transition: all 0.3s; }
.name-input::placeholder { color: rgba(255, 255, 255, 0.25); }
.name-input:focus { border-color: #8A2BE2; box-shadow: 0 0 20px rgba(138, 43, 226, 0.2); background: rgba(138, 43, 226, 0.12); }

/* ===== 错误提示弹窗 ===== */
.error-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.85); background: rgba(30, 0, 10, 0.95); border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 18px; padding: 28px 36px; text-align: center; z-index: 1000; opacity: 0; transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1); pointer-events: none; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.error-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.error-toast .toast-icon { font-size: 42px; margin-bottom: 12px; }
.error-toast p { font-size: 14px; color: rgba(255, 255, 255, 0.75); line-height: 1.7; }

/* ===== 前置摄像头画面镜像翻转 ===== */
#camera-video { transform: scaleX(-1); }

/* ===== 星座推算提示 ===== */
.constellation-hint {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  animation: fadeInUp 0.3s ease;
}
