/* D菇島・財運占卜所 —— 夜市巷底的籤詩鋪
   設計 thesis：神明的口吻，數據的骨。
   字體二元性：楷體＝占卜神秘面（籤詩、吉凶、儀式）；黑體＝誠實數據面（機率、命中率）。
   紅漲綠跌＝台股色彩即吉凶色彩。簽名元素：朱紅印章。 */
:root {
  /* 色票 —— 暖橘燭火：夜市巷底的暖燈籠底下 */
  --ink:        #1c1108;   /* 暖炭褐 */
  --ink-2:      #281810;   /* 抬升表面（暖褐） */
  --ink-3:      #35220f;   /* 卡片（琥珀褐） */
  --paper:      #f6e8c9;   /* 籤紙米（暖） */
  --paper-dim:  #d8c095;   /* 次要文字 */
  --paper-faint:#9c8560;   /* 註腳 */
  --temple:     #de5730;   /* 柿紅（漲／吉／熱） */
  --temple-deep:#9c3417;
  --gold:       #f0a94e;   /* 琥珀橘（主色） */
  --gold-soft:  #c9863c;
  --jade:       #57a586;   /* 竹青（跌／凶） */
  --jade-deep:  #337a5f;
  --up:         #ef6a43;   /* 漲（暖珊瑚紅） */
  --down:       #63b193;   /* 跌 */
  /* 暖橘 hairline 與光暈 */
  --hair:       rgba(240,169,78,.16);
  --hair-2:     rgba(240,169,78,.36);
  --glow:       rgba(240,169,78,.36);
  /* 字體角色 */
  --f-oracle: "DFKai-SB","BiauKai","KaiTi","Noto Serif TC","Songti TC",serif;
  --f-ui: "Microsoft JhengHei","PingFang TC","Noto Sans TC",system-ui,sans-serif;
  --f-num: "Nunito", ui-rounded, "SF Pro Rounded", "Varela Round", "Segoe UI", system-ui, sans-serif;
  /* 半徑與尺度 */
  --r-sm: 9px; --r: 13px; --r-lg: 18px;
  --shell: min(620px, 100%);
}

/* 圓潤數字字型（子集：0-9 . %；中文自動 fallback） */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/nunito-num.woff2") format("woff2");
  unicode-range: U+25, U+2e, U+30-39;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%;
  background:
    radial-gradient(52rem 26rem at 50% -8rem, #552f13 0%, transparent 62%),
    radial-gradient(34rem 22rem at 88% 112%, #3d200c 0%, transparent 55%),
    radial-gradient(30rem 20rem at 6% 30%, #45260f 0%, transparent 60%),
    var(--ink);
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--f-ui);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#app { width: var(--shell); padding: 0 1.1rem 2.4rem; flex: 1; }

/* 通用文字色向 —— 台股紅漲綠跌 */
.up { color: var(--up); }
.down { color: var(--down); }

/* ============ 招牌 hero（跨畫面常駐） ============ */
.site-head { text-align: center; padding: 1.8rem 1rem 0.7rem; width: var(--shell); }

/* 朱紅印章徽記：與籤紙上的印章同一顆語彙 */
.crest {
  width: 62px; height: 62px; margin: 0 auto 0.9rem;
  border-radius: 16px;
  display: grid; place-items: center;
  font-family: var(--f-oracle);
  font-size: 2rem; color: var(--paper);
  background:
    radial-gradient(circle at 32% 28%, #f0754c, var(--temple) 45%, var(--temple-deep));
  border: 1.5px solid rgba(255,225,210,.35);
  box-shadow:
    0 0 0 4px rgba(19,12,18,.9),
    0 0 0 5.5px var(--hair-2),
    0 8px 26px rgba(222,87,48,.4);
  position: relative;
  animation: crestGlow 5.5s ease-in-out infinite;
}
@keyframes crestGlow {
  0%,100% { box-shadow: 0 0 0 4px rgba(19,12,18,.9), 0 0 0 5.5px var(--hair-2), 0 8px 22px rgba(222,87,48,.32); }
  50%     { box-shadow: 0 0 0 4px rgba(19,12,18,.9), 0 0 0 5.5px var(--hair-2), 0 10px 34px rgba(222,87,48,.55); }
}

.site-head h1 {
  font-family: var(--f-oracle);
  font-weight: 700;
  font-size: clamp(1.8rem, 6.5vw, 2.5rem);
  letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--gold);
  text-shadow: 0 0 22px rgba(240,169,78,.38);
}
.site-head .sub {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--paper-dim);
  font-size: 0.74rem; letter-spacing: 0.34em; text-indent: 0.34em;
  padding: 0.18rem 0.9rem;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.data-date { text-align: center; font-size: 0.76rem; color: var(--paper-faint); margin-top: 0.7rem; line-height: 1.9; }
.data-date .predict-for { color: var(--gold); font-weight: 600; letter-spacing: 0.04em; }
.data-date .basis { color: var(--paper-dim); }
.data-date .gen { color: var(--paper-faint); font-size: 0.71rem; }
.data-date .stale { color: var(--temple); }

.site-foot {
  width: var(--shell);
  padding: 1.2rem 1.4rem 1.6rem;
  color: var(--paper-faint);
  font-size: 0.72rem; line-height: 1.75;
  text-align: center;
  border-top: 1px solid var(--hair);
}

/* ============ 畫面切換 ============ */
.screen { display: none; animation: fadein 0.5s cubic-bezier(.2,.7,.3,1); }
.screen.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============ 段落眉標（楷體＋金線側翼） ============ */
.record-h, .dp-title {
  font-family: var(--f-oracle);
  color: var(--gold);
  letter-spacing: 0.26em; text-indent: 0.26em;
  font-size: 1.02rem;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  flex-wrap: wrap;
}
.record-h { margin: 1.7rem 0 0.7rem; }
.dp-title { margin-bottom: 0.6rem; }
.record-h::before, .record-h::after,
.dp-title::before, .dp-title::after {
  content: ""; height: 1px; width: 2.2rem;
  background: linear-gradient(90deg, transparent, var(--hair-2));
}
.record-h::after, .dp-title::after { transform: scaleX(-1); }
.record-h small {
  flex: 0 0 100%; text-align: center;
  font-size: 0.68rem; color: var(--paper-faint);
  font-family: var(--f-ui); letter-spacing: 0; text-indent: 0;
  margin-top: -0.1rem;
}

/* ============ NPC 對話（懸掛布幔） ============ */
.npc-bubble {
  display: flex; gap: 0.85rem; align-items: flex-start;
  background: linear-gradient(160deg, rgba(242,230,201,.06), rgba(242,230,201,.02));
  border: 1px solid var(--hair-2);
  border-radius: var(--r);
  padding: 0.95rem 1.05rem;
  margin: 1.3rem 0 1.1rem;
  position: relative;
}
.npc-bubble::before {
  content: ""; position: absolute; left: 1.9rem; top: -7px;
  width: 12px; height: 12px; transform: rotate(45deg);
  background: linear-gradient(160deg, #221820, #1a1219);
  border-left: 1px solid var(--hair-2); border-top: 1px solid var(--hair-2);
}
.npc-bubble .avatar {
  font-size: 2.1rem; line-height: 1; flex: none;
  filter: drop-shadow(0 0 8px rgba(240,169,78,.4));
}
.npc-bubble .who { font-size: 0.72rem; color: var(--gold); letter-spacing: 0.14em; margin-bottom: 0.15rem; }
.npc-bubble .line { font-size: 0.95rem; color: var(--paper); }

/* ============ 健康橫幅（漏跑／過期／盤中補跑提示） ============ */
.health-banner {
  display: flex; align-items: flex-start; gap: 0.6rem;
  margin: 1rem 0 0.2rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--r);
  font-size: 0.86rem; line-height: 1.6;
  border: 1px solid var(--hair-2);
  border-left: 4px solid var(--gold);
  background: linear-gradient(100deg, rgba(240,169,78,.12), rgba(240,169,78,.04));
  color: var(--paper);
}
.health-banner::before { content: "🕯"; font-size: 1.1rem; line-height: 1.3; flex: none; }
.health-banner.warn { border-left-color: var(--gold); }
.health-banner.warn::before { content: "🕯"; }
.health-banner.bad {
  border-left-color: var(--temple);
  background: linear-gradient(100deg, rgba(222,87,48,.16), rgba(222,87,48,.05));
}
.health-banner.bad::before { content: "⚠️"; }
.health-banner b { color: var(--gold); font-weight: 700; }
.health-banner .hb-title { display: block; color: var(--gold); font-weight: 700; margin-bottom: 0.1rem; letter-spacing: 0.03em; }
.health-banner.bad .hb-title, .health-banner.bad b { color: #f0a58f; }
.health-banner .hb-sub { color: var(--paper-dim); font-size: 0.78rem; }

/* ============ 婆婆戰績入口（功德牌匾） ============ */
.record-banner {
  width: 100%;
  display: flex; align-items: center; gap: 0.55rem;
  margin: 0.2rem 0 1.2rem;
  padding: 0.7rem 1.05rem;
  border: 1px solid var(--hair-2);
  border-left: 3px solid var(--gold);
  border-radius: var(--r);
  background: linear-gradient(100deg, rgba(222,87,48,.14), rgba(240,169,78,.06));
  color: var(--paper);
  font-family: var(--f-ui); font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.record-banner:hover, .record-banner:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.record-banner:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.record-banner .rb-icon { font-size: 1.2rem; flex: none; }
.record-banner b {
  font-family: var(--f-num); font-weight: 800; color: var(--gold);
  font-size: 1.3rem; margin: 0 0.25rem;
}
.record-banner small { color: var(--paper-dim); }
.record-banner .rb-go { margin-left: auto; color: var(--gold); font-size: 0.8rem; white-space: nowrap; }

/* ============ 戰績頁 ============ */
.record-hero {
  text-align: center;
  margin: 1.5rem 0 0.9rem;
  padding: 1.5rem 1.2rem;
  border: 1px solid var(--hair-2);
  border-radius: var(--r-lg);
  background:
    radial-gradient(24rem 12rem at 50% -2rem, rgba(222,87,48,.16), transparent 70%),
    linear-gradient(170deg, var(--ink-3), var(--ink));
}
.rh-big {
  font-family: var(--f-num);
  font-weight: 800;
  font-size: 4.4rem; line-height: 1; color: var(--gold);
  text-shadow: 0 0 26px rgba(240,169,78,.35);
  letter-spacing: -0.01em;
}
.rh-big .rh-pct { font-size: 1.8rem; font-weight: 700; margin-left: 0.12rem; }
.rh-label { color: var(--paper-dim); font-size: 0.9rem; margin-top: 0.5rem; letter-spacing: 0.06em; }
.rh-sub { color: var(--gold-soft); font-size: 0.77rem; margin-top: 0.25rem; }
.record-note { font-size: 0.78rem; color: var(--paper-faint); line-height: 1.7; padding: 0 0.2rem; }

/* 逐日對帳列 */
.rday {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 0.8rem; margin: 0.32rem 0;
  border-radius: var(--r-sm); font-size: 0.85rem;
  background: rgba(242,230,201,.04);
  border-left: 3px solid transparent;
}
.rday.ok   { border-left-color: var(--up); }
.rday.miss { border-left-color: var(--down); }
.rday .rd-date { color: var(--paper-dim); width: 3.1rem; font-variant-numeric: tabular-nums; }
.rday .rd-pred { color: var(--paper); width: 6.5rem; }
.rday .rd-act  { width: 3.4rem; }
.rday .rd-mark { font-weight: 700; width: 1.2rem; text-align: center; }
.rday.ok   .rd-mark { color: var(--gold); }
.rday.miss .rd-mark { color: var(--paper-faint); }
.rday .rd-sect { margin-left: auto; color: var(--paper-faint); font-size: 0.74rem; font-variant-numeric: tabular-nums; }

/* 各對象命中率條 */
.rtar { display: flex; align-items: center; gap: 0.65rem; margin: 0.38rem 0; font-size: 0.85rem; }
.rt-name { width: 6.6rem; color: var(--paper-dim); }
.rt-track { flex: 1; height: 8px; background: rgba(242,230,201,.07); border-radius: 5px; overflow: hidden; }
.rt-fill { height: 100%; border-radius: 5px; }
.rt-fill.good { background: linear-gradient(90deg, var(--temple-deep), var(--up)); }
.rt-fill.mid  { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.rt-fill.low  { background: linear-gradient(90deg, var(--jade-deep), var(--down)); }
.rt-pct { width: 4.6rem; text-align: right; color: var(--paper); font-variant-numeric: tabular-nums; }
.rt-pct small { color: var(--paper-faint); font-size: 0.72rem; }
/* #3 各對象命中率條加上 Wilson 信賴區間誤差帶 */
.rt-track { position: relative; }
.rt-fill { position: relative; z-index: 1; }
.rt-ci { position: absolute; top: 0; bottom: 0; z-index: 0; background: rgba(240,169,78,.18); border-radius: 5px; }

/* ============ #2 頭條三線對照 ============ */
.record-compare { margin: 0.2rem 0 0.4rem; padding: 0.9rem 1rem 0.7rem; border: 1px solid var(--hair); border-radius: var(--r); background: linear-gradient(180deg, rgba(242,230,201,.03), transparent); }
.cmp-title { font-family: var(--f-oracle); color: var(--gold); letter-spacing: 0.2em; text-align: center; font-size: 0.95rem; margin-bottom: 0.6rem; }
.cmp-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.34rem 0; font-size: 0.84rem; }
.cmp-name { width: 6.8rem; color: var(--paper-dim); flex: none; }
.cmp-track { position: relative; flex: 1; height: 12px; background: rgba(242,230,201,.07); border-radius: 6px; }
.cmp-track::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(242,230,201,.28); }
.cmp-fill { position: relative; z-index: 1; height: 100%; border-radius: 6px; }
.cmp-fill.base { background: var(--paper-faint); }
.cmp-fill.live { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.cmp-fill.model { background: var(--jade); }
.cmp-ci { position: absolute; top: 0; bottom: 0; z-index: 0; background: rgba(240,169,78,.2); border-radius: 6px; }
.cmp-val { width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--paper-dim); }
.cmp-val.live { color: var(--gold); font-weight: 700; }
.cmp-note { font-size: 0.7rem; color: var(--paper-faint); line-height: 1.6; margin-top: 0.5rem; }

/* ============ #4 明日三段成績單 ============ */
.record-stages { margin-bottom: 0.3rem; }
.sm-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.32rem 0; padding: 0.35rem 0.7rem; border-radius: var(--r-sm); background: rgba(242,230,201,.04); font-size: 0.85rem; border-left: 3px solid var(--hair); }
.sm-row.hot { background: rgba(232,189,95,.11); border-left-color: var(--gold); }
.sm-when { font-family: var(--f-oracle); width: 2.6rem; color: var(--paper-dim); letter-spacing: 0.1em; }
.sm-row.hot .sm-when { color: var(--gold); }
.sm-track { flex: 1; height: 9px; background: rgba(242,230,201,.07); border-radius: 5px; overflow: hidden; }
.sm-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.sm-val { width: 3rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--paper); }
.sm-tag { width: 4.2rem; font-size: 0.64rem; text-align: center; color: #3a220c; background: var(--gold-soft); border-radius: 3px; padding: 0.08rem 0; letter-spacing: 0.03em; }
.sm-tag.ghost { background: transparent; }
.sm-row.hot .sm-tag { background: var(--gold); }

/* ============ #1 籤級校準表 ============ */
.record-calib { margin-bottom: 0.3rem; }
.cal-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0; font-size: 0.85rem; }
.cal-tier { width: 2.6rem; text-align: center; font-family: var(--f-oracle); font-weight: 700; flex: none; }
.cal-track { position: relative; flex: 1; height: 11px; background: rgba(242,230,201,.07); border-radius: 6px; overflow: hidden; }
.cal-track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(242,230,201,.3); z-index: 2; }
.cal-fill { height: 100%; border-radius: 6px; }
.cal-fill.hot { background: linear-gradient(90deg, var(--temple-deep), var(--up)); }
.cal-fill.mid { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.cal-fill.cold { background: linear-gradient(90deg, var(--jade-deep), var(--down)); }
.cal-val { width: 6.4rem; text-align: right; color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.cal-val b { color: var(--paper); }
.cal-val small { color: var(--paper-faint); font-size: 0.68rem; }

/* ============ #3 戰績成熟度 ============ */
.record-maturity { margin: 0.2rem 0 0.5rem; }
.mat-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.mat-label { width: 5.4rem; color: var(--paper-dim); flex: none; }
.mat-track { flex: 1; height: 8px; background: rgba(242,230,201,.07); border-radius: 5px; overflow: hidden; }
.mat-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--temple), var(--gold)); }
.mat-val { width: 5.6rem; text-align: right; color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.mat-note { font-size: 0.7rem; color: var(--paper-faint); margin-top: 0.35rem; line-height: 1.6; }

/* ============ 選擇板塊（籤格磚） ============ */
.target-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 0.7rem; }
@media (max-width: 460px) { .target-grid { grid-template-columns: repeat(2, 1fr); } }
.target-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 0.28rem;
  padding: 0.95rem 0.4rem 0.85rem;
  border: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  color: var(--paper);
  border-radius: var(--r);
  font-family: var(--f-ui); font-size: 0.9rem; letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.target-btn::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(14rem 8rem at 50% -3rem, rgba(240,169,78,.16), transparent 70%);
  opacity: 0; transition: opacity .2s;
}
.target-btn:hover, .target-btn:focus-visible {
  border-color: var(--hair-2); transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
}
.target-btn:hover::after, .target-btn:focus-visible::after { opacity: 1; }
.target-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.target-btn .ico { font-size: 1.55rem; display: block; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }

/* ============ 通用按鈕（金箔籤令牌） ============ */
.btn {
  display: inline-block;
  font-family: var(--f-oracle);
  font-size: 1.12rem; letter-spacing: 0.28em; text-indent: 0.28em;
  color: #3a220c;
  background: linear-gradient(180deg, #f2ce76, var(--gold) 45%, #c99a40);
  border: none; border-radius: 999px;
  padding: 0.7rem 2.4rem;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(240,169,78,.32), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(240,169,78,.5), inset 0 1px 0 rgba(255,255,255,.4); }
.btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.btn:active { transform: translateY(0); filter: brightness(.96); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.btn.ghost {
  background: transparent; color: var(--paper-dim);
  box-shadow: none; border: 1px solid var(--hair-2);
}
.center { text-align: center; margin-top: 1.2rem; }
.back-row { margin-top: 1.6rem; text-align: center; }
.back-row .btn { font-size: 0.92rem; padding: 0.48rem 1.5rem; margin: 0 0.3rem; }

/* ============ 求籤儀式（籤筒） ============ */
.stick-stage { text-align: center; padding: 2rem 0 0.8rem; }
.stick-cup {
  display: inline-block; width: 96px; height: 118px;
  border-radius: 10px 10px 16px 16px;
  background: linear-gradient(180deg, #8a5330 0%, #5a331c 55%, #43260f 100%);
  border: 2px solid #2a170c;
  box-shadow: inset 0 8px 14px rgba(0,0,0,.4), inset 0 -4px 10px rgba(0,0,0,.5), 0 12px 26px rgba(0,0,0,.5);
  position: relative;
}
.stick-cup::before {           /* 筒口 */
  content: ""; position: absolute; left: -2px; right: -2px; top: -3px; height: 15px;
  border-radius: 9px 9px 3px 3px;
  background: linear-gradient(180deg, #a36a3c, #6d4324);
  border: 2px solid #2a170c;
}
.stick-cup::after {            /* 筒身金環 */
  content: ""; position: absolute; left: 6px; right: 6px; top: 42px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); opacity: .55;
}
.stick-cup.shaking { animation: shake 0.5s ease 2; }
@keyframes shake {
  0%,100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-8deg) translateY(-2px); }
  75% { transform: rotate(8deg) translateY(-2px); }
}
.stick {
  position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%);
  width: 13px; height: 60px; z-index: 2;
  background: linear-gradient(180deg, #f0dcac, #cba86a);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 0 14px rgba(240,169,78,.5);
  opacity: 0; transition: height 0.7s ease, opacity 0.3s ease;
}
.stick::before {              /* 籤頭朱紅 */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px;
  background: var(--temple); border-radius: 3px 3px 0 0;
}
.stick.risen { opacity: 1; height: 122px; }

/* ============ 結果頁 ============ */
.result-head { text-align: center; margin-top: 1.3rem; }
.result-head .target-name { font-size: 1rem; color: var(--paper-dim); letter-spacing: 0.22em; text-indent: 0.22em; }
.tier-badge {
  font-family: var(--f-oracle); font-weight: 700;
  font-size: clamp(2.8rem, 11vw, 3.8rem);
  letter-spacing: 0.32em; text-indent: 0.32em;
  display: block; margin: 0.25rem 0 0.15rem;
}
.t-great-luck, .t-good-luck { color: var(--up); text-shadow: 0 0 26px rgba(239,106,67,.55); }
.t-small-luck { color: #ef9a6f; text-shadow: 0 0 18px rgba(239,154,111,.4); }
.t-neutral    { color: var(--gold); text-shadow: 0 0 20px rgba(240,169,78,.4); }
.t-small-bad, .t-bad-luck { color: var(--down); }
.t-great-bad  { color: var(--jade); text-shadow: 0 0 26px rgba(65,161,134,.55); }
.ask-line { font-size: 0.79rem; color: var(--paper-faint); margin-top: 0.15rem; }

/* ---- 直書籤詩（視覺簽名）＋ 朱紅印章 ---- */
.poem-slip {
  margin: 1.4rem auto 0;
  width: fit-content;
  background:
    linear-gradient(105deg, rgba(255,255,255,.14), transparent 40%),
    linear-gradient(175deg, #f8eed6, #e6d3aa);
  color: #4a2c1a;
  border-radius: 5px;
  padding: 1.5rem 1.3rem 1.7rem;
  box-shadow: 0 14px 36px rgba(0,0,0,.55), inset 0 0 46px rgba(160,110,60,.2);
  position: relative;
  animation: slipdown 0.75s cubic-bezier(.2,.8,.3,1);
}
@keyframes slipdown { from { transform: translateY(-28px) rotate(-1deg); opacity: 0; } to { transform: none; opacity: 1; } }
.poem-slip::before {           /* 內框線 */
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(140,60,40,.5);
  border-radius: 3px; pointer-events: none;
}
.poem-wrap { display: flex; flex-direction: row-reverse; justify-content: center; align-items: flex-start; }
.poem-body {
  writing-mode: vertical-rl;
  font-family: var(--f-oracle); font-weight: 700;
  font-size: 1.3rem; letter-spacing: 0.32em; line-height: 2.15;
  height: 15rem;
}
.poem-no {
  writing-mode: vertical-rl;
  font-family: var(--f-oracle);
  color: #a03c2c; font-size: 0.82rem; letter-spacing: 0.2em;
  margin-left: 0.9rem;
}
/* 朱紅印章：蓋在籤紙左下、略微旋轉、壓住邊角 */
.poem-seal {
  position: absolute; left: 0.9rem; bottom: 0.9rem;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  font-family: var(--f-oracle); font-weight: 700;
  font-size: 1.15rem; line-height: 1; color: #b23122;
  border: 2px solid #b23122; border-radius: 6px;
  transform: rotate(-8deg);
  opacity: .82; mix-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px rgba(178,49,34,.4);
}
.poem-seal::before {           /* 印泥不均的斑駁 */
  content: ""; position: absolute; inset: 0; border-radius: 5px;
  background: radial-gradient(circle at 70% 30%, transparent 40%, rgba(242,230,201,.35));
  pointer-events: none;
}

/* ---- 統計徽章（誠實數據面：乾淨黑體） ---- */
.stat-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1.3rem; }
.chip {
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  font-family: var(--f-ui); font-size: 0.78rem;
  padding: 0.32rem 0.9rem;
  color: var(--paper-dim);
  background: rgba(242,230,201,.03);
}
.chip b { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.hot  b { color: var(--up); }
.chip.cold b { color: var(--down); }

/* ---- 明日細解 ---- */
.detail-panel {
  margin-top: 1.2rem;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 1rem 1.05rem 0.8rem;
  background: linear-gradient(180deg, rgba(242,230,201,.03), transparent);
}
/* 一日三段 */
.stages { margin: 0.2rem 0 0.5rem; }
.stage {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.46rem 0.75rem; margin: 0.32rem 0;
  border-radius: var(--r-sm);
  background: rgba(242,230,201,.04);
  border-left: 3px solid var(--hair);
  font-size: 0.88rem;
}
.stage.main { background: rgba(240,169,78,.11); border-left-color: var(--gold); }
.st-when { font-family: var(--f-oracle); letter-spacing: 0.12em; width: 2.8rem; color: var(--paper-dim); }
.stage.main .st-when { color: var(--gold); }
.st-verdict { width: 4.8rem; font-weight: 600; }
.st-verdict.up { color: var(--up); }
.st-verdict.down { color: var(--down); }
.st-pct { color: var(--paper); font-variant-numeric: tabular-nums; }
.st-tag {
  font-size: 0.62rem; color: #3a220c; background: var(--gold-soft);
  border-radius: 3px; padding: 0.06rem 0.32rem; letter-spacing: 0.05em;
}
.st-hit { margin-left: auto; font-size: 0.72rem; color: var(--paper-faint); font-variant-numeric: tabular-nums; }

/* 幅度分布 */
.mag-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0; opacity: 0.62; transition: opacity .2s; }
.mag-row.hot { opacity: 1; }
.mag-row.hot .mag-label { color: var(--paper); }
.mag-label {
  width: 7.2rem; text-align: right; font-size: 0.85rem; color: var(--paper-dim);
  display: flex; flex-direction: column; line-height: 1.2; align-items: flex-end;
}
.mag-label small { font-size: 0.62rem; opacity: 0.7; }
.mag-track { flex: 1; height: 9px; background: rgba(242,230,201,.07); border-radius: 5px; overflow: hidden; }
.mag-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.mag-pct { width: 3.4rem; font-size: 0.82rem; color: var(--paper); font-variant-numeric: tabular-nums; }
.dp-note { font-size: 0.72rem; color: var(--paper-faint); text-align: center; margin-top: 0.5rem; line-height: 1.6; }
.dp-sub { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-top: 0.7rem; }

/* ---- NPC 解籤 ---- */
.explain { margin-top: 1.2rem; }
.explain .twist {
  font-family: var(--f-oracle);
  color: var(--gold);
  border-left: 3px solid var(--gold-soft);
  padding: 0.25rem 0.85rem;
  margin: 0.6rem 0;
  background: rgba(240,169,78,.06);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ---- 攤開真實數據 ---- */
details.raw {
  margin-top: 1.1rem;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 0.7rem 1rem;
  font-family: var(--f-ui); font-size: 0.85rem;
}
details.raw summary {
  cursor: pointer; color: var(--gold);
  letter-spacing: 0.1em; list-style: none;
}
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary::before { content: "✦ "; color: var(--gold-soft); }
details.raw[open] summary { margin-bottom: 0.3rem; }
details.raw table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
details.raw td { padding: 0.3rem 0.3rem; border-bottom: 1px dashed var(--hair); }
details.raw td:last-child { text-align: right; color: var(--paper); font-variant-numeric: tabular-nums; }
details.raw td:first-child { color: var(--paper-dim); }

/* ---- 錯誤 ---- */
.error-box {
  margin-top: 2rem; text-align: center;
  border: 1px solid var(--temple);
  border-radius: var(--r); padding: 1.3rem;
  color: #ef9a8d; font-size: 0.9rem; line-height: 1.7;
  background: rgba(222,87,48,.06);
}
.error-box code { color: var(--gold); font-size: 0.85em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
