/**
 * 首页壳：先扣底栏 Tab，剩余内容区等比例（用户 2026-10-21）
 * 星空 25% | 四行按键(+开始排盘) 50% | 黄历+注册/备案 25%
 * 手机/平板/电脑同一比例随屏缩放；禁止 zoom
 */

.theme-gentle .chart-input-phase {
  --home-action-btn-h: auto;
}

/* —— 一屏三区：1fr / 2fr / 1fr = 25% / 50% / 25% —— */
.theme-gentle .app-shell.app-shell-chart-home {
  height: var(--vvh, 100dvh);
  max-height: var(--vvh, 100dvh);
  min-height: 0;
  padding-bottom: calc(var(--home-tab-pad, 76px) + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.theme-gentle .app-shell.app-shell-chart-home .main {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.theme-gentle .card-chart-home.chart-input-phase {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: grid !important;
  grid-template-rows: 1fr 2fr 1fr !important;
  align-content: stretch;
  padding: 0 !important;
  margin: 0 !important;
  row-gap: 0 !important;
}

.theme-gentle .chart-input-phase .chart-home-head {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.theme-gentle .chart-input-phase .chart-home-head-media-wrap {
  animation: none;
  transform: none;
}

.theme-gentle .chart-input-phase .chart-home-head-poster,
.theme-gentle .chart-input-phase .chart-home-head-media {
  display: block;
  transform: none;
  object-fit: cover;
  object-position: center 40%;
  width: 100%;
  height: 100%;
}

.theme-gentle .chart-input-phase .face-home-middle-zone {
  display: flex !important;
  flex-direction: column !important;
  justify-content: stretch !important;
  align-content: stretch !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.theme-gentle .chart-input-phase .face-home-core-group {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  padding: clamp(4px, 1vh, 10px) var(--space-md, 14px) clamp(4px, 0.8vh, 8px);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 中间区四行等高：昵称 · 时间 · 地址 · 开始排盘（开始排盘是第 4 行，不是第 5 行） */
.theme-gentle .chart-input-phase .face-home-core-group .home-form-four-rows {
  flex: 1 1 auto !important;
  gap: clamp(4px, 0.9vh, 10px);
  min-height: 0 !important;
  height: 100% !important;
  padding: 0;
  align-content: stretch;
  display: grid !important;
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
}

.theme-gentle .chart-input-phase .face-home-core-group .face-chart-btn {
  min-height: 44px !important;
  max-height: none !important;
  height: auto !important;
  margin-top: 0;
}

.theme-gentle .chart-input-phase .face-home-core-group .home-form-four-rows > .face-slot,
.theme-gentle .chart-input-phase .home-form-four-rows .home-entry-card,
.theme-gentle .chart-input-phase .home-form-four-rows .user-name-cell input,
.theme-gentle .chart-input-phase .home-form-four-rows .gender-cell .seg-chip-group,
.theme-gentle .chart-input-phase .home-form-four-rows .calendar-cell .seg-chip-group,
.theme-gentle .chart-input-phase .home-form-four-rows .home-entry-card-reverse,
.theme-gentle .chart-input-phase .face-chart-btn .home-row-action-btn {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  box-sizing: border-box;
}

.theme-gentle .chart-input-phase .home-form-four-rows .user-gender-row,
.theme-gentle .chart-input-phase .home-form-four-rows .home-action-split,
.theme-gentle .chart-input-phase .home-split-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-right-col, 6.75rem);
  column-gap: var(--home-form-gap, 8px);
  gap: var(--home-form-gap, 8px);
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.theme-gentle .chart-input-phase .home-split-pair > *,
.theme-gentle .chart-input-phase .home-form-four-rows .user-gender-row > * {
  min-width: 0;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.theme-gentle .chart-input-phase .face-home-calendar-zone {
  position: relative;
  align-self: stretch !important;
  justify-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  padding: var(--space-xs, 6px) var(--space-md, 14px) var(--space-xs, 6px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
  margin: 0 !important;
}

.theme-gentle .chart-input-phase .home-calendar-icp-float {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 0 2px;
  pointer-events: auto;
  z-index: 2;
}

/* 黄历 25% 区内：备案/注册信息贴在板下方，各端都显示 */
.theme-gentle .chart-input-phase .site-icp-foot.site-icp-foot--under-cal {
  display: block !important;
  flex: 0 0 auto;
  margin: 2px 0 0;
  padding: 0 4px;
  font-size: clamp(0.625rem, 1.6vh, 0.75rem);
  line-height: 1.3;
  color: #94a3b8;
  background: transparent;
  border: none;
  text-align: center;
}

.theme-gentle .chart-input-phase .home-calendar-zone-title {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 4px 6px;
  font-size: var(--font-caption, 0.8125rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #8a5a00;
  text-align: center;
}

.theme-gentle .chart-input-phase .face-home-calendar-zone > .face-slot {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.theme-gentle .chart-input-phase .home-calendar-board.home-now-clock {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

.theme-gentle .chart-input-phase .face-chart-btn {
  overflow: hidden;
  max-width: 100%;
}

.theme-gentle .chart-input-phase .face-chart-btn .btn-chin-primary,
.theme-gentle .chart-input-phase .face-chart-btn .btn-chin-inline,
.theme-gentle .chart-input-phase .face-chart-btn .home-row-action-btn {
  font-size: var(--font-body, 1rem);
  width: 100%;
  height: 100% !important;
  min-height: 44px !important;
  max-height: none !important;
}

.theme-gentle .chart-input-phase .home-form-four-rows .gender-cell .seg-chip-btn,
.theme-gentle .chart-input-phase .home-form-four-rows .calendar-cell .seg-chip-btn {
  border-radius: 8px;
  min-height: 0;
  height: auto;
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.theme-gentle .chart-input-phase .home-form-four-rows .gender-cell .seg-chip-group,
.theme-gentle .chart-input-phase .home-form-four-rows .calendar-cell .seg-chip-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

/*
 * 短屏也不改成 height:auto：一滚黄历就会钻到 fixed 底栏下面（手机失真）
 * 首页录入始终一屏定高：星空可缩，表单 max-content，黄历定高压在底栏之上
 */
html.ui-scroll:not(.ui-desktop) body.theme-gentle:has(.app-shell-chart-home),
html.ui-short:not(.ui-desktop) body.theme-gentle:has(.app-shell-chart-home) {
  overflow: hidden;
  height: 100%;
}

html.ui-scroll:not(.ui-desktop) .theme-gentle .app-shell.app-shell-chart-home,
html.ui-short:not(.ui-desktop) .theme-gentle .app-shell.app-shell-chart-home {
  height: var(--vvh, 100dvh) !important;
  max-height: var(--vvh, 100dvh) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

html.ui-scroll:not(.ui-desktop) .theme-gentle .app-shell.app-shell-chart-home .main,
html.ui-short:not(.ui-desktop) .theme-gentle .app-shell.app-shell-chart-home .main {
  height: 100% !important;
  overflow: hidden !important;
}

html.ui-scroll:not(.ui-desktop) .theme-gentle .card-chart-home.chart-input-phase,
html.ui-short:not(.ui-desktop) .theme-gentle .card-chart-home.chart-input-phase {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  grid-template-rows: 1fr 2fr 1fr !important;
  align-content: stretch !important;
}

html.ui-scroll:not(.ui-desktop) .theme-gentle .chart-input-phase .face-home-calendar-zone,
html.ui-short:not(.ui-desktop) .theme-gentle .chart-input-phase .face-home-calendar-zone {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
}

html.ui-phone .theme-gentle .chart-input-phase .face-home-calendar-zone {
  min-height: 0;
}

html.ui-phone .theme-gentle .chart-input-phase .home-calendar-board.home-now-clock {
  height: 100%;
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
}

/* iPad / 平板：同 25/50/25，壳居中 */
html.ui-tablet .theme-gentle .app-shell.app-shell-chart-home {
  width: min(100%, var(--shell-max, 640px));
  max-width: min(100%, var(--shell-max, 640px));
}

html.ui-tablet .theme-gentle .card-chart-home.chart-input-phase {
  grid-template-rows: 1fr 2fr 1fr !important;
  align-content: stretch !important;
}

html.ui-tablet .theme-gentle .chart-input-phase .face-home-middle-zone {
  justify-content: stretch !important;
}

/*
 * 桌面 / Mac：同 25% / 50% / 25% 三区（用户要求各端等比例）
 * birth-form 用 contents，让中间区与黄历直接占第 2、3 行
 */
html.ui-desktop .theme-gentle .app-shell.app-shell-chart-home {
  height: var(--vvh, 100dvh) !important;
  max-height: var(--vvh, 100dvh) !important;
  overflow: hidden !important;
}

html.ui-desktop .theme-gentle .app-shell.app-shell-chart-home .main {
  height: 100% !important;
  overflow: hidden !important;
}

html.ui-desktop .theme-gentle .card-chart-home.chart-input-phase {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  grid-template-rows: 1fr 2fr 1fr !important;
  align-content: stretch !important;
}

html.ui-desktop .theme-gentle .chart-input-phase .birth-form-thumb-zone.birth-form-fields {
  display: contents !important;
}

html.ui-desktop .theme-gentle .chart-input-phase .face-home-middle-zone {
  grid-row: 2 !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
  justify-content: stretch !important;
}

html.ui-desktop .theme-gentle .chart-input-phase .face-home-calendar-zone {
  grid-row: 3 !important;
  flex: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: var(--space-xs, 6px) var(--space-md, 14px) 4px !important;
  margin-top: 0 !important;
  border-top: 1px solid rgba(201, 162, 39, 0.35);
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(245, 200, 66, 0.22) 0%, transparent 55%),
    linear-gradient(180deg, #fffaf0 0%, #fff3e0 100%);
}

html.ui-desktop .theme-gentle .chart-input-phase .face-home-calendar-zone > .face-slot {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

html.ui-desktop .theme-gentle .chart-input-phase .home-calendar-board.home-now-clock {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
}

html.ui-desktop .theme-gentle .chart-input-phase .face-home-core-group {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

html.ui-desktop .theme-gentle .chart-input-phase .home-calendar-board .hnc-board--comfort {
  height: 100% !important;
  min-height: 0 !important;
  border-width: 1.5px !important;
  border-color: rgba(180, 130, 20, 0.65) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 4px 14px rgba(155, 27, 48, 0.12) !important;
}

/* 详盘：跟壳宽 */
.theme-gentle:has(.app-shell-chart-result) .tab-bar {
  display: none;
}

.theme-gentle .app-shell-chart-result {
  width: min(100%, var(--shell-max));
  max-width: min(100%, var(--shell-max));
  padding-bottom: 0;
  height: auto;
  overflow: auto;
}

.theme-gentle .app-shell-chart-result .bazi-content-detail {
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-sm, 8px) var(--space-md, 12px) var(--space-lg, 16px);
}

.theme-gentle .app-shell-chart-result .bazi-export-bar {
  gap: var(--space-sm, 6px);
  margin: 0 0 var(--space-sm, 6px);
}

.theme-gentle .app-shell-chart-result .btn-export {
  min-height: var(--tap-min, 44px);
  font-size: var(--font-caption, 0.82rem);
}

.theme-gentle .app-shell-chart-result .bazi-table,
.theme-gentle .app-shell-chart-result .bazi-table-wz {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.theme-gentle .app-shell-chart-result .dayun-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
}
