/* NaviNana 八字合盤報告 · A4 頁面樣式（794 × 1123 px） */
.nr-page {
  --ink: #2B2150;
  --ink-2: #5A4F7A;
  --ink-3: #8A819F;
  --purple: #3A2A74;
  --purple-2: #6C52B3;
  --lilac: #C9B3F0;
  --lilac-bg: #F2ECFD;
  --rose: #E0789B;
  --rose-bg: #FDEBF1;
  --gold: #C9993A;
  --gold-2: #E8C77A;
  --gold-bg: #FBF3E0;
  --cream: #FFFBF4;
  --line: #EADFCB;
  --pa: #7457C4;
  --pa-bg: #EFE9FC;
  --pb: #E0789B;
  --pb-bg: #FDEAF0;
  position: relative;
  width: 794px;
  height: 1123px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 58px 54px 60px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Huninn', 'LXGW WenKai TC', 'Noto Sans TC', 'Noto Sans CJK HK', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 13.5px;
  line-height: 1.7;
  letter-spacing: 0.2px;
}
.nr-page * { box-sizing: border-box; }
.nr-page p { margin: 0; }
.nr-bgdeco { position: absolute; inset: 0; pointer-events: none; }
.nr-serif { font-family: 'DM Serif Display', 'Playfair Display', Georgia, 'Times New Roman', serif; }

/* 頁眉頁腳 */
.nr-head { position: absolute; top: 20px; left: 54px; right: 54px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.nr-head .nr-brand { display: flex; align-items: center; gap: 7px; color: var(--purple); font-size: 11.5px; }
.nr-head .nr-brand b { letter-spacing: 2px; }
.nr-foot { position: absolute; bottom: 22px; left: 54px; right: 54px; display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 8px; }
.nr-foot .nr-pn { width: 26px; height: 26px; border-radius: 50%; background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; }

/* 標題 */
.nr-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.nr-title .nr-no { width: 40px; height: 40px; border-radius: 14px; background: var(--purple); color: var(--gold-2); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.nr-title h2 { margin: 0; font-size: 25px; line-height: 1.25; color: var(--purple); font-weight: 700; }
.nr-title .nr-sub { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }
.nr-h3 { font-size: 16px; color: var(--purple); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.nr-h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }

/* 卡片 */
.nr-card { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.nr-card.soft { background: var(--lilac-bg); border-color: #E2D6FA; }
.nr-card.rose { background: var(--rose-bg); border-color: #F8D2DF; }
.nr-card.gold { background: var(--gold-bg); border-color: #F1DDB0; }
.nr-card.pa { background: var(--pa-bg); border-color: #D9CCF7; }
.nr-card.pb { background: var(--pb-bg); border-color: #F6CCDA; }
.nr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nr-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.nr-gap { height: 12px; }
.nr-small { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.nr-tiny { font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.nr-chip { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 11.5px; line-height: 20px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); margin: 0 4px 4px 0; white-space: nowrap; }
.nr-chip.pa { background: var(--pa); border-color: var(--pa); color: #fff; }
.nr-chip.pb { background: var(--pb); border-color: var(--pb); color: #fff; }
.nr-chip.gold { background: var(--gold-bg); border-color: #EBD39C; color: #8A6516; }
.nr-chip.purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.nr-name-a { color: var(--pa); font-weight: 700; }
.nr-name-b { color: var(--pb); font-weight: 700; }
.nr-bubble { position: relative; background: #fff; border: 1.5px solid #E2D6FA; border-radius: 18px; padding: 12px 16px; font-size: 13px; color: var(--ink-2); }
.nr-nana-say { display: flex; align-items: flex-end; gap: 10px; }
.nr-nana-say img { width: 74px; flex: none; }
.nr-nana-say .nr-bubble { flex: 1; border-bottom-left-radius: 4px; }
.nr-kv { display: grid; grid-template-columns: 64px 1fr; row-gap: 3px; font-size: 12.5px; }
.nr-kv dt { color: var(--ink-3); }
.nr-kv dd { margin: 0; color: var(--ink); }

/* 命盤表 */
.nr-chart { width: 100%; border-collapse: separate; border-spacing: 0; text-align: center; font-size: 12px; }
.nr-chart th { font-weight: 400; color: var(--ink-3); font-size: 11px; padding: 3px 0; }
.nr-chart td { padding: 2px 0; }
.nr-chart .rowlab { color: var(--ink-3); font-size: 10px; width: 26px; text-align: left; padding-left: 4px; }
.nr-chart .big { font-size: 23px; line-height: 1.2; font-weight: 700; }
.nr-chart .tg { font-size: 11px; color: var(--ink-2); }
.nr-chart .hide { font-size: 10px; line-height: 1.45; color: var(--ink-2); white-space: nowrap; }
.nr-chart .dm { background: var(--gold-bg); border-radius: 10px; }
.nr-bar { height: 12px; border-radius: 6px; background: #F1ECE3; overflow: hidden; }
.nr-bar > i { display: block; height: 100%; border-radius: 6px; }
.nr-wxrow { display: grid; grid-template-columns: 22px 1fr 38px; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.nr-wxdot { width: 22px; height: 22px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }

/* 分數 */
.nr-score-ring { position: relative; width: 190px; height: 190px; }
.nr-score-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.nr-score-ring .num b { font-size: 58px; line-height: 1; color: var(--purple); }
.nr-score-ring .num span { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.nr-grade { display: inline-flex; align-items: center; gap: 8px; background: var(--purple); color: #fff; border-radius: 999px; padding: 4px 16px 4px 6px; font-size: 14px; }
.nr-grade b { background: var(--gold-2); color: var(--purple); border-radius: 999px; padding: 0 10px; font-size: 14px; }
.nr-typebanner { background: linear-gradient(135deg, #3A2A74 0%, #6C52B3 100%); color: #fff; border-radius: 20px; padding: 16px 20px; }
.nr-typebanner .lab { font-size: 11.5px; color: var(--gold-2); letter-spacing: 2px; }
.nr-typebanner h3 { margin: 2px 0 6px; font-size: 23px; line-height: 1.3; }
.nr-typebanner p { font-size: 13px; color: #EDE6FF; }
.nr-dimlist { display: grid; grid-template-columns: 1fr; gap: 6px; }
.nr-dimrow { display: grid; grid-template-columns: 70px 1fr 30px; gap: 8px; align-items: center; font-size: 12.5px; }

/* 連線圖 */
.nr-pbox { position: absolute; width: 74px; height: 92px; border-radius: 16px; background: #fff; border: 2px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.nr-pbox .pos { font-size: 10px; color: var(--ink-3); }
.nr-pbox .gz { font-size: 26px; font-weight: 700; }
.nr-linklabel { position: absolute; transform: translate(-50%, -50%); background: #fff; border: 1.5px solid; border-radius: 999px; padding: 0 8px; font-size: 11px; line-height: 19px; white-space: nowrap; }
.nr-linkitem { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.nr-linkitem:last-child { border-bottom: 0; }
.nr-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 12px; line-height: 1.3; padding: 5px 4px; color: #fff; text-align: center; }
.nr-badge.good { background: var(--rose); }
.nr-badge.bad { background: #8F8399; }
.nr-badge.neutral { background: var(--purple-2); }

/* 五行調色盤 */
.nr-palette { display: flex; height: 36px; border-radius: 12px; overflow: hidden; }
.nr-palette > div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }

/* 流年 */
.nr-year { display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: start; }
.nr-year .yl { text-align: center; }
.nr-year .yl .yy { font-size: 24px; color: var(--purple); line-height: 1.1; }
.nr-year .yl .gz { font-size: 13px; color: var(--ink-2); }
.nr-year ul { margin: 4px 0 0; padding-left: 16px; }
.nr-year li { font-size: 12px; color: var(--ink-2); line-height: 1.6; }

/* 吉日 */
.nr-dates { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.nr-dates td { padding: 7px 6px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.nr-dates .d { color: var(--purple); font-size: 15px; white-space: nowrap; }
.nr-swatch { display: inline-block; width: 28px; height: 28px; border-radius: 9px; margin-right: 6px; vertical-align: middle; border: 2px solid #fff; }

/* 封面 */
.nr-cover { background: linear-gradient(180deg, #1F1546 0%, #34256E 48%, #5B3F9E 100%); color: #fff; padding: 0; }
.nr-cover .inner { position: absolute; inset: 0; padding: 54px 56px; display: flex; flex-direction: column; align-items: center; }
.nr-cover .brandline { display: flex; align-items: center; gap: 10px; color: var(--gold-2); font-size: 13px; letter-spacing: 3px; }
.nr-cover h1 { margin: 26px 0 0; font-size: 70px; line-height: 1; letter-spacing: 1px; color: #fff; font-weight: 400; }
.nr-cover .t2 { margin-top: 10px; font-size: 27px; letter-spacing: 6px; color: #fff; }
.nr-cover .t3 { margin-top: 8px; font-size: 14px; letter-spacing: 3px; color: var(--gold-2); }
.nr-cover .stage { position: relative; width: 100%; height: 470px; margin-top: 16px; }
.nr-cover .halo { position: absolute; left: 50%; top: 20px; width: 400px; height: 400px; margin-left: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 233, 180, 0.55) 0%, rgba(255, 220, 160, 0.18) 45%, rgba(255, 220, 160, 0) 70%); }
.nr-cover .nana { position: absolute; left: 50%; top: 40px; width: 330px; margin-left: -165px; }
.nr-cover .who { position: absolute; top: 300px; width: 180px; background: rgba(255, 255, 255, 0.95); color: var(--ink); border-radius: 20px; padding: 12px 14px; text-align: center; }
.nr-cover .who .nm { font-size: 20px; font-weight: 700; line-height: 1.3; }
.nr-cover .who .meta { font-size: 11.5px; color: var(--ink-2); }
.nr-cover .scorebox { margin-top: 6px; display: flex; align-items: center; gap: 20px; background: rgba(255, 255, 255, 0.1); border: 1.5px solid rgba(232, 199, 122, 0.6); border-radius: 26px; padding: 14px 26px; }
.nr-cover .scorebox .sc { font-size: 64px; line-height: 1; color: var(--gold-2); }
.nr-cover .foot { position: absolute; bottom: 30px; left: 56px; right: 56px; text-align: center; font-size: 11px; color: #CFC3F2; letter-spacing: 1px; }

/* 分享卡 1080×1350 */
.nr-share { position: relative; width: 1080px; height: 1350px; overflow: hidden; background: linear-gradient(180deg, #1F1546 0%, #34256E 50%, #5B3F9E 100%); color: #fff; font-family: 'Huninn', 'Noto Sans TC', 'Noto Sans CJK HK', sans-serif; }

/* ── v2 追加 ── */
.nr-evi { font-size: 10.5px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }
.nr-evi b { color: var(--gold); font-weight: 400; }
.nr-lv { display: inline-block; min-width: 38px; text-align: center; border-radius: 8px; padding: 0 6px; font-size: 11px; line-height: 19px; }
.nr-lv.l2 { background: #3A2A74; color: #fff; }
.nr-lv.l1 { background: #E6DCFA; color: #3A2A74; }
.nr-lv.l0 { background: #F1ECE3; color: #8A819F; }
.nr-lv.lm { background: #F7D9D2; color: #9E4A3A; }
.nr-ck { display: grid; grid-template-columns: 20px 44px 1fr; gap: 6px; align-items: start; font-size: 11.5px; line-height: 1.5; margin-bottom: 3px; }
.nr-ck .mk { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; margin-top: 1px; }
.nr-ck .mk.y { background: #4F9D69; }
.nr-ck .mk.n { background: #C9B8B0; }
.nr-ck b { color: var(--purple); font-weight: 700; }
.nr-flag { font-size: 11px; line-height: 1.5; color: #8A5A10; background: #FBF3E0; border-radius: 8px; padding: 4px 8px; margin-top: 4px; }
.nr-flag.hi { color: #9E3A2E; background: #FBE6E1; }
.nr-cert { display: inline-block; border-radius: 999px; padding: 0 9px; font-size: 11px; line-height: 19px; }
.nr-cert.high { background: #DDF1E2; color: #2F6B45; }
.nr-cert.medium { background: #FBF3E0; color: #8A6516; }
.nr-cert.low { background: #FBE1DE; color: #9E3A2E; }
.nr-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nr-mcell { border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 8px 10px; min-height: 118px; }
.nr-mcell.good { border-color: #E9C7D6; background: #FDF3F7; }
.nr-mcell.care { border-color: #E8D8C7; background: #FAF6F0; }
.nr-mcell .mh { display: flex; justify-content: space-between; align-items: baseline; }
.nr-mcell .mm { font-size: 17px; color: var(--purple); font-weight: 700; }
.nr-mtag { border-radius: 999px; padding: 0 8px; font-size: 11px; line-height: 18px; }
.nr-mtag.good { background: var(--rose); color: #fff; }
.nr-mtag.plain { background: #EFE9FC; color: var(--purple); }
.nr-mtag.care { background: #8F8399; color: #fff; }
.nr-facet { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.nr-facet:last-child { border-bottom: 0; }
.nr-facet .fl { font-size: 12.5px; color: var(--purple); font-weight: 700; }
.nr-rel { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.nr-rel:last-child { border-bottom: 0; }
.nr-rel .rh { display: flex; align-items: center; gap: 8px; }
.nr-rel .eff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.nr-rel .eff div { font-size: 11px; line-height: 1.5; border-radius: 8px; padding: 4px 7px; }
.nr-tone-p { background: #EAF5EC; color: #2F6B45; }
.nr-tone-n { background: #FBEBE7; color: #8F3B2E; }
.nr-tone-0 { background: #F4F1EC; color: #6E6490; }
/* 版面保護（app.js fitPage）：內容超出頁腳時逐級收緊；只調整間距及字級，不改動內容 */
.nr-tight .nr-gap { height: 6px; }
.nr-tight .nr-title { margin-bottom: 8px; }
.nr-tight .nr-rel { padding: 4px 0; }
.nr-tight .nr-dates td { padding: 4px 6px; }
.nr-tight .nr-year li { line-height: 1.45; }
.nr-tight2 .nr-tiny { font-size: 10px !important; line-height: 1.42 !important; }
.nr-tight2 .nr-small { font-size: 11.5px !important; line-height: 1.5 !important; }
.nr-tight2 .nr-rel .eff div { font-size: 10.5px; line-height: 1.42; padding: 3px 6px; }

/* ── 日文／英文報告頁面（.nr-en／.nr-ja；中文頁面沒有這兩個 class，不受影響）：只調整欄寬、字距及個別表格字級 ── */
.nr-en, .nr-ja { text-rendering: geometricPrecision; }
.nr-cover.nr-en .t2, .nr-cover.nr-ja .t2 { letter-spacing: 1.5px; }
.nr-cover.nr-en .t2 { font-size: 24px; line-height: 1.35; }
.nr-cover.nr-en .t3 { letter-spacing: 1.5px; font-size: 12px; }
.nr-en .nr-tiny { font-size: 10px; line-height: 1.45; }
.nr-en .nr-small { font-size: 11.5px; line-height: 1.5; }
.nr-en .nr-kv { font-size: 11.5px; }
.nr-en .nr-ck { grid-template-columns: 20px 62px 1fr; font-size: 11px; }
.nr-en .nr-lv { min-width: 0; padding: 0 5px; font-size: 9.5px; }
.nr-ja .nr-lv { min-width: 0; padding: 0 5px; font-size: 10px; }
.nr-en .nr-lv, .nr-ja .nr-lv { white-space: normal !important; line-height: 14px; padding-top: 2px; padding-bottom: 2px; }
.nr-en .nr-lv small, .nr-ja .nr-lv small { display: block; font-size: 9px !important; }
.nr-en .nr-chart .tg { font-size: 9px; line-height: 1.2; }
.nr-en .nr-chart .hide { font-size: 8.5px; white-space: normal; }
.nr-en .nr-chart .py { display: block; font-size: 8.5px; color: var(--ink-3); line-height: 1; }
.nr-en .nr-chart .rowlab { font-size: 8.5px; width: 34px; }
.nr-en .nr-dates { font-size: 11px; }
.nr-en .nr-dates td { padding: 4px 4px; }
.nr-en .nr-year { grid-template-columns: 104px 1fr; }
.nr-en .nr-year li { font-size: 11px; line-height: 1.5; }
.nr-en .nr-mcell { padding: 6px 8px; min-height: 0; }
.nr-en .nr-mcell .mh, .nr-ja .nr-mcell .mh { flex-wrap: wrap; gap: 2px 6px; }
.nr-en .nr-mcell .mh > span:last-child, .nr-ja .nr-mcell .mh > span:last-child { white-space: nowrap; margin-left: auto; }
.nr-en .nr-mcell .mm { font-size: 16px; white-space: nowrap; }
.nr-en .nr-mtag, .nr-ja .nr-mtag { white-space: nowrap; }
.nr-en .nr-linklabel { font-size: 9.5px; }
.nr-en .nr-pbox .pos { font-size: 9px; }
.nr-en .nr-pbox .pyx { font-size: 9px; font-weight: 400; color: var(--ink-3); margin-left: 3px; vertical-align: middle; }
.nr-luck { table-layout: fixed; }
.nr-luck td { white-space: normal !important; word-break: normal; overflow-wrap: anywhere; vertical-align: top; }
.nr-luck td:nth-child(1) { width: 78px !important; }
.nr-luck td:nth-child(2) { width: 88px !important; }
.nr-luck td:nth-child(3) { width: 96px !important; }
.nr-luck td:nth-child(4) { width: 156px !important; }
.nr-luck td:nth-child(5), .nr-luck td:nth-child(6) { width: 72px !important; }
.nr-luck tr:first-child td:nth-child(5), .nr-luck tr:first-child td:nth-child(6) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap !important; }
.nr-luck .nr-mtag { white-space: normal !important; display: inline-block; line-height: 1.25; padding: 2px 7px; border-radius: 9px; overflow-wrap: normal; word-break: normal; text-align: center; }
.nr-ja .nr-luck td:nth-child(4) { width: 140px !important; }
.nr-en.nr-tight2 .nr-tiny { font-size: 9.5px !important; line-height: 1.4 !important; }
.nr-en.nr-tight2 .nr-small { font-size: 11px !important; line-height: 1.45 !important; }
