/* ============================================================
   第六轮 UI 调整：六神同步 / 梅花放大带标签 / 小字小按钮加大 /
   长生等卦面按钮加大 / 干支历进工具页后的排版
   ============================================================ */

/* ---------- 1. 六神与六亲五行同字号（JS 已同步，这里兜住版面） ---------- */
@media (min-width: 901px) {
  #view-cast .ct-shen {
    /* 默认跟排盘字号，但设置里单独调过六神字号时以它为准 */
    font-size: var(--m-shen-fs, var(--m-chart-fs, 15.5px)) !important;
    letter-spacing: 0;
    line-height: 1.35;
  }
  #view-cast .ct-shen .qx { font-size: calc(var(--m-chart-fs, 15.5px) * 0.82); }
  /* 六神列宽跟着字号走 */
  #view-cast .ct-head,
  #view-cast .ct-row {
    grid-template-columns: calc(var(--m-chart-fs, 15.5px) * 2.6) minmax(0, 1fr) minmax(0, 1fr) !important;
  }
  #view-cast .chart-body.no-bian .ct-head,
  #view-cast .chart-body.no-bian .ct-row {
    grid-template-columns: calc(var(--m-chart-fs, 15.5px) * 2.6) minmax(0, 1fr) !important;
  }

  /* ---------- 2. 梅花盘：整行放大，标签在卦象上方 ---------- */
  /* 按钮一行、卦象另起一行 */
  #view-cast .meihua-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  #view-cast .mh-head { width: 100%; }
  #view-cast .mh-actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }

  #view-cast .meihua-bar { padding: 14px 16px 16px; }
  #view-cast .mh-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px 28px;
    margin-top: 14px;
    grid-template-columns: none;
  }
  #view-cast .mh-item {
    flex: 0 0 auto;
    min-width: 96px;
    align-items: center;
    gap: 0;
    padding: 8px 6px 6px;
    border-radius: 8px;
  }
  #view-cast .mh-tag {
    display: block;
    font-family: var(--font-serif);
    font-size: calc(var(--m-chart-fs, 15.5px) * 0.78);
    letter-spacing: .12em;
    color: var(--ink-3);
    margin-bottom: 6px;
  }
  #view-cast .mh-hex { height: auto; gap: 4px; }
  #view-cast .mh-line {
    width: 68px;
    height: 8px;
    border-radius: 2px;
  }
  #view-cast .mh-line.yin { background: transparent; }
  #view-cast .mh-line.yin b { width: 29px; height: 8px; border-radius: 2px; }
  #view-cast .mh-name {
    margin-top: 7px;
    font-size: calc(var(--m-chart-fs, 15.5px) * 0.92);
  }

  /* ---------- 3. 小字号整体加大 ---------- */
  .hint, #view-tools .tool-card > header .hint { font-size: 13px !important; }
  .m-card .field-label { font-size: 13.5px; }
  .ss-item, .ss-toggle { font-size: calc(var(--m-chart-fs, 15.5px) * 0.88) !important; }
  .chip { font-size: 12.5px; padding: 1px 7px; }
  .vtag { font-size: 12.5px; padding: 2px 8px; }
  .rec-card .rec-no, .rec-card .rec-sn { font-size: 13px; }
  .rec-card .rec-gua { font-size: 15.5px; }
  .rec-sum, .rec-empty { font-size: 13.5px; }
  .rs-title, .rs-manage { font-size: 13.5px; }
  .rs-chip { font-size: 14px; }
  #gcal .gcal-sub, #gcal .gcal-jie { font-size: 13px; }
  .gcal-week { font-size: 12px; }
  .gc-date { font-size: 12px !important; }
  .gc-gz { font-size: 14.5px !important; }
  .gc-month { font-size: 11.5px !important; }
  .iy-item, .hint-line { font-size: 13px; }
  .foot { font-size: 12.5px; }

  /* 小按钮也加大（不是主按钮的那种） */
  .btn.small, .btn.sm, .seg-btn, .rs-manage, .tool-ord-btn {
    font-size: 13.5px !important;
    padding: 4px 12px !important;
    min-height: 30px;
  }
  .icon-btn { width: 30px; height: 30px; font-size: 15px; }
  .mh-btn {
    font-size: 14px !important;
    padding: 6px 10px !important;
    min-width: 72px;
  }
  #view-cast .mh-btn { flex: 0 0 auto; }

  /* ---------- 4. 卦面上的按钮（长生「帝旺」这类）加大 ---------- */
  #view-tools #toolChangsheng .cs-wx-btn {
    font-size: 15px !important;
    padding: 8px 20px !important;
    min-width: 96px;
    min-height: 38px;
  }
  #view-tools #toolChangsheng .cs-stage-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px 12px;
  }
  #view-tools #toolChangsheng .cs-stage {
    font-size: 15.5px !important;
    padding: 10px 12px !important;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  #view-tools #toolChangsheng .cs-stage b { font-size: 16px; }
  #view-tools #toolChangsheng .cs-stage span { font-size: 12.5px; }
  #view-tools #toolYingqi .yq-chip {
    font-size: 14px !important;
    padding: 6px 10px !important;
    min-height: 34px;
    min-width: 52px;
  }
  #view-tools #toolNayin .ny-item, #view-tools #toolNayin button {
    font-size: 14.5px !important;
    padding: 7px 10px !important;
    min-height: 36px;
  }
  #view-tools #toolGuigu .gg-cat {
    font-size: 14px !important;
    padding: 6px 14px !important;
    min-height: 34px;
  }

  /* ---------- 5. 干支历进工具页后的排版 ---------- */
  #gcalSlot { display: block; }
  #gcalSlot .gcal {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 10px;
    box-shadow: none;
    touch-action: auto;
  }
  #gcalSlot .gcal .gcal-head { cursor: default; }
  #gcalSlot .gcal .gcal-week,
  #gcalSlot .gcal #gcalBody { max-width: 760px; margin-left: auto; margin-right: auto; }
  #gcalSlot .gcal .gc-day { min-height: 52px; }
}
