/* tea-chart.css — 🔮 命理茶語 overlay（fortune-plan.md M4）
   overlay 家族（同 tea-fortune 語彙：z 10060、深綠×米白×金、襯線）。
   高度一律 vh fallback＋dvh（手機穩定性鐵則⑦）。

   ⚠️ **本檔＝「家族三選一 picker（.hh-cp-*）＋生辰表單」，沒有別的了**——
   自 2026-07-15 沉浸頁上線後，`tea-chart.js renderReport()` 排完盤是直接 `openSkyScene()`，
   classic 報告從此不再渲染。2026-08-15 已清掉隨之成為死碼的 35 個 class／82 條規則
   （.hh-chart-cell*／-palace／-star／-sec／-tabs／-cosmos-*／-gate*／-dx／-share／
   -scene-launch／-challenge／-bright*／-list／-disclaimer／-foot／-redo／-ask-ai…）
   ＋ 43 個對應的 i18n key（chart_zw_sec_*／chart_tab_*／chart_gate_*／sky_open_*…）。
   要復原去 git 翻 `1804e7cd`。**盤面/報告的樣式現在只在 tea-chart-scene.css**，
   別再往這裡加報告用的規則。
   📐 字級（2026-08-15 對齊 DESIGN-STANDARDS §1）：表單/選單說明 12.5–14、
      picker 需求章 12.5、隱私註記 12.5——**中文一律 ≥11px**。 */

.hh-chart-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(24, 34, 26, 0.55);
  -webkit-backdrop-filter: var(--hh-scrim-blur);
  backdrop-filter: var(--hh-scrim-blur);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hh-chart-overlay.is-open { opacity: 1; }

.hh-chart-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  /* 2026-07-15 業主拍板玻璃表單：classic 報告退役後 overlay 只剩表單/玻璃門，整面入夜 */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(58, 84, 118, 0.45), transparent 62%),
    linear-gradient(160deg, #141c30 0%, #0d1522 60%, #0a1018 100%);
  color: #f0ead8;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 -8px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(24px);
  transition: transform 0.25s ease;
  font-family: "Noto Serif TC", "Noto Serif TC Fallback", "Songti TC", serif;
}
.hh-chart-overlay.is-open .hh-chart-panel { transform: translateY(0); }

.hh-chart-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: rgba(240, 234, 216, 0.6);
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}
.hh-chart-head {
  padding: 18px 20px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.hh-chart-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: #d4b576;
}
.hh-chart-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0.25em;
}
/* 表單態的「‹ 換一種讀法」（回三選一）——與 ✕ 左右對稱，44px 熱區 */
.hh-chart-back {
  position: absolute;
  top: 10px;
  left: 6px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  font: 500 13px/44px "Noto Serif TC", "Noto Serif TC Fallback", serif;
  letter-spacing: 0.1em;
  color: rgba(240, 234, 216, 0.72);
}
.hh-chart-back:hover { color: #d4b576; }
.hh-chart-back[hidden] { display: none; }

/* ── 步驟 0：家族三選一（2026-08-08）──
   命理茶語＝紫微／三光／茶塔羅三個功能的傘。三張卡權重相等，別再把其中一個做成小膠囊。 */
.hh-chart-pick { display: grid; gap: 10px; margin-top: 2px; }
.hh-chart-pick-card {
  appearance: none; -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 12px 15px 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(212, 181, 118, 0.26);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  color: #f0ead8;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.hh-chart-pick-card:hover,
.hh-chart-pick-card:focus-visible {
  border-color: rgba(212, 181, 118, 0.6);
  background: linear-gradient(160deg, rgba(212, 181, 118, 0.12), rgba(255, 255, 255, 0.02));
  outline: none;
}
.hh-chart-pick-card:active { transform: scale(0.99); }
.hh-cp-glyph {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(212, 181, 118, 0.4);
  color: #d4b576;
}
.hh-cp-glyph svg { width: 22px; height: 22px; display: block; }
.hh-cp-txt { flex: 1 1 auto; min-width: 0; display: block; line-height: 1.5; }
.hh-cp-txt b {
  display: block;
  font: 700 16px/1.5 "Noto Serif TC", "Noto Serif TC Fallback", serif;
  letter-spacing: 0.14em;
  color: #f4efdf;
}
.hh-cp-txt small {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: rgba(212, 181, 118, 0.7);
}
.hh-cp-txt em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(240, 234, 216, 0.66);
}
.hh-cp-req {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(240, 234, 216, 0.62);
  background: rgba(255, 255, 255, 0.06);
}
.hh-cp-req.is-free {
  color: #e6cd94;
  background: rgba(212, 181, 118, 0.16);
}
.hh-cp-go { flex: none; color: rgba(212, 181, 118, 0.65); font-size: 20px; line-height: 1; }

/* 紫微＋「不知道出生時間」＝排不出來，先講清楚 */
.hh-chart-needtime {
  margin: -4px 0 12px;
  padding: 8px 11px;
  border-radius: 8px;
  border-left: 2px solid rgba(212, 181, 118, 0.6);
  background: rgba(212, 181, 118, 0.08);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(240, 234, 216, 0.8);
}
.hh-chart-needtime[hidden] { display: none; }
.hh-chart-body {
  /* flex 子項預設 min-height:auto 不會縮＝body 撐破 92dvh panel、overflow-y 永不觸發
     ＝手機表單完全不能捲（2026-07-15 業主真機回報「不能滑」的根因） */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto; /* 勿加 -webkit-overflow-scrolling:touch（legacy 旗標，iOS 真機凍結嫌疑） */
  touch-action: pan-y;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  line-height: 1.9;
  font-size: 14.5px;
}

/* 桌機＝三聯屏：月亮｜太陽（放大）｜上升 */
@media (min-width: 1024px) {
}

/* ── 表單 ── */
.hh-chart-intro { margin: 0 0 14px; color: rgba(240, 234, 216, 0.66); }
.hh-chart-field { display: block; margin: 0 0 12px; }
.hh-chart-field > span { display: block; font-size: 12.5px; color: #d4b576; margin-bottom: 6px; letter-spacing: 0.14em; }
.hh-chart-field input[type="date"],
.hh-chart-field input[type="time"],
.hh-chart-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box; /* 沒這行 padding 會撐爆 100%（2026-07-15 業主回報爆版） */
  /* iOS 的 date/time input 有 UA 內在寬度（inline-flex），會贏過 width:100% ＝照樣溢出；
     appearance:none 才真正交還寬度控制（2026-07-15 業主真機二度回報溢出） */
  -webkit-appearance: none;
  appearance: none;
  display: block;
  font-size: 16px; /* iOS 防聚焦放大鐵則 */
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #f0ead8;
  font-family: inherit;
  color-scheme: dark; /* 原生日期/時間選擇器跟著入夜 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.hh-chart-field input[type="date"],
.hh-chart-field input[type="time"] {
  min-height: 47px; /* appearance:none 後 iOS 空值會塌高 */
}
/* appearance:none 後 iOS 值改靠左＝維持原生置中視覺 */
.hh-chart-field input::-webkit-date-and-time-value { text-align: center; }
.hh-chart-field input:focus,
.hh-chart-field select:focus {
  outline: none;
  border-color: rgba(212, 181, 118, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 3px rgba(212, 181, 118, 0.18);
}
.hh-chart-clear {
  border: 0;
  background: transparent;
  color: #c08a80;
  font-family: inherit;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.hh-chart-field input:disabled { opacity: 0.45; }
.hh-chart-checkbox { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 14px; color: rgba(240, 234, 216, 0.7); }
.hh-chart-checkbox input, .hh-chart-body input[type="checkbox"] { accent-color: #d4b576; }
.hh-chart-seg { display: flex; gap: 8px; }
.hh-chart-seg label { flex: 1; }
.hh-chart-seg input { position: absolute; opacity: 0; pointer-events: none; }
.hh-chart-seg i {
  display: block;
  text-align: center;
  font-style: normal;
  letter-spacing: 0.2em;
  padding: 11px 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(240, 234, 216, 0.75);
  cursor: pointer;
}
.hh-chart-seg input:checked + i {
  background: linear-gradient(160deg, #f2e7c8, #d4b576);
  color: #080611;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 18px rgba(212, 181, 118, 0.3);
}
.hh-chart-note { font-size: 12.5px; color: rgba(240, 234, 216, 0.45); margin: 4px 0 16px; line-height: 1.8; }
.hh-chart-submit {
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(160deg, #f2e7c8, #d4b576);
  color: #080611;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.3em;
  padding: 15px 0 15px 6px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(212, 181, 118, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.hh-chart-submit:active { transform: scale(0.98); }
/* 登入會員身分綠標（renderForm 於已登入時插入） */
.hh-chart-member {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(6, 199, 85, 0.1);
  border: 1px solid rgba(6, 199, 85, 0.3);
  font-size: 11.5px;
  color: rgba(240, 234, 216, 0.8);
}
.hh-chart-member .dot { width: 7px; height: 7px; border-radius: 50%; background: #06c755; box-shadow: 0 0 8px rgba(6, 199, 85, 0.8); flex: none; }
/* 訪客選配登入列（2026-07-15 免登入化）：不擋排盤，只順帶提供生辰同步 */
.hh-chart-guestlogin {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(240, 234, 216, 0.55);
}
.hh-chart-loginbtn {
  appearance: none;
  cursor: pointer;
  border: 1px solid rgba(6, 199, 85, 0.5);
  border-radius: 999px;
  background: rgba(6, 199, 85, 0.12);
  color: #7fe0a8;
  font-family: inherit;
  font-size: 13px;
  padding: 4px 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.hh-chart-privacy { font-size: 12.5px; color: rgba(240, 234, 216, 0.42); text-align: center; margin: 12px 0 0; }
.hh-chart-loading { text-align: center; padding: 48px 0; color: rgba(240, 234, 216, 0.6); letter-spacing: 0.2em; }

/* ── 宜飲卡 ── */
.hh-chart-teas { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.hh-chart-tea {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid #e0d8c2;
  border-left: 3px solid #a8894f;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.hh-chart-tea img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; }
.hh-chart-tea-name { font-size: 14px; font-weight: 600; }
.hh-chart-tea-meta { font-size: 11.5px; color: #8a8471; }
/* M7 命中理由（依你的盤命中的香型）：金字小註 */
.hh-chart-tea-why { font-size: 11px; color: #a8894f; letter-spacing: 0.04em; }

/* 桌機＝置中對話框 */
@media (min-width: 1024px) {
  .hh-chart-overlay { align-items: center; padding: 24px; }
  .hh-chart-panel { border-radius: 18px; max-height: 88vh; max-height: 88dvh; }
  .hh-chart-body { padding: 22px 32px 28px; }
  /* 三選一＝並排「三道門」（非 zh 只有兩張，auto-fit 自動變兩欄） */
  .hh-chart-pick { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
  .hh-chart-pick-card { flex-direction: column; align-items: center; text-align: center; padding: 22px 16px 20px; gap: 12px; }
  .hh-cp-txt { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; }
  .hh-cp-txt em { flex: 1 1 auto; }
  .hh-cp-go { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hh-chart-overlay, .hh-chart-panel { transition: none; }
}

