body {
  padding: 0;
  margin: 0;
}
#container {
  padding: 2px;
  margin: auto;
  max-width: 500px;
}
.zw-home-content {
  max-width: 100% !important;
  overflow: hidden !important;
}
#bazi-container {
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box;
}
.ziwei {
  display: grid;
  border: 1px darkgray groove;
  padding: 1px;
  /* 恢复高度80%，避免中宫内容被挤压 */
  height: 80%;
  line-height: 18px;
  font-size: 16px;
  grid-template-columns: repeat(4, 25%);
  grid-template-rows: repeat(4, 25%);
}
.ziwei > div {
  border: 1px solid #b7b7b7;
  margin: 1px;
  position: relative;
  font-size: 1em;
  overflow: visible;
}
.zwDivCenter {
  grid-column-start: 2;
  grid-column-end: 4;
  grid-row-start: 2;
  grid-row-end: 4;
  position: relative;
  border: 1px solid #b7b7b7;
  margin: 1px;
  font-weight: bold;
  /* 中宫允许内部滚动，确保内容完整显示 */
  overflow: auto;
  /* 确保按钮有空间显示 */
  padding-bottom: 40px;
  box-sizing: border-box;
}
.zwDivCenter div {
  text-align: left;
  margin: 8px;
}
#bazi-container {
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box;
  padding: 4px 2px;
  /* 确保四柱容器有足够高度 */
  min-height: 80px;
}
.zwDivCenter .zwcopy {
  bottom: 0;
  right: 0;
  font-size: 1em;
  font-weight: normal;
}
.StarA,
.StarB,
.StarC,
.MangA,
.MangB,
.MangC,
.MangY10,
.MangY1,
.zwcopy,
.zwDivHeader > div {
  position: absolute;
}
.starDiv {
  border: 0px solid blue;
  margin: 5px;
}
.StarA {
  top: 0;
  color: blue;
}
.StarA span {
  color: Fuchsia;
}
.Star4 {
  margin-top: 8px;
}
.Star4 span {
  color: #8000ff;
  font-weight: normal;
}
.StarB {
  color: Red;
  top: 0;
}
.StarC {
  text-align: right;
  top: 75px;
  right: 0;
  width: 100%;
}
.StarA,
.StarC {
  text-align: right;
}
.StarAll {
  display: none;
}
.MangB {
  width: 100%;
  font-weight: bold;
}
.MangC {
  color: blue;
}
.MangA,
.MangB,
.MangC {
  bottom: 0;
}
.MangY10,
.MangY1 {
  width: 100%;
  height: 1.5em;
  font-size: 0.8em;
}
.MangY10,
.MangY1,
.MangB {
  text-align: center;
}
.MangY10 {
  bottom: 3.2em;
  color: purple;
}
.MangY1 {
  bottom: 2.8em;
  color: navy;
  font-size: 10px;
  line-height: 11px;
}
.zwStarRight,
.MangC {
  right: 0;
}
.zwStarLeft,
.MangA {
  left: 0;
}

.shen {
  color: red;
}

.weui-half-screen-dialog {
  max-width: 500px;
  margin: auto;
}

/* 奇门九宫格样式 */
#qimen-grid {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  max-width: 100%;
  /* 确保奇门九宫格有足够的底部空间给按钮 */
  margin-bottom: 10px;
}

#qimen-grid > div {
  display: grid !important;
  grid-template-columns: repeat(3, 36px) !important;
  grid-template-rows: repeat(3, 36px) !important;
  border: 2px solid #2c3e50 !important;
  grid-auto-flow: row !important;
}

.qimen-cell {
  border: 1px solid #2c3e50 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  font-weight: bold !important;
  color: #2c3e50 !important;
  background-color: #f8f9fa !important;
  box-sizing: border-box !important;
}

/* 排盘按钮悬浮样式 */
#paipan-button {
  /* 按钮悬浮在最上层 */
  position: sticky !important;
  bottom: 5px !important;
  z-index: 1000 !important;
  /* 按钮样式 */
  max-width: 80px !important;
  font-size: 14px !important;
  padding: 6px 12px !important;
  /* 确保按钮不被其他样式覆盖 */
  margin: 0 !important;
}

/* 确保按钮始终在最上层 */
.weui-btn {
  position: relative !important;
  z-index: 100 !important;
}
