/* ============================================
   八字命理 - Modern H5 Design System
   ============================================ */

/* ----- CSS Variables ----- */
:root {
  --gold: #D4A74D;
  --gold-dark: #B8860B;
  --gold-light: #F5E6CC;
  --ink: #1C1C1E;
  --ink-light: #3A3A3C;
  --cream: #FBF9F7;
  --cream-dark: #F5F0EB;
  --white: #FFFFFF;
  --text: #1C1C1E;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border: #F0EDE8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input { font-family: inherit; outline: none; }

.view { display: none; }
.view.active { display: block; }

/* ----- Container ----- */
.container {
  padding: 0 16px 80px;
  max-width: 100%;
  margin: 0 auto;
}

/* ============================================
   TOP NAVIGATION
   ============================================ */
.top-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: row;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 16px;
  padding-bottom: calc(6px + var(--safe-bottom));
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 8px 0 4px;
  font-size: 11px;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nav-item::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 4px;
  border-radius: 6px;
  background: var(--cream-dark);
  transition: background 0.2s;
}

.nav-item[data-nav="home"]::before {
  content: '🏠';
  font-size: 14px;
  line-height: 24px;
}

.nav-item[data-nav="calendar"]::before {
  content: '📅';
  font-size: 14px;
  line-height: 24px;
}

.nav-item[data-nav="research"]::before {
  content: '📖';
  font-size: 14px;
  line-height: 24px;
}

.nav-item[data-nav="case"]::before {
  content: '📋';
  font-size: 14px;
  line-height: 24px;
}

.nav-item[data-nav="profile"]::before {
  content: '👤';
  font-size: 14px;
  line-height: 24px;
}

.nav-item.active {
  color: var(--gold-dark);
}

.nav-item.active::before {
  background: var(--gold-light);
}

.nav-item:active {
  opacity: 0.7;
}

/* ============================================
   HOME HEADER
   ============================================ */
.home-header {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 28px 24px 24px;
  margin: 16px 0 16px;
  background: linear-gradient(145deg, #1a1a2e 0%, #2d2d44 50%, #3d3d5c 100%);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(26,26,46,0.25);
}

.home-header-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hh-deco {
  position: absolute;
  border-radius: 50%;
}

.hh-deco-1 {
  width: 200px;
  height: 200px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(212,167,77,0.15) 0%, transparent 70%);
}

.hh-deco-2 {
  width: 140px;
  height: 140px;
  bottom: -50px;
  left: -30px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}

.home-header-content {
  position: relative;
  z-index: 1;
}

.hh-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hh-greeting {
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.hh-date {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}

.hh-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  display: block;
  letter-spacing: 6px;
  line-height: 1.2;
}

.hh-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 6px;
  letter-spacing: 2px;
  font-weight: 300;
}

.hh-slogan {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid rgba(212,167,77,0.75);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, rgba(212,167,77,0.10) 0%, rgba(212,167,77,0) 100%);
}

.hh-slogan-quote {
  display: block;
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.5px;
  font-weight: 300;
  color: rgba(255,255,255,0.8);
}

/* ============================================
   FUNCTION GRID
   ============================================ */
.func-grid {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.func-grid-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 10px;
}

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

.func-grid-item {
  flex: 1;
  text-align: center;
  padding: 16px 6px;
  border-radius: var(--radius-md);
  background: var(--cream);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.func-grid-item:active {
  transform: scale(0.96);
  background: var(--cream-dark);
}

.func-icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  border-radius: 14px;
  margin: 0 auto 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.func-icon-bazi { background: linear-gradient(135deg, #4e342e, #6d4c41); }
.func-icon-marriage { background: linear-gradient(135deg, #c62828, #ef5350); }
.func-icon-calendar { background: linear-gradient(135deg, #b8860b, #f5c842); }
.func-icon-family { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.func-icon-team { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.func-icon-reverse { background: linear-gradient(135deg, #00695c, #26a69a); }

.func-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-top: 4px;
}

.func-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
}

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold-light);
}

.card-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-light);
  display: block;
  margin-top: 12px;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   FORM
   ============================================ */
.form-card {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  color: var(--ink-light);
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-input {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 15px;
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,167,77,0.1);
  background: var(--white);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-row-datetime {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 16px;
}

.picker-box {
  flex: 1;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  font-size: 13px;
  height: 42px;
  color: var(--text);
  transition: border-color 0.2s;
  min-width: 0;
}

.picker-box:focus {
  border-color: var(--gold);
}

.picker-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-align: center;
}

.date-mode-switch {
  display: flex;
  flex-direction: row;
  background: var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.dm-btn {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.dm-btn.dm-active {
  background: var(--white);
  color: var(--gold-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Gender Toggle */
.gender-toggle {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.gender-btn {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--cream);
  cursor: pointer;
  transition: all 0.2s;
}

.gender-btn.gender-sel {
  border-color: var(--gold-dark);
  background: linear-gradient(135deg, #2d2d44, #3d3d5c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45,45,68,0.2);
}

.gender-icon {
  font-size: 18px;
}

/* 关系角色 toggle（7 项：换行 + 紧凑，避免 flex:1 挤爆一行） */
.role-toggle {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}
.role-toggle .role-btn {
  flex: 0 1 auto;
  min-width: 72px;
  padding: 8px 10px;
  font-size: 13px;
  gap: 4px;
}

/* Unknown Time Toggle */
.unknown-time-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
}

.ut-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--cream);
  transition: all 0.2s;
}

.ut-checkbox.ut-checked {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.ut-checkmark {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.ut-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Buttons */
.btn-submit {
  width: 100%;
  height: 46px;
  line-height: 46px;
  text-align: center;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
  letter-spacing: 2px;
}

.btn-submit:active {
  transform: scale(0.98);
  opacity: 0.9;
}

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

.btn-share {
  width: 100%;
  height: 42px;
  line-height: 42px;
  text-align: center;
  background: var(--white);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-share:active {
  background: var(--cream);
}

/* ============================================
   NOTICE CARD
   ============================================ */
.notice-card {
  background: linear-gradient(135deg, #FFFBEB, #FFF8E1);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.notice-body {
  flex: 1;
}

.notice-text {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.7;
}

/* ============================================
   RESULT
   ============================================ */
.result-section {
  animation: fadeSlideUp 0.35s ease;
}

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

.report-banner {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(26,26,46,0.15);
}

.report-banner-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
  display: block;
}

.report-banner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 4px;
}

.result-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}

.name-badge {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

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

.btn-save {
  font-size: 13px;
  padding: 6px 16px;
  background: var(--gold-dark);
  color: #fff;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-save:active {
  transform: scale(0.95);
  opacity: 0.85;
}

.saved-tag {
  font-size: 12px;
  color: #059669;
  background: #ECFDF5;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.info-item {
  font-size: 13px;
  color: var(--ink-light);
}

/* ============================================
   FOUR PILLARS
   ============================================ */
.bazi-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pillar-grid {
  display: flex;
  flex-direction: column;
  min-width: 300px;
}

.pg-row {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--border);
}

.pg-row:last-child { border-bottom: none; }

.pg-header .pg-cell {
  font-weight: 700;
  color: var(--text);
}

.pg-cell {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  font-size: 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.label-cell {
  flex: 0 0 48px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pillar-title { font-size: 14px; }
.day-col { color: #DC2626; }
.shishen-cell { font-size: 12px; color: var(--ink-light); }
.day-cell { color: #DC2626; font-weight: 700; }

.gan-cell {
  font-size: 22px;
  font-weight: 700;
  padding: 4px;
}

.zhi-cell {
  font-size: 22px;
  font-weight: 700;
  padding: 4px;
}

.day-gan-cell, .day-zhi-cell {
  color: #DC2626;
  font-size: 24px;
}

.has-info {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
  cursor: pointer;
}

/* Wu Xing Colors */
.wx-mu { color: #059669; }
.wx-huo { color: #DC2626; }
.wx-tu { color: #8B5CF6; }
.wx-jin { color: #D97706; }
.wx-shui { color: #2563EB; }

/* Cang Gan */
.cg-cell { flex-direction: column; gap: 1px; padding: 3px 2px; }
.cg-char { font-size: 14px; font-weight: 700; }
.cg-entry { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 3px; width: 100%; }
.cg-ss { font-size: 10px; color: var(--ink-light); }
.cg-pct { font-size: 8px; color: var(--text-tertiary); }
.dishi-cell { font-size: 13px; color: var(--ink-light); }
.nayin-cell { font-size: 12px; color: var(--ink-light); }

.bazi-footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.info-tag {
  font-size: 12px;
  color: var(--ink-light);
  background: var(--cream);
  padding: 4px 12px;
  border-radius: 6px;
}

/* ============================================
   WU XING BARS
   ============================================ */
.wuxing-bar-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wx-label {
  flex: 0 0 24px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.wx-s { font-weight: 900; opacity: 1; }
.wx-m { font-weight: 700; opacity: 0.75; }
.wx-w { font-weight: 400; opacity: 0.45; }

.wx-bar-bg {
  flex: 1;
  height: 14px;
  background: var(--cream-dark);
  border-radius: 7px;
  overflow: hidden;
}

.wx-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}

.wx-bar-fill-mu { background: linear-gradient(90deg, #34D399, #059669); }
.wx-bar-fill-huo { background: linear-gradient(90deg, #F87171, #DC2626); }
.wx-bar-fill-tu { background: linear-gradient(90deg, #A78BFA, #7C3AED); }
.wx-bar-fill-jin { background: linear-gradient(90deg, #FBBF24, #D97706); }
.wx-bar-fill-shui { background: linear-gradient(90deg, #60A5FA, #2563EB); }

.wx-bar-pct-label {
  display: block;
  font-size: 10px;
  color: #fff;
  line-height: 14px;
  padding: 0 6px;
  text-align: right;
  white-space: nowrap;
}

.wx-val {
  flex: 0 0 36px;
  font-size: 13px;
  text-align: right;
  color: var(--ink-light);
  font-weight: 600;
}

.strong { color: #DC2626; font-weight: 700; }
.weak { color: #2563EB; font-weight: 700; }
.medium { color: var(--ink-light); font-weight: 600; }

/* ============================================
   SHEN SHA
   ============================================ */
.shensha-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ss-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.ss-label {
  flex: 0 0 36px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 28px;
}

.ss-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ss-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--ink-light);
}

.tag-good { background: #ECFDF5; border-color: #A7F3D0; color: #059669; }
.tag-bad { background: #FEF2F2; border-color: #FCA5A5; color: #DC2626; }
.tag-neutral { background: #EFF6FF; border-color: #93C5FD; color: #2563EB; }

/* 英文报告里的中文术语注释（小字，从属显示） */
.bz-term-zh { font-size: 0.72em; color: var(--text-secondary); font-weight: 400; white-space: nowrap; }
.bz-glossary { font-size: 13px; line-height: 1.7; color: var(--text); }
.bz-glossary-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.bz-glossary-en { font-weight: 500; color: var(--text); }
.bz-glossary-zh { color: var(--text-secondary); font-size: 12px; }

.no-data {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ============================================
   DAYUN
   ============================================ */
.dayun-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-light);
  margin-bottom: 14px;
}

.dayun-strong {
  font-weight: 700;
  color: var(--text);
}

.ln-current {
  color: #DC2626;
  font-weight: 700;
}

.dayun-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dayun-table {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  /* 自适应容器宽度：禁用 max-content 撑宽（流年释义 max-content 达 432px，会把整表顶到 584px
     导致手机端/窄窗口必须在卡片内左右拖动）。改 min-width:0 后文本靠 overflow-wrap 换行收缩 */
  min-width: 0;
}

.dy-row, .ln-row {
  display: flex;
  flex-direction: row;
}

.dy-th {
  flex: 0 0 44px;
  font-weight: 700;
  background: var(--cream-dark);
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink-light);
}

.dy-fixed, .ln-fixed {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 2px solid var(--border);
}

.col-0 { background: #FEF2F2; }
.col-1 { background: #EFF6FF; }
.col-2 { background: #ECFDF5; }
.col-3 { background: #FFFBEB; }
.col-4 { background: #FAF5FF; }
.col-5 { background: #ECFEFF; }

.dy-td {
  flex: 0 0 68px;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.dy-ganzhi {
  font-weight: 700;
  color: var(--text);
}

/* ── 大运流年：逐年流年四字成语展开区 ── */
.dayun-head {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.dy-toggle {
  flex: 0 0 22px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 10px;
}

.dayun-years {
  display: none;
  width: 100%;
}

.dayun-years.open {
  display: block;
}

.lnn-row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  border-bottom: 1px dashed var(--border);
  padding: 5px 4px;
  font-size: 12px;
}

.lnn-head {
  background: var(--cream-dark);
  font-weight: 700;
  color: var(--ink-light);
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.lnn-year { flex: 0 0 46px; text-align: left; color: var(--text-secondary); }
.lnn-gz   { flex: 0 0 56px; font-weight: 600; }
.lnn-ss   { flex: 0 0 42px; color: var(--text-secondary); }
.lnn-idiom { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.li-zh   { font-weight: 700; margin-right: 4px; }
.li-en   { color: var(--ink-light); font-weight: 400; margin-right: 4px; }
.li-mean { display: block; color: var(--text-secondary); margin-top: 2px; }
.li-hint { display: block; color: var(--ink-light); margin-top: 2px; font-size: 11px; }

.dayun-tip {
  font-size: 11px;
  color: var(--ink-light);
  margin-top: 6px;
  line-height: 1.5;
}

/* 手机窄屏：逐年流年改「堆叠卡片式」——年份/干支/十神一行、成语+释义+建议整行独占一行，
   彻底免横向拖动（配合 .dayun-table{min-width:0}）。PC（>560px）保持横排列式不变 */
@media (max-width: 560px) {
  .lnn-head { display: none; }
  .lnn-row  { flex-wrap: wrap; }
  .lnn-idiom { flex: 1 1 100%; }
}

.ln-th {
  flex: 0 0 68px;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
  background: var(--cream-dark);
  font-weight: 600;
  color: var(--ink-light);
}

.ln-label {
  flex: 0 0 44px;
  font-size: 10px;
  color: var(--text-secondary);
}

.ln-td {
  flex: 0 0 68px;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
}

.ln-curr {
  background: #FFFBEB !important;
  border-color: var(--gold) !important;
}

.ln-cell-year {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  line-height: 1.2;
}

.ln-cell-ganzhi {
  font-size: 12px;
  font-weight: 700;
  display: block;
  line-height: 1.2;
  color: var(--text);
}

/* ============================================
   PLAIN SUMMARY
   ============================================ */
.plain-summary {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: #FFFBEB;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold);
}

/* ============================================
   JING DIAN / COMPREHENSIVE
   ============================================ */
.row-2col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jingdian-item {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.jingdian-subtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

.jingdian-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jd-field {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.jd-val {
  font-weight: 700;
  color: #DC2626;
}

/* Comprehensive */
.comp-item {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.comp-subtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.comp-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-field { font-size: 13px; color: var(--text); line-height: 1.6; }
.cp-val { font-weight: 700; color: var(--ink-light); }
.cp-val-strong { font-weight: 700; color: #DC2626; }
.cp-highlight { color: var(--ink-light); font-style: italic; margin-top: 4px; }

.cp-section-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  margin-bottom: 4px;
}

.cp-analysis-line {
  padding-left: 8px;
  border-left: 2px solid var(--gold-light);
  margin-bottom: 2px;
}

.cp-divider {
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 6px;
}

.comp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Ratings */
.ratings-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 6px;
  padding: 12px;
  background: var(--cream);
  border-radius: var(--radius-md);
}

.rating-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.rating-label {
  flex: 0 0 64px;
  font-size: 12px;
  color: var(--ink-light);
  font-weight: 600;
}

.rating-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transition: width 0.4s ease;
}

.rating-score {
  flex: 0 0 38px;
  font-size: 12px;
  color: var(--ink-light);
  text-align: right;
  font-weight: 600;
}

/* CJ Sections */
.cj-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.cj-section-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.cj-strength-title { color: #059669; }
.cj-weakness-title { color: #DC2626; }
.cj-suggest-title { color: var(--ink-light); }

.cj-item {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  padding: 2px 0;
}

.cj-strength { color: #059669; }
.cj-weakness { color: var(--text-tertiary); }
.cj-suggest { color: var(--text); }

/* ============================================
   MARRIAGE SCORE
   ============================================ */
.hy-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.hy-score-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.hy-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--cream-dark);
  border-radius: 5px;
  overflow: hidden;
}

.hy-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transition: width 0.4s;
}

.hy-score-text {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.hy-excellent { color: #059669; }
.hy-good { color: var(--ink-light); }
.hy-fair { color: var(--gold-dark); }
.hy-poor { color: #DC2626; }

/* ============================================
   CHILD BAR
   ============================================ */
.child-bar-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.child-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  flex: 0 0 auto;
}

.child-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--cream-dark);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  min-width: 40px;
}

.child-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.child-bar-son {
  background: linear-gradient(90deg, #818CF8, #6366F1);
}

.child-bar-daughter {
  background: linear-gradient(90deg, #F472B6, #EC4899);
}

/* ============================================
   GX ITEMS
   ============================================ */
.gx-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.gx-item:last-child { border-bottom: none; }

.gx-detail {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* ============================================
   POPUP
   ============================================ */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 360px;
  width: 100%;
  max-height: 75vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

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

.popup-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 12px;
}

.popup-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.popup-close {
  font-size: 24px;
  color: var(--text-tertiary);
  padding: 2px 6px;
  cursor: pointer;
  transition: color 0.2s;
}

.popup-close:hover { color: var(--text); }

.popup-body {
  padding: 12px 20px 20px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  max-height: 50vh;
  overflow-y: auto;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 2000;
  text-align: center;
  pointer-events: none;
  animation: toastAnim 2.2s ease forwards;
  max-width: 80%;
}

@keyframes toastAnim {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0.9); }
  12% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============================================
   CALENDAR
   ============================================ */
.today-banner {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  margin: 0 0 12px;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: #FEFEFE;
  box-shadow: 0 4px 16px rgba(26,26,46,0.12);
}

.today-title {
  font-size: 16px;
  font-weight: 700;
  display: block;
}

.today-lunar {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  display: block;
  margin-top: 2px;
}

.today-ganzhi {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 2px;
}

.today-shichen {
  font-size: 13px;
  color: var(--gold);
  display: block;
  margin-top: 4px;
  font-weight: 600;
}

.today-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.today-tag {
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  padding: 3px 12px;
  border-radius: 20px;
  color: rgba(255,255,255,0.8);
}

.term-tag {
  background: var(--gold);
  color: #1a1a2e;
  font-weight: 600;
}

.mode-switch {
  display: flex;
  flex-direction: row;
  margin: 0 0 12px;
  background: var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.mode-btn {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.mode-active {
  background: var(--white);
  color: var(--gold-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.cal-header {
  background: var(--white);
  margin: 0 0 10px;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

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

.nav-btn {
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 22px;
  color: var(--ink-light);
  background: var(--cream);
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:active {
  background: var(--gold-light);
  color: var(--gold-dark);
}

.cal-picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cal-picker-row select {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding: 6px 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
}

.cal-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.cal-today-btn {
  text-align: center;
  padding: 6px 0 0;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cal-today-btn:active { opacity: 0.6; }

.cal-weekday-row {
  display: flex;
  padding: 0;
}

.cal-weekday {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.wd-sun, .wd-sat { color: #DC2626; }

.cal-grid {
  margin: 0 0 16px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.cal-week { display: flex; }
.cal-cell { flex: 1; aspect-ratio: 0.85; padding: 2px; }

.cal-day-bg {
  height: 100%;
  border-radius: var(--radius-sm);
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-day-bg:active { background: var(--cream); }

.cal-today {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  box-shadow: 0 2px 8px rgba(212,167,77,0.3);
}

.cal-term { background: #FFFBEB; }

.cal-day-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.cal-today-text { color: #fff !important; }
.cal-weekend { color: #DC2626; }

.cal-lunar-day {
  font-size: 9px;
  color: var(--text-tertiary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.cal-today .cal-lunar-day { color: rgba(255,255,255,0.85); }

.cal-ganzhi {
  font-size: 9px;
  line-height: 1.1;
  font-weight: 500;
}

.cal-jianchu {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-light);
  line-height: 1.2;
}

.cal-term-tag {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 7px;
  background: var(--gold);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.2;
}

/* Day Detail */
.detail-card {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 40px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.detail-header { margin-bottom: 16px; }

.detail-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-solar {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.detail-close {
  font-size: 24px;
  color: var(--text-tertiary);
  padding: 4px 8px;
  cursor: pointer;
}

.detail-lunar {
  font-size: 14px;
  color: var(--ink-light);
  margin-top: 4px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dtag {
  font-size: 12px;
  background: var(--cream);
  padding: 4px 14px;
  border-radius: 20px;
  color: var(--ink-light);
}

.dtag-term {
  background: var(--gold-light);
  color: var(--gold-dark);
  font-weight: 600;
}

.detail-ganzhi-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.gz-item {
  flex: 1;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

.gz-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.gz-val {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.gz-highlight { color: #DC2626; }

.detail-jianchu-row {
  background: var(--gold-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.jc-label { font-size: 12px; color: var(--text-secondary); }
.jc-val { font-size: 17px; font-weight: 700; color: #DC2626; }
.jc-meaning { font-size: 13px; color: var(--ink-light); }

.detail-section { margin-bottom: 14px; }

.section-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.yi-title { color: #059669; }
.ji-title { color: #DC2626; }
.shichen-title { color: var(--text); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-yi {
  font-size: 13px;
  background: #ECFDF5;
  color: #059669;
  padding: 5px 16px;
  border-radius: 20px;
  font-weight: 500;
  display: inline-block;
}

.tag-ji {
  font-size: 13px;
  background: #FEF2F2;
  color: #DC2626;
  padding: 5px 16px;
  border-radius: 20px;
  font-weight: 500;
  display: inline-block;
}

.shichen-scroll {
  width: 100%;
  overflow-x: auto;
  margin-top: 8px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.shichen-grid {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.shichen-item {
  flex: 0 0 130px;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.shichen-current {
  background: #FFFBEB;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.shichen-time {
  font-size: 12px;
  color: var(--ink-light);
  font-weight: 600;
  display: block;
}

.shichen-ganzhi {
  font-size: 15px;
  color: #DC2626;
  font-weight: 700;
  display: block;
  margin: 4px 0 6px;
}

.shichen-yi-list, .shichen-ji-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.tag-shichen-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

/* ============================================
   MARRIAGE PAGE
   ============================================ */
.dual-form {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.person-form {
  flex: 1;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px;
}

.person-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 10px;
  text-align: center;
}

.person-title.male { color: #2563EB; }
.person-title.female { color: #DC2626; }

.picker-row {
  display: flex;
  flex-direction: row;
  gap: 4px;
}

.picker-box-sm {
  flex: 1;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: 5px 2px;
  text-align: center;
  font-size: 11px;
  height: 34px;
  color: var(--text);
  min-width: 0;
}

.btn-calc {
  width: 100%;
  height: 46px;
  line-height: 46px;
  text-align: center;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  padding: 0;
  margin-top: 14px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.btn-calc:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.score-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.score-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.score-detail { flex: 1; }

.score-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.score-desc {
  font-size: 13px;
  color: var(--ink-light);
  display: block;
  margin-top: 2px;
}

.score-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  display: block;
  margin-top: 4px;
}

.bazi-compare {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.bazi-col {
  flex: 1;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 10px;
}

.bazi-col-title {
  font-size: 13px;
  font-weight: 700;
  display: block;
  text-align: center;
  margin-bottom: 4px;
}

.bazi-col-sub {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  text-align: center;
  margin-bottom: 6px;
}

.pillar-row {
  display: flex;
  flex-direction: row;
  gap: 3px;
  margin-bottom: 4px;
}

.pillar-label {
  flex: 0 0 26px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 24px;
}

.pillar-cell {
  flex: 1;
  text-align: center;
  padding: 3px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
}

.analysis-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.analysis-item:last-child { border-bottom: none; }

.analysis-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.analysis-tags {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.analysis-desc {
  font-size: 13px;
  color: var(--ink-light);
}

/* ===== WX Bars (Marriage) ===== */
.wx-bar-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.wx-bar-item:last-child { border-bottom: none; }

.wx-bar-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.wx-bar-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 2px;
}

.wx-bar-row-2 {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.wx-bar-side {
  flex: 0 0 18px;
  font-size: 11px;
  color: var(--ink-light);
  text-align: center;
}

.wx-bar-bg {
  flex: 1;
  height: 12px;
  background: var(--cream-dark);
  border-radius: 6px;
  overflow: hidden;
}

.wx-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.wx-bar-fill-mu { background: linear-gradient(90deg, #A7F3D0, #059669); }
.wx-bar-fill-huo { background: linear-gradient(90deg, #FCA5A5, #DC2626); }
.wx-bar-fill-tu { background: linear-gradient(90deg, #DDD6FE, #7C3AED); }
.wx-bar-fill-jin { background: linear-gradient(90deg, #FDE68A, #D97706); }
.wx-bar-fill-shui { background: linear-gradient(90deg, #93C5FD, #2563EB); }

.wx-bar-pct {
  flex: 0 0 38px;
  font-size: 12px;
  color: var(--ink-light);
  text-align: right;
  font-weight: 600;
}

.wx-bar-comment {
  font-size: 12px;
  display: block;
  margin-top: 2px;
  padding-left: 26px;
}

.comment-warn { color: #DC2626; }
.comment-neutral { color: var(--ink-light); }

/* ===== Marriage Pillar-Grid（排盘模式并排，紧凑化覆盖主盘 grid） ===== */
.bazi-compare .pillar-grid { min-width: 0; flex: 1; }
.bazi-compare .pg-cell { padding: 5px 2px; font-size: 12px; }
.bazi-compare .label-cell { flex: 0 0 24px; font-size: 9px; }
.bazi-compare .pillar-title { font-size: 12px; }
.bazi-compare .gan-cell, .bazi-compare .zhi-cell { font-size: 17px; padding: 2px; }
.bazi-compare .shishen-cell { font-size: 10px; }
.bazi-compare .cg-char { font-size: 12px; }
.bazi-compare .cg-ss { font-size: 9px; }
.bazi-compare .cg-pct { font-size: 9px; }

/* ===== Marriage WX（参考合伙人显示方式：图例 + 融合横条） ===== */
.wx-pair-head { display: flex; flex-direction: row; align-items: center; gap: 6px; margin-top: 6px; margin-bottom: 4px; }
.wx-pair-spacer { flex: 0 0 24px; }
.wx-pair-name { flex: 1; text-align: center; font-size: 11px; font-weight: 600; }
.wx-pair-row { display: flex; flex-direction: row; align-items: center; gap: 6px; margin-bottom: 4px; }
.wx-pair-el { flex: 0 0 24px; text-align: center; font-weight: 700; font-size: 13px; }
.wx-pair-bar { flex: 1; display: flex; flex-direction: row; height: 16px; border-radius: 4px; overflow: hidden; background: #F0EDE8; }
.wx-pair-seg { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; white-space: nowrap; min-width: 0; }

/* ============================================
   FAMILY PAGE
   ============================================ */
.member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-card {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  border: 1px solid var(--border);
}

.member-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.member-idx {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.member-name-input {
  flex: 1;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
  background: var(--white);
  transition: border-color 0.2s;
}

.member-name-input:focus {
  border-color: var(--gold);
}

.btn-remove {
  font-size: 20px;
  color: #DC2626;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-remove:active { opacity: 1; }

.role-selector {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.role-tag {
  padding: 4px 12px;
  font-size: 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--ink-light);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
}

.role-tag.sel {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-color: transparent;
}

.gender-tabs {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.gender-tab {
  flex: 1;
  text-align: center;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.gender-tab.sel {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-color: transparent;
}

.btn-add {
  width: 100%;
  height: 42px;
  line-height: 42px;
  text-align: center;
  border: 1.5px dashed var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: none;
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add:active {
  background: var(--cream);
  border-color: var(--gold);
  color: var(--gold-dark);
}

.family-summary, .team-summary {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 14px;
}

.summary-item {
  flex: 1;
  text-align: center;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border);
}

.summary-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.summary-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.member-bazi-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-bazi-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.member-bazi-card:nth-child(odd) { background: var(--cream); }
.member-bazi-card:nth-child(even) { background: var(--white); }

.member-bazi-header {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.member-bazi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.pair-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pair-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  border-left: 3px solid var(--border);
}

.pair-card.good { border-left-color: #059669; }
.pair-card.bad { border-left-color: #DC2626; }

.pair-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.pair-detail {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.6;
}

.pair-tags {
  margin-top: 6px;
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
}

.guide-card {
  background: linear-gradient(135deg, #FFFBEB, var(--white));
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  border-left: 3px solid var(--gold);
}

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

/* ============================================
   PARTNERSHIP
   ============================================ */
.member-chart {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.member-chart:last-child { border-bottom: none; }

.chart-name {
  flex: 0 0 42px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chart-sub {
  font-size: 11px;
  color: var(--text-secondary);
  flex: 0 0 42px;
}

.chart-bar-bg {
  flex: 1;
  height: 18px;
  background: var(--cream-dark);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}

.chart-bar-seg { height: 100%; }
.chart-bar-mu { background: #34D399; }
.chart-bar-huo { background: #F87171; }
.chart-bar-tu { background: #A78BFA; }
.chart-bar-jin { background: #FBBF24; }
.chart-bar-shui { background: #60A5FA; }

.wx-legend {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-light);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.wx-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wx-stat-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.analysis-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-line;
}

/* ============================================
   REVERSE
   ============================================ */
.pillar-input-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

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

.pillar-label-rev {
  flex: 0 0 44px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
  border-radius: 6px;
  color: #fff;
}

.pillar-year { background: #78716C; }
.pillar-month { background: #6D4C41; }
.pillar-day { background: #4e342e; }
.pillar-hour { background: #2d2d44; }

.pg-box {
  flex: 1;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
}

.pg-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
}

.pg-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.pillar-combo {
  flex: 0 0 48px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.pillar-combo-day { color: #DC2626; font-size: 18px; }

.range-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.range-box {
  flex: 1;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  height: 44px;
}

.range-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
}

.range-sep {
  color: var(--text-secondary);
  font-size: 13px;
}

.btn-search {
  width: 100%;
  height: 46px;
  line-height: 46px;
  text-align: center;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.btn-search:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.example-hint {
  text-align: center;
  font-size: 13px;
  color: var(--gold-dark);
  margin-top: 10px;
  padding: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.example-hint:active { opacity: 0.6; }

.result-summary {
  font-size: 14px;
  color: var(--ink-light);
  display: block;
}

.count-num {
  font-size: 20px;
  font-weight: 700;
  color: #DC2626;
}

.err-text { color: #DC2626; }

.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold);
  transition: background 0.2s;
}

.ri-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ri-solar {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.ri-lunar {
  font-size: 12px;
  color: var(--text-secondary);
}

.ri-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ri-ganzhi {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.ri-hour {
  font-size: 11px;
  color: var(--gold-dark);
}

.btn-chart-mini {
  margin-top: 4px;
  padding: 3px 10px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: none;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-chart-mini:hover {
  background: var(--gold);
  color: #fff;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 36px 24px 28px;
  margin: 16px 0 20px;
  background: linear-gradient(145deg, #1a1a2e 0%, #2d2d44 40%, #3d3d5c 100%);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(26,26,46,0.25);
}

.profile-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ph-deco {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,167,77,0.12) 0%, transparent 70%);
}

.ph-deco-1 { width: 200px; height: 200px; top: -60px; right: -40px; }
.ph-deco-2 { width: 140px; height: 140px; bottom: -30px; left: -20px; }
.ph-deco-3 { width: 100px; height: 100px; bottom: 40px; right: 30px; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%); }

.profile-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ph-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 16px;
}

.ph-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 4px 20px rgba(212,167,77,0.35);
  position: relative;
  z-index: 1;
}

.ph-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(212,167,77,0.3);
  animation: phPulse 2.5s ease-in-out infinite;
}

@keyframes phPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.06); opacity: 0.15; }
}

.ph-name-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ph-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: none;
  border: none;
  outline: none;
  text-align: center;
  max-width: 160px;
  padding: 2px 8px;
  border-radius: 6px;
  caret-color: var(--gold);
  transition: background 0.2s;
}

.ph-name:focus { background: rgba(255,255,255,0.08); }
.ph-name::placeholder { color: rgba(255,255,255,0.35); }

.ph-badge {
  font-size: 10px;
  padding: 3px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a2e;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ph-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 3px;
  font-weight: 300;
}

/* Stats */
.profile-stats {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-bottom: 20px;
}

.ps-item {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.ps-item:active {
  transform: scale(0.95);
}

.ps-icon { font-size: 24px; margin-bottom: 6px; }

.ps-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.ps-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Menu */
.profile-menu {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.pm-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.pm-item:last-child { border-bottom: none; }
.pm-item:active { background: var(--cream); }

.pm-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 16px;
}

.pm-icon svg { width: 22px; height: 22px; }

.pm-icon-saved { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); color: #2563EB; }
.pm-icon-share { background: linear-gradient(135deg, #FEF2F2, #FEE2E2); color: #DC2626; }
.pm-icon-clear { background: linear-gradient(135deg, var(--cream), var(--cream-dark)); color: var(--ink-light); }

.pm-text { flex: 1; min-width: 0; }

.pm-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pm-desc {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.pm-arrow {
  font-size: 22px;
  color: var(--border);
  flex-shrink: 0;
  margin-left: 8px;
  font-weight: 300;
}

/* Footer */
.profile-footer {
  text-align: center;
  padding: 12px 0 24px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.pf-text {
  font-size: 11px;
  color: var(--text-tertiary);
}

.pf-divider {
  font-size: 11px;
  color: var(--border);
}

/* ============================================
   SAVED BAZI
   ============================================ */
.header-bar {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 16px 0 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(26,26,46,0.15);
}

.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.header-icon { font-size: 28px; }
.header-text { flex: 1; }

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.header-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 2px;
}

.header-count {
  background: rgba(255,255,255,0.1);
  padding: 6px 16px;
  border-radius: 20px;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 2px;
}

.header-count .count-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-light);
}

.header-count .count-unit {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.saved-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

.card-strip {
  width: 4px;
  flex-shrink: 0;
  align-self: stretch;
}

.strip-male { background: linear-gradient(180deg, #60A5FA, #2563EB); }
.strip-female { background: linear-gradient(180deg, #F87171, #DC2626); }

.saved-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 0 0 14px;
}

.avatar-male { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.avatar-female { background: linear-gradient(135deg, #DC2626, #EF4444); }

.avatar-gender {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.avatar-sx {
  font-size: 9px;
  color: rgba(255,255,255,0.85);
  line-height: 1;
  margin-top: 1px;
}

/* ===== 出生地全球定位 ===== */
.city-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.city-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.city-select-row select {
  flex: 1;
}
.btn-locate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-locate:hover {
  background: var(--cream-dark);
  border-color: var(--gold);
}
.btn-locate:active {
  transform: scale(0.96);
}
.btn-locate.locating {
  opacity: 0.7;
  pointer-events: none;
}
.btn-locate .locate-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.city-coord-inputs {
  display: none;
  gap: 8px;
}
.city-coord-inputs.show {
  display: flex;
}
.city-coord-inputs .coord-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.city-coord-inputs .coord-group label {
  font-size: 11px;
  color: var(--text-secondary);
}
.city-coord-inputs .coord-group input {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.city-coord-inputs .coord-group input:focus {
  border-color: var(--gold);
}
.city-locate-status {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
  display: none;
}
.city-locate-status.show {
  display: block;
}
.city-locate-status.success {
  color: #52c41a;
}
.city-locate-status.error {
  color: #ef4444;
}

.saved-info {
  flex: 1;
  min-width: 0;
  padding: 14px 14px 14px 16px;
}

.info-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.saved-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.saved-age {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--cream);
  padding: 2px 10px;
  border-radius: 20px;
}

.saved-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.info-tags {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.tag-gender, .tag-sx {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  line-height: 1.8;
}

.tag-male { background: #EFF6FF; color: #2563EB; }
.tag-female { background: #FEF2F2; color: #DC2626; }

.card-arrow {
  font-size: 22px;
  color: var(--border);
  padding-right: 16px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  margin-top: 10px;
}

.empty-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-icon { font-size: 38px; }

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 28px;
  line-height: 1.6;
}

.empty-btn {
  display: inline-block;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  padding: 12px 36px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.empty-btn:active {
  transform: scale(0.95);
  opacity: 0.9;
}

.bottom-bar {
  text-align: center;
  padding: 20px 0 10px;
}

.refresh-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:active {
  background: var(--cream);
}

/* ============================================
   PROFILE COLORS
   ============================================ */
.member-idx.role-father { background: #2563EB; }
.member-idx.role-mother { background: #DC2626; }
.member-idx.role-husband { background: #059669; }
.member-idx.role-wife { background: #EC4899; }
.member-idx.role-son { background: #F59E0B; }
.member-idx.role-daughter { background: #8B5CF6; }
.member-idx.role-elder { background: #0D9488; }
.member-idx.role-other { background: var(--ink-light); }

/* ============================================
   GOLD ACCENT
   ============================================ */
.gold-text { color: var(--gold-dark); font-weight: 700; }
.gold-bg { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #fff; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 380px) {
  .dual-form { flex-direction: column; }
  .bazi-compare { flex-direction: column; }
  .func-grid-row { gap: 6px; }
  .func-grid-item { padding: 12px 4px; }
  .func-icon { width: 40px; height: 40px; line-height: 40px; font-size: 17px; }
  .func-label { font-size: 12px; }
}

@media (min-width: 420px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
    max-width: 480px;
    margin: 0 auto;
  }
  .top-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ============================================
   BaziReading Brand Additions
   ============================================ */

/* Badge Row */
.hh-badge-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hh-badge {
  font-size: 11px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  padding: 3px 12px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

/* Section Label */
.section-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-light);
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 16px;
  text-align: center;
  color: #fff;
}
.cta-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-light);
  display: block;
  margin-bottom: 8px;
}
.cta-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-bottom: 14px;
  line-height: 1.6;
}
.btn-cta {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a2e;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.btn-cta:active { transform: scale(0.96); }

/* Research Hero */
.research-hero {
  background: linear-gradient(135deg, #1a1a2e, #2d2d44);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 16px;
  color: #fff;
}
.research-hero-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  display: block;
  margin-bottom: 10px;
}
.research-hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  display: block;
  line-height: 1.7;
}

/* Research Stats */
.research-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.rs-item {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  border: 1px solid var(--border);
}
.rs-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-dark);
  display: block;
}
.rs-label {
  font-size: 10px;
  color: var(--text-tertiary);
  display: block;
  margin-top: 4px;
}

/* Research List */
.research-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.research-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.research-card:active { background: var(--cream); }
.rc-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 8px;
}
.rc-tag-new { background: #DC2626; color: #fff; }
.rc-tag-featured { background: var(--gold); color: #1a1a2e; }
.rc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
  line-height: 1.4;
}
.rc-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 8px;
}
.rc-desc {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  line-height: 1.5;
}

/* Research Detail */
.research-detail {
  animation: fadeSlideUp 0.3s ease;
}
.btn-back {
  font-size: 14px;
  color: var(--gold-dark);
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 16px;
}
.rd-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.rd-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
}
.rd-tags { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.rd-tag {
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.rd-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}
.rd-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.rd-content p {
  margin-bottom: 12px;
  color: var(--ink-light);
}

/* Research CTA */
.research-cta {
  background: linear-gradient(135deg, #FFFBEB, #FFF8E1);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  text-align: center;
}
.rcta-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}
.rcta-desc {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 12px;
  line-height: 1.6;
}
.rcta-btn {
  display: inline-block;
  padding: 8px 24px;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* ============================================
   CASE STUDY
   ============================================ */
.case-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 32px 24px 28px;
  margin: 16px 0;
  background: linear-gradient(145deg, #1a1a2e 0%, #2d2d44 50%, #3d3d5c 100%);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(26,26,46,0.25);
}

.case-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 30%, rgba(212,167,77,0.1) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(212,167,77,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.case-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-hero-tag {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.case-hero-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  letter-spacing: 1px;
}

.case-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.case-section {
  margin-bottom: 20px;
}

.case-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding: 0 2px;
}

.cst-icon {
  font-size: 18px;
}

.case-card {
  padding: 20px;
}

.case-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

.case-text strong {
  color: var(--text);
  font-weight: 600;
}

.case-info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.case-info-item {
  flex: 1;
  min-width: calc(50% - 10px);
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cii-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.cii-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* WX Summary */
.wx-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--cream);
  border-radius: var(--radius-sm);
}

.ws-label {
  flex: 0 0 48px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ws-value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.wx-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.wx-tag-huo { background: rgba(220,38,38,0.1); color: #DC2626; }
.wx-tag-mu { background: rgba(5,150,105,0.1); color: #059669; }
.wx-tag-tu { background: rgba(139,92,246,0.1); color: #7C3AED; }
.wx-tag-jin { background: rgba(217,119,6,0.1); color: #D97706; }
.wx-tag-shui { background: rgba(37,99,235,0.1); color: #2563EB; }

.wx-value-label {
  flex: 0 0 32px;
  font-size: 13px;
  color: var(--ink-light);
  font-weight: 600;
  text-align: right;
}

/* Case Subsections */
.case-subsection {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.case-subsection:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.css-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.css-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cssg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.cssg-label {
  flex: 0 0 80px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cssg-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 0 0 auto;
}

.cssg-desc {
  font-size: 12px;
  color: var(--text-secondary);
  width: 100%;
  margin-top: 2px;
}

/* Insight list */
.case-insight-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cil-item {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 4px 0;
}

/* Direction grid */
.case-dir-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.cdg-block {
  flex: 1;
  min-width: calc(50% - 8px);
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cdg-block-wide {
  min-width: calc(100% - 0px);
}

.cdg-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cdg-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.cdg-val-huo {
  color: #DC2626;
}

.case-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-tag {
  font-size: 12px;
  padding: 4px 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
}

/* Da Yun card */
.case-dy-card {
  background: linear-gradient(135deg, #fefce8, #fff);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.cdc-header {
  padding: 12px 16px;
  background: rgba(253,230,138,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #fde68a;
}

.cdc-label {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
}

.cdc-age {
  font-size: 12px;
  color: #a16207;
  font-weight: 500;
}

.cdc-body {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cdc-pillars {
  flex: 0 0 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cdc-gan {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.cdc-zhi {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.cdc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cdc-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.cdc-rl {
  flex: 0 0 80px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.cdc-rv {
  color: var(--text);
  font-weight: 500;
}

.cdc-row-imp .cdc-rv {
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

/* Year card */
.case-year-card {
  background: linear-gradient(135deg, #fef2f2, #fff);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.cyc-header {
  padding: 12px 16px;
  background: rgba(254,202,202,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #fecaca;
}

.cyc-label {
  font-size: 14px;
  font-weight: 700;
  color: #991b1b;
}

.cyc-year {
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
}

/* ============================================
   CHAT CONSULTANT
   ============================================ */
.chat-msg {
  display: flex;
  margin-bottom: 2px;
}

.chat-msg-bot {
  justify-content: flex-start;
}

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-bot-thinking {
  justify-content: flex-start;
  opacity: 0.6;
}

.chat-msg-content {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-msg-bot .chat-msg-content {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.chat-msg-user .chat-msg-content {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-bot-thinking .chat-msg-content {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-secondary);
  font-style: italic;
}

.chat-msg-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-topic-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.chat-topic-btn:active {
  background: var(--cream-dark);
  transform: scale(0.96);
}

.chat-followup-btn {
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--cream-dark);
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.chat-followup-btn:active {
  background: var(--gold-light);
  border-color: var(--gold);
  color: var(--gold-dark);
}

.cyc-body {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cyc-pillars {
  flex: 0 0 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cyc-gan {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.cyc-zhi {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.cyc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cyc-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.cyc-rl {
  flex: 0 0 60px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.cyc-rv {
  color: var(--text);
  font-weight: 500;
}

.cyc-row-imp .cyc-rv {
  color: #991b1b;
  font-size: 12px;
  line-height: 1.5;
}

/* Future years chips */
.case-fy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.fy-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
  flex: 0 0 auto;
}

.fy-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
}

.fy-year {
  color: var(--text-secondary);
  font-weight: 500;
}

.fy-ganzhi {
  font-weight: 700;
  color: var(--text);
}

.fy-shishen {
  color: var(--text-tertiary);
  font-size: 11px;
  padding: 1px 6px;
  background: #fff;
  border-radius: 8px;
}

/* Framework steps */
.case-framework {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.cf-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.cf-num {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cf-body {
  flex: 1;
  padding-top: 4px;
}

.cf-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.cf-desc {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Rating grid */
.case-rating-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--cream);
  border-radius: var(--radius-sm);
}

.cr-label {
  flex: 0 0 72px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.cr-stars {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 2px;
}

.cr-desc {
  width: 100%;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Case CTA */
.case-cta {
  background: linear-gradient(145deg, #1a1a2e 0%, #2d2d44 50%, #3d3d5c 100%);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(26,26,46,0.25);
}

.case-cta-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.case-cta-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  max-width: 400px;
}

.case-cta .btn-cta {
  margin-top: 4px;
}

/* ============================================
   LANGUAGE TOGGLE
   ============================================ */
.lang-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  user-select: none;
  letter-spacing: 0;
}

.lang-toggle:active {
  transform: scale(0.9);
}

.lang-toggle.zh {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #fff;
  box-shadow: 0 4px 16px rgba(212,167,77,0.3);
}

.nav-label {
  display: inline;
}

/* ============================================
   AUTH MODAL
   ============================================ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.auth-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%; max-width: 360px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.auth-close {
  position: absolute; top: 12px; right: 16px;
  font-size: 24px; color: var(--text-tertiary);
  cursor: pointer; line-height: 1;
}

.auth-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.auth-tab {
  flex: 1; text-align: center; padding: 10px 0;
  font-weight: 600; font-size: 15px; color: var(--text-tertiary);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}

.auth-tab-active {
  color: var(--gold-dark); border-bottom-color: var(--gold);
}

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

.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

.auth-error { font-size: 12px; color: #DC2626; min-height: 16px; }

/* 忘记密码：登录框底部链接 + 两步式视图状态/返回 */
.auth-forgot-link { text-align: right; font-size: 13px; color: var(--gold-dark); cursor: pointer; margin-top: -6px; }
.auth-forgot-link:hover { text-decoration: underline; }
.auth-status { font-size: 12px; color: #059669; min-height: 16px; white-space: normal; line-height: 1.5; }
.auth-back { text-align: center; font-size: 13px; color: var(--text-tertiary); cursor: pointer; margin-top: 4px; }
.auth-back:hover { color: var(--gold-dark); }

/* 语音输入：麦克风按钮 + 行容器 */
.mic-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.mic-row > input,
.mic-row > textarea { flex: 1; min-width: 0; }
.mic-row > .member-name-input { flex: 1; min-width: 0; }
.mic-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--cream-dark);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mic-btn:hover { border-color: var(--gold); background: var(--gold-light); }
.mic-btn.mic-active {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

/* 目的多选 chips（注册 / 目的对话框） */
.purpose-chips .chip, #dlgPurpose .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--cream-dark);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.purpose-chips .chip:has(input:checked), #dlgPurpose .chip:has(input:checked) {
  background: var(--gold-light);
  border-color: var(--gold);
  color: var(--gold-dark);
  font-weight: 600;
}
.purpose-chips .chip input, #dlgPurpose .chip input { accent-color: var(--gold); }

.auth-user-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
}

.auth-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.auth-email { font-size: 12px; color: var(--text-tertiary); }

.auth-btn-login {
  padding: 6px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: var(--gold); font-size: 12px; font-weight: 600;
  border: none; cursor: pointer;
}

.auth-btn-logout {
  padding: 6px 12px; border-radius: 10px;
  background: #FEF2F2; border: 1px solid #FCA5A5;
  font-size: 12px; color: #DC2626; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.auth-btn-logout:hover { background: #DC2626; color: #fff; }

.auth-btn-switch {
  padding: 6px 12px; border-radius: 10px;
  background: var(--gold-light); border: 1px solid var(--gold);
  font-size: 12px; color: var(--gold-dark); font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.auth-btn-switch:hover { background: var(--gold); color: #fff; }

.lunar-info {
  cursor: pointer; color: var(--text-tertiary); font-size: 11px;
  display: inline-block; margin-left: 2px;
  transition: color 0.2s;
}
.lunar-info:hover { color: var(--gold); }

.advice-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.advice-item:last-child { border-bottom: none; }
.advice-icon { flex: 0 0 28px; font-size: 20px; text-align: center; line-height: 1.6; }
.advice-body { flex: 1; }
.advice-title { display: block; font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.advice-text { display: block; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.child-summary {
  padding: 10px 14px; background: var(--cream);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: 13px; color: var(--text); line-height: 1.6;
}

/* ===== Payment Modal ===== */
.pay-plan {
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  background: var(--white);
}
.pay-plan:hover {
  border-color: var(--gold);
  background: var(--cream-dark);
}
.pay-plan.selected {
  border-color: var(--gold-dark);
  background: #faf5f0;
}
.pay-plan .pay-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Credits stat in profile */
.ps-item-credits { display: flex; }
.ps-item-credits .ps-icon { color: var(--gold); }

/* ===== 报告打印导出 PDF ===== */
@media print {
  body * { visibility: hidden !important; }
  #printContainer, #printContainer * { visibility: visible !important; }
  #printContainer { position: absolute !important; left: 0; top: 0; width: 100%; }
  #printContainer .print-section { margin-bottom: 14px; }
  #printContainer .print-qr-page { page-break-before: always; }
  @page { margin: 15mm; }
}
@media screen {
  #printContainer { display: none; }
}

/* ===== 用户调查悬浮对话框（site-wide fixed，可收起）===== */
.survey-fab {
  position: fixed;
  right: 14px;
  bottom: calc(76px + var(--safe-bottom, 0px));
  z-index: 500;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  color: var(--gold);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(212, 167, 77, 0.35);
  transition: transform 0.2s;
}
.survey-fab:active { transform: scale(0.92); }
.survey-panel {
  position: fixed;
  right: 14px;
  bottom: calc(76px + var(--safe-bottom, 0px));
  z-index: 501;
  width: min(320px, calc(100vw - 28px));
  max-height: 70vh;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.survey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}
.survey-close {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.survey-close:hover { color: var(--ink); background: var(--cream-dark); }
.survey-body { padding: 12px 14px; overflow-y: auto; }
.survey-reward {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--gold-dark);
  background: var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.survey-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.survey-text {
  flex: 1;
  box-sizing: border-box;
  resize: none;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
}
.survey-text:focus { outline: none; border-color: var(--gold); }
.survey-shot-wrap {
  position: relative;
  margin-top: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
}
.survey-shot {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}
.survey-shot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.survey-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.survey-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.survey-file-btn {
  width: 38px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
}
.survey-file-btn:hover { border-color: var(--gold); }
.survey-submit {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.survey-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* ============ SEO 页脚内链 ============ */
.seo-foot {
  margin-top: 28px;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--border);
  background: var(--cream);
}

.seo-foot-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.seo-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
}

.seo-foot-links a {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.seo-foot-links a:hover { color: var(--gold-dark); }

.seo-foot-ss a { color: var(--gold-dark); }

.seo-foot-disclaimer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

/* ============ A股市场风险预警 ============ */
.func-icon-risk { background: linear-gradient(135deg, #b71c1c, #ef5350); }

.risk-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.risk-score-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.risk-score-label { font-size: 13px; color: var(--text-secondary); }

.risk-score-num {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-dark);
}

.risk-level-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.risk-lv-normal { background: #2E7D32; }
.risk-lv-early  { background: #D4A74D; }
.risk-lv-mid    { background: #EF6C00; }
.risk-lv-near   { background: #C62828; }
.risk-lv-nodata { background: #9CA3AF; }

.risk-level-hint { font-size: 13px; color: var(--text-secondary); text-align: center; }

.risk-meta { font-size: 11px; color: var(--text-tertiary); }

.risk-refresh-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.risk-refresh-btn:active { transform: scale(0.96); }

.risk-attention {
  background: #FFF7E6;
  border: 1px solid #F0D9A8;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: #8a6d1a;
  margin-bottom: 14px;
}

.risk-chart-card { margin-bottom: 14px; }

.risk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

.risk-legend-item { display: inline-flex; align-items: center; gap: 4px; }

.risk-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.risk-svg-wrap { width: 100%; overflow-x: auto; margin-top: 6px; }

.risk-chart-foot { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

.risk-factors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }

.risk-factor {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.risk-factor-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

.risk-factor-name { font-size: 13px; font-weight: 700; color: var(--text); }

.risk-factor-tier {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.risk-factor-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }

.risk-factor-value { font-size: 18px; font-weight: 700; color: var(--ink); }

.risk-factor-score { font-size: 12px; color: var(--text-secondary); }

.risk-factor-logic { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.risk-factor-meta { font-size: 11px; color: var(--text-tertiary); }

.risk-factor-chart { margin-top: 2px; }

/* 数据来源详情（可折叠） */
.risk-source {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  margin-top: 2px;
}

.risk-source-summary {
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.risk-source-summary::-webkit-details-marker { display: none; }

.risk-source-summary::before { content: '▸ '; color: var(--gold-dark); }

.risk-source[open] .risk-source-summary::before { content: '▾ '; }

.risk-source-body { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }

.risk-source-row { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }

.risk-source-row b { color: var(--text); font-weight: 600; margin-right: 4px; }

.risk-source-url code {
  font-family: Consolas, Menlo, monospace;
  font-size: 10px;
  color: #8a6d1a;
  background: #f5efe0;
  border: 1px solid #eadfbf;
  border-radius: 4px;
  padding: 1px 5px;
  word-break: break-all;
}

.risk-rules { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.risk-rules-intro {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 10px 0 0;
  padding: 10px 12px;
  background: rgba(201, 168, 110, 0.07);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
}

/* 递进阶梯：平稳 → 一级 → 二级 → 三级，四级色徽章 + 箭头 + 门槛条件 */
.risk-ladder {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px 4px;
  margin-top: 12px;
  padding: 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.risk-ladder-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 96px;
}

.risk-ladder-chip {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.risk-ladder-arrow {
  align-self: center;
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0 2px;
}

.risk-ladder-cond { font-size: 10px; color: var(--text-tertiary); white-space: nowrap; }

/* 四级明细：触发 / 信号 / 应对 三行，标签金色 */
.risk-rule-row {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.risk-rule-name { font-size: 13px; font-weight: 700; color: var(--gold-dark); min-width: 120px; }

.risk-rule-cond b,
.risk-rule-signal b,
.risk-rule-hint b { color: var(--gold-dark); font-weight: 600; margin-right: 4px; }

.risk-rule-cond { font-size: 12px; color: var(--text-secondary); }

.risk-rule-signal { font-size: 12px; color: var(--text-secondary); flex-basis: 100%; }

.risk-rule-hint { font-size: 12px; color: var(--text-tertiary); flex-basis: 100%; }

/* 联动说明：等级动态升降 + 两种「分高不触发」 + 共振门硬前提 */
.risk-ladder-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.risk-constraints { margin-top: 14px; }

.risk-constraint-item {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 480px) {
  .risk-factors { grid-template-columns: 1fr; }
}

/* ============ 行业风险（大盘页「行业」页签 · 精选 24 行业） ============ */
.risk-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.risk-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s ease;
}
.risk-tab.active {
  background: linear-gradient(135deg, var(--gold-dark), #c9a227);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.risk-overview-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.risk-overview-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.risk-overview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.risk-overview-meta b { color: var(--gold-dark); }
.risk-sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.risk-sort-label { font-size: 12px; color: var(--text-secondary); }
.risk-sort-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.risk-sort-btn.active {
  background: var(--gold-dark);
  color: #fff;
  border-color: transparent;
}
.risk-sector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.risk-sector-card { margin-bottom: 0; padding: 12px; }
.risk-sector-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.risk-sector-name { font-size: 14px; font-weight: 700; color: var(--text); }
.risk-sector-num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold-dark);
  margin-top: 6px;
}
.risk-sector-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.risk-sector-metric { font-size: 11px; color: var(--text-secondary); }
.risk-sector-metric.up { color: #C62828; }
.risk-sector-metric.down { color: #2E7D32; }
.risk-sector-detail { display: none; margin-top: 10px; }

@media (max-width: 480px) {
  .risk-sector-grid { grid-template-columns: 1fr; }
}

/* ===== 个股风险页（第三页签 📈 个股） ===== */
.risk-stock-searchbar { margin-bottom: 12px; }
.risk-stock-search { position: relative; }
.risk-stock-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.risk-stock-search input:focus { border-color: var(--gold-dark); }
.risk-stock-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.risk-suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.risk-suggest-item:last-child { border-bottom: none; }
.risk-suggest-item:active { background: #faf6ea; }
.risk-suggest-name { font-weight: 600; color: var(--text); }
.risk-suggest-code { color: var(--text-tertiary); font-size: 12px; }
.risk-suggest-empty { padding: 12px 14px; color: var(--text-tertiary); font-size: 13px; }
.risk-stock-empty { text-align: center; padding: 32px 16px; }
.risk-stock-empty p { color: var(--text-secondary); margin-bottom: 14px; font-size: 14px; }
.risk-stock-cost-hint { margin-top: 12px; font-size: 12px; color: var(--text-tertiary); }
.risk-stock-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 12px; }
.risk-stock-name { font-size: 18px; font-weight: 700; color: var(--text); }
.risk-stock-code { font-size: 12px; color: var(--text-tertiary); }
.risk-stock-price { font-size: 20px; font-weight: 800; color: var(--text); }
.risk-stock-pct { font-size: 14px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.risk-stock-pct.up { color: #C62828; }
.risk-stock-pct.down { color: #2E7D32; }
.risk-price-spark { margin-bottom: 12px; }
.risk-price-spark .card-title { display: block; margin-bottom: 6px; }
.risk-horizon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.risk-horizon-card {
  flex: 1 1 240px;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.risk-horizon-card.nodata { background: #fafafa; }
.risk-horizon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.risk-horizon-title { font-size: 13px; font-weight: 700; color: var(--text); }
.risk-level-badge.risk-lv-veryhigh { background: #C62828; }
.risk-level-badge.risk-lv-high { background: #EF6C00; }
.risk-level-badge.risk-lv-moderate { background: #D4A74D; }
.risk-level-badge.risk-lv-low { background: #2E7D32; }
.risk-horizon-score { font-size: 40px; font-weight: 800; line-height: 1; color: var(--text); margin-bottom: 8px; }
.risk-prob-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.risk-prob-label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.risk-prob-bar {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #f0f0f0;
  overflow: visible;
}
.risk-prob-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #D4A74D, #EF6C00);
}
.risk-base-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #7a5c12;
  opacity: 0.65;
  border-radius: 1px;
}
.risk-prob-num { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
.risk-prob-num small { font-weight: 400; color: var(--text-tertiary); }
.risk-horizon-basis { border-top: 1px dashed var(--border); padding-top: 6px; margin-bottom: 6px; }
.risk-basis-line { font-size: 12px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }
.risk-basis-line.risk-meta { font-size: 11px; color: var(--text-tertiary); }
.risk-horizon-k { color: var(--text-tertiary); min-width: 52px; }
.risk-horizon-v { color: var(--text); font-weight: 600; }
.risk-horizon-confirm { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.risk-horizon-confirm.up { color: #C62828; }
.risk-horizon-confirm.down { color: #2E7D32; }
.risk-horizon-hint { font-size: 12px; color: var(--text-secondary); margin: 0; }
.risk-horizon-nodata { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.risk-method-card { margin-bottom: 12px; }
.risk-method-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 6px 0 0; }
@media (max-width: 480px) {
  .risk-horizon-card { flex: 1 1 46%; min-width: 0; }
}

/* ============================================
   DESKTOP SHELL (≥1024px) — shell only; nothing <1024 changes
   Base rule keeps the header from flashing on mobile (also hidden by the media gate below).
   ============================================ */
.desktop-top { display: none; }

@media (min-width: 1024px) {
  .desktop-top {
    display: flex;
    align-items: center;
    gap: 26px;
    position: sticky;
    top: 0;
    z-index: 150;                          /* < .lang-toggle(200) < survey(500) < overlays(999/1000) < toast(2000) */
    min-height: 56px;
    box-sizing: border-box;
    padding: 8px 64px 8px 24px;            /* right 64px reserves the fixed 40px #langToggle */
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }
  .desktop-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-decoration: none;
  }
  .desktop-tagline { font-size: 12px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 1px; }
  .desktop-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }

  /* neutralize the shared .nav-item mobile style inside the desktop bar */
  .desktop-nav .nav-item {
    flex: none;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 999px;
    text-decoration: none;
  }
  .desktop-nav .nav-item::before { content: ''; display: none; }   /* kill emoji-square pseudo icons */
  .desktop-nav .nav-item:hover { background: var(--cream-dark); color: var(--ink); }
  .desktop-nav .nav-item.active { color: var(--gold-dark); background: var(--gold-light); }
  .desktop-nav .nav-label { font-size: inherit; }

  /* hide the mobile bottom tab bar */
  #topNav { display: none !important; }

  /* widen the single content column to 920px (overrides the 480px @420 rule by source order) */
  .container {
    max-width: 920px;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 48px;                  /* bottom bar gone; reduce the 80px mobile clearance */
  }

  /* home service cells: light scale-up only — do NOT restructure the 3+3+1 rows (last row Risk CTA is full-width by design) */
  .func-grid-item { padding: 20px 10px; }
  .func-icon { width: 56px; height: 56px; line-height: 56px; font-size: 22px; }
  .func-label { font-size: 15px; }
  .func-desc { font-size: 12px; }

  /* keep the single fixed lang toggle visually docked in the header's right edge */
  .lang-toggle { top: 8px; right: 12px; }
}
