/* =============================================
   八字命理测算 - 主样式表
   响应式设计，兼容PC端与移动端
   ============================================= */

:root {
  --gold: #c9a227;
  --gold-light: #e8c76d;
  --gold-dark: #8b6914;
  --red: #c0392b;
  --red-light: #e74c3c;
  --bg-dark: #0d0d1a;
  --bg-card: rgba(20, 15, 40, 0.85);
  --bg-card-hover: rgba(30, 22, 55, 0.92);
  --border: rgba(201, 162, 39, 0.25);
  --border-hover: rgba(201, 162, 39, 0.5);
  --text-primary: #f0e6c8;
  --text-secondary: #b8a880;
  --text-muted: #7a6a4a;
  --wood: #4caf50;
  --fire: #f44336;
  --earth: #ff9800;
  --metal: #9e9e9e;
  --water: #2196f3;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 20px rgba(201, 162, 39, 0.2);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

/* ---- 背景装饰 ---- */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}
.bg-circle-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #c9a227 0%, transparent 70%);
  top: -200px; left: -200px;
}
.bg-circle-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6b21a8 0%, transparent 70%);
  bottom: -150px; right: -150px;
}
.bg-orb {
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,162,39,0.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

/* ---- 容器 ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ---- 导航 ---- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
}
.logo-icon {
  font-size: 1.6rem;
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
}
.nav-links a:hover {
  color: var(--gold);
}

/* ---- Hero ---- */
.hero {
  padding: 140px 0 80px;
  min-height: 90vh;
  display: flex;
  align-items: center;
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.3);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 24px;
}
.hero-title {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 20px;
}
.title-main {
  display: block;
  background: linear-gradient(135deg, #f0e6c8 0%, var(--gold) 50%, #c9a227 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 3.5rem;
}
.title-sub {
  display: block;
  color: var(--text-secondary);
  font-size: 1.8rem;
  font-weight: 400;
}
.hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 36px;
}
.btn-hero {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0d0d1a;
  padding: 14px 40px;
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 1px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(201,162,39,0.35);
}
.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,0.5);
}

/* 八卦图 */
.bagua-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.bagua-outer {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bagua-symbol {
  font-size: 5rem;
  color: var(--gold);
  animation: spin-slow 20s linear infinite;
  filter: drop-shadow(0 0 20px rgba(201,162,39,0.4));
  line-height: 1;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.bagua-ring {
  position: absolute;
  inset: 0;
  animation: spin-reverse 30s linear infinite;
}
.trigram {
  position: absolute;
  font-size: 1.6rem;
  color: rgba(201,162,39,0.6);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 50%; top: 50%;
}
.t1 { transform: translate(-50%, -50%) translate(0, -120px); }
.t2 { transform: translate(-50%, -50%) translate(85px, -85px); }
.t3 { transform: translate(-50%, -50%) translate(120px, 0); }
.t4 { transform: translate(-50%, -50%) translate(85px, 85px); }
.t5 { transform: translate(-50%, -50%) translate(0, 120px); }
.t6 { transform: translate(-50%, -50%) translate(-85px, 85px); }
.t7 { transform: translate(-50%, -50%) translate(-120px, 0); }
.t8 { transform: translate(-50%, -50%) translate(-85px, -85px); }
@keyframes spin-reverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* ---- 表单区 ---- */
.form-section {
  padding: 80px 0;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 10px;
}
.section-header p {
  color: var(--text-secondary);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  max-width: 760px;
  margin: 0 auto;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.form-group-gender {
  grid-column: 1 / -1;
}
.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}
.label-icon {
  font-size: 1rem;
}
.form-group input,
.form-group select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-group input::placeholder {
  color: var(--text-muted);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(201,162,39,0.08);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.1);
}
.form-group select option {
  background: #1a1230;
  color: var(--text-primary);
}

/* 性别选择 */
.gender-group {
  display: flex;
  gap: 16px;
}
.gender-option {
  flex: 1;
  cursor: pointer;
}
.gender-option input[type="radio"] {
  display: none;
}
.gender-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.gender-icon {
  font-size: 1.2rem;
}
.gender-option input:checked + .gender-btn {
  border-color: var(--gold);
  background: rgba(201,162,39,0.12);
  color: var(--gold);
}
.gender-option:hover .gender-btn {
  border-color: var(--gold-light);
  background: rgba(201,162,39,0.06);
}

.form-footer {
  text-align: center;
  margin-bottom: 16px;
}
.btn-submit {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0d0d1a;
  border: none;
  padding: 16px 60px;
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(201,162,39,0.35);
  font-family: inherit;
  min-width: 200px;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,0.5);
}
.btn-submit:active {
  transform: translateY(0);
}
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(13,13,26,0.3);
  border-top-color: #0d0d1a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}
.form-tip span {
  color: var(--gold);
}

/* ---- 结果区 ---- */
.result-section {
  padding: 60px 0;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.result-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-gold);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  font-size: 1.4rem;
}
.card-header h3 {
  font-size: 1.2rem;
  color: var(--gold);
  flex: 1;
}
.card-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(201,162,39,0.08);
  padding: 3px 10px;
  border-radius: 100px;
}

/* 基本信息网格 */
.basic-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.info-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.info-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* 四柱表格 */
.pillar-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pillar-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
.pillar-table th {
  background: rgba(201,162,39,0.1);
  color: var(--gold);
  padding: 12px 16px;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid var(--border);
  font-weight: 600;
}
.pillar-table td {
  padding: 12px 16px;
  border: 1px solid rgba(201,162,39,0.1);
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-primary);
  vertical-align: middle;
}
.pillar-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}
.pillar-table .day-col {
  background: rgba(201,162,39,0.05);
  color: var(--gold);
}
.pillar-table .ganzhi-big {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 2px;
}
.pillar-table .day-col .ganzhi-big {
  color: var(--gold);
}
.pillar-table .shishen-badge {
  display: inline-block;
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.3);
  color: var(--gold-light);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.82rem;
}
.pillar-table .day-col .shishen-badge {
  background: rgba(201,162,39,0.25);
  color: var(--gold);
}
.pillar-table .canggan-cell {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.pillar-table .row-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: left;
  padding-left: 20px;
}
.wuxing-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}
.wuxing-tag.wood { background: rgba(76,175,80,0.2); color: #81c784; }
.wuxing-tag.fire { background: rgba(244,67,54,0.2); color: #ef9a9a; }
.wuxing-tag.earth { background: rgba(255,152,0,0.2); color: #ffcc80; }
.wuxing-tag.metal { background: rgba(158,158,158,0.2); color: #e0e0e0; }
.wuxing-tag.water { background: rgba(33,150,243,0.2); color: #90caf9; }

/* 左右两列布局 */
.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* 五行图表 */
.wuxing-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wx-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wx-bar-label {
  width: 32px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  flex-shrink: 0;
}
.wx-bar-wrap {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  height: 12px;
  overflow: hidden;
}
.wx-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s ease;
}
.wx-bar-fill.wood { background: linear-gradient(90deg, #388e3c, #66bb6a); }
.wx-bar-fill.fire { background: linear-gradient(90deg, #c62828, #ef5350); }
.wx-bar-fill.earth { background: linear-gradient(90deg, #e65100, #ffa726); }
.wx-bar-fill.metal { background: linear-gradient(90deg, #546e7a, #b0bec5); }
.wx-bar-fill.water { background: linear-gradient(90deg, #1565c0, #42a5f5); }
.wx-bar-value {
  width: 40px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

/* 日主强弱 */
.strength-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.strength-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}
.strength-key {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.strength-val {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}
.strength-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
}
.strength-badge.strong { background: rgba(244,67,54,0.2); color: #ef9a9a; border: 1px solid rgba(244,67,54,0.3); }
.strength-badge.weak   { background: rgba(33,150,243,0.2); color: #90caf9; border: 1px solid rgba(33,150,243,0.3); }
.strength-badge.mid    { background: rgba(76,175,80,0.2); color: #81c784; border: 1px solid rgba(76,175,80,0.3); }

/* 用神喜忌 */
.yongshen-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.yongshen-item {
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.yongshen-item.xi {
  background: rgba(76,175,80,0.1);
  border: 1px solid rgba(76,175,80,0.25);
}
.yongshen-item.ji {
  background: rgba(244,67,54,0.1);
  border: 1px solid rgba(244,67,54,0.25);
}
.yongshen-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.yongshen-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 4px;
}
.yongshen-item.xi .yongshen-value { color: #81c784; }
.yongshen-item.ji .yongshen-value { color: #ef9a9a; }
.yongshen-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* 性格分析 */
.personality-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
.personality-symbol {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, rgba(201,162,39,0.15), rgba(201,162,39,0.05));
  border: 2px solid rgba(201,162,39,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  flex-shrink: 0;
}
.personality-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.p-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.p-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.p-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* 大运 */
.dayun-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.dayun-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}
.dayun-item:hover {
  border-color: var(--gold);
  background: rgba(201,162,39,0.08);
  transform: translateY(-2px);
}
.dayun-item.current {
  border-color: var(--gold);
  background: rgba(201,162,39,0.12);
  box-shadow: 0 0 12px rgba(201,162,39,0.2);
}
.dayun-num {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.dayun-ganzhi {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.dayun-age {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.dayun-wuxing {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dayun-year {
  font-size: 0.72rem;
  color: var(--gold-dark);
  margin-top: 4px;
}

/* 流年 */
.liunian-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.liunian-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  transition: var(--transition);
}
.liunian-item.current-year {
  border-color: var(--gold);
  background: rgba(201,162,39,0.1);
}
.liunian-year-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.liunian-ganzhi {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}
.liunian-item.current-year .liunian-ganzhi {
  color: var(--gold);
}
.liunian-shengxiao {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 重算按钮 */
.result-actions {
  text-align: center;
  padding: 20px 0 40px;
}
.btn-recalc {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 12px 40px;
  border-radius: 100px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 1px;
}
.btn-recalc:hover {
  background: rgba(201,162,39,0.1);
}

/* ---- 知识区 ---- */
.knowledge-section {
  padding: 80px 0;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--border);
}
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.knowledge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}
.knowledge-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}
.k-icon {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0d0d1a;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.knowledge-card h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.knowledge-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}
.tiangan-grid, .dizhi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tg, .dz {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 36px;
  border: 1px solid transparent;
}
.tg small, .dz small {
  font-size: 0.62rem;
  font-weight: 400;
  opacity: 0.7;
  white-space: nowrap;
}
.tg.wood, .dz.wood { background: rgba(76,175,80,0.15); color: #81c784; border-color: rgba(76,175,80,0.25); }
.tg.fire, .dz.fire { background: rgba(244,67,54,0.15); color: #ef9a9a; border-color: rgba(244,67,54,0.25); }
.tg.earth, .dz.earth { background: rgba(255,152,0,0.15); color: #ffcc80; border-color: rgba(255,152,0,0.25); }
.tg.metal, .dz.metal { background: rgba(158,158,158,0.15); color: #e0e0e0; border-color: rgba(158,158,158,0.25); }
.tg.water, .dz.water { background: rgba(33,150,243,0.15); color: #90caf9; border-color: rgba(33,150,243,0.25); }

.wuxing-diagram { text-align: center; }
.wx-cycle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.wx {
  display: inline-block;
  width: 32px; height: 32px;
  border-radius: 50%;
  line-height: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.wx.wood { background: rgba(76,175,80,0.25); color: #81c784; }
.wx.fire { background: rgba(244,67,54,0.25); color: #ef9a9a; }
.wx.earth { background: rgba(255,152,0,0.25); color: #ffcc80; }
.wx.metal { background: rgba(158,158,158,0.25); color: #e0e0e0; }
.wx.water { background: rgba(33,150,243,0.25); color: #90caf9; }
.wx-arrow { color: var(--text-muted); font-size: 0.8rem; }
.wx-note { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }

.shishen-list-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ss-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-primary);
}
.ss-item em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ---- 页脚 ---- */
.footer {
  background: rgba(0,0,0,0.4);
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.footer-tip {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-copy a {
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-copy a:hover {
  color: var(--gold);
}

/* ---- 错误提示 ---- */
.error-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(192, 57, 43, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.error-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================================
   响应式 - 平板
   ======================================================== */
@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-visual {
    order: -1;
  }
  .bagua-outer {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }
  .bagua-symbol { font-size: 3.8rem; }
  .t1 { transform: translate(-50%, -50%) translate(0, -94px); }
  .t2 { transform: translate(-50%, -50%) translate(66px, -66px); }
  .t3 { transform: translate(-50%, -50%) translate(94px, 0); }
  .t4 { transform: translate(-50%, -50%) translate(66px, 66px); }
  .t5 { transform: translate(-50%, -50%) translate(0, 94px); }
  .t6 { transform: translate(-50%, -50%) translate(-66px, 66px); }
  .t7 { transform: translate(-50%, -50%) translate(-94px, 0); }
  .t8 { transform: translate(-50%, -50%) translate(-66px, -66px); }
  .title-main { font-size: 2.6rem; }
  .title-sub { font-size: 1.4rem; }
  .result-row {
    grid-template-columns: 1fr;
  }
  .yongshen-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================================================
   响应式 - 手机
   ======================================================== */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero {
    padding: 100px 0 60px;
    min-height: auto;
  }
  .hero-title { font-size: 2rem; }
  .title-main { font-size: 2.2rem; }
  .title-sub { font-size: 1.2rem; }
  .hero-desc { font-size: 0.95rem; }
  .bagua-outer { width: 180px; height: 180px; }
  .bagua-symbol { font-size: 3rem; }
  .t1 { transform: translate(-50%, -50%) translate(0, -76px); }
  .t2 { transform: translate(-50%, -50%) translate(54px, -54px); }
  .t3 { transform: translate(-50%, -50%) translate(76px, 0); }
  .t4 { transform: translate(-50%, -50%) translate(54px, 54px); }
  .t5 { transform: translate(-50%, -50%) translate(0, 76px); }
  .t6 { transform: translate(-50%, -50%) translate(-54px, 54px); }
  .t7 { transform: translate(-50%, -50%) translate(-76px, 0); }
  .t8 { transform: translate(-50%, -50%) translate(-54px, -54px); }

  .form-card { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-group-gender { grid-column: 1; }

  .result-card { padding: 20px 16px; }
  .pillar-table th, .pillar-table td { padding: 8px; font-size: 0.85rem; }
  .pillar-table .ganzhi-big { font-size: 1.4rem; }
  .yongshen-content { grid-template-columns: 1fr; }
  .personality-content { grid-template-columns: 1fr; }
  .personality-symbol { width: 70px; height: 70px; font-size: 1.8rem; margin: 0 auto; }
  .personality-info { grid-template-columns: 1fr; }
  .dayun-list { grid-template-columns: repeat(4, 1fr); }
  .liunian-list { grid-template-columns: repeat(5, 1fr); }
  .basic-info-grid { grid-template-columns: 1fr 1fr; }

  .knowledge-grid { grid-template-columns: 1fr; }
  .section-header h2 { font-size: 1.5rem; }
}

@media (max-width: 380px) {
  .dayun-list { grid-template-columns: repeat(3, 1fr); }
  .liunian-list { grid-template-columns: repeat(4, 1fr); }
}

/* ========================================================
   Tab 切换
   ======================================================== */
.result-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: inherit;
  padding: 12px 28px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.tab-btn .ai-icon {
  color: var(--gold);
  font-size: 0.9rem;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ========================================================
   格局
   ======================================================== */
.gejv-main {
  background: linear-gradient(135deg, rgba(201,162,39,0.1), rgba(201,162,39,0.04));
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.gejv-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.gejv-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.gejv-specials { margin-top: 4px; }
.gejv-special-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.gejv-special-item {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 2px solid var(--gold-dark);
}

/* ========================================================
   神煞
   ======================================================== */
.shensha-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  margin-bottom: 10px;
}
.shensha-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.shensha-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-light);
}
.shensha-pos {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.shensha-jixiong {
  margin-left: auto;
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 600;
}
.ji-good  { background: rgba(76,175,80,0.2);   color: #81c784; border: 1px solid rgba(76,175,80,0.3); }
.ji-bad   { background: rgba(244,67,54,0.2);   color: #ef9a9a; border: 1px solid rgba(244,67,54,0.3); }
.ji-mid   { background: rgba(255,152,0,0.2);   color: #ffcc80; border: 1px solid rgba(255,152,0,0.3); }
.shensha-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.shenshas-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 20px 0;
}

/* ========================================================
   地支关系
   ======================================================== */
.dizhi-rel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
}
.rel-good { background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.25); }
.rel-bad  { background: rgba(244,67,54,0.1); border: 1px solid rgba(244,67,54,0.25); }
.rel-mid  { background: rgba(255,152,0,0.1); border: 1px solid rgba(255,152,0,0.25); }
.rel-type {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.rel-vals { color: var(--text-secondary); }
.dizhi-rel-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 14px 0;
}

/* ========================================================
   AI 深度解读面板
   ======================================================== */
.ai-panel {
  min-height: 400px;
}
.ai-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.ai-sec-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-family: inherit;
  padding: 8px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}
.ai-sec-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.ai-sec-btn.active {
  background: rgba(201,162,39,0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* 触发区 */
.ai-trigger {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}
.ai-trigger-inner {
  text-align: center;
}
.ai-orb {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(201,162,39,0.3) 0%, rgba(201,162,39,0.05) 70%);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: pulse 3s ease-in-out infinite;
}
.ai-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  max-width: 380px;
  line-height: 1.7;
}
.btn-ai-start {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0d0d1a;
  border: none;
  padding: 14px 40px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 1px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(201,162,39,0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-ai-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,0.5);
}
.ai-icon-btn { font-size: 1rem; }

/* 加载动画 */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
}
.ai-loading p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.ai-loading-dots {
  display: flex;
  gap: 8px;
}
.ai-loading-dots span {
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  animation: dot-bounce 1.4s ease-in-out infinite;
}
.ai-loading-dots span:nth-child(1) { animation-delay: 0s; }
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* 输出区 */
.ai-output-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ai-output-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(201,162,39,0.06);
  border-bottom: 1px solid var(--border);
}
.ai-model-tag {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
  flex: 1;
}
.btn-ai-copy, .btn-ai-regen {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ai-copy:hover, .btn-ai-regen:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.ai-output-content {
  padding: 24px 28px;
  font-size: 0.95rem;
  line-height: 2;
  color: var(--text-secondary);
  max-height: 600px;
  overflow-y: auto;
}
.ai-output-content strong {
  color: var(--gold-light);
  font-size: 1rem;
}
.ai-cursor {
  display: none;
  width: 2px;
  height: 1.2em;
  background: var(--gold);
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  border-radius: 1px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* toast success */
.error-toast.toast-success {
  background: rgba(46, 125, 50, 0.9);
}

/* ========================================================
   响应式补充
   ======================================================== */
@media (max-width: 600px) {
  .result-tabs { overflow-x: auto; }
  .tab-btn { padding: 10px 16px; font-size: 0.9rem; white-space: nowrap; }
  .ai-sections { gap: 6px; }
  .ai-sec-btn { padding: 6px 12px; font-size: 0.82rem; }
  .ai-output-content { padding: 16px; font-size: 0.9rem; }
  .dizhi-rel-list { flex-direction: column; }
}
