:root {
  --primary-glow: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(120, 119, 198, 0.1) 70%);
  --secondary-glow: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, rgba(120, 119, 198, 0) 60%);
  --bg-color: #0b0a1a;
  --glass-bg: rgba(25, 23, 48, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(168, 85, 247, 0.4);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent: #a855f7;
  --accent-pink: #ec4899;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-size: 16px;
  line-height: 1.5;
}

/* 微信小程序 WebView 容器与自适应适配 */
.container {
  width: 100%;
  max-width: 480px; /* 适合小程序 WebView 或手机端 */
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

/* 极光背景特效 */
body::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -20%;
  width: 140%;
  height: 60%;
  background: var(--primary-glow);
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
}

body::after {
  content: "";
  position: absolute;
  bottom: -10%;
  right: -20%;
  width: 140%;
  height: 60%;
  background: var(--secondary-glow);
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
}

/* 头部导航与标题 */
header {
  text-align: center;
  padding: 24px 0 16px 0;
  z-index: 10;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, #d8b4fe 70%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0px 4px 20px rgba(168, 85, 247, 0.25);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* SPA 路由卡片切换 */
.page {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
  flex: 1;
}

.page.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 毛玻璃卡片系统 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s ease;
}

.glass-card:focus-within {
  border-color: var(--glass-border-focus);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}

/* 表单组件 */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* 按钮组与自适应选项切换 */
.btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.btn-toggle.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

input[type="text"],
input[type="date"],
input[type="time"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
  -webkit-appearance: none; /* 消除iOS圆角与默认阴影 */
}

input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.15);
}

/* 问答性格选择题 */
.question-item {
  margin-bottom: 16px;
}

.question-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

/* 渐变流光动作按钮 */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-pink) 100%);
  border: none;
  border-radius: 14px;
  padding: 14px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2);
}

/* 占星报告专有样式 */
.match-header {
  text-align: center;
  padding: 10px 0;
}

.match-circle {
  width: 110px;
  height: 110px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, var(--accent-pink) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.4);
}

.match-circle::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: #0f0d26;
  border-radius: 50%;
  z-index: 1;
}

.match-score {
  font-size: 1.8rem;
  font-weight: 800;
  z-index: 2;
  background: linear-gradient(135deg, #fff, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.relationship-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.relationship-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* 雷达图Canvas容器 */
.radar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}

#radarCanvas {
  max-width: 100%;
}

/* 行星配置详情 */
.planet-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planet-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.planet-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: bold;
  margin-right: 12px;
}

.planet-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 70px;
}

.planet-zodiac {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.planet-desc-tag {
  font-size: 0.75rem;
  background: rgba(236, 72, 153, 0.1);
  color: var(--accent-pink);
  padding: 2px 8px;
  border-radius: 20px;
}

/* 特效彩蛋样式 */
.egg-card {
  border: 1px solid rgba(236, 72, 153, 0.3);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
  animation: shine 2s infinite alternate;
}

@keyframes shine {
  0% { box-shadow: 0 0 10px rgba(236, 72, 153, 0.1); }
  100% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.3); }
}

.egg-tag {
  font-size: 0.75rem;
  background: linear-gradient(135deg, #f472b6, #a855f7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* 分享海报页面 */
.poster-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.poster-canvas-wrapper {
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-width: 100%;
}

#posterCanvas {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

.poster-tips {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
}

/* 返回按钮 */
.btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 进度条 */
.progress-bar-container {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.progress-step {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  transition: background-color 0.3s;
}

.progress-step.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-pink));
}

/* 功德簿专有样式 (玄学修仙像素风) */
.karma-muyu-card {
  text-align: center;
  background: rgba(16, 24, 20, 0.7) !important; /* 墨绿色国风玄学底色 */
  border-color: rgba(16, 185, 129, 0.2) !important;
  position: relative;
  overflow: hidden;
}

.karma-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(16, 185, 129, 0.2);
  padding-bottom: 10px;
}

.karma-title-pixel {
  font-size: 1rem;
  font-weight: bold;
  color: #10b981;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.karma-counter-pixel {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.muyu-click-area {
  padding: 30px 0;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.muyu-wood {
  font-size: 4rem;
  display: inline-block;
  transition: transform 0.05s ease;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.3));
}

.muyu-wood.tapped {
  transform: scale(0.9);
}

/* 功德选项卡列表 */
.karma-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.karma-item-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.karma-item-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.karma-item-row.checked {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.karma-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-secondary);
  border-radius: 6px;
  margin-right: 14px;
  position: relative;
  transition: all 0.2s;
}

.karma-item-row.checked .karma-checkbox {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.karma-item-row.checked .karma-checkbox::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.karma-item-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
}

.karma-name {
  font-size: 0.85rem;
  color: #fff;
  font-weight: 600;
}

.karma-points {
  font-size: 0.8rem;
  font-weight: 700;
}

.karma-points.plus {
  color: #4ade80;
}

.karma-points.minus {
  color: #f87171;
}

/* 功德文字飞出动效 */
.pixel-effect-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pixel-float-text {
  position: absolute;
  font-weight: bold;
  font-size: 1.15rem;
  animation: floatUp 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1);
  }
}

/* 自适应隐藏/显示样式 */
.hidden {
  display: none !important;
}

