/* ============================================
   新生儿生辰八字起名小程序 - 全局自定义样式
   新中式 + 轻现代国潮风格
   ============================================ */

/* ---- 设计变量 ---- */
:root {
  --primary: #1A5F5F;
  --primary-light: #2D8B8B;
  --primary-dark: #134545;
  --secondary: #C9A84C;
  --secondary-light: #DCC478;
  --accent: #E8533E;
  --bg-primary: #FAF8F5;
  --bg-secondary: #F0EDE8;
  --bg-card: #FFFFFF;
  --text-primary: #1C1C1C;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --border: #E5E0D8;
  --border-dark: #CCC7BE;
  --success: #34A853;
  --warning: #F5A623;
  --error: #E53E3E;
  --gold: #C9A84C;
  --gold-light: #F5E6C4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ---- 全局重置 ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select { font-family: inherit; outline: none; }

/* ---- 页面外壳（小程序模拟） ---- */
.phone-frame {
  width: 375px;
  min-height: 667px;
  background: var(--bg-card);
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 0 8px #1A1A1A;
  display: flex;
  flex-direction: column;
}

/* iOS 状态栏 */
.status-bar {
  height: 44px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}
.status-bar .time { font-weight: 700; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.status-bar .icon-signal, .status-bar .icon-wifi, .status-bar .icon-battery {
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}

/* ---- 页面容器 ---- */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
  padding-bottom: 80px;
}
.page-content::-webkit-scrollbar { width: 0; }

/* ---- 底部 Tab 栏 ---- */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 100;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: none;
  transition: color 0.2s;
}
.tab-item i { font-size: 22px; line-height: 1; }
.tab-item.active { color: var(--primary); }
.tab-item .tab-label { font-weight: 500; }

/* ---- 通用标题栏 ---- */
.nav-bar {
  height: 56px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-bar .nav-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-bar .nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  border-radius: 50%;
  transition: background 0.2s;
}
.nav-bar .nav-btn:active { background: var(--bg-secondary); }

/* ---- 卡片 ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ---- 按钮 ---- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  padding: 14px 24px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(26,95,95,0.35);
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 2px 6px rgba(26,95,95,0.25); }
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-gold {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(201,168,76,0.35);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 28px; font-size: 17px; }

/* ---- 标签 / Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}
.badge-primary { background: rgba(26,95,95,0.12); color: var(--primary); }
.badge-gold { background: rgba(201,168,76,0.15); color: #9A7830; }
.badge-success { background: rgba(52,168,83,0.12); color: var(--success); }
.badge-error { background: rgba(229,62,62,0.12); color: var(--error); }
.badge-muted { background: var(--bg-secondary); color: var(--text-muted); }

/* ---- 分数圆环 ---- */
.score-ring {
  position: relative;
  width: 80px;
  height: 80px;
}
.score-ring svg { width: 80px; height: 80px; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 6; }
.score-ring .bg { stroke: var(--border); }
.score-ring .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-ring .score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.score-ring .score-text small { font-size: 10px; font-weight: 500; color: var(--text-muted); }

/* ---- 五行颜色 ---- */
.wuxing-jin { color: #A0A0A0; }
.wuxing-mu { color: #34A853; }
.wuxing-shui { color: #4285F4; }
.wuxing-huo { color: #E53E3E; }
.wuxing-tu { color: #C9A84C; }

/* ---- 分隔线 ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ---- 列表项 ---- */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  gap: 12px;
  transition: background 0.15s;
}
.list-item:active { background: var(--bg-secondary); }
.list-item .list-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.list-item .list-body { flex: 1; min-width: 0; }
.list-item .list-body .list-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.list-item .list-body .list-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item .list-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* ---- 空状态 ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}
.empty-state i { font-size: 48px; color: var(--border-dark); }
.empty-state p { font-size: 14px; color: var(--text-muted); }
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); }

/* ---- 名字卡片 ---- */
.name-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.name-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.name-card .name-surname { font-size: 13px; color: var(--text-muted); }
.name-card .name-full {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 2px;
}
.name-card .name-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.name-card .name-score {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.name-card .name-score .score-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary);
}
.name-card .name-score .score-label { font-size: 12px; color: var(--text-muted); }

/* ---- 八字展示 ---- */
.bazi-display {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.bazi-display .bazi-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.bazi-display .bazi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 3px;
}
.bazi-display .bazi-row {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.bazi-display .bazi-col { text-align: center; }
.bazi-display .bazi-col .col-label { font-size: 11px; color: var(--text-muted); }
.bazi-display .bazi-col .col-val { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }

/* ---- 进度条 ---- */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 1s ease;
}

/* ---- 环形图表 ---- */
.donut-chart {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.donut-chart canvas { max-width: 120px; }
.donut-chart .donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* ---- 渐变背景区块 ---- */
.gradient-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
}
.gradient-hero-soft {
  background: linear-gradient(135deg, #F5E6C4 0%, #FDF8EE 100%);
}

/* ---- 浮动操作按钮 ---- */
.fab {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}
.fab:active { transform: scale(0.95); }
.fab-primary { background: var(--primary); color: white; }
.fab-gold { background: var(--secondary); color: white; }

/* ---- 加载动画 ---- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; }

/* ---- 过渡动画 ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-fade-in-up { animation: fadeInUp 0.5s ease forwards; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .phone-frame { border-radius: 32px; box-shadow: var(--shadow-md), 0 0 0 5px #1A1A1A; }
}