/* ========================================
   一德官网 · 八字排盘工具样式
   /css/tool.css · v1.0 · 2026-05-27
   仅用于 /tools/ 目录下的工具页面
   ======================================== */
/* ---------- 工具页主容器 ---------- */
.tool-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2c2c2c;
  line-height: 1.75;
}
/* ---------- 答案框前置(GEO 优化) ---------- */
.tool-answer-box {
  background: #f9f5ec;
  border-left: 4px solid #8b6f47;
  padding: 18px 22px;
  margin: 24px 0 32px;
  border-radius: 4px;
  font-size: 15px;
  color: #3a3a3a;
}
/* ---------- 输入表单区 ---------- */
.tool-form {
  background: #fefcf7;
  border: 1px solid #e8dfc9;
  border-radius: 8px;
  padding: 28px 24px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(139, 111, 71, 0.06);
}
.tool-form h2 {
  font-size: 18px;
  color: #5c4628;
  margin: 0 0 20px;
  font-weight: 600;
}
.tool-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}
.tool-form-row label {
  min-width: 80px;
  font-size: 14px;
  color: #5c4628;
  font-weight: 500;
}
.tool-form-row select,
.tool-form-row input[type="text"] {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border: 1px solid #d4c5a0;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  color: #333;
  font-family: inherit;
}
.tool-form-row select:focus,
.tool-form-row input[type="text"]:focus {
  outline: none;
  border-color: #8b6f47;
  box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.15);
}
.tool-form-radio {
  display: inline-flex;
  align-items: center;
  margin-right: 16px;
  cursor: pointer;
}
.tool-form-radio input {
  margin-right: 6px;
}
.tool-form-hint {
  font-size: 12px;
  color: #8a7c5e;
  margin-top: 4px;
  width: 100%;
}
.tool-submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: #8b6f47;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.tool-submit-btn:hover {
  background: #6f5736;
}
.tool-submit-btn:disabled {
  background: #c2b89e;
  cursor: not-allowed;
}
/* ---------- 排盘结果区 ---------- */
.tool-result {
  display: none;
  margin-top: 32px;
}
.tool-result.active {
  display: block;
}
.result-section {
  margin-bottom: 28px;
  background: #fff;
  border: 1px solid #e8dfc9;
  border-radius: 6px;
  padding: 20px 22px;
}
.result-section h3 {
  font-size: 16px;
  color: #5c4628;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d4c5a0;
  font-weight: 600;
}
/* 四柱八字表 */
.bazi-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}
.bazi-pillar {
  background: #faf6ec;
  border: 1px solid #e0d4b0;
  border-radius: 4px;
  padding: 12px 6px;
}
.bazi-pillar-label {
  font-size: 12px;
  color: #8a7c5e;
  margin-bottom: 6px;
}
.bazi-pillar-gan {
  font-size: 22px;
  font-weight: 700;
  color: #5c4628;
  margin-bottom: 2px;
}
.bazi-pillar-zhi {
  font-size: 22px;
  font-weight: 700;
  color: #8b4513;
  margin-bottom: 6px;
}
.bazi-pillar-shishen {
  font-size: 11px;
  color: #6f5736;
  line-height: 1.4;
}
.bazi-pillar-day .bazi-pillar-gan {
  color: #c0392b;
  position: relative;
}
.bazi-pillar-day .bazi-pillar-gan::after {
  content: "日主";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #c0392b;
  font-weight: 400;
}
/* 五行统计 */
.wuxing-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  text-align: center;
}
.wuxing-item {
  padding: 10px 4px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}
.wx-jin   { background: #f4e9c8; color: #8a7228; }
.wx-mu    { background: #d4ecd2; color: #2f6b2c; }
.wx-shui  { background: #d4e3f4; color: #2c5a8a; }
.wx-huo   { background: #f4d4d2; color: #8a2c2c; }
.wx-tu    { background: #ede4d0; color: #6b5028; }
.wuxing-item-label { display: block; font-size: 12px; margin-bottom: 4px; opacity: 0.85; }
.wuxing-item-count { display: block; font-size: 18px; }
/* 旺衰判断 */
.wangshuai-card {
  background: linear-gradient(135deg, #faf6ec 0%, #f4ead2 100%);
  padding: 16px 20px;
  border-radius: 6px;
  border-left: 3px solid #8b6f47;
}
.wangshuai-result {
  font-size: 18px;
  font-weight: 700;
  color: #5c4628;
  margin-bottom: 8px;
}
.wangshuai-desc {
  font-size: 14px;
  color: #6f5736;
  line-height: 1.7;
}
/* 大运表 */
.dayun-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dayun-table th,
.dayun-table td {
  border: 1px solid #e0d4b0;
  padding: 8px 6px;
  text-align: center;
}
.dayun-table th {
  background: #faf6ec;
  color: #5c4628;
  font-weight: 600;
}
/* 神煞 */
.shensha-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shensha-tag {
  display: inline-block;
  padding: 4px 10px;
  background: #f4ead2;
  color: #6f5736;
  border-radius: 12px;
  font-size: 12px;
}
/* ---------- 文章推荐模块(核心引流) ---------- */
.tool-recommend {
  margin-top: 36px;
  padding: 24px 22px;
  background: #fefcf7;
  border: 2px solid #d4c5a0;
  border-radius: 8px;
}
.tool-recommend h3 {
  font-size: 18px;
  color: #5c4628;
  margin: 0 0 8px;
  font-weight: 700;
}
.tool-recommend-subtitle {
  font-size: 13px;
  color: #8a7c5e;
  margin-bottom: 18px;
}
.recommend-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.recommend-item {
  display: block;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e8dfc9;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.recommend-item:hover {
  border-color: #8b6f47;
  box-shadow: 0 2px 8px rgba(139, 111, 71, 0.12);
  transform: translateY(-1px);
}
.recommend-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #5c4628;
  margin-bottom: 4px;
}
.recommend-item-summary {
  font-size: 13px;
  color: #6f5736;
  line-height: 1.6;
}
/* ---------- 详测引流 CTA ---------- */
.tool-cta {
  margin: 40px 0 0;
  padding: 28px 24px;
  background: linear-gradient(135deg, #8b6f47 0%, #6f5736 100%);
  border-radius: 8px;
  color: #fff;
  text-align: center;
}
.tool-cta h3 {
  font-size: 20px;
  margin: 0 0 12px;
  font-weight: 700;
  color: #fff;
}
.tool-cta p {
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.7;
  opacity: 0.92;
}
.tool-cta-btn {
  display: inline-block;
  padding: 12px 36px;
  background: #fff;
  color: #5c4628;
  border-radius: 6px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.tool-cta-btn:hover {
  background: #faf6ec;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* ---------- FAQ 区 ---------- */
.tool-faq {
  margin-top: 40px;
}
.tool-faq h2 {
  font-size: 20px;
  color: #5c4628;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d4c5a0;
}
.faq-item {
  background: #fefcf7;
  border: 1px solid #e8dfc9;
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 16px 20px;
}
.faq-question {
  font-size: 15px;
  font-weight: 600;
  color: #5c4628;
  margin: 0 0 8px;
}
.faq-answer {
  font-size: 14px;
  color: #4a4a4a;
  line-height: 1.75;
  margin: 0;
}
.faq-answer a {
  color: #8b6f47;
  text-decoration: underline;
}
/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .tool-container { padding: 16px 12px 60px; }
  .bazi-pillars { gap: 4px; }
  .bazi-pillar { padding: 10px 4px; }
  .bazi-pillar-gan, .bazi-pillar-zhi { font-size: 18px; }
  .wuxing-stats { gap: 6px; }
  .wuxing-item-count { font-size: 16px; }
  .tool-form-row { flex-direction: column; align-items: stretch; }
  .tool-form-row label { margin-bottom: 4px; }
  .dayun-table { font-size: 12px; }
  .dayun-table th, .dayun-table td { padding: 6px 3px; }
}
/* ---------- 加载状态 ---------- */
.tool-loading {
  display: none;
  text-align: center;
  padding: 40px 0;
  color: #8a7c5e;
}
.tool-loading.active { display: block; }
.tool-error {
  display: none;
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #8a2c2c;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0;
}
.tool-error.active { display: block; }/* ---------- v1 批命系统:命局结构判断卡片 ---------- */
.tool-judgement {
  margin: 32px 0;
  padding: 24px;
  background: #fbf7ef;
  border: 1px solid #e6d9c2;
  border-radius: 12px;
}
.tool-judgement > h3 {
  margin: 0 0 18px;
  font-size: 20px;
  color: #6b4f2a;
  border-left: 4px solid #b8893f;
  padding-left: 12px;
}
.judgement-card {
  margin-bottom: 16px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #ece3d2;
  border-radius: 10px;
}
.judgement-card:last-of-type { margin-bottom: 8px; }
.judgement-card-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: #8a5a1f;
}
.judgement-card-explain {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.8;
  color: #3a3a3a;
}
.judgement-card-advice {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.8;
  color: #5a4a2a;
  background: #f7f0e3;
  padding: 12px 14px;
  border-radius: 8px;
}
.judgement-card-link {
  display: inline-block;
  font-size: 14px;
  color: #b8893f;
  text-decoration: none;
  font-weight: 500;
}
.judgement-card-link:hover { text-decoration: underline; }
.judgement-footer {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #999;
  font-style: normal;
}
@media (max-width: 768px) {
  .tool-judgement { padding: 16px; }
  .judgement-card { padding: 14px 16px; }
}
