* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   .sr-only — 视觉隐藏 (用户看不到), 但屏幕阅读器 + 搜索引擎爬虫能读到
   用于 SEO H1 / 关键词段落, 不影响视觉设计
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   🎁 活动横幅 (Promo Banner) — 命理风水大师标题下方的活动公告
   ============================================================ */
.promo-banner {
  background: linear-gradient(135deg, #8b0000 0%, #c41e3a 50%, #d4a017 100%);
  background-size: 200% 200%;
  animation: promo-banner-gradient 8s ease infinite;
  color: #fff;
  padding: 18px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(139, 0, 0, 0.28);
  border-radius: 14px;
  /* 不要设 max-width / width / auto margin —
     让横幅自然撑满 .app 容器的内容区 (1000px - 40px padding = 960px),
     这样左右边缘和 header / 服务卡片精确对齐. */
  margin: 8px 0 28px 0;          /* 上 8 / 下 28 (header 自带 margin-bottom 32) */
}

/* 微动画: 背景缓慢流动, 凸显"活动中" */
@keyframes promo-banner-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 右侧装饰光斑 — 像横幅缎带 */
.promo-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: -50px;
  width: 200px;
  height: 100%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
  pointer-events: none;
  animation: promo-banner-shine 6s linear infinite;
}

@keyframes promo-banner-shine {
  0%   { transform: translateX(0); opacity: 0; }
  20%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translateX(-400px); opacity: 0; }
}

.promo-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.promo-banner-icon {
  font-size: 34px;               /* 28 → 34 */
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  animation: promo-icon-bounce 2.5s ease-in-out infinite;
}

@keyframes promo-icon-bounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.12) rotate(-8deg); }
}

.promo-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.promo-banner-title {
  font-size: 18px;               /* 16 → 18 */
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.promo-banner-subtitle {
  font-size: 13.5px;             /* 12.5 → 13.5 */
  opacity: 0.92;
  line-height: 1.5;
  letter-spacing: 0.2px;
  margin-top: 3px;
}

.promo-banner-tag {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 12.5px;             /* 12 → 12.5 */
  font-weight: 600;
  padding: 7px 16px;             /* 5/14 → 7/16 */
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

/* "📸 生成宣传图" 按钮 — 紧挨着 "仅限本期" 标签, 让用户能一键拍宣传图 */
.promo-banner-share-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #8b0000;
  border: 1px solid rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.promo-banner-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.promo-banner-share-btn:active {
  transform: translateY(0);
}

/* 响应式 — 手机端字号缩小 + 文字换行 + 标签独占一行 */
@media (max-width: 720px) {
  .promo-banner {
    padding: 14px 18px;
    margin: 4px 0 22px 0;
    border-radius: 12px;
  }
  .promo-banner-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .promo-banner-icon {
    font-size: 28px;
  }
  .promo-banner-title {
    font-size: 15px;
  }
  .promo-banner-subtitle {
    font-size: 12px;
  }
  .promo-banner-tag {
    font-size: 11.5px;
    padding: 5px 12px;
    margin-left: auto;
  }
  .promo-banner-share-btn {
    font-size: 12px;
    padding: 5px 12px;
  }
}

@media (max-width: 480px) {
  /* 在小屏上把 subtitle 隐藏 — 只保留标题 + 按钮 (避免横幅过高) */
  .promo-banner-subtitle {
    display: none;
  }
  /* 小屏隐藏「仅限本期」标签, 只保留分享按钮 (功能性 > 装饰性) */
  .promo-banner-tag {
    display: none;
  }
}


:root {
  --primary: #8B0000;
  --primary-light: #C41E3A;
  --gold: #D4A017;
  --gold-light: #F5D060;
  --bg: #FDF6EC;
  --bg-card: #FFFAF0;
  --text: #2D1B0E;
  --text-light: #6B4C3B;
  --border: #E8D5B7;
  --shadow: 0 2px 12px rgba(139, 0, 0, 0.08);
  --radius: 12px;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  padding: 28px 0 20px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 32px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 42px;
  line-height: 1;
  /* img logo 支持 */
  width: 42px;
  height: 42px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}
img.logo-icon {
  /* 更贴近文字基线 */
  margin-top: -2px;
}

.logo h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Pre-fill hint shown on dual-person forms when user's profile is loaded */
.profile-prefill-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(45, 138, 78, 0.08), rgba(45, 138, 78, 0.04));
  border: 1px solid rgba(45, 138, 78, 0.35);
  border-radius: 8px;
  font-size: 13px;
  color: #1e6b3a;
  line-height: 1.5;
}
.profile-prefill-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Header actions (profile link / login button) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.header-actions .ha-user {
  font-size: 13px;
  color: var(--text-light);
  padding: 6px 12px;
  background: rgba(212, 160, 23, 0.08);
  border-radius: 16px;
}
.header-actions a.ha-btn,
.header-actions button.ha-btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.header-actions a.ha-btn:hover,
.header-actions button.ha-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}
.header-actions a.ha-btn.ha-btn-primary {
  background: linear-gradient(135deg, #8b0000, #c41e3a);
  color: #fff;
  border-color: transparent;
}
.header-actions a.ha-btn.ha-btn-primary:hover {
  box-shadow: 0 3px 12px rgba(139, 0, 0, 0.35);
}

.ha-msg-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  background: #c41e3a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  text-align: center;
  line-height: 16px;
  margin-left: 4px;
  vertical-align: super;
}

@media (max-width: 600px) {
  .header-content { flex-direction: column; gap: 12px; }
  .header-actions { width: 100%; justify-content: center; }
}

/* Section Title */
.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}

/* Recent Results */
.recent-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.recent-result-card {
  background: linear-gradient(135deg, #fffaf0, #fff5e6);
  border: 1px solid #e8d5b7;
  border-left: 4px solid #d4a017;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.recent-result-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.15);
  border-left-color: #8b0000;
}
.recent-result-card .rr-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.recent-result-card .rr-body {
  flex: 1;
  min-width: 0;
}
.recent-result-card .rr-title {
  font-size: 13px;
  font-weight: 600;
  color: #2d1b0e;
  margin-bottom: 2px;
}
.recent-result-card .rr-meta {
  font-size: 11px;
  color: #999;
}
.recent-result-card .rr-tier {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
  flex-shrink: 0;
}
.recent-result-card .rr-tier.paid {
  background: #d4a017;
  color: #fff;
}
.recent-result-card .rr-tier.free {
  background: #e8d5b7;
  color: #6b4c3b;
}
.recent-result-card .rr-close {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 14px;
  color: #bbb;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.recent-result-card .rr-close:hover {
  color: #c41e3a;
}
@media (max-width: 600px) {
  .recent-results-grid { grid-template-columns: 1fr; }
}

/* Service Grid */
.services {
  margin-bottom: 32px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}

.service-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.service-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.service-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFF5F5 0%, #FFFAF0 100%);
  box-shadow: 0 2px 16px rgba(139, 0, 0, 0.12);
}

.service-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}

.service-card h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.service-card p {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.4;
}

/* Input Section */
.input-section {
  margin-bottom: 32px;
}

.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  background: white;
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
}

/* Dual Form — 两人并排布局 */
.dual-form {
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.person-form {
  flex: 1 1 0;
  min-width: 0;               /* 关键: 允许 flex 子元素缩小到容器宽度 */
  background: rgba(139, 0, 0, 0.02);
  border: 1px solid rgba(139, 0, 0, 0.08);
  border-radius: 10px;
  padding: 16px 18px;
}

.person-form h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(139, 0, 0, 0.15);
  text-align: center;
  letter-spacing: 2px;
}

.person-form .form-group,
.person-form .bazi-row {
  margin-bottom: 12px;
}

.person-form .bazi-row:last-child {
  margin-bottom: 0;
}

/* 双人表单里的标签行内: 改为上下堆叠, 每个字段占满列宽 */
.person-form .bazi-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.person-form .bazi-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 2px;
  min-width: auto;
  width: auto;
}

.person-form .bazi-field {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 日期时间: 允许换行, 每个 select 弹性宽度 */
.person-form .bazi-datetime {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.person-form .bazi-datetime select {
  flex: 1 1 auto;
  min-width: 58px;
  padding: 6px 4px;
  font-size: 13px;
}

.person-form .bazi-datetime input[type="time"] {
  flex: 1 1 80px;
  min-width: 80px;
  padding: 6px 8px;
  font-size: 13px;
}

.person-form .bazi-datetime span {
  font-size: 12px;
  color: var(--text-light);
  margin: 0 -2px;
}

/* 出生地址: 三个下拉占满, 换行 */
.person-form .bazi-address {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.person-form .bazi-address select {
  flex: 1 1 calc(50% - 3px);
  min-width: 100px;
  padding: 6px 8px;
  font-size: 13px;
}

/* 性别 radio 居左紧凑 */
.person-form input[type="radio"] + span {
  font-size: 14px;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  padding: 0 4px;
  flex: 0 0 auto;
  align-self: center;
}

/* 中窄屏: 两人改为垂直堆叠 */
@media (max-width: 900px) {
  .dual-form {
    flex-direction: column;
    gap: 20px;
  }
  .vs-divider {
    padding: 8px 0;
  }
}

/* Tier Selector (free vs paid) */
.tier-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.tier-option {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e8d5b7;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: #fff;
  position: relative;
}
.tier-option:hover {
  border-color: #d4a017;
  transform: translateY(-1px);
}
.tier-option.active {
  border-color: #8b0000;
  background: linear-gradient(135deg, #fdf6ec 0%, #fff8f0 100%);
  box-shadow: 0 2px 12px rgba(139, 0, 0, 0.12);
}
.tier-badge {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.tier-free .tier-badge { color: #2d8a4e; }
.tier-paid .tier-badge { color: #d4a017; }
.tier-title {
  font-size: 15px;
  font-weight: 600;
  color: #2d1b0e;
  margin-bottom: 2px;
}
.tier-desc {
  font-size: 12px;
  color: #9ca3af;
}
.tier-price {
  font-size: 16px;
  font-weight: 700;
  color: #8b0000;
  margin-top: 4px;
}
/* 限时免费促销: 原价划掉 + 红色 ¥0 */
.tier-price-strike {
  color: #9ca3af;
  font-weight: 500;
  text-decoration: line-through;
  margin-right: 6px;
}
.tier-price-free {
  color: #b91c1c;
  font-weight: 700;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  letter-spacing: 2px;
  margin-top: 8px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 20px;
}

/* Result Section */
.result-section {
  margin-bottom: 40px;
}

.result-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 200px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  gap: 12px;
}

.loading p {
  color: var(--text-light);
  font-size: 14px;
}

.loading-hint {
  font-size: 12px !important;
  color: var(--text-muted, #9ca3af) !important;
  margin-top: -6px;
}

.loading-timer {
  font-size: 13px;
  color: #8b0000;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  margin: 2px 0 8px;
}

.loading-steps {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 8px 0;
}

.loading-step {
  font-size: 12px;
  color: #9ca3af;
  padding: 4px 10px;
  border-radius: 12px;
  background: #f5f0e8;
  transition: all 0.3s;
}

.loading-step.active {
  color: #8b0000;
  background: #fdf6ec;
  border: 1px solid #d4a017;
  font-weight: 600;
}

.loading-step.done {
  color: #2d8a4e;
  background: #d1fae5;
}

.stop-btn {
  margin-top: 12px;
  padding: 9px 24px;
  background: #fff;
  color: #8b0000;
  border: 1.5px solid #d4a017;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(139, 0, 0, 0.1);
}
.stop-btn:hover {
  background: #8b0000;
  color: #fff;
  border-color: #8b0000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
}
.stop-btn .stop-icon {
  font-size: 13px;
  line-height: 1;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}

.result-text h1, .result-text h2, .result-text h3 {
  font-family: 'Noto Serif SC', serif;
  color: var(--primary);
  margin: 20px 0 10px;
}

.result-text h1 { font-size: 22px; }
.result-text h2 { font-size: 18px; }
.result-text h3 { font-size: 16px; }

.result-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.result-text th, .result-text td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: center;
  font-size: 14px;
}

.result-text th {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFFAF0 100%);
  font-weight: 600;
  color: var(--primary);
}

.result-text strong {
  color: var(--primary);
}

.result-text ul, .result-text ol {
  padding-left: 24px;
  margin: 8px 0;
}

.result-text li {
  margin-bottom: 4px;
}

.result-text blockquote {
  border-left: 3px solid var(--gold);
  padding: 8px 16px;
  margin: 12px 0;
  background: rgba(212, 160, 23, 0.06);
  font-style: italic;
  color: var(--text-light);
}

.result-text hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 12px;
}

/* ===== Bazi Form ===== */
.bazi-form {
  padding: 28px 32px;
}

.bazi-row {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}

.bazi-label {
  flex-shrink: 0;
  width: 72px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  text-align: right;
}

.bazi-field {
  flex: 1;
}

.bazi-field input[type="text"],
.bazi-field input[type="time"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  background: white;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s;
}

.bazi-field input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Radio group */
.radio-group {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
}

.radio-group input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Calendar toggle */
.calendar-toggle {
  display: flex;
  background: #F0E6D3;
  border-radius: 24px;
  padding: 3px;
  margin-left: 16px;
}

.cal-btn {
  padding: 6px 20px;
  border: none;
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.cal-btn.active {
  background: var(--gold);
  color: white;
  font-weight: 500;
}

/* Datetime row */
.bazi-datetime {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bazi-datetime select {
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  background: white;
  color: var(--text);
  min-width: 80px;
}

.bazi-datetime select:focus {
  outline: none;
  border-color: var(--primary);
}

.bazi-datetime span {
  font-size: 14px;
  color: var(--text-light);
}

.bazi-datetime input[type="time"] {
  width: 120px;
  flex-shrink: 0;
}

/* Address row */
.bazi-address {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bazi-address select {
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  background: white;
  color: var(--text);
  min-width: 120px;
}

/* 国家选择器: 略带 highlight 让它从其它 select 中突出 (默认中国大陆) */
.bazi-address select.country-select {
  background: #fffaf0;
  border-color: #d4a017;
  font-weight: 500;
  color: #8b0000;
}

/* 境外城市文本输入框 */
.bazi-address input.foreign-only {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  background: white;
  color: var(--text);
  flex: 1;
  min-width: 200px;
}

.bazi-address input.foreign-only:focus {
  outline: none;
  border-color: var(--primary);
}

.bazi-address select:focus {
  outline: none;
  border-color: var(--primary);
}

.bazi-address input {
  flex: 1;
  min-width: 0;
}

/* Checkbox options */
.bazi-options {
  gap: 24px;
  padding-left: 88px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.checkbox-group input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

/* Info display */
.bazi-info {
  padding-left: 88px;
  display: flex;
  gap: 32px;
  font-size: 13px;
  color: var(--text-light);
  margin-top: -4px;
}

/* ============================================================
   MOBILE RESPONSIVE — All phones (iPhone / Android)
   ============================================================ */

@media (max-width: 600px) {
  /* -- Global -- */
  .app {
    padding: 0 12px;
  }

  /* -- Header -- */
  .header {
    padding: 16px 0 14px;
    margin-bottom: 20px;
  }
  .header-content {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .logo {
    gap: 10px;
  }
  .logo-icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
  }
  .logo h1 {
    font-size: 20px;
    letter-spacing: 1px;
  }
  .subtitle {
    font-size: 11px;
  }
  .header-actions {
    width: 100%;
    justify-content: center;
    gap: 6px;
  }
  .header-actions a.ha-btn,
  .header-actions button.ha-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  .header-actions .ha-user {
    font-size: 11px;
    padding: 4px 10px;
  }

  /* -- Service Grid -- */
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .service-card {
    padding: 12px 8px;
    border-radius: 10px;
    border-width: 1.5px;
  }
  .service-card h3 {
    font-size: 13px;
  }
  .service-card p {
    font-size: 10px;
    line-height: 1.3;
  }
  .service-icon {
    font-size: 24px;
  }

  /* -- Section Titles -- */
  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  /* -- Input Form -- */
  .input-section {
    margin-bottom: 16px;
  }
  .form-panel {
    padding: 14px;
  }
  .form-row {
    flex-direction: column;
    gap: 10px;
  }
  .form-group label {
    font-size: 12px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 9px 10px;
    font-size: 14px;
  }

  /* -- Bazi form rows -- */
  .bazi-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px;
  }
  .bazi-label {
    min-width: auto !important;
    width: auto !important;
    font-size: 12px !important;
  }
  .bazi-field {
    width: 100% !important;
    min-width: 0 !important;
  }
  .bazi-datetime {
    flex-wrap: wrap;
  }
  .bazi-datetime select {
    min-width: 55px;
    flex: 1 1 auto;
    font-size: 13px;
    padding: 8px 4px;
  }
  .bazi-datetime input[type="time"] {
    flex: 1 1 90px;
    min-width: 90px;
    font-size: 14px;
    padding: 8px;
  }
  .bazi-address select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    font-size: 13px;
    padding: 8px;
  }
  .birth-summary {
    font-size: 11px;
    gap: 16px;
    padding-left: 0;
    flex-wrap: wrap;
  }

  /* -- Tier Selector -- */
  .tier-selector {
    gap: 8px;
  }
  .tier-option {
    padding: 10px 8px;
    border-radius: 10px;
  }
  .tier-title {
    font-size: 13px;
  }
  .tier-desc {
    font-size: 10px;
  }
  .tier-price {
    font-size: 14px;
  }
  .tier-badge {
    font-size: 11px;
  }

  /* -- Submit Button -- */
  .submit-btn {
    padding: 14px;
    font-size: 15px;
    letter-spacing: 1px;
    border-radius: 10px;
  }

  /* -- Dual Form (marriage/partner) -- */
  .dual-form {
    flex-direction: column;
    gap: 16px;
  }
  .person-form {
    padding: 12px 14px;
  }
  .person-form h3 {
    font-size: 14px;
  }
  .vs-divider {
    padding: 8px 0;
    font-size: 16px;
  }

  /* -- Footer -- */
  .site-footer {
    font-size: 11px;
    padding: 16px 12px;
  }
}

/* Extra small screens (iPhone SE, 320px) */
@media (max-width: 380px) {
  .app {
    padding: 0 8px;
  }
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .service-card {
    padding: 10px 6px;
  }
  .service-card h3 {
    font-size: 12px;
  }
  .logo h1 {
    font-size: 18px;
  }
  .header-actions a.ha-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  .tier-option {
    padding: 8px 6px;
  }
  .tier-title {
    font-size: 12px;
  }
}

/* ============================================================
   Service Intro Banner — 所有服务通用的金色介绍卡
   (在 "填写信息" 标题下方, 由 selectService() 动态填充)
   ============================================================ */
.service-intro-banner {
  margin: 0 0 20px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #fff6d5 0%, #fbe6a6 60%, #f4d068 100%);
  border: 1px solid #d4a017;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(212, 160, 23, 0.15);
  color: #4a3010;
}
.intro-banner-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  line-height: 1.3;
  color: #8b0000;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.intro-banner-title strong { color: #8b0000; font-weight: 700; }
.intro-banner-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #6b4c3b;
  letter-spacing: 0.5px;
  font-family: 'Noto Sans SC', sans-serif;
}
.intro-year-chip {
  display: inline-block;
  padding: 1px 10px;
  background: rgba(139, 0, 0, 0.08);
  border-radius: 6px;
  font-weight: 700;
  color: #8b0000;
  margin-right: 2px;
}
.intro-banner-sell {
  font-size: 13.5px;
  line-height: 1.8;
  color: #4a3010;
  margin-top: 10px;
}
.intro-banner-sell strong { color: #8b0000; font-weight: 700; }
.intro-sell-tag {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 2px;
  background: rgba(139, 0, 0, 0.1);
  color: #8b0000;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12.5px;
}
.intro-banner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.intro-chip {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 999px;
  font-size: 12px;
  color: #6b4c3b;
  font-weight: 500;
}
@media (max-width: 640px) {
  .intro-banner-title { font-size: 18px; }
  .intro-banner-sell { font-size: 12.5px; }
  .intro-chip { font-size: 11px; padding: 3px 8px; }
}

/* ============================================================
   Auspicious Form - Date Range + Event Category
   ============================================================ */
.auspicious-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.auspicious-date-input {
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d4c5a9;
  border-radius: 4px;
  background: #faf7f0;
  color: #4a3010;
  min-width: 145px;
}
.auspicious-date-input:focus {
  outline: none;
  border-color: #8b0000;
}
.auspicious-range-hint {
  font-size: 12px;
  color: #999;
}
.auspicious-event-hint {
  margin-top: 6px;
  padding: 6px 10px;
  background: #fff6d5;
  border-left: 3px solid #d4a017;
  border-radius: 4px;
  font-size: 12px;
  color: #8b5a00;
  line-height: 1.5;
}

/* ============================================================
   Naming Form - Tag Groups for 期望
   ============================================================ */
.naming-tags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
}
.naming-tag {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: #faf7f0;
  border: 1px solid #d4c5a9;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: #6b4c3b;
  transition: all .15s;
  user-select: none;
}
.naming-tag:hover { background: #fff6d5; border-color: #d4a017; }
.naming-tag input[type="checkbox"] {
  display: none;
}
.naming-tag input[type="checkbox"]:checked + span {
  color: #8b0000;
  font-weight: 600;
}
.naming-tag.checked {
  background: linear-gradient(135deg, #fff6d5, #fae6a6);
  border-color: #d4a017;
  color: #8b0000;
}

/* ============================================================
   Fengshui Form - Structured Layout
   ============================================================ */
.fengshui-layout-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.fs-layout-sel {
  width: 68px;
  padding: 6px 4px;
}
.fengshui-layout-row span {
  color: #6b4c3b;
  font-size: 14px;
  margin-right: 4px;
}

/* Floor plan upload zone */
.fs-floorplan-area {
  border: 2px dashed #d4c5a9;
  border-radius: 10px;
  padding: 20px;
  background: #faf7f0;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.fs-floorplan-area:hover {
  border-color: #8b0000;
  background: #fff6d5;
}
.fs-fp-icon { font-size: 40px; margin-bottom: 8px; }
.fs-fp-title {
  font-size: 15px; font-weight: 600; color: #8b0000; margin-bottom: 8px;
}
.fs-fp-hint {
  font-size: 12px; color: #6b4c3b; line-height: 1.8;
}
.fs-fp-hint strong { color: #c41e3a; }
#fengshui-floorplan-preview img {
  max-width: 100%; max-height: 280px; border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.fs-fp-preview-info {
  margin-top: 10px; display: flex; gap: 10px;
  justify-content: center; align-items: center;
  font-size: 12px; color: #6b4c3b;
}
.fs-fp-clear {
  padding: 4px 12px; background: #fff;
  border: 1px solid #d4c5a9; border-radius: 4px;
  color: #8b0000; font-size: 12px; cursor: pointer;
}
.fs-fp-clear:hover { background: #fce8ea; }
.fs-fp-status {
  margin-top: 8px; padding: 6px 10px;
  background: #fdf6ec; border: 1px solid #e8d5b7; border-radius: 6px;
  font-size: 12px; color: #6b4c3b; line-height: 1.5;
}
.fs-fp-status.error {
  background: #fce8ea; border-color: #c41e3a; color: #8b0000;
}

/* Focus checkboxes - max 3 */
.fengshui-focus-row {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.fs-focus-cb {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #faf7f0; border: 1px solid #d4c5a9;
  border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.fs-focus-cb:hover { background: #fff6d5; }
.fs-focus-cb input[type="checkbox"]:checked + span {
  color: #8b0000; font-weight: 600;
}
.fs-focus-cb.checked {
  background: #fff6d5; border-color: #d4a017;
}
.fs-focus-cb.disabled {
  opacity: 0.4; cursor: not-allowed;
}
.fs-focus-cb.disabled:hover { background: #faf7f0; }
.fs-focus-hint {
  font-size: 11px; color: #999; font-weight: 400;
}
.fs-focus-count {
  margin-top: 6px; font-size: 12px; color: #6b4c3b;
}
.fs-focus-count strong { color: #8b0000; }
.fs-focus-count.max { color: #c41e3a; font-weight: 600; }


/* ============================================================
   Palmistry Photo Tips (拍照指南)
   ============================================================ */
.palm-photo-tips {
  margin-top: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fffaf0 0%, #fef5dc 100%);
  border: 1px solid #e5d4b5;
  border-radius: 10px;
  color: #4a3010;
}
.palm-tips-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #8b0000;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d4c5a9;
}
.palm-tips-icon {
  font-size: 20px;
}
.palm-tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.palm-tip-item {
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 160, 23, 0.2);
}
.palm-tip-title {
  font-weight: 700;
  font-size: 13px;
  color: #8b5a00;
  margin-bottom: 6px;
}
.palm-tip-body {
  font-size: 12px;
  color: #6b4c3b;
  line-height: 1.8;
}
.palm-tip-body strong {
  color: #c41e3a;
}
.palm-tips-tradition {
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff6d5 0%, #fde8a6 100%);
  border-left: 3px solid #d4a017;
  border-radius: 4px;
  margin-bottom: 8px;
}
.palm-tips-tradition-title {
  font-size: 13px;
  font-weight: 700;
  color: #8b5a00;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.palm-tips-tradition-title strong {
  color: #c41e3a;
  font-size: 14px;
  padding: 1px 8px;
  background: rgba(196, 30, 58, 0.1);
  border-radius: 4px;
  margin-left: 4px;
}
.palm-tips-tradition-body {
  font-size: 12px;
  color: #6b4c3b;
  line-height: 1.8;
}
.palm-tips-tradition-body strong {
  color: #8b0000;
}
.palm-tip-hilite {
  display: inline-block;
  padding: 1px 6px;
  background: #c41e3a;
  color: #fff !important;
  border-radius: 3px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.palm-tips-avoid {
  padding: 8px 12px;
  background: #fce8ea;
  border-left: 3px solid #c41e3a;
  border-radius: 4px;
  font-size: 12px;
  color: #8b0000;
  line-height: 1.7;
  margin-bottom: 8px;
}
.palm-tips-avoid strong {
  color: #8b0000;
  margin-right: 4px;
}
.palm-tips-sample {
  padding: 8px 12px;
  background: #e8f5e9;
  border-left: 3px solid #2d8a4e;
  border-radius: 4px;
  font-size: 12px;
  color: #1f5e37;
  line-height: 1.7;
}
.palm-tips-sample strong {
  color: #2d8a4e;
}
@media (max-width: 640px) {
  .palm-tips-grid { grid-template-columns: 1fr; }
  .palm-tip-body, .palm-tips-avoid, .palm-tips-sample { font-size: 11.5px; }
}
