/* ===== 老黄历 H5 · 样式（移动优先·传统宣纸风·适配微信内置浏览器） ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Heiti SC", sans-serif;
  color: #3a2c20;
  background:
    radial-gradient(120% 80% at 50% 0%, #fbf6ea 0%, #f3ead6 55%, #ece0c6 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 480px; margin: 0 auto;
  padding: 16px 14px calc(32px + env(safe-area-inset-bottom));
  padding-top: calc(16px + env(safe-area-inset-top));
}

/* 顶部 */
.hd { display: flex; align-items: center; gap: 14px; padding: 6px 4px 14px; }
.seal {
  width: 52px; height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  background: #b5341f; color: #fff4e8;
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  border-radius: 8px; line-height: 1.05; text-align: center;
  box-shadow: 0 2px 8px rgba(181,52,31,.35);
  font-family: "KaiTi", "STKaiti", serif;
}
.hd-text h1 { margin: 0; font-size: 26px; letter-spacing: 6px; font-weight: 800; color: #7a1f12; }
.hd-text p { margin: 2px 0 0; font-size: 12px; color: #998871; letter-spacing: 2px; }

/* 日期栏 */
.datebar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px;
}
.nav-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border: none; border-radius: 10px;
  background: #fffaf0; color: #b5341f; font-size: 22px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: pointer;
}
.nav-btn:active { transform: scale(.94); }
.date-pick { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; }
#dateInput {
  border: 1px solid #e2d4b6; border-radius: 10px; background: #fffaf0;
  padding: 9px 10px; font-size: 15px; color: #3a2c20; text-align: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}
.today-btn {
  border: 1px solid #c9a227; background: #fff; color: #a8841a;
  border-radius: 10px; padding: 9px 14px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.today-btn:active { background: #fdf3da; }

/* 卡片通用 */
.card {
  background: linear-gradient(180deg, #fffdf8 0%, #fffaf0 100%);
  border: 1px solid #ecdfc4; border-radius: 16px;
  padding: 16px; margin-bottom: 14px;
  box-shadow: 0 3px 14px rgba(120,90,40,.08);
}

/* 主历卡 */
.main-card { text-align: center; position: relative; overflow: hidden; }
.main-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% -10%, rgba(201,162,39,.10), transparent 60%);
  pointer-events: none;
}
.solar-line { display: flex; align-items: center; justify-content: center; gap: 10px; }
.solar-line span:first-child { font-size: 17px; font-weight: 700; color: #4a3a2a; letter-spacing: 1px; }
.src-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #eef5f0; color: #2f7d5b; border: 1px solid #cfe6d8;
}
.src-badge.toolfk { background: #fdeee9; color: #b5341f; border-color: #f3c9bd; }
.lunar-line { font-size: 22px; font-weight: 800; color: #7a1f12; margin: 8px 0 12px; letter-spacing: 2px; font-family: "KaiTi","STKaiti",serif; }
.gz-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-size: 13px; padding: 5px 11px; border-radius: 20px;
  background: #fbf2dc; color: #8a6a16; border: 1px solid #ecd9a6; font-weight: 600;
}
.chip.animal { background: #fdeae5; color: #b5341f; border-color: #f3c9bd; }
.chip.nayin { background: #eef1f6; color: #3a5a86; border-color: #cdd9ec; }
.zhi-line { margin-top: 12px; font-size: 13px; color: #6b5a45; letter-spacing: 1px; }

/* 宜忌 */
.yi-ji { display: flex; gap: 12px; margin-bottom: 14px; }
.panel { flex: 1; border-radius: 16px; padding: 14px 12px; min-height: 150px; }
.panel.yi { background: linear-gradient(180deg,#fdeee9,#fbe3db); border: 1px solid #f3c9bd; }
.panel.ji { background: linear-gradient(180deg,#eaf3ee,#dcebe2); border: 1px solid #cfe6d8; }
.panel-hd {
  font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 10px;
  font-family: "KaiTi","STKaiti",serif;
}
.panel.yi .panel-hd { color: #b5341f; }
.panel.ji .panel-hd { color: #2f7d5b; }
.panel-bd { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.panel-bd span {
  font-size: 13px; padding: 4px 9px; border-radius: 8px; background: rgba(255,255,255,.7);
}
.panel.yi .panel-bd span { color: #9e2b16; }
.panel.ji .panel-bd span { color: #20664a; }
.empty-tip { color: #9b8a74; font-size: 12px; text-align: center; width: 100%; padding: 14px 0; }

/* 信息网格 */
.grid-card { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #ecdfc4; padding: 0; overflow: hidden; }
.cell { background: #fffdf8; padding: 12px 14px; }
.cell .k { font-size: 12px; color: #998871; margin-bottom: 4px; letter-spacing: 1px; }
.cell .v { font-size: 15px; color: #3a2c20; font-weight: 600; line-height: 1.5; }
.cell.full { grid-column: 1 / -1; }
.tag-good { color: #2f7d5b; }
.tag-bad { color: #b5341f; }

/* 节气 */
.jieqi-card { display: flex; justify-content: space-around; text-align: center; }
.jq { flex: 1; }
.jq .k { font-size: 12px; color: #998871; margin-bottom: 4px; }
.jq .v { font-size: 14px; color: #7a1f12; font-weight: 700; }

/* 更多 */
.more { margin-bottom: 14px; }
.more summary {
  list-style: none; cursor: pointer; text-align: center; font-size: 13px;
  color: #a8841a; padding: 10px; background: #fffaf0; border: 1px dashed #e2d4b6;
  border-radius: 12px;
}
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { border-radius: 12px 12px 0 0; border-bottom: none; }
.more .card { border-radius: 0 0 12px 12px; margin-top: 0; }

/* 页脚 */
.ft { text-align: center; font-size: 11px; color: #a9967c; padding: 8px 0 0; letter-spacing: .5px; }

/* 加载态 */
.loading { opacity: .5; transition: opacity .2s; }

/* 错误提示 */
.err-box {
  display: none;
  background: #fdeee9; color: #b5341f; border: 1px solid #f3c9bd;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  font-size: 13px; line-height: 1.5;
}
