/* ═══════════════════════════════════════════════
   命理工作台 - 样式表
   主题：传统中国风 · 米白金
   ═══════════════════════════════════════════════ */

:root {
  --bg-base: #fef9f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f4e8;
  --bg-input: #faf6ee;
  --border: #e8dcc8;
  --border-light: #d4c8a8;
  --gold: #c9a96e;
  --gold-light: #d4b67a;
  --gold-dim: #a68a4a;
  --gold-bg: #fff8ec;
  --text: #3d3226;
  --text-secondary: #7a6e5e;
  --text-dim: #a89b8c;
  --red: #c41e3a;
  --red-bg: #fdf2f2;
  --green: #4a7c59;
  --green-bg: #f2f9f4;
  --blue: #5b7f95;
  --purple: #7b6b9e;
  --orange: #c8843a;
  --radius: 12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-gold: 0 2px 12px rgba(201,169,110,0.2);
}

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

body {
  font-family: 'PingFang SC','Hiragino Sans GB','Microsoft YaHei','Noto Sans CJK SC',sans-serif;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* 背景纹理 */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201,169,110,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(196,30,58,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(123,107,158,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* ─── 头部 ──────────────────────────────────── */
.header {
  text-align: center;
  padding: 30px 20px 20px;
  position: relative;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #c9a96e, #a67c3d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.header .version-tag {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 4px;
  opacity: 0.7;
}

.header .subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.header .bagua-img {
  width: 140px;
  height: 140px;
  margin-bottom: 8px;
  opacity: 0.9;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

/* ─── 日期面板 ──────────────────────────────── */
.date-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.date-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.date-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--red), transparent);
}

.date-card .label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.query-date-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}
.query-date-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.date-card .solar-date {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.date-card .lunar-date {
  font-size: 16px;
  color: var(--red);
  margin-bottom: 8px;
}

.date-card .meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-card .meta span {
  background: var(--bg-input);
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ─── 输入面板 ──────────────────────────────── */
.input-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.input-panel h2 {
  font-size: 20px;
  color: var(--gold-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  /* V8.1.3 顶部对齐：label 一条线、控件一条线。
     原 end（底边对齐）会因「出生地」组多出真太阳时提示而把该组控件抬高 ~23px */
  align-items: flex-start;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 12px;
  color: var(--text-dim);
}

.input-group input:not([type="radio"]),
.input-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  /* V8.1.3 显式统一高度：Safari 原生 select 计高与 Chrome 不同，靠 padding 撑高会跨引擎错位 */
  height: 40px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.birth-date-row {
  display: flex;
  gap: 6px;
}

.birth-date-row select {
  flex: 1;
  min-width: 70px;
}

/* V8.1.3 按钮组无 label：补出 label+间距高度（≈23px），使按钮与同排下拉控件落在同一水平线 */
.bazi-actions {
  align-self: flex-start;
  padding-top: 23px;
}
/* 面板内按钮与下拉控件统一 40px 高（含 border-box，纵向 padding 归零由高度撑起） */
#input-panel .btn-primary,
#input-panel .btn-secondary {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

.btn-primary {
  background: linear-gradient(135deg, #c9a96e, #b8933d);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(201,169,110,0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,169,110,0.4);
}

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

/* ─── 信息面板 ──────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.info-grid.info-grid-2col {
  grid-template-columns: repeat(2, 1fr);
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.accessory-card { margin: 20px 0; }

.info-card h3 {
  font-size: 14px;
  color: var(--gold-dim);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold-bg);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 宜忌 - 建除黄道 + 精简两行 */
.jianchu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-input);
  flex-wrap: wrap;
}
.jianchu-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}
.jianchu-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--bg-input);
}
.huangdao-god {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.huangdao-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
}
.huangdao-tag.huang { color: var(--red); background: var(--red-bg); }
.huangdao-tag.hei { color: var(--text-dim); background: var(--bg-input); }
.yiji-reason {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 4px 0 6px;
}

.yi-line, .ji-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-input);
}
.yi-line:last-child, .ji-line:last-child { border-bottom: none; }

.yi-tag, .ji-tag {
  font-weight: 700;
  font-size: 14px;
  min-width: 24px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 4px;
}
.yi-tag { color: var(--green); background: var(--green-bg); }
.ji-tag { color: var(--red); background: var(--red-bg); }

.yi-text, .ji-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

/* 色彩推荐 */
.color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.color-section {
  margin-bottom: 8px;
}

.color-section .label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.color-section .colors {
  font-size: 14px;
  color: var(--text);
}

.color-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* 吉时列表 */
.lucky-hour-list {
  list-style: none;
}

.lucky-hour-list li {
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--bg-input);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lucky-hour-list li:last-child { border-bottom: none; }

.lucky-hour-list .hour-name {
  color: var(--gold-dim);
  font-weight: 600;
}

.lucky-hour-list .hour-time {
  color: var(--text-dim);
  font-size: 12px;
}

.lucky-hour-list .hour-tip {
  font-size: 12px;
  color: var(--text-secondary);
}

.lucky-hour-list .hour-element-tag {
  font-size: 11px;
  margin-left: 6px;
  vertical-align: middle;
}

.hour-fav-ji { color: var(--green); font-weight: 700; font-size: 13px; }
.hour-fav-xiong { color: var(--red); font-weight: 600; font-size: 13px; }
.hour-fav-ping { color: var(--text-dim); font-size: 13px; }

.hour-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 4px;
}
.hour-fav-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 4px;
}

.caishen-dir {
  color: var(--gold-dim);
  font-weight: 600;
  font-size: 13px;
}

/* ─── 八字分析面板 ──────────────────────────── */
.bazi-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.bazi-panel h2 {
  font-size: 20px;
  color: var(--gold-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bazi-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.pillar {
  background: var(--gold-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: box-shadow 0.2s;
}

.pillar:hover {
  box-shadow: var(--shadow-gold);
}

.pillar .pillar-name {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.pillar .pillar-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

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

.pillar .pillar-god {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* 分析结果 */
.analysis-section {
  margin-bottom: 16px;
}

.analysis-section .section-title {
  font-size: 14px;
  color: var(--gold-dim);
  margin-bottom: 8px;
  font-weight: 600;
}

.analysis-section .section-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

.analysis-section .highlight {
  color: var(--gold-dim);
  font-weight: 600;
}

.analysis-section .bad {
  color: var(--red);
}

.analysis-section .good {
  color: var(--green);
}
.analysis-section .warn-text { color: var(--orange); font-weight: 600; }
.cross-book { display: inline-block; min-width: 9em; text-align: last-left; }
.cross-line { display: block; padding-left: 2.5em; margin-top: 3px; line-height: 1.8; }

/* ─── 可折叠区域 ──────────────────────────────── */
.collapsible-wrap {
  margin: 4px 0;
}
.collapsible-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--gold-dim);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
  text-align: left;
  transition: background 0.2s;
}
.collapsible-btn:hover { background: var(--surface-hover); }
.collapsible-btn.expanded { color: var(--gold); }
.collapsible-btn .tri { display: inline-block; transition: transform .2s ease; margin-right: 2px; }
.collapsible-btn.expanded .tri { transform: rotate(90deg); }
.collapsible-body {
  display: none;
  padding: 8px 0;
  font-size: 14px;
}
.collapsible-body.open { display: block; }

/* ─── 子段落（折叠区内） ───────────────────────── */
.subsection {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dim);
  margin-bottom: 4px;
}

/* ─── 五神推演 ──────────────────────────────── */
.five-gods-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  line-height: 1.5;
}
.five-gods-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.god-card {
  text-align: center;
  padding: 14px 8px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.god-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.god-card .god-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dim);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.god-card .god-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.god-card.god-yong { border-color: #e53935; background: #fff5f5; }
.god-card.god-yong .god-name { color: #e53935; }
.god-card.god-xi   { border-color: #ffb300; background: #fffde7; }
.god-card.god-xi   .god-name { color: #ff8f00; }
.god-card.god-ji   { border-color: #546e7a; background: #eceff1; }
.god-card.god-ji   .god-name { color: #546e7a; }
.god-card.god-chou { border-color: #8d6e63; background: #efebe9; }
.god-card.god-chou .god-name { color: #6d4c41; }
.god-card.god-xian { border-color: #bdbdbd; background: #fafafa; }
.god-card.god-xian .god-name { color: #9e9e9e; }

/* 五神下拉框 */
.god-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.god-select:hover { border-color: var(--gold); }
.god-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,169,110,0.2); }

/* 还原按钮 */
.reset-gods-btn {
  padding: 5px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--gold);
  background: rgba(201,169,110,0.08);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.reset-gods-btn:hover {
  background: rgba(201,169,110,0.2);
  box-shadow: 0 2px 8px rgba(201,169,110,0.2);
}


/* 个人五神标注（区别于关系标签） */
.god-tag-personal {
  background: rgba(229,57,53,0.1);
  color: #c62828;
  border-color: rgba(229,57,53,0.3);
}

/* ─── 综合评定徽章（当日+个人双维度）── */
.combined-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.combined-synergy {
  background: rgba(76,175,80,0.15);
  color: #2e7d32;
  border: 1px solid rgba(76,175,80,0.4);
}
.combined-good {
  background: rgba(129,199,132,0.12);
  color: #388e3c;
  border: 1px solid rgba(129,199,132,0.3);
}
.combined-neutral {
  background: rgba(158,158,158,0.1);
  color: #757575;
  border: 1px solid rgba(158,158,158,0.25);
}
.combined-warn {
  background: rgba(255,152,0,0.12);
  color: #e65100;
  border: 1px solid rgba(255,152,0,0.3);
}
.combined-avoid {
  background: rgba(244,67,54,0.12);
  color: #c62828;
  border: 1px solid rgba(244,67,54,0.3);
}

/* 评分明细 */
.score-detail {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 2px;
}

/* 综合评定高亮/弱化 */
.color-section-highlight {
  border-left: 3px solid #4caf50;
  padding-left: 8px;
  background: rgba(76,175,80,0.04);
}
.color-section-dimmed {
  opacity: 0.6;
  border-left: 3px solid #f44336;
  padding-left: 8px;
}

.god-xian-els {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── 时辰方位表 ────────────────────────────── */
.hour-direction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}

.hour-direction-table th {
  background: var(--gold-bg);
  color: var(--gold-dim);
  padding: 12px 8px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}

.hour-direction-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--bg-input);
  color: var(--text);
}

.hour-direction-table tr:hover {
  background: var(--bg-card-hover);
}

.hour-direction-table .current-hour {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
}

.hour-direction-table .favorable-ji {
  color: var(--green);
  font-weight: 600;
}

.hour-direction-table .favorable-xiong {
  color: var(--red);
  font-weight: 600;
}

.hour-direction-table .favorable-ping {
  color: var(--text-secondary);
}

/* ─── 提示 ──────────────────────────────────── */
.placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.placeholder .icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ─── 底部 ──────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 30px;
}

.footer .disclaimer {
  max-width: 600px;
  margin: 0 auto 8px;
  line-height: 1.6;
}

/* ─── 五行标识 ──────────────────────────────── */
.element-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.el-wood { background: #e8f5e9; color: #2e7d32; }
.el-fire { background: #fce4ec; color: #c62828; }
.el-earth{ background: #fff3e0; color: #e65100; }
.el-metal{ background: #f5f5f5; color: #616161; }
.el-water{ background: #e3f2fd; color: #1565c0; }

/* ─── 响应式 ────────────────────────────────── */
@media (max-width: 900px) {
  .info-grid { grid-template-columns: 1fr; }
  .info-grid.info-grid-2col { grid-template-columns: 1fr; }
  .date-panel { grid-template-columns: 1fr; }
  .bazi-pillars { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .header h1 { font-size: 22px; }
  .container { padding: 12px; }
}

/* ─── 动画 ──────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

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

.loading-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ─── 五行统计条 ────────────────────────────── */
.element-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.element-bar-bg {
  flex: 1;
  height: 14px;
  background: rgba(128,128,128,0.15);
  border-radius: 7px;
  overflow: hidden;
}

.element-bar {
  height: 100%;
  border-radius: 7px;
  transition: width 0.3s ease;
}

.element-bar.el-wood { background: linear-gradient(90deg, #2e7d32, #66bb6a); }
.element-bar.el-fire { background: linear-gradient(90deg, #c62828, #ef5350); }
.element-bar.el-earth { background: linear-gradient(90deg, #e65100, #ff9800); }
.element-bar.el-metal { background: linear-gradient(90deg, #757575, #bdbdbd); }
.element-bar.el-water { background: linear-gradient(90deg, #1565c0, #42a5f5); }

.element-count {
  min-width: 42px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ─── 色彩列表 ──────────────────────────────── */
.color-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.color-list .color-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-list .color-section .label {
  min-width: 160px;
  font-size: 13px;
}

/* ─── 五神标签 ──────────────────────────────── */
.god-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(201,169,110,0.15);
  color: var(--gold);
  border: 1px solid rgba(201,169,110,0.3);
}

/* ─── ⑥ 最终穿搭方案 ─────────────────────────── */
.final-color-tiers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.final-tier {
  border: 1px solid rgba(201,169,110,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
}

.tier-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tier-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
}

.accessory-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 6px 0 2px;
}

.accessory-line .acc-name {
  font-size: 13px;
  color: var(--text);
}

.final-color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.final-color-item .label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}

.score-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(76,175,80,0.12);
  color: #4CAF50;
  border: 1px solid rgba(76,175,80,0.25);
}

.score-tag.negative {
  background: rgba(244,67,54,0.12);
  color: #f44336;
  border-color: rgba(244,67,54,0.25);
}

/* ─── 出生地三段式下拉 ──────────────────────── */
.birth-location-row {
  display: flex;
  gap: 6px;
}

.birth-location-row select {
  flex: 1;
  min-width: 80px;
}

.birth-location-row select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.solar-time-note {
  font-size: 12px;
  color: var(--gold-dim);
  margin-top: 2px;
  line-height: 1.4;
}

/* ─── 真太阳时横幅 ──────────────────────────── */
.solar-time-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.solar-time-banner.solar-changed {
  background: rgba(201,169,110,0.08);
  border: 1px solid rgba(201,169,110,0.3);
  color: var(--text);
}
.solar-time-banner.solar-unchanged {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ─── 性格特征核心特质标签 ──────────────────── */
.keyword-tag {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 12px;
  font-size: 12px;
  background: linear-gradient(135deg, rgba(201,169,110,0.18), rgba(201,169,110,0.08));
  border: 1px solid rgba(201,169,110,0.35);
  color: var(--gold);
}

/* ─── 印旺身淹格局判定高亮 ──────────────────── */
.analysis-section.pattern-yinwang {
  border: 2px solid var(--orange);
  background: rgba(200,132,58,0.04);
  border-radius: var(--radius);
}
.analysis-section.pattern-yinwang .section-title {
  color: var(--orange);
  font-weight: 700;
}

/* ─── 穿搭部位建议 ──────────────────────────── */
.clothing-advice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .clothing-advice-grid {
    grid-template-columns: 1fr;
  }
}
.clothing-part {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.clothing-part .part-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--gold-dim);
}
.clothing-upper { border-left: 3px solid var(--red); }
.clothing-lower { border-left: 3px solid var(--gold); }
.clothing-shoes { border-left: 3px solid var(--text-dim); }
.clothing-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
}

/* ─── 第④段 当日天时五行 ─────────────────────── */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.info-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-dim);
  vertical-align: middle;
}
.info-label {
  width: 100px;
  color: var(--gold-dim);
  font-weight: 600;
  white-space: nowrap;
}

.impact-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 6px;
}
.impact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.2s;
}
.impact-el { min-width: 50px; }
.impact-rel { flex: 1; color: var(--text-dim); }
.impact-note { font-size: 12px; color: var(--gold); }

.impact-row.el-row-boost {
  background: rgba(76,175,80,0.08);
  border-left: 3px solid #4caf50;
}
.impact-row.el-row-self {
  background: rgba(255,193,7,0.08);
  border-left: 3px solid var(--gold);
}
.impact-row.el-row-harmony {
  background: rgba(33,150,243,0.06);
  border-left: 3px solid #2196f3;
}
.impact-row.el-row-drain {
  background: rgba(255,152,0,0.06);
  border-left: 3px solid #ff9800;
}
.impact-row.el-row-neutral {
  background: rgba(158,158,158,0.05);
  border-left: 3px solid #9e9e9e;
}
.impact-row.el-row-suppress {
  background: rgba(244,67,54,0.08);
  border-left: 3px solid #f44336;
}

/* ═══════════════════════════════════════════════
   双人八字匹配评估模块
   ═══════════════════════════════════════════════ */
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 1px;
}
.btn-secondary:hover {
  background: var(--gold-bg);
  transform: translateY(-1px);
}
.btn-secondary:active { transform: translateY(0); }

.match-input-grid {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.match-input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-input-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  padding: 4px 0;
  border-bottom: 2px solid var(--gold);
}
.match-input-col .input-row {
  display: flex;
  gap: 6px;
}
.match-input-col select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}
.match-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-dim);
  padding: 0 8px;
}

.match-profile {
  padding: 10px 14px;
}
.match-pillars {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.match-section {
  padding: 10px 14px;
}
.match-row {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin: 2px 0;
}

/* 五神标签色系 */
.god-tag.god-yong { background: rgba(74,124,89,0.15); color: var(--green); border-color: rgba(74,124,89,0.3); }
.god-tag.god-xi { background: rgba(91,127,149,0.15); color: var(--blue); border-color: rgba(91,127,149,0.3); }
.god-tag.god-ji { background: rgba(196,30,58,0.15); color: var(--red); border-color: rgba(196,30,58,0.3); }
.god-tag.god-chou { background: rgba(200,132,58,0.15); color: var(--orange); border-color: rgba(200,132,58,0.3); }

/* ═══ 双人匹配弹窗 ═══ */
.match-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.match-modal {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
}
.match-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--gold-bg);
  border-radius: 16px 16px 0 0;
}
.match-modal-header h2 {
  font-size: 20px;
  color: var(--gold-dim);
  margin: 0;
}
.match-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.match-modal-close:hover {
  color: var(--red);
}
.match-modal-body {
  padding: 20px 24px;
}
.match-form-row {
  margin-bottom: 16px;
}
.match-form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.match-form-select,
.match-form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.match-form-select:focus,
.match-form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,169,110,0.15);
}
.match-form-grid {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.match-form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.match-form-col-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  padding: 6px 0;
  border-bottom: 2px solid var(--gold);
}
.match-form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.match-date-row {
  display: flex;
  gap: 6px;
}
.match-date-sel {
  flex: 1;
  min-width: 0;
}
@media (max-width: 560px) {
  .match-form-grid {
    flex-direction: column;
  }
  .match-vs {
    text-align: center;
    padding: 4px 0;
  }
}

/* ─── 匿名统计计数器 ──────────────────────── */
.visit-counter {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
  margin: 0 auto 16px;
  max-width: 540px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(201,169,110,0.14), rgba(201,169,110,0.05));
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(201,169,110,0.18);
}
.visit-counter .visit-total {
  font-weight: 800;
  font-size: 20px;
  color: var(--gold-dim);
  margin: 0 4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(201,169,110,0.35);
}

/* ─── 功能 Tab 导航 ─────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  margin: 0 auto 18px;
  max-width: 540px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 1px;
}
.tab-btn:hover { color: var(--gold-dim); }
.tab-btn.active {
  background: linear-gradient(135deg, #c9a96e, #b8933d);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201,169,110,0.3);
}
.tab-hidden { display: none !important; }

/* ─── 大运流年模块 ─────────────────────────── */
.dayun-year-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dayun-year-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

/* 大运流年操作区：独立成行（字段下移），字段与按钮横排（按钮右移） */
.dayun-actions {
  flex-basis: 100%;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 4px;
}

.dayun-gz {
  font-weight: 700;
  color: var(--gold-dim);
  letter-spacing: 2px;
}

/* 大运表 */
.dayun-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}
.dayun-table th {
  background: var(--gold-bg);
  color: var(--gold-dim);
  padding: 10px 8px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}
.dayun-table td {
  padding: 9px 8px;
  text-align: center;
  border-bottom: 1px solid var(--bg-input);
  color: var(--text);
}
.dayun-table .dayun-age { color: var(--text-dim); }
.dayun-table .dayun-tone {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: left;
  max-width: 280px;
}
.dayun-table tr:hover { background: var(--bg-card-hover); }
.dayun-table tr.current-yun {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  font-weight: 600;
}
.dayun-table tr.current-yun .dayun-gz { color: var(--red); }

.god-el {
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0;
}

/* 流年卡 */
.liunian-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--bg-card);
  transition: box-shadow 0.2s;
}
.liunian-card:hover { box-shadow: var(--shadow-sm); }
.liunian-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bg-input);
  margin-bottom: 10px;
}
.liunian-head .ln-year {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.liunian-head .ln-gz {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-dim);
  letter-spacing: 2px;
}
.liunian-head .ln-god {
  font-size: 12px;
  color: var(--text-secondary);
}
.liunian-body { font-size: 14px; line-height: 1.8; color: var(--text); }
.liunian-body p { margin: 4px 0; }
.liunian-sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.liunian-sub-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-dim);
  min-width: 92px;
  flex-shrink: 0;
  padding-top: 2px;
}
.liunian-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.dim-chip {
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  color: var(--text-secondary);
}
.liunian-rel-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* 关系标签 chip */
.rel-chip {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid;
}
.rel-chong { background: rgba(196,30,58,0.1); color: var(--red); border-color: rgba(196,30,58,0.3); }
.rel-xing  { background: rgba(200,132,58,0.1); color: var(--orange); border-color: rgba(200,132,58,0.3); }
.rel-hai   { background: rgba(91,127,149,0.1); color: var(--blue); border-color: rgba(91,127,149,0.3); }
.rel-he    { background: rgba(76,175,80,0.1); color: var(--green); border-color: rgba(76,175,80,0.3); }
.rel-sanhe { background: rgba(123,107,158,0.1); color: var(--purple); border-color: rgba(123,107,158,0.3); }

/* 评分徽章（五档） */
.rate-badge {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid;
}
.rate-top  { background: rgba(76,175,80,0.18);  color: #2e7d32; border-color: rgba(76,175,80,0.5); }
.rate-high { background: rgba(129,199,132,0.15); color: #388e3c; border-color: rgba(129,199,132,0.45); }
.rate-mid  { background: rgba(201,169,110,0.18); color: var(--gold-dim); border-color: rgba(201,169,110,0.5); }
.rate-low  { background: rgba(255,152,0,0.14);  color: #e65100; border-color: rgba(255,152,0,0.4); }
.rate-bad  { background: rgba(244,67,54,0.14);  color: #c62828; border-color: rgba(244,67,54,0.4); }

/* 评分明细 */
.score-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.score-detail-item {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
  border: 1px solid;
}
.sd-plus  { background: rgba(76,175,80,0.1);  color: #2e7d32; border-color: rgba(76,175,80,0.3); }
.sd-minus { background: rgba(244,67,54,0.1);  color: #c62828; border-color: rgba(244,67,54,0.3); }

/* ─── 星座运势面板（V8.1.0）────────────────────────────────
   此前 .horoscope-actions / .horoscope-result 在本文件中【完全没有定义】，
   导致「查询运势」按钮与下方结果卡片间距实测为 0～1px，与上方 46px 落差明显。
   此处补齐样式，并把面板内区块间距统一为 20px（与卡片 padding 一致）：
     h2 ─20─ 选择行 ─20─ 结果区 ─ 右下来源注记                          */
#horoscope-panel h2 { margin-bottom: 20px; }
/* 对齐统一由 .input-row 的 flex-start + 控件显式高度接管（V8.1.3），此处只保留间距 */
#horoscope-panel .input-row { margin-bottom: 20px; }
/* V8.2.2 星座数据来源注记：页脚免责声明下方、居中、11px 弱化（不抢视觉焦点） */
.horoscope-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.horoscope-result { margin-top: 0; }
/* V8.3.0 查询按钮旁的限额说明：弱化提示，与按钮垂直居中 */
.horoscope-quota-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
  white-space: normal;
}
/* 结果卡片自带外边距时不再叠加，确保 20px 唯一 */
.horoscope-result > .info-card:first-child { margin-top: 0; }

/* 生日 → 星座推算小工具（V8.1.1：原生 date 控件改为年/月/日三个下拉，与八字面板同一样式）*/
.zodiac-tool { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.zodiac-tool .birth-date-row { flex: 0 0 auto; gap: 8px; }
.zodiac-tool .birth-date-row select { flex: 0 0 auto; width: 96px; } /* 年/月/日等宽，容得下「2026年」 */
.zodiac-group { flex: 0 0 auto; } /* 不被压缩：宽度不足时整组换行，而非把下拉挤扁 */

/* 运势周期单选：与相邻下拉控件垂直居中、条目间距 18px */
.period-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 40px; }
.period-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.period-row input[type="radio"] { cursor: pointer; margin: 0; }

/* 面板内：控件横向 16px、换行纵向 20px
   含 label 的组顶部对齐 → 各控件成一条水平线；
   按钮组用 padding-top 补出 label 高度与控件行齐平 */
#horoscope-panel .input-row { align-items: flex-start; gap: 16px; row-gap: 20px; margin-bottom: 20px; }
#horoscope-panel .horoscope-actions { align-self: flex-start; padding-top: 23px; }
/* 面板内控件统一 40px 高，按钮与下拉齐平 */
/* 面板内控件统一 40px 高，按钮与下拉齐平（V8.1.3 纵向 padding 归零、高度显式） */
#horoscope-panel .btn-sm { height: 40px; padding: 0 16px; font-size: 13px; letter-spacing: 0; flex: 0 0 auto; }
#horoscope-panel .horoscope-actions .btn-primary { height: 40px; padding: 0 24px; }

/* 结果提示：与上方控件留 8px、与下方区块由既有 20px 间距自然分隔 */
.zodiac-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 14px;
  color: var(--gold-dim);
  white-space: nowrap;
}
.zodiac-hint:empty { display: none; }

/* 窄屏：生日推算组独占整行；三下拉等分整行（保证「2026年」完整显示），按钮另起一行 */
@media (max-width: 640px) {
  #horoscope-panel .input-row { row-gap: 20px; }
  .zodiac-group { flex: 1 1 100%; }
  .zodiac-tool { width: 100%; gap: 10px; }
  .zodiac-tool .birth-date-row { flex: 1 1 100%; gap: 6px; }
  .zodiac-tool .birth-date-row select { flex: 1 1 0; width: auto; min-width: 0; }
  #horoscope-panel .horoscope-actions { flex: 1 1 100%; align-self: auto; padding-top: 0; }
}

