/* assets/css/app.css — 網頁版 SPA 元件樣式（依賴 theme.js 注入的 --pv-* 變數） */

:root {
  --pv-bg: #F5F0E8; --pv-card: #FFFDF7; --pv-line: #D4C5A9;
  --pv-ink: #1A1A2E; --pv-muted: #8B6914; --pv-primary: #B8860B;
  --pv-soft: #FAF3E0; --pv-shadow: 0 1px 3px rgba(0,0,0,.06);
  --pv-text2: #5A5A5A; --pv-text3: #9A9A9A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--pv-bg);
  color: var(--pv-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.6;
  /* LL-128：底部安全區改由固定定位的 .tabbar 自己保留，body 不再重複留白（否則會與 .view 的底部內距疊成兩份空白）。 */
  transition: background .3s, color .3s;
}
a { color: var(--pv-primary); text-decoration: none; }

/* ── Header ── */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--pv-card); border-bottom: 1px solid var(--pv-line);
  box-shadow: var(--pv-shadow);
}
.app-header .brand { font-weight: 700; font-size: 17px; letter-spacing: .5px; color: var(--pv-ink); }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  border: 1px solid var(--pv-line); background: transparent; color: var(--pv-text2);
  font-size: 12px; padding: 4px 9px; border-radius: 14px; cursor: pointer; transition: .2s;
}
.lang-switch button.active { background: var(--pv-primary); color: #fff; border-color: var(--pv-primary); }

/* ── View / cards ── */
.view { max-width: 720px; margin: 0 auto; padding: 14px 14px 90px; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.card {
  background: var(--pv-card); border: 1px solid var(--pv-line); border-radius: 14px;
  padding: 16px; margin-bottom: 14px; box-shadow: var(--pv-shadow);
}
.card-title { display: flex; align-items: center; font-weight: 700; font-size: 16px; margin-bottom: 10px; color: var(--pv-ink); }
.card-title.sm { font-size: 14px; margin-top: 14px; }
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pv-primary); margin-right: 8px; }
.note { font-size: 13px; color: var(--pv-text2); margin: 6px 0; }
.muted { color: var(--pv-text3); font-size: 13px; }

/* ── 帳號卡：信箱驗證狀態（階段 2）────────────────────────────
   未驗證用暖色外框「提醒」而非紅色「錯誤」——帳號完全可用，
   紅色會讓使用者以為帳號壞了（本專案一貫的語氣原則）。 */
.acc-verify {
  border: 1px solid var(--pv-line); border-radius: 12px;
  background: var(--pv-soft); padding: 12px; margin: 8px 0 10px;
}
.acc-verify-t { font-weight: 700; font-size: 14px; margin: 0 0 2px; color: var(--pv-ink); }
.acc-verify .note { margin: 0 0 10px; }
.acc-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 3px 10px; margin: 6px 0 10px;
}
.acc-badge.ok { background: rgba(46, 125, 50, .12); color: #2E7D32; border: 1px solid rgba(46, 125, 50, .3); }
.disclaimer { font-size: 12px; color: var(--pv-text3); line-height: 1.7; padding: 12px 4px; }

/* ── Today almanac ── */
.today-head { text-align: center; padding: 6px 0 10px; }
.today-greg { font-size: 15px; color: var(--pv-text2); }
.today-lunar { font-size: 22px; font-weight: 700; margin: 2px 0; }
.today-pillar { font-size: 16px; color: var(--pv-primary); letter-spacing: 2px; }
.yiji { display: flex; gap: 12px; margin-top: 8px; }
.yiji-col { flex: 1; }
.yiji-label { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.yiji-label.good { color: #2E7D32; }
.yiji-label.bad { color: #C0392B; }
.tag { display: inline-block; background: var(--pv-soft); border: 1px solid var(--pv-line); border-radius: 8px; padding: 3px 8px; margin: 0 4px 6px 0; font-size: 13px; }
.tag.good { color: #2E7D32; }
.tag.bad { color: #C0392B; }
.chongsha { margin-top: 8px; font-size: 13px; color: var(--pv-text2); }
.taboo-banner { display: none; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #FDECEA; color: #C0392B; font-size: 13px; }
.taboo-banner.show { display: block; }
.taboo-items { font-weight: 700; }

/* ── Converter ── */
.converter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.conv-select { padding: 8px 6px; border: 1px solid var(--pv-line); border-radius: 8px; background: var(--pv-bg); color: var(--pv-ink); font-size: 15px; }
.conv-sep { color: var(--pv-text2); }
.convert-result { margin-top: 10px; }
.gz-result { text-align: center; }
.gz-line { font-size: 14px; color: var(--pv-text2); }
.gz-lunar { font-size: 20px; font-weight: 700; color: var(--pv-ink); margin: 2px 0; }
.gz-pillars { display: flex; justify-content: center; gap: 12px; margin: 12px 0; }
.gz-pillar { display: flex; flex-direction: column; align-items: center; }
.gz-label { font-size: 11px; color: var(--pv-text3); }
.gz-val { font-size: 17px; font-weight: 700; color: var(--pv-primary); }
.gz-yiji { text-align: left; margin: 8px 0; }
.yiji-row { display: flex; gap: 8px; margin-bottom: 4px; }
.gz-chong { margin-top: 6px; font-size: 13px; color: var(--pv-text2); }
.gz-empty { color: var(--pv-text3); font-size: 13px; padding: 10px; }

/* ── Buttons / forms ── */
.btn { display: inline-block; border: none; border-radius: 12px; padding: 11px 18px; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; }
.btn.primary { background: var(--pv-primary); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--pv-line); color: var(--pv-ink); }
.btn.full { width: 100%; margin: 14px 0; }
.bazi-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bazi-form label { display: flex; flex-direction: column; font-size: 13px; color: var(--pv-text2); gap: 4px; }
.bazi-form input, .bazi-form select {
  padding: 10px 12px; border: 1px solid var(--pv-line); border-radius: 10px;
  background: var(--pv-bg); color: var(--pv-ink); font-size: 15px;
}
.compat-two { display: flex; gap: 12px; flex-wrap: wrap; }
.compat-col { flex: 1; min-width: 240px; }
.compat-col h3 { font-size: 14px; color: var(--pv-muted); margin: 8px 0 4px; }

/* ── Bazi result ── */
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.pillar { background: var(--pv-soft); border: 1px solid var(--pv-line); border-radius: 12px; padding: 10px 4px; text-align: center; }
.pillar-label { font-size: 11px; color: var(--pv-text3); }
.pillar-gz { font-size: 24px; font-weight: 700; color: var(--pv-ink); line-height: 1.1; }
.pillar-gz .zhi { color: var(--pv-primary); }
.dm { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.dm-label { font-size: 13px; color: var(--pv-text2); }
.dm-val { font-size: 20px; font-weight: 700; color: var(--pv-primary); }
.essence { font-size: 14px; color: var(--pv-text2); line-height: 1.7; }
.wuxing { margin-top: 12px; }
.wx-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; }
.wx-k { width: 24px; color: var(--pv-text2); }
.wx-bar { flex: 1; height: 10px; background: var(--pv-soft); border-radius: 6px; overflow: hidden; }
.wx-bar i { display: block; height: 100%; background: var(--pv-primary); }
.wx-v { width: 24px; text-align: right; color: var(--pv-text2); }
.shen { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; }
.price-note { margin-top: 14px; padding: 10px 12px; background: var(--pv-soft); border-radius: 10px; font-size: 13px; color: var(--pv-text2); }

/* ── Compat ── */
.compat-score { font-size: 42px; font-weight: 800; color: var(--pv-primary); text-align: center; }
.compat-score span { display: block; font-size: 13px; font-weight: 500; color: var(--pv-text2); }
.compat-level { text-align: center; font-size: 18px; font-weight: 700; margin: 4px 0 12px; }
.compat-dims { margin: 10px 0; }
.dim { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; }
.dim-k { width: 90px; color: var(--pv-text2); }
.dim-bar { flex: 1; height: 10px; background: var(--pv-soft); border-radius: 6px; overflow: hidden; }
.dim-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pv-primary), var(--pv-gold)); }
.dim-v { width: 36px; text-align: right; color: var(--pv-text2); }
.compat-summary { font-size: 14px; line-height: 1.8; color: var(--pv-text2); }

/* ── Daily ── */
.daily-level { font-size: 22px; font-weight: 800; text-align: center; color: var(--pv-primary); padding: 10px 0; }
.daily-summary { font-size: 15px; line-height: 1.8; }
.daily-row { margin: 6px 0; font-size: 14px; }
.daily-k { font-weight: 700; margin-right: 6px; }

/* ── Orders / price ── */
.price-box { display: flex; gap: 12px; margin: 12px 0; }
.price-box div { flex: 1; text-align: center; padding: 14px; background: var(--pv-soft); border: 1px solid var(--pv-line); border-radius: 12px; font-weight: 700; color: var(--pv-primary); }

/* ── 訂單列表（v3：接後端 /api/orders）── */
.ord-list { display: flex; flex-direction: column; gap: 8px; }
.ord-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 12px; border: 1px solid var(--pv-line); border-radius: 10px;
  background: var(--pv-soft);
}
.ord-main { flex: 1; min-width: 0; }
.ord-name { font-size: 14px; font-weight: 600; color: var(--pv-ink); }
.ord-meta { font-size: 12px; color: var(--pv-text3); margin-top: 3px; }
.ord-badge {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.ord-badge.st-paid { background: rgba(46,125,50,.14); color: #2E7D32; }
.ord-badge.st-pending { background: rgba(245,124,0,.15); color: #E65100; }
.ord-badge.st-failed { background: rgba(198,40,40,.14); color: #C62828; }
.ord-badge.st-refunded { background: rgba(120,120,120,.16); color: var(--pv-text2); }
.ord-view {
  flex: 0 0 auto; font-size: 12.5px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--pv-primary); background: transparent;
  color: var(--pv-primary); cursor: pointer;
}
.ord-view:hover { background: var(--pv-soft); }
.ord-buy { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ord-refresh {
  margin-left: auto; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--pv-line); background: var(--pv-card); color: var(--pv-ink);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.ord-refresh:hover { background: var(--pv-soft); }
.ord-refresh:disabled { opacity: .5; cursor: default; }

/* ── Page header（v1.14.2：子頁面如「我的報告記錄」頂部的返回＋標題列）── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 12px;
  margin: 0;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--pv-ink);
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
  font-weight: 300;
  background: var(--pv-card);
  border: 1px solid var(--pv-line);
  transition: background .15s;
}
.back-btn:hover { background: var(--pv-soft); }
.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--pv-ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── About 頁（v1.14.2 對齊完整版小程式：純文字展示，網址/信箱以 CSS user-select 讓用戶長按複製，不呼叫剪貼板 API）── */
.about-link-row {
  text-align: center;
  padding: 12px 16px 0;
}
.about-link-row .link {
  color: var(--pv-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
}
.about-link-row .link:hover { color: var(--pv-ink); background: var(--pv-soft); }

.about-card {
  margin: 8px 12px 16px;
  padding: 20px 16px;
  background: var(--pv-card);
  border: 1px solid var(--pv-line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.about-card .about-header { padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--pv-bg); }
.about-card .about-title { font-size: 18px; font-weight: bold; color: var(--pv-ink); }
.about-card .about-studio { margin-top: 6px; font-size: 13px; color: var(--pv-muted); line-height: 1.5; }
.about-card .about-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--pv-bg); font-size: 13px; }
.about-card .about-row:last-of-type { border-bottom: none; }
/* LL-130：標籤欄原本固定 132px ＋ nowrap，把右欄擠到只剩約 193px，
   逼得長網址被 word-break: break-all 從中間切斷（英文版實測切成 app.bazide / stiny.site）。
   改為「標籤可縮、可換行」（用戶要求：左側標籤可換行、右側網址不可換行），把寬度優先讓給右欄。
   ⚠️ 但 min-width 必須留 auto（＝flex 預設的 content-based 最小尺寸，即最長單詞的 min-content）：
   若寫 min-width: 0，標籤欄會被壓到 0，`Business` 這種單一單詞就會被切成 Busi／nes／s
   （2026-09-11 真機回報）。overflow-wrap 同理須為 normal，只在空白處換行。 */
.about-card .about-label { flex: 0 1 auto; min-width: auto; max-width: 132px; color: var(--pv-muted); line-height: 1.5; overflow-wrap: normal; }
/* break-all 會把英文單字與網址從中間切斷；overflow-wrap 只在整串放不下時才斷。 */
.about-card .about-value { flex: 1 1 auto; min-width: 0; color: var(--pv-ink); text-align: left; line-height: 1.5; overflow-wrap: break-word; }
.about-card .about-link { color: var(--pv-primary); }
/* 網址／Email 是單一 token，不允許換行；寬度不足時由左側 .about-label 縮讓。 */
.about-card .about-value.about-link { flex: 0 0 auto; white-space: nowrap; }
.about-card .about-disclaimer {
  margin-top: 16px;
  padding: 16px 20px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--pv-text3);
  background: var(--pv-soft);
  border-radius: 12px;
}

/* 允許長按選取（網頁版對應小程式的 user-select="true"） */
.selectable {
  user-select: text;
  -webkit-user-select: text;
}

/* ── Theme picker（v1.14.2 下拉展開式：對齊完整版小程式）
   收起時顯示當前主題（5 色色票條＋名稱＋展開箭頭），展開時才顯示 6 個色票格 ── */
.theme-panel { padding: 0; }
.theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.theme-header:hover { background: var(--pv-soft, #FAF3E0); }
.theme-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.theme-current .theme-strip {
  width: 74px;
  height: 18px;
  flex: 0 0 auto;
}
.theme-current-name {
  font-size: 14px;
  color: var(--pv-ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-arrow {
  font-size: 18px;
  color: var(--pv-muted);
  transition: transform 0.2s;
  flex: 0 0 auto;
}
.theme-arrow.expanded { transform: rotate(-90deg); }
/* 展開後的色票格（沿用 v1.14.1 的 .theme-grid 樣式） */
.theme-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
.theme-option {
  position: relative;
  width: calc(50% - 5px);
  box-sizing: border-box;
  padding: 10px;
  border: 2px solid var(--pv-line);
  border-radius: 10px;
  background: var(--pv-card);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.theme-option.active { border-color: var(--pv-primary); background: var(--pv-soft); }
.theme-strip {
  display: flex;
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--pv-line);
}
.theme-strip > span { flex: 1; display: block; height: 100%; }
.theme-option-name {
  margin-top: 8px;
  font-size: 12px;
  color: var(--pv-ink);
  text-align: center;
  line-height: 1.3;
}
.theme-option-check {
  display: none;
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 12px;
  font-weight: bold;
  color: var(--pv-primary);
}
.theme-option.active .theme-option-check { display: block; }

/* ── Tab bar ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  /* LL-128：box-sizing: border-box 下 height 已含 padding。若安全區只寫進 padding-bottom
     而 height 仍固定 56px，安全區會「吃掉」內容高度（真機實測 safe-area-inset-bottom ≈ 34px，
     56px 只剩約 21px 可用）；內容（圖標 20px ＋ 間距 2px ＋ 文字 ~17px ≈ 39px）被迫溢出，
     justify-content: center 便把它往上下各擠一半 → 圖標上半部凸出到導航欄背景之外。
     故 height 必須把安全區加回去。第一條是舊 WebView 的保底：env() 不支援時該宣告整條失效，
     height 仍維持 56px（不會變成 auto）。 */
  height: 56px;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--pv-card); border-top: 1px solid var(--pv-line);
  box-shadow: 0 -1px 6px rgba(0,0,0,.05);
}
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--pv-text3); font-size: 11px; text-decoration: none; }
.tab-item .tab-icon { font-size: 20px; line-height: 1; }
.tab-item.active { color: var(--pv-primary); font-weight: 700; }

/* ── Misc ── */
.link { color: var(--pv-primary); }
.err { color: #C0392B; font-size: 14px; }
.loading { text-align: center; color: var(--pv-text3); padding: 20px; }
.raw { font-size: 12px; background: var(--pv-soft); padding: 10px; border-radius: 8px; overflow: auto; white-space: pre-wrap; }
#toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  /* 導航欄含安全區後變高，toast 須同步抬高，否則會被壓在導航欄底下 */
  bottom: calc(80px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════ 黃曆月曆（對齊完整版小程序 calendar 頁）═════ */
.setup-card { text-align: center; }
.setup-icon { font-size: 40px; margin-bottom: 8px; }
.setup-title { font-size: 17px; font-weight: 700; color: var(--pv-ink); margin-bottom: 6px; }
.setup-desc { font-size: 13px; color: var(--pv-text3); margin-bottom: 14px; line-height: 1.6; }
.cal-hint { font-size: 12px; color: var(--pv-text3); text-align: center; margin: 8px 0; }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.month-nav .nav-btn { background: var(--pv-soft); border: 1px solid var(--pv-line); color: var(--pv-ink); border-radius: 8px; padding: 6px 12px; font-size: 16px; cursor: pointer; }
.month-title-wrap { position: relative; text-align: center; flex: 1; }
.month-title { font-size: 17px; font-weight: 700; color: var(--pv-ink); pointer-events: none; }
.month-input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

.huangli-filter { background: var(--pv-card); border: 1px solid var(--pv-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.huangli-header { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.huangli-title { font-size: 14px; font-weight: 700; color: var(--pv-ink); }
.huangli-hint { flex: 1; font-size: 11px; color: var(--pv-text3); }
.huangli-toggle { color: var(--pv-primary); font-size: 13px; }
.huangli-chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; }
.huangli-chip { flex: 0 0 auto; border: 1px solid var(--pv-line); background: var(--pv-soft); color: var(--pv-ink); border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.huangli-chip.selected { background: var(--pv-primary); color: #fff; border-color: var(--pv-primary); }
.huangli-categories { padding-top: 8px; }
.huangli-cat-items { display: flex; flex-wrap: wrap; gap: 6px; }
.huangli-cat-chip { border: 1px solid var(--pv-line); background: var(--pv-soft); color: var(--pv-ink); border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.huangli-cat-chip.selected { background: var(--pv-primary); color: #fff; border-color: var(--pv-primary); }

.calendar-grid { background: var(--pv-card); border: 1px solid var(--pv-line); border-radius: 12px; padding: 8px 6px; margin-bottom: 12px; }
.dow-row { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dow { font-size: 11px; color: var(--pv-text3); padding: 4px 0; }
.day-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }
.day-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 56px; padding: 3px 1px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--pv-ink); font-size: 11px; cursor: pointer; overflow: hidden;
}
.day-cell.empty { cursor: default; }
.day-num { font-size: 13px; font-weight: 700; }
.day-festival { font-size: 9px; color: var(--pv-text3); line-height: 1.2; }
.day-festival.is-festival { color: var(--pv-gold); font-weight: 700; }
.day-gz { font-size: 9px; color: var(--pv-text2); }
.day-level { font-size: 9px; color: var(--pv-text3); }
/* 五級吉凶底色：綠吉 → 紅凶（專案視覺規範，不得翻轉） */
.day-cell.level-1 { background: rgba(46,125,50,.20); }
.day-cell.level-2 { background: rgba(104,159,56,.16); }
.day-cell.level-3 { background: rgba(158,158,158,.10); }
.day-cell.level-4 { background: rgba(245,124,0,.16); }
.day-cell.level-5 { background: rgba(198,40,40,.18); }
.day-cell.is-today { border-color: var(--pv-primary); box-shadow: 0 0 0 1px var(--pv-primary) inset; }
.day-cell.is-huangli { border-color: #2E7D32; }
.day-cell.is-jiri { border-color: #C62828; }

.date-list { display: flex; flex-direction: column; gap: 6px; }
.date-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--pv-soft); border: 1px solid var(--pv-line); border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--pv-ink); cursor: pointer; }
.date-item.good { border-left: 3px solid #2E7D32; }
.date-item.bad { border-left: 3px solid #C62828; }
.date-label { font-weight: 700; }
.date-gz { color: var(--pv-text2); font-size: 12px; }
.date-score { margin-left: auto; color: var(--pv-primary); font-weight: 700; }
.empty-text { font-size: 13px; color: var(--pv-text3); text-align: center; padding: 8px 0; }
.load-error { text-align: center; color: #C0392B; font-size: 14px; padding: 16px; }
.retry-btn { display: inline-block; margin-top: 8px; background: var(--pv-primary); color: #fff; border: none; border-radius: 8px; padding: 6px 16px; cursor: pointer; }

/* ══════ 黃曆單日詳情（對齊 calendar-detail 頁）═════ */
.detail-head { text-align: center; padding: 8px 0 14px; }
.detail-nav { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.detail-nav .nav-btn { background: var(--pv-soft); border: 1px solid var(--pv-line); color: var(--pv-ink); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.detail-date { font-size: 20px; font-weight: 800; color: var(--pv-ink); }
.detail-sub { font-size: 13px; color: var(--pv-text2); margin-top: 4px; }
.detail-term { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--pv-gold); border: 1px solid var(--pv-gold); border-radius: 12px; padding: 2px 10px; }
.detail-level { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 700; border-radius: 8px; padding: 3px 12px; }
.detail-level.level-1 { background: rgba(46,125,50,.20); }
.detail-level.level-2 { background: rgba(104,159,56,.16); }
.detail-level.level-3 { background: rgba(158,158,158,.12); }
.detail-level.level-4 { background: rgba(245,124,0,.16); }
.detail-level.level-5 { background: rgba(198,40,40,.18); }
.detail-notes { font-size: 12px; color: var(--pv-text3); margin-top: 8px; line-height: 1.6; }
.hongtong-badge { margin-top: 10px; background: rgba(198,40,40,.12); color: #C62828; border: 1px solid #C62828; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; text-align: center; }
.shensha-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.shensha-tag { font-size: 12px; border-radius: 12px; padding: 3px 10px; border: 1px solid var(--pv-line); background: var(--pv-soft); }
.shensha-tag.k-good, .shensha-tag.k-huangdao { color: #2E7D32; border-color: #2E7D32; }
.shensha-tag.k-bad, .shensha-tag.k-heidao { color: #C62828; border-color: #C62828; }
.shensha-tag.k-jianchu { color: var(--pv-gold); border-color: var(--pv-gold); }
.chongsha-line { font-size: 14px; color: var(--pv-ink); }
.jifang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.jifang-item { display: flex; flex-direction: column; background: var(--pv-soft); border-radius: 8px; padding: 7px 10px; }
.jf-k { font-size: 11px; color: var(--pv-text3); }
.jf-v { font-size: 14px; font-weight: 700; color: var(--pv-ink); }
.dayinfo-rows .di-row { font-size: 13px; color: var(--pv-ink); padding: 4px 0; }
.shichen-list { display: flex; flex-direction: column; gap: 6px; }
.sc-item { border: 1px solid var(--pv-line); border-radius: 8px; padding: 7px 10px; background: var(--pv-soft); }
.sc-item.is-good { border-left: 3px solid #2E7D32; }
.sc-item.is-bad { border-left: 3px solid #C62828; }
.sc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sc-name { font-weight: 700; }
.sc-range { font-size: 11px; color: var(--pv-text3); }
.sc-shen { font-size: 12px; color: var(--pv-text2); }
.sc-flag { margin-left: auto; font-size: 11px; font-weight: 700; }
.sc-item.is-good .sc-flag { color: #2E7D32; }
.sc-item.is-bad .sc-flag { color: #C62828; }
.sc-yiji { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 11px; color: var(--pv-text3); }

/* ══════ 排盤輸入 / 結果（對齊 index / result）═════ */
.gender-row { display: flex; gap: 8px; margin-bottom: 10px; }
.gender-btn { flex: 1; border: 1px solid var(--pv-line); background: var(--pv-soft); color: var(--pv-ink); border-radius: 8px; padding: 9px 0; font-size: 14px; cursor: pointer; }
.gender-btn.active { background: var(--pv-primary); color: #fff; border-color: var(--pv-primary); font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--pv-ink); margin: 6px 0 10px; }
.check-row input { width: 16px; height: 16px; }
.price-row { font-size: 13px; color: var(--pv-ink); background: var(--pv-soft); border-radius: 8px; padding: 8px 10px; margin: 10px 0; }

.result-header { text-align: center; padding: 6px 0 12px; }
.success-title { font-size: 19px; font-weight: 800; color: var(--pv-ink); }
.success-desc { font-size: 13px; color: var(--pv-text3); margin-top: 4px; }
.preview-card .info-row, .detail-row { display: flex; gap: 10px; padding: 4px 0; font-size: 14px; }
.info-label, .detail-key { flex: 0 0 72px; color: var(--pv-text3); font-size: 13px; }
.info-value, .detail-val { flex: 1; color: var(--pv-ink); }
.info-value.pillars { font-weight: 700; letter-spacing: 2px; }
.divider { height: 1px; background: var(--pv-line); margin: 8px 0; }
.detail-card .card-title { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.toggle-arrow { color: var(--pv-primary); font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-item { background: var(--pv-soft); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; }
.detail-item .detail-key { flex: none; }
.detail-item .detail-val { font-size: 13px; font-weight: 700; }
.download-card .download-desc { font-size: 12px; color: var(--pv-text3); margin-bottom: 10px; line-height: 1.6; }

/* ══════ 合拍（對齊 compatibility）═════ */
.section-a .card-title .dot { background: #2E7D32; }
.section-b .card-title .dot { background: #C62828; }
.score-card { text-align: center; }
.compat-dims .dim.good .dim-bar i { background: #2E7D32; }
.compat-dims .dim.bad .dim-bar i { background: #C62828; }
.compat-summary { font-size: 14px; color: var(--pv-ink); line-height: 1.7; }

/* ══════ 我的 / 記錄訂單（對齊 profile）═════ */
.card-title.fold { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: 14px; color: var(--pv-ink); border-bottom: 1px solid var(--pv-line); }
.switch-row:last-of-type { border-bottom: none; }
.switch-row input { width: 20px; height: 20px; }
.summary-pillars { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.gz-chip { background: var(--pv-soft); border: 1px solid var(--pv-line); border-radius: 14px; padding: 3px 12px; font-size: 13px; font-weight: 700; color: var(--pv-ink); }
.daymaster-essence { font-size: 13px; color: var(--pv-ink); background: var(--pv-soft); border-left: 3px solid var(--pv-gold); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; line-height: 1.7; }
.record-item { display: flex; align-items: center; gap: 8px; background: var(--pv-soft); border: 1px solid var(--pv-line); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; }
.record-info { flex: 1; min-width: 0; }
.rec-title { font-size: 14px; font-weight: 700; color: var(--pv-ink); }
.rec-sub { font-size: 11px; color: var(--pv-text3); }
.rec-del { padding: 4px 8px; font-size: 13px; }

/* ══════ 城市選擇器（對齊 citypicker）═════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.citypicker-panel { background: var(--pv-card); border-radius: 14px; width: 100%; max-width: 420px; max-height: 86vh; overflow: auto; padding: 16px; }
.cp-header { font-size: 16px; font-weight: 700; color: var(--pv-ink); margin-bottom: 12px; }
.cp-row { margin-bottom: 10px; }
.cp-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--pv-text3); }
.cp-row select { width: 100%; padding: 9px 10px; border: 1px solid var(--pv-line); border-radius: 8px; background: var(--pv-soft); color: var(--pv-ink); font-size: 14px; }
.cp-display { font-size: 14px; font-weight: 700; color: var(--pv-primary); text-align: center; padding: 8px 0; }
.cp-total { font-size: 11px; color: var(--pv-text3); text-align: center; }
.cp-actions { display: flex; gap: 8px; margin-top: 12px; }
.cp-actions .btn { flex: 1; }

/* ══════ 自訂時間選擇器（對齊 time-picker）═════ */
.tp-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: flex; align-items: flex-end; }
.tp-panel { width: 100%; background: var(--pv-card); border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.tp-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--pv-line); }
.tp-title { font-size: 15px; font-weight: 700; color: var(--pv-ink); }
.tp-btn { background: none; border: none; color: var(--pv-text3); font-size: 14px; cursor: pointer; padding: 6px 8px; }
.tp-btn.tp-ok { color: var(--pv-primary); font-weight: 700; }
.tp-columns { position: relative; display: flex; height: 220px; overflow: hidden; }
.tp-indicator { position: absolute; left: 8px; right: 8px; top: 50%; height: 44px; transform: translateY(-50%); background: rgba(218,165,32,.12); border-top: 1px solid var(--pv-gold); border-bottom: 1px solid var(--pv-gold); pointer-events: none; }
.tp-col { flex: 1; overflow-y: auto; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; }
.tp-col::-webkit-scrollbar { display: none; }
.tp-item { height: 44px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--pv-text3); scroll-snap-align: center; }
.tp-item.active { color: var(--pv-ink); font-weight: 700; }
.tp-pad { height: 88px; }

/* ══════ 海報預覽（對齊 poster 元件）═════ */
.poster-panel { background: var(--pv-card); border-radius: 14px; padding: 14px; width: 100%; max-width: 380px; max-height: 90vh; overflow: auto; }
.poster-img { width: 100%; border-radius: 10px; display: block; }
.poster-actions { display: flex; gap: 8px; margin-top: 12px; }
.poster-actions .btn { flex: 1; text-align: center; text-decoration: none; }

/* 強制讓 HTML 標準 [hidden] 屬性真正生效：`.modal-overlay` 設了 `display:flex`，
   會蓋過 UA 預設的 `[hidden]{display:none}`，導致 close() 設的 hidden=true 無效、
   遮罩一直留在畫面上、點按也沒反應。 */
/* ══════ 「我的」個人頭像／暱稱（對齊 profile .profile-header）══════ */
.profile-header { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 56px; overflow: hidden;
  background: var(--pv-soft); border: 1px solid var(--pv-line);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* v1.14.2：預設頭像＝官方 logo。新 logo 已預先裁掉四周留白（內容佔 86%），
   故此處不再加 padding（舊版 6px padding 會把已裁好的 logo 又縮小一次）、不降透明度。 */
.avatar .default-avatar { width: 100%; height: 100%; object-fit: cover; }
.avatar-ph { font-size: 26px; color: var(--pv-primary); }
.avatar-side { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nickname { font-size: 16px; font-weight: 700; color: var(--pv-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nickname.placeholder { color: var(--pv-text3); font-weight: 400; }
.link-btn { font-size: 12px; color: var(--pv-primary); text-decoration: underline; cursor: pointer; }
.stat-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 15px; color: var(--pv-ink); text-decoration: none; }
.stat-icon { font-size: 20px; }
.summary-extras { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.summary-chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--pv-soft); color: var(--pv-text2); }
.privacy-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--pv-primary); text-decoration: underline; }

/* ══════ 範例報告（對齊 profile .example-section）══════ */
.example-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.example-divider::before, .example-divider::after { content: ""; flex: 1; height: 1px; background: var(--pv-line); }
.example-divider span { font-size: 12px; color: var(--pv-text3); }
.example-item { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 8px;
  padding: 10px; border: 1px solid var(--pv-line); border-radius: 10px; background: var(--pv-card);
  text-align: left; cursor: pointer; }
.example-item .ex-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 16px; font-weight: 700; }
.example-item.male .ex-icon { background: #E8F0FF; color: #1E3A8A; }
.example-item.female .ex-icon { background: #FFE8F0; color: #B91C5C; }
.example-item .ex-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.example-item .ex-text b { font-size: 14px; color: var(--pv-ink); }
.example-item .ex-text i { font-size: 11px; color: var(--pv-text3); font-style: normal; }

/* ══════ 溫馨提示卡（對齊 index .tips-card）══════ */
.tips-list { margin: 0; padding-left: 18px; }
.tips-list li { font-size: 12px; color: var(--pv-text2); line-height: 1.7; }

/* ══════ 記錄／訂單卡（對齊 history .record-wrap）══════ */
.record-wrap { display: flex; align-items: stretch; gap: 8px; margin-bottom: 8px; }
.record-item { flex: 1; display: flex; gap: 10px; padding: 10px; border: 1px solid var(--pv-line);
  border-radius: 10px; background: var(--pv-card); cursor: pointer; }
.record-bar { width: 5px; border-radius: 3px; flex: 0 0 5px; background: var(--pv-primary); }
.record-bar.gender-male { background: var(--pv-select, #2E7D5B); }
.record-bar.gender-female { background: var(--pv-primary); }
.record-bar.gender-compat { background: linear-gradient(180deg, var(--pv-primary), var(--pv-select, #2E7D5B)); }
.record-time { font-size: 11px; color: var(--pv-text3); margin-top: 2px; }
.record-wrap .rec-del { align-self: center; }
.privacy-note { font-size: 11px; color: var(--pv-text3); line-height: 1.6; }

/* ══════ 頁尾版本（對齊 profile .footer-actions）══════ */
.footer-actions { text-align: center; padding: 10px 0 4px; }
.app-version { font-size: 11px; color: var(--pv-text3); }

/* ══════ 合拍記錄選取彈窗項目 ══════ */
.pick-item { text-align: left; line-height: 1.5; margin-bottom: 6px; }
.pick-item .muted { font-size: 11px; color: var(--pv-text3); }

[hidden] { display: none !important; }

/* ══════ 今日提示（對齊 pages/daily）═════ */
.page-decor { position: fixed; top: 0; left: 0; right: 0; width: 100%; max-width: 100vw; opacity: 0.32; pointer-events: none; z-index: 0; }
.page-content { position: relative; z-index: 1; }

.sk-line { height: 12px; background: linear-gradient(90deg, var(--pv-soft) 0%, var(--pv-line) 50%, var(--pv-soft) 100%); background-size: 200% 100%; border-radius: 6px; margin-bottom: 8px; animation: sk-shimmer 1.4s linear infinite; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-date-header { text-align: center; padding: 14px 16px 4px; }
.sk-date { width: 40%; margin: 0 auto 8px; }
.sk-lunar { width: 55%; height: 14px; margin: 0 auto; }
.sk-score-section { display: flex; align-items: center; justify-content: center; padding: 16px 0; }
.sk-ring { width: 132px; height: 132px; border-radius: 50%; background: var(--pv-soft); border: 4px solid var(--pv-line); }
.sk-card { padding: 14px; }
.sk-triple { display: flex; gap: 12px; }
.sk-col { flex: 1; }
.sk-label { height: 10px !important; margin-bottom: 6px !important; width: 60%; }
.sk-value { height: 14px !important; width: 80%; }
.sk-title { width: 35%; }
.sk-text { width: 95%; }
.sk-text.short { width: 70%; }
.sk-hint { text-align: center; color: var(--pv-text3); font-size: 12px; padding: 6px 0 12px; }

.date-header { text-align: center; padding: 12px 16px 4px; }
.date-text { font-size: 14px; color: var(--pv-text3); }
.lunar-text { font-size: 15px; color: var(--pv-ink); font-weight: 700; margin-top: 4px; }
.lunar-gz { color: var(--pv-gold); font-weight: 700; }

/* ── 每日運勢評分環（v1.14.2 對齊完整版小程式：96px 主環 + 金線外圈 + 虛線內圈 + 兩側金飾線／菱形收尾，主題色用 --lv* 自適應）── */
.score-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 6px 0 10px;
}
.score-ring {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
/* 外圈金線（與主環留 8px 間距） */
.score-ring::before {
  content: '';
  position: absolute;
  left: -8px; top: -8px; right: -8px; bottom: -8px;
  border-radius: 50%;
  border: 1px solid var(--pv-gold);
  opacity: 0.4;
  pointer-events: none;
}
/* 內圈虛線細環 */
.score-ring::after {
  content: '';
  position: absolute;
  left: 5px; top: 5px; right: 5px; bottom: 5px;
  border-radius: 50%;
  border: 1px dashed var(--pv-gold);
  opacity: 0.4;
  pointer-events: none;
}
/* 左右金飾線（線—菱形收尾，左右鏡像） */
.score-flourish { position: relative; width: 44px; height: 10px; }
.score-flourish::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  opacity: 0.5;
}
.fl-left::before  { background: linear-gradient(to right, transparent, var(--pv-gold)); }
.fl-right::before { background: linear-gradient(to left,  transparent, var(--pv-gold)); }
.score-flourish::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 5px; height: 5px;
  background: var(--pv-gold);
  opacity: 0.65;
  transform: translateY(-50%) rotate(45deg);
}
.fl-left::after  { right: -2px; }
.fl-right::after { left: -2px; }
/* 主題色用 --lv*，由 theme.js applyCssVars() 注入，深淺色主題自適應 */
.level-good    { background: var(--lv1bg); border-color: var(--lv1); }
.level-neutral { background: var(--lv3bg); border-color: var(--lv3); }
.level-caution { background: var(--lv4bg); border-color: var(--lv4); }
.level-bad     { background: var(--lv5bg); border-color: var(--lv5); }
/* 等級字：正常字重（v1.13.2 對齊小程式），中文 30px、英文 20px（避免 Caution 之類 7 字母溢出） */
.ring-level { font-size: 30px; font-weight: normal; color: var(--pv-ink); }
.score-ring.lang-en .ring-level { font-size: 20px; }

.info-card { padding: 12px; }
.info-row-triple { display: flex; gap: 12px; }
.info-col { flex: 1; text-align: center; }
.info-label { font-size: 12px; color: var(--pv-text3); }
.info-value { font-size: 15px; font-weight: 700; color: var(--pv-ink); margin-top: 2px; }

.personal-yiji { margin-bottom: 10px; }
.personal-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.personal-label { font-size: 13px; font-weight: 700; min-width: 28px; padding-top: 4px; }
.personal-label.yi { color: #2E7D32; }
.personal-label.ji { color: #C62828; }
.personal-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.personal-tag { font-size: 12px; border-radius: 10px; padding: 3px 10px; }
.personal-tag.yi { background: rgba(46,125,50,.12); color: #2E7D32; border: 1px solid rgba(46,125,50,.4); }
.personal-tag.ji { background: rgba(198,40,40,.10); color: #C62828; border: 1px solid rgba(198,40,40,.4); }
.tips-list { display: flex; flex-direction: column; gap: 4px; }
.tip-item { display: flex; gap: 6px; font-size: 14px; color: var(--pv-ink); line-height: 1.7; }
.tip-dot { color: var(--pv-primary); }

.severity-badge { font-size: 11px; color: #C62828; background: rgba(198,40,40,.12); border: 1px solid #C62828; border-radius: 10px; padding: 1px 8px; margin-left: 8px; }
.almanac-date { text-align: center; font-size: 13px; color: var(--pv-text2); margin: 6px 0 8px; }
.trad-yiji { display: flex; flex-direction: column; gap: 6px; }
.trad-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.trad-label { font-weight: 700; min-width: 28px; }
.trad-label.yi { color: #2E7D32; }
.trad-label.ji { color: #C62828; }
.trad-text { flex: 1; color: var(--pv-ink); }

.poster-row { margin: 8px 0 14px; text-align: center; }
.btn-poster { background: var(--pv-soft); border: 1px solid var(--pv-gold); color: var(--pv-gold); border-radius: 18px; padding: 6px 18px; font-size: 13px; cursor: pointer; }
.btn-poster:hover { background: rgba(218,165,32,.12); }
