/* 八字排盘页面样式（页面上方留出安全区+免责条+导航栏，整体下移避免裁切） */

/* 主内容区整体下移，避免被固定导航挡住 */
.bazi-form,
.bazi-result,
.bazi-from-register {
  margin-top: var(--header-height);
}

/* 免责声明提示（bazi 页内若覆盖 fortune.css 则保留安全区） */
.disclaimer-tip {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 8px 15px calc(env(safe-area-inset-bottom) + 8px) 15px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  border-radius: 0;
  cursor: pointer;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}

.disclaimer-icon {
  font-size: 18px;
  margin-right: 10px;
}

.disclaimer-text {
  flex: 1;
  font-size: 13px;
  color: #856404;
}

.disclaimer-arrow {
  font-size: 18px;
  color: #856404;
}

/* 输入表单卡片 */
.input-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"] {
  width: 100%;
  height: 45px;
  padding: 0 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-item input[type="radio"] {
  margin-right: 8px;
}

/* 结果容器 */
.result-container {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 基本信息卡片 */
.header-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  color: #fff;
}

.case-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.case-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: bold;
}

.case-mingju {
  font-size: 14px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
}

.case-gender {
  font-size: 16px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 20px;
}

.header-line {
  font-size: 14px;
  margin-bottom: 8px;
  opacity: 0.9;
}

/* 八字表格 */
.bazi-table {
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  overflow-x: auto;
}

.bazi-header-row,
.bazi-row {
  display: grid;
  grid-template-columns: 60px repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.row-label {
  font-size: 13px;
  font-weight: bold;
  color: #666;
  text-align: center;
}

.col-label {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  text-align: center;
  padding: 8px 0;
}

.cell {
  text-align: center;
  padding: 10px 5px;
  font-size: 16px;
  background: #f8f9fa;
  border-radius: 6px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell.gan,
.cell.zhi {
  font-weight: bold;
  font-size: 18px;
}

/* 藏干行 */
.canggan-row .cell {
  flex-direction: column;
  padding: 8px 5px;
  min-height: 60px;
}

.multi-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.canggan-item {
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.canggan-gan {
  font-weight: bold;
}

.canggan-shishen {
  color: #999;
  font-size: 11px;
}

/* 五行统计卡片 */
.wuxing-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
}

.card-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.wuxing-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.wuxing-item {
  text-align: center;
  padding: 15px 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.wuxing-name {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
}

.wuxing-count {
  font-size: 24px;
  font-weight: bold;
}

.wuxing-item.wood { border-left: 4px solid #22c55e; }
.wuxing-item.fire { border-left: 4px solid #ef4444; }
.wuxing-item.earth { border-left: 4px solid #d4af37; }
.wuxing-item.metal { border-left: 4px solid #f59e0b; }
.wuxing-item.water { border-left: 4px solid #3b82f6; }

/* 操作按钮 */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.btn-action {
  background: #fff;
  border: 1px solid #e0e0e0;
  color: #667eea;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn-action:active {
  background: #f5f5f5;
}

/* 免责声明弹窗 */
.disclaimer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disclaimer-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.disclaimer-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin: 20px;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1;
}

.disclaimer-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

.disclaimer-body {
  margin-bottom: 20px;
}

.disclaimer-text {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  text-align: justify;
}

.disclaimer-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.disclaimer-btn {
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.disclaimer-btn.cancel {
  background: #f5f5f5;
  color: #666;
}

.disclaimer-btn.confirm {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

/* 五行颜色 */
.color-wood { color: #22c55e; }
.color-fire { color: #ef4444; }
.color-earth { color: #d4af37; }
.color-metal { color: #f59e0b; }
.color-water { color: #3b82f6; }
