:root{
  --zhu:#C23B22;   /* 朱砂红 */
  --dai:#2C3E50;   /* 黛蓝 */
  --mo:#1A1A1A;    /* 墨黑 */
  --mi:#F5F0E8;    /* 米白 */
  --gold:#C9A227;
  /* —— 紙墨階（統一全站底色，取代裸 #fff/#FFFDF8/#fdfaf5/#EDE4D4）—— */
  --paper:#FFFDF8;      /* 主紙面（暖白） */
  --paper-2:#F5F0E8;    /* 次紙面（米白，等同 --mi） */
  --paper-3:#EDE4D4;    /* 紙緣 / 分隔（暖灰） */
  --ink-soft:#6b6358;   /* 軟墨：次要文字 */
  --ink-mid:#3a342c;    /* 中墨：正文加重 */
  --ink-strong:#1A1A1A; /* 濃墨：主文字（等同 --mo） */
  /* —— 五行五色（輔助點綴：元素標籤 / 狀態 / 分區）—— */
  --el-wood:#3E6B5C;    /* 木 · 青瓷 */
  --el-fire:var(--zhu); /* 火 · 朱砂 */
  --el-earth:var(--gold);/* 土 · 藤黃 */
  --el-metal:#A6A29B;   /* 金 · 月白 */
  --el-water:var(--dai); /* 水 · 黛藍 */
  /* —— 形制 —— */
  --line:rgba(44,62,80,.18); /* 統一 1px 細線框 */
  --radius:6px;             /* 統一圓角（印章/九宮 2px） */
  --shadow:0 1px 3px rgba(26,26,26,.06);
}
*{box-sizing:border-box;}
body{
  margin:0; background-color:var(--mi); color:var(--mo);
  font-family:"Songti SC","STSong","Noto Serif CJK SC","Times New Roman",serif;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    radial-gradient(circle at 20% 10%, rgba(194,59,34,.05), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(44,62,80,.06), transparent 40%);
  min-height:100vh;
}
body.rtl{direction:rtl; font-family:"Noto Naskh Arabic","Amiri",serif;}

/* 顶栏 */
.topbar{
  max-width:980px; margin:0 auto; padding:28px 24px 10px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.brand .name{ font-size:30px; letter-spacing:4px; color:var(--dai); font-weight:700; position:relative; display:inline-flex; align-items:center; }
.brand .name::after{ content:"易"; display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; margin-left:12px; font-size:16px; font-weight:700; color:#fff;
  background:var(--zhu); border-radius:3px; transform:rotate(-5deg); letter-spacing:0;
  box-shadow:0 1px 2px rgba(26,26,26,.25); vertical-align:middle; }
.brand .sub{ font-size:13px; color:#7a6f63; letter-spacing:1px; margin-top:4px; }
.lang-wrap{ display:flex; align-items:center; gap:8px; font-size:13px; color:#7a6f63; }
select#langSel{ border:1px solid var(--dai); background:var(--mi); color:var(--mo);
  padding:6px 10px; border-radius:6px; font-family:inherit; }
.nav{ max-width:980px; margin:0 auto; padding:6px 24px 0; display:flex; gap:10px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.nav-btn{ background:none; border:none; padding:10px 18px; font-size:16px; color:var(--dai); cursor:pointer;
  border-bottom:3px solid transparent; font-family:inherit; }
.nav-btn.active{ border-bottom-color:var(--zhu); color:var(--zhu); font-weight:700; }

/* 主区 */
main{ max-width:980px; margin:0 auto; padding:28px 24px 60px; }
.hint{ color:#7a6f63; font-size:15px; margin:6px 0 18px; }
.methods{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; }
.method{ text-align:left; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px; cursor:pointer; transition:.15s; font-family:inherit; }
.method:hover{ transform:translateY(-2px); box-shadow:0 6px 18px rgba(44,62,80,.12); }
.method.active{ border-color:var(--zhu); box-shadow:0 0 0 2px rgba(194,59,34,.25); }
.m-name{ font-size:19px; color:var(--dai); font-weight:700; }
.m-desc{ font-size:13px; color:#8a7f73; margin-top:6px; line-height:1.5; }

.field{ width:100%; margin-top:16px; padding:12px 14px; border:1px solid rgba(44,62,80,.3);
  border-radius:var(--radius); background:var(--paper); font-family:inherit; font-size:16px; color:var(--mo); }
.field.area{ min-height:70px; resize:vertical; }
.btn{ font-family:inherit; cursor:pointer; border-radius:var(--radius); padding:12px 22px; font-size:16px; border:1px solid transparent; margin-top:18px; }
.btn.primary{ background:var(--zhu); color:#fff; }
.btn.primary:hover{ background:#a8321c; }
.btn.ghost{ background:var(--paper); border-color:var(--dai); color:var(--dai); }
.btn.ghost:hover{ background:var(--dai); color:#fff; }
.ai-hint{ color:#9a8f83; font-size:13px; margin-top:14px; }

/* 结果 */
.res-title{ color:var(--dai); font-size:24px; border-left:5px solid var(--zhu); padding-left:12px; }
.res-q{ font-size:16px; color:var(--zhu); background:rgba(194,59,34,.06); padding:10px 14px; border-radius:var(--radius); margin:10px 0; }
.gua-row{ display:flex; gap:20px; flex-wrap:wrap; margin-top:18px; }
.gua-row.center{ justify-content:center; }
.gua-col{ flex:1; min-width:220px; }
.gua-tag{ display:inline-block; font-size:13px; color:#fff; padding:3px 12px; border-radius:20px; margin-bottom:10px; }
.tag-ben{ background:var(--dai); } .tag-bian{ background:var(--zhu); } .tag-hu{ background:#5b7a6b; }
.gua-card{ background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:18px; }
.gua-head{ display:flex; gap:16px; align-items:center; }
.gua-sym{ flex:0 0 auto; }
.gua-no{ font-size:13px; color:#9a8f83; }
.gua-name{ font-size:26px; color:var(--zhu); font-weight:700; }
.gua-tri{ font-size:14px; color:var(--dai); margin-top:2px; }
.gua-sec{ margin-top:14px; border-top:1px dashed var(--line); padding-top:10px; }
.lab{ display:inline-block; font-size:13px; color:#fff; background:var(--dai); padding:2px 10px; border-radius:6px; margin-bottom:6px; }
.gua-sec p{ margin:4px 0 0; line-height:1.7; font-size:15px; }
.white{ color:#5b534a !important; }
.moving-yao{ background:rgba(194,59,34,.08); border-right:3px solid var(--zhu); padding:6px 10px; border-radius:6px; font-size:14px; margin-top:6px; }
.res-actions{ margin-top:22px; display:flex; gap:12px; flex-wrap:wrap; }

/* 卦象线 */
.hex{ display:inline-flex; flex-direction:column; gap:9px; padding:6px; width:96px; box-sizing:border-box; }
.hline{ height:13px; display:flex; gap:16px; }
.hline .bar{ flex:1; background:var(--mo); border-radius:3px; }
.hline.yin .bar{ flex:1; }
.hline.yang{ gap:0; }
.hline.moving .bar{ background:var(--zhu); }
body.theme-dark .hline .bar{ background:#dcd6c8; }
body.theme-dark .hline.moving .bar{ background:#E0593F; }
.diary-mini .hex{ gap:5px; } .diary-mini .hline{ height:8px; gap:9px; }

/* 日记 */
.diary-list{ display:flex; flex-direction:column; gap:12px; margin-top:10px; }
.diary-item{ display:flex; gap:14px; align-items:center; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:12px 16px; }
.diary-mini{ flex:0 0 auto; }
.diary-info{ flex:1; }
.diary-name{ font-size:18px; color:var(--dai); font-weight:700; }
.diary-q{ font-size:14px; margin-top:3px; color:var(--mo); }
.muted{ color:#9a8f83; } .small{ font-size:12px; }
.del{ background:none; border:none; color:#b0a89e; font-size:18px; cursor:pointer; }
.del:hover{ color:var(--zhu); }
.about-text{ line-height:1.9; font-size:16px; background:var(--paper); padding:20px; border-radius:var(--radius); border:1px solid var(--line); }
.about-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-top:18px; }
.about-grid>div{ background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:16px; line-height:1.6; }

/* 页脚 */
footer{ max-width:980px; margin:0 auto; padding:24px; border-top:1px solid var(--line); }
#disclaimer{ font-size:12px; color:#9a8f83; line-height:1.7; text-align:center; }

/* 起卦·誠意（問題焦點） */
.big-area{ min-height:92px; font-size:16px; line-height:1.6; }
.big-btn{ width:100%; text-align:center; padding:14px 22px; font-size:17px; letter-spacing:1px; }
.coin-tip{ color:#7a6f63; font-size:14px; margin-top:16px; line-height:1.6; }

/* 起卦·凝神儀式 */
.ritual{ max-width:560px; margin:6px auto 0; text-align:center; }
.center-title{ border-left:none !important; text-align:center; padding-left:0 !important; }
.breath{ position:relative; width:172px; height:172px; margin:6px auto 4px; }
.breath-core{ position:absolute; inset:40px; border-radius:50%;
  background:radial-gradient(circle at 50% 38%, rgba(194,59,34,.9), rgba(44,62,80,.9));
  animation:breath 6s ease-in-out infinite; box-shadow:0 0 34px rgba(44,62,80,.28); }
.breath-ring{ position:absolute; inset:0; border-radius:50%; border:2px solid rgba(194,59,34,.35);
  animation:breathRing 6s ease-in-out infinite; }
@keyframes breath{ 0%,100%{ transform:scale(.86); opacity:.82; } 50%{ transform:scale(1.06); opacity:1; } }
@keyframes breathRing{ 0%,100%{ transform:scale(.86); opacity:.5; } 50%{ transform:scale(1.14); opacity:0; } }
.ritual-sub{ color:#7a6f63; font-size:15px; margin:2px 0 20px; line-height:1.7; }
.ritual-steps{ list-style:none; padding:0; margin:0 0 20px; text-align:left; }
.rstep{ display:flex; gap:12px; align-items:flex-start; padding:12px 14px; border-radius:var(--radius);
  background:var(--paper); border:1px solid rgba(44,62,80,.12); margin-bottom:10px; line-height:1.65; font-size:15px;
  opacity:.45; transition:.45s; }
.rstep.active{ opacity:1; border-color:var(--zhu); box-shadow:0 0 0 2px rgba(194,59,34,.18); }
.rnum{ flex:0 0 auto; width:26px; height:26px; border-radius:50%; background:var(--dai); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:14px; }
.ritual-sound{ display:flex; gap:10px; justify-content:center; margin-bottom:6px; }
.small-btn{ padding:8px 16px; font-size:14px; margin-top:0; }
.link-btn{ background:none; border:none; color:#9a8f83; text-decoration:underline; cursor:pointer;
  font-family:inherit; font-size:14px; margin-top:16px; display:block; width:100%; }
.link-btn:hover{ color:var(--zhu); }

/* AI 智能體解讀 */
.ai-block{ margin-top:26px; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:20px; position:relative; }
.ai-block::before{ content:""; position:absolute; left:0; top:18px; bottom:18px; width:4px; background:linear-gradient(var(--zhu),var(--dai)); border-radius:4px; }
.ai-head{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; padding-left:10px; }
.ai-badge{ font-size:15px; font-weight:700; color:#fff; background:linear-gradient(135deg,var(--zhu),var(--dai)); padding:5px 14px; border-radius:20px; letter-spacing:1px; }
.ai-note{ font-size:12px; color:#9a8f83; line-height:1.5; }
.ai-lead{ font-size:16px; line-height:1.8; color:var(--dai); padding-left:10px; margin:6px 0 14px; }
.ai-sec{ padding-left:10px; margin-top:14px; border-top:1px dashed rgba(44,62,80,.16); padding-top:10px; }
.ai-sec p{ margin:4px 0 0; line-height:1.8; font-size:15px; }
.lab-wuxing{ background:var(--gold) !important; }
.ai-persp{ margin:6px 0 0; padding-left:20px; }
.ai-persp li{ line-height:1.8; font-size:15px; margin-bottom:6px; }
.ai-closing{ padding-left:10px; margin-top:16px; font-size:15px; line-height:1.9; color:#5b534a; background:rgba(194,59,34,.05); padding:12px 14px; border-radius:var(--radius); }
.ai-prompt{ padding-left:10px; margin-top:14px; }
.ai-prompt summary{ cursor:pointer; font-size:13px; color:#7a6f63; }
.ai-prompt pre{ white-space:pre-wrap; word-break:break-word; background:#f3efe6; border-radius:var(--radius); padding:12px; font-size:12px; line-height:1.6; color:#5b534a; font-family:ui-monospace,Menlo,Consolas,monospace; max-height:260px; overflow:auto; }

/* ---------- 移動端適配 ---------- */
@media (max-width:640px){
  .topbar{ padding:18px 16px 8px; }
  .brand .name{ font-size:24px; }
  .brand .sub{ font-size:11px; }
  .nav{ padding:6px 16px 0; gap:6px; }
  .nav-btn{ padding:8px 12px; font-size:14px; }
  main{ padding:20px 16px 48px; }
  .gua-row{ flex-direction:column; gap:16px; }
  .gua-col{ min-width:0; }
  .methods{ grid-template-columns:1fr; }
  .breath{ width:140px; height:140px; }
  .res-title{ font-size:20px; }
  .gua-name{ font-size:22px; }
  .ai-block{ padding:16px; }
  .ai-note{ flex-basis:100%; }
  .ritual-steps .rstep{ font-size:14px; }
}
@media (max-width:380px){
  .brand .sub{ display:none; }
  .btn.primary, .btn.ghost{ font-size:15px; }
}

/* ============ 追問對話框 · 東方美學 ============ */
#fqOverlay{position:fixed;inset:0;z-index:1000;background:rgba(26,26,26,.45);backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;animation:fqIn .18s ease;}
#fqOverlay.out{animation:fqOut .18s ease forwards;}
@keyframes fqIn{from{opacity:0}to{opacity:1}}
@keyframes fqOut{from{opacity:1}to{opacity:0}}
.fq-panel{position:relative;width:min(540px,88vw);background:#F7F2E9;border:1px solid rgba(44,62,80,.55);
  border-radius:var(--radius);box-shadow:0 18px 50px rgba(26,26,26,.35);display:flex;overflow:hidden;
  animation:fqRise .22s ease;}
@keyframes fqRise{from{transform:translateY(14px);opacity:0}to{transform:none;opacity:1}}
.fq-panel::before{content:'';position:absolute;inset:6px;border:1px solid rgba(194,59,34,.35);border-radius:6px;pointer-events:none;z-index:1;}
.fq-title{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:14px;
  writing-mode:vertical-rl;letter-spacing:10px;font-size:21px;color:#fff;background:var(--zhu);padding:20px 13px;}
.fq-panel.latin .fq-title{writing-mode:horizontal-tb;letter-spacing:2px;font-size:17px;align-self:flex-start;
  flex-direction:row;gap:10px;padding:14px 16px;min-width:100%;box-sizing:border-box;}
.fq-seal{writing-mode:horizontal-tb;letter-spacing:1px;flex:none;width:32px;height:32px;border-radius:4px;
  background:var(--paper);color:var(--zhu);font-size:12px;display:flex;align-items:center;justify-content:center;
  font-weight:700;box-shadow:inset 0 0 0 1px var(--zhu);}
.fq-main{flex:1;position:relative;z-index:2;padding:28px 28px 22px;background:
  radial-gradient(circle at 85% 12%, rgba(44,62,80,.05), transparent 45%),
  radial-gradient(circle at 8% 92%, rgba(194,59,34,.05), transparent 40%);}
.fq-label{font-size:15px;color:var(--dai);letter-spacing:2px;margin-bottom:14px;display:flex;align-items:center;gap:8px;}
.fq-label::before{content:'☰';color:var(--zhu);font-size:13px;}
.fq-input{width:100%;border:none;border-bottom:2px solid rgba(44,62,80,.4);background:transparent;
  padding:8px 2px;font-family:inherit;font-size:16px;color:var(--mo);outline:none;transition:border-color .2s;}
.fq-input:focus{border-bottom-color:var(--zhu);}
.fq-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:26px;}
.fq-btn{font-family:inherit;font-size:15px;padding:8px 26px;border-radius:6px;cursor:pointer;letter-spacing:3px;transition:.15s;}
.fq-ok{background:var(--zhu);color:#fff;border:1px solid var(--zhu);}
.fq-ok:hover{background:#a8321c;}
.fq-cancel{background:transparent;color:var(--dai);border:1px solid rgba(44,62,80,.5);}
.fq-cancel:hover{background:rgba(44,62,80,.08);}
body.rtl .fq-panel{flex-direction:row-reverse;}

/* ============ 端侧模型状态角标 ============ */
#gxModelChip{position:fixed;right:18px;bottom:18px;z-index:900;background:rgba(26,26,26,.85);color:#F5F0E8;
  font-size:13px;letter-spacing:1px;padding:8px 16px;border-radius:20px;box-shadow:0 6px 18px rgba(0,0,0,.25);
  align-items:center;gap:8px;transition:opacity .5s;}
#gxModelChip .dot{width:8px;height:8px;border-radius:50%;background:var(--gold);animation:gxPulse 1.2s infinite;flex:none;}
#gxModelChip.ok .dot{background:#4a7c59;animation:none;}
/* 角标内的迷你进度条（深底，浅色条） */
#gxModelChip .model-mini-bar{height:4px;border-radius:4px;background:rgba(255,255,255,.18);overflow:hidden;margin-top:6px;width:100%;}
#gxModelChip .model-mini-fill{height:100%;width:0;background:#E2BC4C;transition:width .25s ease;}
#gxModelChip .model-mini-bar.indeterminate .model-mini-fill{width:40%;animation:gxBarIndet 1.1s infinite ease-in-out;}
@keyframes gxPulse{0%,100%{opacity:.35}50%{opacity:1}}

/* 靜心閘門：禁用態必須肉眼可辨，避免「點了沒反應」的困惑 */
.btn:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.25);box-shadow:none;}
.btn:disabled:hover{background:var(--zhu);}

/* ============ 内页中国风背景（每页不同古代纹样） ============ */
#gxPageBg{position:fixed;inset:0;z-index:-2;background-position:center;background-size:cover;
  background-repeat:no-repeat;opacity:0;transition:opacity .6s ease;pointer-events:none;}
#gxPageWash{position:fixed;inset:0;z-index:-1;background:rgba(245,240,232,.32);
  opacity:0;transition:opacity .6s ease;pointer-events:none;}
body.bg-on #gxPageBg,body.bg-on #gxPageWash{opacity:1;}

/* ---------- 分享卡片预览弹层 ---------- */
.sc-overlay{position:fixed;inset:0;background:rgba(26,22,18,.74);z-index:1200;display:flex;
  align-items:center;justify-content:center;padding:18px;animation:scFade .25s ease;}
@keyframes scFade{from{opacity:0}to{opacity:1}}
.sc-box{background:#F7F2E9;border-radius:18px;padding:16px 16px 14px;max-height:94vh;overflow:auto;
  box-shadow:0 18px 60px rgba(0,0,0,.35);text-align:center;max-width:480px;width:100%;}
.sc-title{font-weight:700;color:#8a2f1e;margin-bottom:10px;letter-spacing:.08em;font-size:16px;}
.sc-box canvas{width:min(74vw,340px);height:auto;border-radius:var(--radius);box-shadow:0 6px 24px rgba(0,0,0,.18);}
.sc-actions{display:flex;gap:10px;justify-content:center;margin-top:14px;flex-wrap:wrap;}
.sc-note{font-size:13px;color:#7a6f60;margin-top:10px;line-height:1.7;}
.sc-lock{display:inline-flex;align-items:center;gap:6px;background:#FBEDE8;color:#B03A22;
  border:1px solid #E5C4B8;padding:6px 12px;border-radius:999px;font-size:13px;}

/* ---------- 會員與套餐 paywall（M1 骨架） ---------- */
.pw-box{text-align:left!important;max-width:560px;}
.pw-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
.pw-title{font-weight:700;color:var(--zhu);letter-spacing:.08em;font-size:19px;}
.pw-x{border:none;background:transparent;font-size:20px;color:#9a8d7c;cursor:pointer;line-height:1;}
.pw-regions{display:flex;gap:8px;margin-bottom:8px;flex-wrap:wrap;}
.pw-reg{flex:1;min-width:90px;font-family:inherit;cursor:pointer;border:1px solid var(--line);
  background:var(--paper);color:var(--mo);border-radius:999px;padding:9px 8px;font-size:14px;transition:.15s;}
.pw-reg.active{background:linear-gradient(135deg,var(--zhu),var(--dai));color:#fff;border-color:transparent;font-weight:700;}
.pw-region-note{font-size:13px;color:#8a7d6c;margin-bottom:12px;}
.pw-cur-sym{font-weight:700;color:var(--zhu);}
.pw-current{background:rgba(194,59,34,.07);border:1px solid rgba(194,59,34,.2);border-radius:var(--radius);
  padding:10px 12px;margin-bottom:12px;font-size:14px;line-height:1.7;}
.pw-cur-row{color:var(--dai);}
.pw-gift{background:rgba(212,175,55,.14);border:1px solid rgba(212,175,55,.4);border-radius:var(--radius);
  padding:9px 12px;margin-bottom:12px;font-size:14px;color:#8a6a12;}
.pw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:12px;}
.pw-plan{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:14px;
  display:flex;flex-direction:column;gap:8px;align-items:stretch;position:relative;}
.pw-plan-name{font-weight:700;color:var(--mo);font-size:15px;line-height:1.4;}
.pw-plan-price{font-size:22px;font-weight:800;color:var(--zhu);}
.pw-plan-price .pw-sub{font-size:13px;font-weight:500;color:#8a7d6c;margin-left:2px;}
.pw-tag{position:absolute;top:8px;right:8px;background:var(--gold);color:#5a4a12;font-size:11px;
  padding:2px 8px;border-radius:999px;font-weight:700;}
.pw-free{background:rgba(44,62,80,.06);border:1px solid var(--line);border-radius:var(--radius);
  padding:10px 12px;margin-bottom:12px;font-size:13px;line-height:1.7;color:#5b534a;}
.pw-comp{background:#FBEFE6;border:1px solid #E5C4B8;border-radius:var(--radius);padding:12px 14px;
  margin-bottom:12px;font-size:12.5px;line-height:1.85;color:#6a5b48;}
.pw-comp-cn{border-color:#C23B22;background:#FBEDE8;color:#8a2f1e;font-weight:600;}
.pw-comp-title{font-weight:700;margin-bottom:4px;display:block;}
.pw-comp-body{font-weight:400;}
.pw-login-note{font-size:13px;color:#B03A22;text-align:center;margin-top:6px;}
.pw-loading,.pw-err{padding:28px;text-align:center;color:#8a7d6c;}

/* ============ 主题切换按钮（明 / 夜卜） ============ */
.theme-toggle{width:36px;height:36px;border-radius:50%;border:1px solid var(--dai);background:var(--mi);
  color:var(--zhu);font-size:17px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  margin-left:8px;line-height:1;padding:0;transition:transform .2s,background .3s,color .3s;}
.theme-toggle:hover{transform:scale(1.08);}

/* ============ 夜卜暗黑模式（可選，保留宣紙亮色為默認） ============ */
body.theme-dark{
  background:#0c0f13; color:#e9e2d2;
  background-image:radial-gradient(circle at 20% 10%, rgba(194,59,34,.10), transparent 45%),
                   radial-gradient(circle at 80% 90%, rgba(60,90,150,.14), transparent 45%);
}
body.theme-dark .topbar .name{color:#e9e2d2;}
body.theme-dark .topbar .sub{color:#9a9384;}
body.theme-dark .lang-wrap{color:#9a9384;}
body.theme-dark select#langSel{background:#161b22;color:#e9e2d2;border-color:#3a4350;}
body.theme-dark .theme-toggle{background:#161b22;color:#E8C66B;border-color:#3a4350;}
body.theme-dark .nav{border-bottom-color:rgba(255,255,255,.12);}
body.theme-dark .nav-btn{color:#b9c2cf;}
body.theme-dark .nav-btn.active{color:#E8C66B;border-bottom-color:#C23B22;}
body.theme-dark .method{background:#161b22;border-color:rgba(255,255,255,.14);}
body.theme-dark .method:hover{box-shadow:0 6px 18px rgba(0,0,0,.55);}
body.theme-dark .m-name{color:#cdd6e2;}
body.theme-dark .m-desc{color:#8b94a3;}
body.theme-dark .field{background:#141a21;color:#e9e2d2;border-color:rgba(255,255,255,.18);}
body.theme-dark .btn.ghost{background:#1a212b;border-color:#3a4350;color:#cdd6e2;}
body.theme-dark .btn.ghost:hover{background:#26303c;color:#fff;}
body.theme-dark .res-title{color:#E8C66B;}
body.theme-dark .res-q{color:#e9b8ac;background:rgba(194,59,34,.12);}
body.theme-dark .gua-card,body.theme-dark .ai-block,body.theme-dark .diary-item,
body.theme-dark .gua-col{background:#161b22;border-color:rgba(255,255,255,.12);color:#e9e2d2;}
body.theme-dark .gua-name,body.theme-dark .gua-no,body.theme-dark .muted,body.theme-dark .hint{color:#9aa3b0;}
body.theme-dark .ai-sec,body.theme-dark .ai-head{color:#cdd6e2;}
body.theme-dark .ai-note,body.theme-dark .ai-hint{color:#8b94a3;}
body.theme-dark .sc-box{background:#141a21;color:#e9e2d2;}
body.theme-dark .sc-title{color:#E8C66B;}
body.theme-dark .sc-note{color:#9aa3b0;}
body.theme-dark .fq-panel{background:#1a212b;color:#e9e2d2;}
body.theme-dark .fq-input{background:#141a21;color:#e9e2d2;border-color:rgba(255,255,255,.2);}
body.theme-dark .fq-label,body.theme-dark .fq-title{color:#E8C66B;}
body.theme-dark #gxPageWash{background:rgba(8,10,14,.74);}
body.theme-dark .tag-ben,body.theme-dark .tag-bian,body.theme-dark .tag-hu{color:#fff;}
body.theme-dark .breath-core,body.theme-dark .breath-ring{border-color:rgba(232,198,107,.5);}
body.theme-dark .diary-read-prev{color:#9aa3b0;}

/* ============ 第 1 波模組：圖鑑 / 主題占卜 / 簽文 / 表單 ============ */
.daily-streak{display:inline-block;background:rgba(194,59,34,.08);color:#C23B22;border-radius:999px;
  padding:6px 14px;font-size:14px;margin:8px 0 4px;}
body.theme-dark .daily-streak{background:rgba(232,198,107,.12);color:#E8C66B;}
.verse-box{margin-top:16px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:16px;}
body.theme-dark .verse-box{background:#161b22;border-color:rgba(255,255,255,.14);}
.verse-head{font-weight:700;color:var(--zhu);letter-spacing:.1em;margin-bottom:8px;}
.verse-body{white-space:pre-wrap;line-height:2;font-size:17px;color:var(--mo);margin-bottom:12px;min-height:1.5em;}
body.theme-dark .verse-body{color:#e9e2d2;}
.atlas-prog{font-size:15px;color:#7a6f63;margin:6px 0;}
.atlas-bar{height:8px;border-radius:999px;background:rgba(44,62,80,.12);overflow:hidden;margin:8px 0 16px;}
.atlas-bar i{display:block;height:100%;background:linear-gradient(90deg,#C23B22,#C9A227);}
.atlas-done{color:#C23B22;font-weight:700;margin:6px 0;}
.atlas-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;}
.atlas-cell{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px;border-radius:var(--radius);
  border:1px solid rgba(44,62,80,.12);background:rgba(44,62,80,.03);cursor:pointer;font-family:inherit;opacity:.4;}
.atlas-cell.got{opacity:1;border-color:rgba(194,59,34,.4);background:rgba(194,59,34,.05);}
.atlas-mini{transform:scale(.62);transform-origin:center;}
.atlas-name{font-size:11px;color:#7a6f63;white-space:nowrap;}
body.theme-dark .atlas-cell{background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.1);}
body.theme-dark .atlas-cell.got{background:rgba(232,198,107,.08);border-color:rgba(232,198,107,.35);}
body.theme-dark .atlas-name{color:#9aa3b0;}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-top:12px;}
.theme-card{display:flex;flex-direction:column;align-items:center;gap:8px;padding:20px 12px;border-radius:var(--radius);
  background:var(--paper);border:1px solid var(--line);cursor:pointer;font-family:inherit;transition:.15s;}
.theme-card:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(44,62,80,.14);}
.theme-ico{font-size:30px;}
.theme-name{font-size:17px;color:var(--dai);font-weight:700;}
body.theme-dark .theme-card{background:#161b22;border-color:rgba(255,255,255,.14);}
body.theme-dark .theme-name{color:#cdd6e2;}
.nat-form{display:flex;flex-direction:column;gap:6px;max-width:420px;margin-top:8px;}
.nat-form .lab, .zw-form .lab, .gx-form .lab{display:block;font-size:14px;color:#fff;background:#2C3E50;padding:8px 12px;border-radius:6px;margin:12px 0 6px;}
body.theme-dark .nat-form .lab, body.theme-dark .zw-form .lab, body.theme-dark .gx-form .lab{background:#1f2d3d;}
@media (max-width:520px){ .atlas-name{display:none;} }

/* ============ 夜卜粒子背景（暗色星塵） ============ */
#gxParticles{position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.9;}

/* ============ 第 2 波：抽卡 / 易經學習 / 卦例牆 / 卦印 ============ */
.today-global{margin-top:10px;font-size:14px;}
.gacha-stage{display:flex;justify-content:center;margin:18px 0 8px;}
.gacha-card{width:240px;height:347px;border-radius:16px;display:flex;align-items:center;justify-content:center;
  box-shadow:0 12px 34px rgba(0,0,0,.22);overflow:hidden;}
.gacha-card canvas{width:240px;height:auto;display:block;}
.gacha-back{width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#2C3E50,#15181d);color:#C9A227;font-size:64px;font-family:serif;letter-spacing:3px;}
.gacha-card.flip{animation:gxFlip .9s ease;}
@keyframes gxFlip{from{transform:rotateY(0)}to{transform:rotateY(360deg)}}
.gacha-info{text-align:center;color:#C23B22;font-weight:700;letter-spacing:.1em;margin:10px 0;}
body.theme-dark .gacha-info{color:#E8C66B;}
.learn-daily{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;margin-bottom:16px;}
body.theme-dark .learn-daily{background:#161b22;border-color:rgba(255,255,255,.14);}
.learn-daily-h{font-weight:700;color:var(--zhu);letter-spacing:.1em;margin-bottom:6px;}
.learn-daily-b{font-size:16px;color:var(--mo);margin-bottom:10px;}
body.theme-dark .learn-daily-b{color:#e9e2d2;}
.learn-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;}
.learn-cell{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 6px;border-radius:var(--radius);
  background:var(--paper);border:1px solid var(--line);cursor:pointer;font-family:inherit;}
.learn-cell:hover{border-color:var(--zhu);}
.learn-mini{transform:scale(.7);transform-origin:center;}
.learn-nm{font-size:12px;color:#7a6f63;white-space:nowrap;}
body.theme-dark .learn-cell{background:#161b22;border-color:rgba(255,255,255,.12);}
body.theme-dark .learn-nm{color:#9aa3b0;}
.learn-sec{margin-top:16px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;}
body.theme-dark .learn-sec{background:#161b22;border-color:rgba(255,255,255,.12);}
.learn-sec h3{margin:0 0 8px;color:var(--zhu);font-size:15px;letter-spacing:.12em;}
.learn-sec p{margin:0;line-height:1.9;}
.learn-yao{margin:0;padding-left:22px;line-height:2;}
/* 中國古籍學習 · 書架 */
.book-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px;margin-top:6px;}
.book-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px 16px;border-radius:var(--radius);
  background:var(--paper);border:1px solid var(--line);cursor:pointer;font-family:inherit;text-align:left;
  box-shadow:0 1px 3px rgba(0,0,0,.05);transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease;}
.book-card:hover{transform:translateY(-3px);border-color:var(--zhu);box-shadow:0 6px 18px rgba(0,0,0,.12);}
.book-ico{font-size:30px;line-height:1;}
.book-tt{font-size:17px;font-weight:700;color:var(--zhu);letter-spacing:.08em;}
.book-sub{font-size:12px;color:#7a6f63;line-height:1.6;}
body.theme-dark .book-card{background:#161b22;border-color:rgba(255,255,255,.12);}
body.theme-dark .book-card:hover{border-color:#c9a86a;}
body.theme-dark .book-sub{color:#9aa3b0;}
body.theme-dark .book-tt{color:#e9e2d2;}
/* 古籍原文閱讀器（宋明刊本逐字原文） */
.classic-chapter{margin-top:16px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;}
body.theme-dark .classic-chapter{background:#161b22;border-color:rgba(255,255,255,.12);}
.classic-ch-h{font-size:18px;font-weight:700;color:var(--zhu);letter-spacing:.1em;margin-bottom:6px;}
.classic-src{font-size:12px;color:#8a7f73;margin-bottom:12px;font-style:italic;}
body.theme-dark .classic-src{color:#8b94a3;}
.classic-text{line-height:2.1;font-size:var(--gx-fs,15px);color:var(--mo);text-align:justify;letter-spacing:.02em;}
body.theme-dark .classic-text{color:#ddd6c5;}
/* 阅读器工具条 / 目录 / 搜索 / 复制 / 字号 */
.classic-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:6px 0 12px;flex-wrap:wrap;}
.classic-tools{display:inline-flex;gap:6px;align-items:center;}
.btn.small{padding:5px 11px;font-size:13px;min-height:auto;line-height:1.4;}
.btn.tiny{padding:2px 9px;font-size:11px;min-height:auto;line-height:1.4;border-radius:8px;margin-left:8px;}
.classic-search{margin:0 0 12px;}
.classic-search .field{width:100%;max-width:420px;}
.classic-toc{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;margin:4px 0 14px;padding:10px 12px;background:var(--paper);border:1px dashed var(--line);border-radius:var(--radius);}
body.theme-dark .classic-toc{background:#161b22;border-color:rgba(255,255,255,.14);}
.toc-h{font-size:12px;color:#8a7f73;width:100%;letter-spacing:.12em;margin-bottom:2px;}
body.theme-dark .toc-h{color:#8b94a3;}
.toc-item{font-size:13px;color:var(--zhu);text-decoration:none;padding:2px 8px;border-radius:8px;background:rgba(122,47,47,.06);}
.toc-item:hover{background:rgba(122,47,47,.16);}
body.theme-dark .toc-item{background:rgba(201,168,106,.12);color:#e9e2d2;}
body.theme-dark .toc-item:hover{background:rgba(201,168,106,.24);}
.classic-ch-h{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.classic-foot{margin-top:18px;font-size:12px;color:#8a7f73;line-height:1.8;border-top:1px dashed var(--line);padding-top:10px;}
body.theme-dark .classic-foot{color:#8b94a3;border-color:rgba(255,255,255,.14);}
/* 阅读进度条（随滚动更新）+ RTL 阅读器外壳（阿拉伯语等 RTL 语言 dir=rtl） */
.classic-reader{position:relative;}
.classic-progress{position:sticky;top:0;z-index:5;height:3px;background:rgba(122,47,47,.08);border-radius:2px;margin:2px 0 14px;overflow:hidden;}
.classic-progress-bar{height:100%;width:0;background:linear-gradient(90deg,var(--zhu),#C23B22);transition:width .12s linear;}
body.theme-dark .classic-progress{background:rgba(232,198,107,.14);}
body.theme-dark .classic-progress-bar{background:linear-gradient(90deg,#E8C66B,#C23B22);}
.classic-reader[dir="rtl"] .classic-toolbar,
.classic-reader[dir="rtl"] .classic-toc{justify-content:flex-end;}
.classic-reader[dir="rtl"] .classic-text{text-align:right;}
.classic-reader[dir="rtl"] .classic-ch-h{flex-direction:row-reverse;}
.classic-reader[dir="rtl"] .classic-ch-h .btn.tiny{margin-left:0;margin-right:8px;}
.classic-reader[dir="rtl"] .classic-toc .toc-item{text-align:right;}
.wall-form{display:flex;flex-direction:column;gap:8px;max-width:520px;}
.wall-list{margin-top:18px;display:flex;flex-direction:column;gap:10px;}
.wall-item{display:flex;gap:12px;align-items:flex-start;background:var(--paper);border:1px solid var(--line);
  border-radius:var(--radius);padding:12px 14px;}
body.theme-dark .wall-item{background:#161b22;border-color:rgba(255,255,255,.12);}
.wall-mini{transform:scale(.72);transform-origin:left top;flex:none;}
.wall-hex{font-weight:700;color:var(--dai);}
body.theme-dark .wall-hex{color:#cdd6e2;}
.wall-note{font-size:15px;line-height:1.7;margin:4px 0;color:var(--mo);}
body.theme-dark .wall-note{color:#e9e2d2;}
.wall-meta{font-size:12px;color:#9a8f83;}
.shake-hint{text-align:center;margin-top:8px;}
.av-img{width:100%;height:100%;object-fit:cover;border-radius:inherit;}

/* 「古義」小字（現代白話下方保留文言原句） */
.gua-old{margin-top:8px;font-size:13px;color:#9a8f83;line-height:1.8;}
body.theme-dark .gua-old{color:#7f8794;}

/* ============ 紫微斗數：表單 / 十二宮盤 / 星曜卡 ============ */
.zw-form{display:flex;flex-direction:column;gap:6px;max-width:460px;}
.zw-seg{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;width:max-content;}
.zw-seg-b{background:var(--paper);border:none;border-right:1px solid var(--line);padding:8px 22px;cursor:pointer;font-family:inherit;font-size:15px;color:var(--dai);}
.zw-seg-b:last-child{border-right:none;}
.zw-seg-b.active{background:var(--zhu);color:#fff;}
body.theme-dark .zw-seg-b{background:#1a212b;color:#cdd6e2;border-right-color:rgba(255,255,255,.12);}
body.theme-dark .zw-seg-b.active{background:#C23B22;color:#fff;}
.zw-row{display:flex;gap:8px;}
.zw-row .field{margin-top:0;}
.zw-cal-toggle{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;width:max-content;margin-bottom:6px;}
.zw-cal-b{background:var(--paper);border:none;border-right:1px solid var(--line);padding:8px 22px;cursor:pointer;font-family:inherit;font-size:15px;color:var(--dai);}
.zw-cal-b:last-child{border-right:none;}
.zw-cal-b.active{background:var(--zhu);color:#fff;}
body.theme-dark .zw-cal-b{background:#1a212b;color:#cdd6e2;border-right-color:rgba(255,255,255,.12);}
body.theme-dark .zw-cal-b.active{background:#C23B22;color:#fff;}
.zw-lunar-wrap{margin-top:6px;}
.zw-lunar-wrap .hint{margin:8px 0 0;}
.zw-lng{max-width:130px;}
.zw-solar{margin:6px 0 12px;}
/* 排盤口徑說明面板 */
.gx-caliber{border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);padding:10px 12px;margin:4px 0 14px;}
.gx-caliber>summary{cursor:pointer;font-weight:600;color:var(--ink);font-size:14px;letter-spacing:.02em;}
.gx-caliber>summary::-webkit-details-marker{color:var(--accent);}
.cb-intro{margin:8px 0 6px;font-size:12px;line-height:1.6;color:var(--muted);}
.cb-grid{display:flex;flex-direction:column;gap:0;border-top:1px dashed var(--line);}
.cb-row{display:flex;gap:10px;padding:6px 0;border-bottom:1px dashed var(--line);font-size:12.5px;line-height:1.5;}
.cb-lab{flex:0 0 116px;color:var(--accent);font-weight:600;}
.cb-val{flex:1;color:var(--ink);}
.cb-diverge{margin:10px 0 2px;padding:8px 10px;border-radius:8px;background:rgba(200,60,40,.10);color:#b23a22;font-size:12px;line-height:1.6;font-weight:600;}
@media (prefers-color-scheme: dark){ .cb-diverge{background:rgba(255,120,90,.14);color:#ff9b7a;} }
.zw-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:8px;}
.zw-palace{border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);padding:8px 9px;min-height:112px;display:flex;flex-direction:column;}
.zw-palace.soul{border-color:rgba(194,59,34,.55);box-shadow:inset 0 0 0 1px rgba(194,59,34,.25);background:rgba(194,59,34,.05);}
.zw-palace.body{border-style:dashed;}
.zw-pal-head{display:flex;justify-content:space-between;align-items:baseline;gap:6px;}
.zw-pal-name{font-weight:700;color:var(--dai);font-size:14px;}
.zw-palace.soul .zw-pal-name{color:var(--zhu);}
.zw-pal-gz{font-size:12px;color:#9a8f83;}
.zw-pal-stars{margin-top:5px;display:flex;flex-wrap:wrap;gap:3px 8px;line-height:1.5;}
.zw-star{font-size:13px;color:#2c3e50;cursor:pointer;white-space:nowrap;}
.zw-star.maj{font-weight:700;color:#1a1a1a;}
.zw-star.lucky{color:#2f6b4f;}
.zw-star.evil{color:#a8452f;}
.zw-star em{font-style:normal;font-size:11px;color:#9a8f83;margin-left:2px;}
.zw-star:hover{text-decoration:underline;}
.zw-empty{color:#c3bcb2;}
.zw-mu{font-style:normal;font-size:10px;padding:0 3px;border-radius:4px;color:#fff;margin-left:3px;vertical-align:1px;}
.mu-禄{background:#3E7C6B;} .mu-权{background:#9C5333;} .mu-科{background:#2B5F75;} .mu-忌{background:#A63A2E;}
.zw-center{grid-column:2/4;grid-row:2/4;border:1px solid rgba(201,162,39,.5);border-radius:var(--radius);
  background:linear-gradient(160deg,rgba(201,162,39,.08),transparent);display:flex;align-items:center;justify-content:center;padding:10px;}
.zw-center-in{text-align:center;line-height:1.9;}
.zw-crow{font-size:14px;color:#5a5348;}
.zw-crow .zw-clab{color:#9a8f83;margin-right:6px;font-size:12px;}
.zw-crow b{color:#2c3e50;}
.zw-csmall{font-size:12px;color:#9a8f83;margin-top:6px;}
body.theme-dark .zw-palace{background:#161b22;border-color:rgba(255,255,255,.12);}
body.theme-dark .zw-pal-name{color:#cdd6e2;} body.theme-dark .zw-palace.soul .zw-pal-name{color:#E8C66B;}
body.theme-dark .zw-star{color:#b9c2cf;} body.theme-dark .zw-star.maj{color:#EDE6D6;}
body.theme-dark .zw-star.lucky{color:#6FD3C0;} body.theme-dark .zw-star.evil{color:#E0593F;}
body.theme-dark .zw-crow{color:#b9c2cf;} body.theme-dark .zw-crow b{color:#EDE6D6;}
.zwc{text-align:center;padding:18px 16px;}
.zwc-tier{font-size:12px;letter-spacing:.2em;color:#9a8f83;}
.zwc-zh{font-size:48px;font-weight:700;color:var(--zhu);letter-spacing:.06em;margin:4px 0;}
.zwc-py{font-size:15px;letter-spacing:.25em;color:#8a7f6f;margin-bottom:12px;}
.zwc-line{font-size:15px;color:#4a4438;line-height:2;}
.zwc-kw{font-size:14px;color:#7a6f63;margin-top:10px;}
@media (max-width:560px){ .zw-palace{min-height:96px;padding:6px;} .zw-star{font-size:12px;} .zw-pal-name{font-size:13px;} }

/* ---------- 紫微：規則引擎判斷 / 表達層 / 星曜插畫 ---------- */
.zw-ai{margin-top:22px;}
.zw-ai-h{margin:0 0 12px;font-size:17px;letter-spacing:.06em;color:#8a2f1e;}
.zw-chips{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;}
.zw-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;
  background:var(--paper);border:1px solid var(--paper-3);border-radius:var(--radius);padding:10px 12px;cursor:pointer;
  transition:.18s;font-family:inherit;}
.zw-chip:hover{border-color:#C9A227;transform:translateY(-1px);}
.zw-chip.on{border-color:#C9A227;background:#FBF4E4;box-shadow:0 0 0 2px rgba(201,162,39,.18);}
.zw-chip-lab{font-size:12px;color:#8a7f6f;letter-spacing:.08em;}
.zw-chip-val{font-size:16px;color:#1A1A1A;font-weight:700;}
.zw-chip-conf{font-size:11px;color:#a89b88;font-style:normal;}
.zw-dimbox{margin-top:14px;background:var(--paper);border:1px solid var(--paper-3);border-radius:var(--radius);padding:14px 16px;}
.zw-dim-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;}
.zw-dim-head b{font-size:15px;color:#6b6255;letter-spacing:.06em;}
.zw-dim-verdict{font-size:19px;font-weight:800;color:#8a2f1e;}
.zw-dim-score{margin-left:auto;font-size:12px;color:#b3a894;}
.zw-warn{margin:10px 0 0;font-size:13px;color:#B03A22;background:#FBEDE8;border:1px solid #E5C4B8;
  border-radius:var(--radius);padding:7px 10px;line-height:1.7;}
.zw-dim-trait{margin:8px 0 0;font-size:14px;line-height:1.85;color:#4a443a;}
.zw-dim-tier{display:inline-block;margin:8px 0 0;font-size:13px;font-weight:700;line-height:1.5;color:#7a4b00;background:linear-gradient(135deg,#F6E7B8,#E9C96A);border:1px solid #C9A227;padding:3px 12px;border-radius:20px;letter-spacing:.5px;}
.zw-dim-band{margin:8px 0 0;font-size:13px;line-height:1.8;color:#6b5a3a;background:#FBF6EA;border:1px solid #EADFC6;border-radius:var(--radius);padding:7px 10px;}
.zw-ev,.zw-adv{margin-top:12px;}
.zw-ev .lab,.zw-adv .lab{display:inline-block;font-size:12px;letter-spacing:.14em;color:#a8956f;margin-bottom:4px;}
.zw-ev ul,.zw-adv ul{margin:0;padding-left:18px;}
.zw-ev li{font-size:13px;line-height:1.85;color:#6b6255;}
.zw-adv li{font-size:14px;line-height:1.85;color:#3a342c;}
.zw-ctx{display:grid;gap:8px;margin:16px 0 10px;}
.zw-ai-out{margin-top:6px;}
.zw-ai-text{font-size:14.5px;line-height:1.95;color:#2f2a23;background:var(--paper);
  border-left:3px solid #C9A227;border-radius:0 10px 10px 0;padding:12px 14px;}
.zw-ai-meta{margin-top:8px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:12px;color:#8a7f6f;}
.zw-src{border-radius:999px;padding:3px 10px;font-size:11.5px;letter-spacing:.05em;}
.zw-src.ok{background:#E8F4EE;color:#2F6B54;border:1px solid #BFDCCF;}
.zw-src.rule{background:#F1EDE4;color:#7a6f60;border:1px solid var(--paper-3);}
.zw-hits{color:#B03A22;font-size:11.5px;}
.zw-dim-tag{background:#F3EEE4;border-radius:999px;padding:3px 10px;font-size:11.5px;color:#6b6255;}
.zw-ask{display:flex;gap:8px;margin-top:14px;}
.zw-ask .field{flex:1;}
.zw-ask-out{margin-top:10px;}
.zw-ask-q{font-size:13px;color:#8a2f1e;margin-bottom:6px;font-weight:600;}
/* 星曜卡：插畫 */
.zwc-box{padding:0 0 14px;overflow:hidden;}
.zwc-art{position:relative;width:100%;aspect-ratio:1/1;overflow:hidden;border-radius:14px 14px 0 0;
  background:#0B0E13;margin-bottom:12px;}
.zwc-art img{width:100%;height:100%;object-fit:cover;display:block;}
.zwc-art-cap{position:absolute;left:0;right:0;bottom:0;padding:26px 16px 12px;
  background:linear-gradient(to bottom,rgba(11,14,19,0),rgba(11,14,19,.92));text-align:left;}
.zwc-cap-zh{display:block;font-size:30px;font-weight:800;color:#E8C66B;letter-spacing:.1em;}
.zwc-cap-py{display:block;font-size:13px;color:rgba(237,230,214,.72);letter-spacing:.14em;margin-top:2px;}
.zwc-box .zwc{padding:0 18px;}
/* 分享卡比例切換 */
.sc-ratios{margin-bottom:-4px;}
.sc-ratios button{font-size:13px;padding:6px 12px;}
/* 暗色「夜卜」適配 */
body.theme-dark .zw-ai-h{color:#E8C66B;}
body.theme-dark .zw-chip{background:#161b22;border-color:rgba(255,255,255,.14);}
body.theme-dark .zw-chip.on{background:#1e2731;border-color:#C9A227;box-shadow:0 0 0 2px rgba(201,162,39,.22);}
body.theme-dark .zw-chip-lab{color:#8b93a1;}
body.theme-dark .zw-chip-val{color:#EDE6D6;}
body.theme-dark .zw-chip-conf{color:#79808c;}
body.theme-dark .zw-dimbox{background:#141a21;border-color:rgba(255,255,255,.1);}
body.theme-dark .zw-dim-head b{color:#9aa3b0;}
body.theme-dark .zw-dim-verdict{color:#E8C66B;}
body.theme-dark .zw-dim-trait{color:#c8cfd8;}
body.theme-dark .zw-dim-band{color:#d8cdb4;background:#1b2129;border-color:#3a4350;}
body.theme-dark .zw-dim-tier{color:#F6E7B8;background:linear-gradient(135deg,#4a3c12,#6b531a);border-color:#C9A227;}
body.theme-dark .zw-ev li{color:#9aa3b0;}
body.theme-dark .zw-adv li{color:#dcd6c8;}
body.theme-dark .zw-ai-text{background:#141a21;color:#dcd6c8;border-left-color:#C9A227;}
body.theme-dark .zw-ai-meta{color:#8b93a1;}
body.theme-dark .zw-src.ok{background:#16302a;color:#7FD1B0;border-color:#26584a;}
body.theme-dark .zw-src.rule{background:#1c222b;color:#9aa3b0;border-color:#2b333e;}
body.theme-dark .zw-dim-tag{background:#1c222b;color:#9aa3b0;}
body.theme-dark .zw-ask-q{color:#E8C66B;}
body.theme-dark .zw-warn{background:#2a1917;border-color:#5a2f28;color:#F0A98F;}

/* ---------- 紫微：命盤要點 / 四化 / 大限軸 / 流年 ---------- */
.zw-key,.zw-decs,.zw-years{margin-top:24px;}
.zw-sec-h{margin:0 0 12px;font-size:17px;letter-spacing:.06em;color:#8a2f1e;display:flex;align-items:center;gap:10px;}
.zw-sub-h{margin:16px 0 8px;font-size:13.5px;letter-spacing:.1em;color:#a8956f;font-weight:600;}
.zw-pats{display:flex;flex-direction:column;gap:8px;}
.zw-pat{display:block;border-radius:8px;border-left:3px solid var(--paper-3);padding:8px 12px;background:var(--paper);}
.zw-pat b{font-weight:700;font-size:14.5px;}
.zw-pat.good{border-left-color:#2F6B54;background:#EEF8F2;}
.zw-pat.mixed{border-left-color:#8a6a1e;background:#FDF6E3;}
.zw-pat.challenging{border-left-color:#B03A22;background:#FBEDE8;}
.zw-pat-plain{display:block;margin-top:3px;font-size:13px;line-height:1.7;color:#4a4a4a;}
.zw-pat-note{display:block;margin-top:4px;font-size:13.5px;line-height:1.85;color:#6b6255;}
.zw-mu4{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;}
.zw-mu4-col{background:var(--paper);border:1px solid var(--paper-3);border-radius:var(--radius);padding:9px 11px;}
.zw-mu4-lab{display:block;font-size:12px;letter-spacing:.1em;margin-bottom:5px;font-weight:700;}
.zw-mu4-col i{display:block;font-style:normal;font-size:14px;color:#2f2a23;line-height:1.7;}
.zw-mu4-col i em{font-style:normal;font-size:11.5px;color:#a8956f;margin-left:2px;}
.zw-mu4-none{color:#c9c0b0!important;}
.zw-fly{margin:0;padding-left:18px;}
.zw-fly li{font-size:13.5px;line-height:1.9;color:#4a443a;}
/* 四化飛星詳解（按源宮分組，命宮置頂展開，其餘收折） */
.zw-fly-detail-grp{margin:7px 0;border:1px solid var(--paper-3);border-radius:var(--radius);overflow:hidden;background:var(--paper);}
.zw-fly-grp-h{font-size:13px;font-weight:700;color:#3a342c;padding:7px 11px;background:#F6EFE0;letter-spacing:.05em;}
details.zw-fly-detail-grp>summary{cursor:pointer;list-style:none;}
details.zw-fly-detail-grp>summary::-webkit-details-marker{display:none;}
details.zw-fly-detail-grp>summary::before{content:'▸ ';color:#a8956f;font-size:11px;}
details.zw-fly-detail-grp[open]>summary::before{content:'▾ ';}
.zw-fly-detail{margin:0;padding:6px 13px 10px 26px;}
.zw-fly-detail li{font-size:13px;line-height:1.85;color:#4a443a;margin-bottom:7px;}
.zw-fly-detail li b{color:#2f2a23;font-weight:700;}
/* 化忌沖命（化忌飛入命宮）：最易耗損，整條判詞標紅警示 */
.zw-fly-ji-life{border-left:3px solid #B03A22;padding-left:9px;background:rgba(176,58,34,.06);color:#B03A22;}
.zw-fly-ji-life b{color:#B03A22!important;}
.zw-fly-ming{border-color:#C9A227;box-shadow:0 0 0 1px rgba(201,162,39,.25);}
.zw-fly-ming>.zw-fly-grp-h{background:#FBF4E4;color:#6a531a;}
.mu-禄{color:#2F6B54;} .mu-权{color:#9C5333;} .mu-科{color:#2B5F75;} .mu-忌{color:#B03A22;}
.zw-daxis{display:flex;gap:8px;overflow-x:auto;padding-bottom:8px;}
.zw-dec{flex:0 0 auto;min-width:92px;display:flex;flex-direction:column;align-items:center;gap:2px;
  background:var(--paper);border:1px solid var(--paper-3);border-radius:var(--radius);padding:9px 10px;cursor:pointer;font-family:inherit;
  transition:.16s;}
.zw-dec:hover{border-color:#C9A227;}
.zw-dec.on{border-color:#C9A227;background:#FBF4E4;box-shadow:0 0 0 2px rgba(201,162,39,.2);}
.zw-dec-age{font-size:11.5px;color:#a8956f;}
.zw-dec-pal{font-size:15px;color:#1A1A1A;}
.zw-dec-gz{font-size:11.5px;color:#8a7f6f;letter-spacing:.06em;}
.zw-dec-detail{margin-top:12px;background:var(--paper);border:1px solid var(--paper-3);border-radius:var(--radius);padding:11px 13px;}
.zw-dec-head{font-size:14px;color:#3a342c;margin-bottom:8px;}
.zw-mu4-inline{display:flex;flex-wrap:wrap;gap:7px;}
.zw-mu-chip{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:4px 11px;font-size:13px;
  border:1px solid var(--paper-3);background:var(--paper);color:#3a342c;}
.zw-mu-chip b{font-weight:700;}
.zw-mu-chip em{font-style:normal;font-size:11.5px;color:#a8956f;}
.zw-mu-chip.mu-禄{border-color:#BFDCCF;background:#EEF8F2;}
.zw-mu-chip.mu-权{border-color:#E8CFB8;background:#FBF1E8;}
.zw-mu-chip.mu-科{border-color:#C6D6E4;background:#EEF4F9;}
.zw-mu-chip.mu-忌{border-color:#E5C4B8;background:#FBEDE8;}
.zw-year-head{font-size:14.5px;color:#2f2a23;margin:8px 0 10px;line-height:1.8;}
.zw-year-head b{color:#8a2f1e;}
.zw-year-sel{width:96px;padding:3px 8px;border:1px solid var(--paper-3);border-radius:var(--radius);font-family:inherit;
  font-size:14px;background:var(--paper);color:#2f2a23;}
.zw-flow{margin-top:9px;font-size:13px;line-height:1.85;}
.zw-flow.bad{color:#B03A22;}
.zw-flow.good{color:#2F6B54;}
.zw-pal-bdg{display:inline-flex;gap:4px;margin-left:auto;}
.zw-bdg{font-style:normal;font-size:10px;line-height:1.5;padding:1px 6px;border-radius:999px;letter-spacing:.04em;}
.zw-bdg.bd{background:rgba(201,162,39,.2);color:#8a6a1e;border:1px solid rgba(201,162,39,.5);}
.zw-bdg.by{background:rgba(224,89,63,.16);color:#a8351f;border:1px solid rgba(224,89,63,.45);}
/* 暗色適配 */
body.theme-dark .zw-sec-h{color:#E8C66B;}
body.theme-dark .zw-sub-h{color:#9c8f6f;}
body.theme-dark .zw-pat{background:#161b22;border-color:rgba(255,255,255,.14);}
body.theme-dark .zw-pat.good{background:#16302a;border-left-color:#26584a;}
body.theme-dark .zw-pat.mixed{background:#2b2415;border-left-color:#5c4a20;}
body.theme-dark .zw-pat.challenging{background:#2a1917;border-left-color:#5a2f28;}
body.theme-dark .zw-pat b{color:#e8e2d4;}
body.theme-dark .zw-pat-plain{color:#aeb4bf;}
body.theme-dark .zw-pat-note{color:#9aa3b0;}
body.theme-dark .zw-mu4-col{background:#141a21;border-color:rgba(255,255,255,.1);}
body.theme-dark .zw-mu4-col i{color:#dcd6c8;}
body.theme-dark .zw-mu4-col i em{color:#79808c;}
body.theme-dark .zw-fly li{color:#b9c2cd;}
body.theme-dark .zw-fly-detail-grp{background:#141a21;border-color:rgba(255,255,255,.1);}
body.theme-dark .zw-fly-grp-h{background:#1c222b;color:#c9bfa6;}
body.theme-dark .zw-fly-detail li{color:#b9c2cd;}
body.theme-dark .zw-fly-detail li b{color:#e6e0d2;}
body.theme-dark .zw-fly-ming{border-color:#C9A227;box-shadow:0 0 0 1px rgba(201,162,39,.35);}
body.theme-dark .zw-fly-ming>.zw-fly-grp-h{background:#241e10;color:#E8C66B;}
body.theme-dark .mu-禄{color:#6FD3C0;} body.theme-dark .mu-权{color:#E0A85B;}
body.theme-dark .mu-科{color:#7FA8E0;} body.theme-dark .mu-忌{color:#E0593F;}
body.theme-dark .zw-dec{background:#141a21;border-color:rgba(255,255,255,.12);}
body.theme-dark .zw-dec.on{background:#1e2731;border-color:#C9A227;}
body.theme-dark .zw-dec-pal{color:#EDE6D6;}
body.theme-dark .zw-dec-detail{background:#141a21;border-color:rgba(255,255,255,.1);}
body.theme-dark .zw-dec-head{color:#c8cfd8;}
body.theme-dark .zw-mu-chip{background:#141a21;border-color:rgba(255,255,255,.14);color:#dcd6c8;}
body.theme-dark .zw-year-head{color:#dcd6c8;}
body.theme-dark .zw-year-head b{color:#E8C66B;}
body.theme-dark .zw-year-sel{background:#141a21;border-color:rgba(255,255,255,.16);color:#dcd6c8;}
body.theme-dark .zw-flow.bad{color:#F0A98F;} body.theme-dark .zw-flow.good{color:#7FD1B0;}

/* 紫微分享卡：預覽放大 + 點擊全屏 */
#zwShareOv .sc-box{max-width:min(94vw,660px);}
#zwShareOv canvas.preview{width:auto;height:auto;max-width:min(92vw,600px);max-height:64vh;display:block;margin:0 auto;border-radius:var(--radius);cursor:zoom-in;}
.sc-zoomhint{font-size:12px;color:#8a7f6f;margin-top:8px;text-align:center;}
.zw-zoom{position:fixed;inset:0;background:rgba(8,8,10,.95);z-index:1400;display:flex;align-items:center;justify-content:center;padding:10px;cursor:zoom-out;}
.zw-zoom canvas{max-width:97vw;max-height:95vh;width:auto;height:auto;}

/* ---------- 運限深入解讀（機會／風險／建議） ---------- */
.zw-ins{margin-top:12px;border-top:1px dashed var(--paper-3);padding-top:11px;}
.zw-ins-theme{font-size:14px;font-weight:700;color:#8a2f1e;margin-bottom:8px;}
.zw-ins-sec{margin-top:7px;}
.zw-ins-lab{display:inline-block;font-size:11.5px;letter-spacing:.12em;padding:2px 9px;border-radius:999px;
  background:#F3EEE4;color:#6b6255;margin-bottom:4px;}
.zw-ins-lab.good{background:#EEF8F2;color:#2F6B54;}
.zw-ins-lab.bad{background:#FBEDE8;color:#B03A22;}
.zw-ins-sec ul{margin:0;padding-left:18px;}
.zw-ins-sec li{font-size:13.5px;line-height:1.85;color:#3a342c;}
.zw-elapsed{color:#a8956f;font-size:12px;}
.zw-retry{margin-left:8px;font-size:12.5px;padding:3px 12px;}
body.theme-dark .zw-ins{border-top-color:rgba(255,255,255,.12);}
body.theme-dark .zw-ins-theme{color:#E8C66B;}
body.theme-dark .zw-ins-lab{background:#1c222b;color:#9aa3b0;}
body.theme-dark .zw-ins-lab.good{background:#16302a;color:#7FD1B0;}
body.theme-dark .zw-ins-lab.bad{background:#2a1917;color:#F0A98F;}
body.theme-dark .zw-ins-sec li{color:#dcd6c8;}

.zw-ai-live{opacity:.85;border-left-color:#8a7f6f;}

.zw-ai-tip{font-size:12px;color:#a8956f;margin-top:-4px;}

/* ---------- 紫微：運限層切換（大限/小限/流年/流月/流日/流時） ---------- */
.zw-stabs{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px;}
.zw-st{font-family:inherit;font-size:13.5px;letter-spacing:.04em;padding:6px 14px;border-radius:999px;
  border:1px solid var(--paper-3);background:var(--paper);color:#5a5245;cursor:pointer;transition:.16s;}
.zw-st:hover{border-color:#C9A227;}
.zw-st.on{background:#8a2f1e;border-color:#8a2f1e;color:#FBF4E4;font-weight:700;}
.zw-scope-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px;
  font-size:13px;color:#8a7f6f;}
.zw-nav-lab{letter-spacing:.1em;}
.zw-sep{color:#cfc4ae;}
.zw-now{padding:4px 12px!important;font-size:12.5px!important;}
.zw-scope-verdict{display:flex;align-items:baseline;gap:10px;margin:8px 0 10px;
  font-size:19px;font-weight:800;color:#8a2f1e;}
.zw-scope-verdict .zw-dim-score{font-weight:400;font-size:12px;color:#b3a894;margin-left:auto;}
/* 十二神（歲前／將前） */
.zw-d12-box{margin-top:14px;border-top:1px dashed var(--paper-3);padding-top:11px;}
.zw-d12-tally{margin-left:8px;font-style:normal;font-size:12px;color:#a8956f;font-weight:400;}
.zw-d12-row{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:6px 0;}
.zw-d12-lab{flex:0 0 auto;font-size:11.5px;letter-spacing:.1em;color:#a8956f;margin-right:4px;}
.zw-d12c{font-size:12px;padding:2px 8px;border-radius:6px;background:#F4F0E8;color:#5a5245;
  border:1px solid transparent;cursor:default;}
.zw-d12c.g{background:#EEF8F2;color:#2F6B54;border-color:#BFDCCF;}
.zw-d12c.b{background:#FBEDE8;color:#B03A22;border-color:#E5C4B8;}
body.theme-dark .zw-st{background:#141a21;border-color:rgba(255,255,255,.14);color:#c8cfd8;}
body.theme-dark .zw-st.on{background:#C9A227;border-color:#C9A227;color:#141a21;}
body.theme-dark .zw-scope-nav{color:#8b93a1;}
body.theme-dark .zw-sep{color:#3a424e;}
body.theme-dark .zw-scope-verdict{color:#E8C66B;}
body.theme-dark .zw-d12-box{border-top-color:rgba(255,255,255,.12);}
body.theme-dark .zw-d12-lab{color:#8b93a1;}
body.theme-dark .zw-d12c{background:#1c222b;color:#c8cfd8;}
body.theme-dark .zw-d12c.g{background:#16302a;color:#7FD1B0;border-color:#26584a;}
body.theme-dark .zw-d12c.b{background:#2a1917;color:#F0A98F;border-color:#5a2f28;}
body.theme-dark .zw-d12-tally{color:#79808c;}

/* ---------- 模型檔位彈層 ---------- */
.mt-box{max-width:520px;}
.mt-sub{font-size:13px;color:#7a6f60;line-height:1.7;margin-bottom:12px;}
.mt-list{display:flex;flex-direction:column;gap:9px;}
.mt-row{display:grid;grid-template-columns:1fr auto;gap:4px 10px;text-align:left;align-items:center;
  background:var(--paper);border:1px solid var(--paper-3);border-radius:var(--radius);padding:11px 14px;cursor:pointer;
  font-family:inherit;transition:.16s;width:100%;}
.mt-row:hover{border-color:#C9A227;transform:translateY(-1px);}
.mt-row.on{border-color:#8a2f1e;background:#FBF4E4;box-shadow:0 0 0 2px rgba(138,47,30,.14);}
.mt-lab{font-size:15.5px;font-weight:700;color:#2f2a23;}
.mt-size{font-size:12px;color:#a8956f;text-align:right;}
.mt-note{grid-column:1/-1;font-size:12.5px;color:#7a6f60;line-height:1.6;}
.mt-tag{font-style:normal;font-size:11px;padding:2px 9px;border-radius:999px;}
.mt-tag.cur{background:#8a2f1e;color:#FBF4E4;}
.mt-tag.rec{background:#EEF8F2;color:#2F6B54;border:1px solid #BFDCCF;}
.mt-tag.warn{background:#FDF6E3;color:#8a6a1e;border:1px solid #E8D6A8;}
.mt-meta{margin-top:12px;font-size:12.5px;color:#7a6f60;}
.mt-hint{margin-top:6px;font-size:12px;color:#a8956f;line-height:1.7;}
.zw-tier-btn{font-size:12.5px!important;}
.zw-tier-btn b{color:#8a2f1e;}
body.theme-dark .mt-sub,body.theme-dark .mt-note,body.theme-dark .mt-meta,body.theme-dark .mt-hint{color:#9aa3b0;}
body.theme-dark .mt-row{background:#141a21;border-color:rgba(255,255,255,.14);}
body.theme-dark .mt-row.on{background:#1e2731;border-color:#C9A227;}
body.theme-dark .mt-lab{color:#EDE6D6;}
body.theme-dark .mt-tag.rec{background:#16302a;color:#7FD1B0;border-color:#26584a;}
body.theme-dark .mt-tag.warn{background:#2b2415;color:#E0C06B;border-color:#5c4a20;}
body.theme-dark .zw-tier-btn b{color:#E8C66B;}

/* 運限 verdict 的得分／信度分隔 */
.zw-scope-verdict .zw-conf{margin-left:0;padding-left:9px;border-left:1px solid var(--paper-3);}
body.theme-dark .zw-scope-verdict .zw-conf{border-left-color:rgba(255,255,255,.15);}
.mt-tag.bad{background:#FBEDE8;color:#B03A22;border:1px solid #E5C4B8;}
.mt-warn{margin-top:8px;font-size:12px;color:#B03A22;background:#FBEDE8;border:1px solid #E5C4B8;
  border-radius:var(--radius);padding:7px 10px;line-height:1.7;}
body.theme-dark .mt-tag.bad{background:#2a1917;color:#F0A98F;border-color:#5a2f28;}
body.theme-dark .mt-warn{background:#2a1917;border-color:#5a2f28;color:#F0A98F;}
/* ---------- 自備 3B 權重輸入 ---------- */
.mt-custom{margin-top:12px;border:1px dashed #D8C9A8;border-radius:var(--radius);padding:10px 12px;background:#FCF8F0;}
.mt-curl-lab{display:block;font-size:12.5px;color:#7a6f60;margin-bottom:7px;font-weight:600;}
.mt-curl-row{display:flex;gap:8px;}
.mt-url{flex:1;min-width:0;font-size:13px;padding:7px 10px;border:1px solid #D8C9A8;border-radius:var(--radius);background:var(--paper);color:#2f2a23;}
.mt-curl-hint{margin-top:7px;font-size:11.5px;color:#a8956f;line-height:1.6;}
body.theme-dark .mt-custom{border-color:rgba(255,255,255,.18);background:#11161c;}
body.theme-dark .mt-curl-lab{color:#9aa3b0;}
body.theme-dark .mt-url{background:#0c1117;border-color:rgba(255,255,255,.18);color:#e9e2d2;}
body.theme-dark .mt-curl-hint{color:#7d8794;}

/* ---------- 運限：大限段下拉（含既往） ---------- */
.zw-scope-nav select.zw-year-sel{font-family:inherit;font-size:13px;padding:5px 10px;border-radius:var(--radius);
  border:1px solid var(--paper-3);background:var(--paper);color:#3a342c;cursor:pointer;}
body.theme-dark .zw-scope-nav select.zw-year-sel{background:#141a21;border-color:rgba(255,255,255,.16);color:#dcd6c8;}

/* ---------- 主動提示 Banner：順風口／耗損點 ---------- */
.zw-focus-banner{display:flex;flex-direction:column;gap:7px;margin:10px 0;padding:11px 13px;border-radius:var(--radius);
  background:linear-gradient(180deg,#FBF4E4,#FFFDF8);border:1px solid #EAD9B6;}
.zw-focus{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13.5px;line-height:1.7;}
.zw-focus b{font-weight:700;}
.zw-focus.tail{color:#2F6B54;}
.zw-focus.drain{color:#B03A22;}
.zw-focus .zw-mu-chip{margin:0;}
body.theme-dark .zw-focus-banner{background:#1a1d22;border-color:rgba(255,255,255,.14);}
body.theme-dark .zw-focus.tail{color:#7FD1B0;}
body.theme-dark .zw-focus.drain{color:#F0A98F;}

/* ---------- AI 解讀：宮位小辭典 ---------- */
.zw-ai-legend{margin-top:12px;border:1px dashed var(--paper-3);border-radius:var(--radius);padding:9px 12px;background:var(--paper);}
.zw-legend-lab{display:block;font-size:11.5px;letter-spacing:.1em;color:#a8956f;margin-bottom:5px;}
.zw-ai-legend ul{margin:0;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:4px;}
.zw-ai-legend li{font-size:13px;line-height:1.7;color:#3a342c;}
.zw-ai-legend li b{color:#8a2f1e;margin-right:4px;}
.zw-ai-share{margin-top:8px;font-size:12.5px!important;}
body.theme-dark .zw-ai-legend{background:#141a21;border-color:rgba(255,255,255,.12);}
body.theme-dark .zw-ai-legend li{color:#dcd6c8;}
body.theme-dark .zw-ai-legend li b{color:#E8C66B;}

/* ---------- 十二宮解說彈層 ---------- */
.zw-gloss{max-width:min(94vw,560px);}
.zw-gloss-list{display:flex;flex-direction:column;gap:2px;margin:10px 0;max-height:60vh;overflow:auto;}
.zw-gloss-row{display:grid;grid-template-columns:64px 1fr;gap:6px 12px;padding:8px 4px;border-bottom:1px solid #F0EADC;}
.zw-gloss-name{grid-row:span 2;font-size:15px;font-weight:700;color:#8a2f1e;align-self:center;}
.zw-gloss-theme{font-size:12.5px;color:#8a7f6f;}
.zw-gloss-mean{font-size:13px;color:#3a342c;line-height:1.6;}
body.theme-dark .zw-gloss-row{border-bottom-color:rgba(255,255,255,.1);}
body.theme-dark .zw-gloss-name{color:#E8C66B;}
body.theme-dark .zw-gloss-mean{color:#dcd6c8;}

/* ---------- 星曜卡輪播畫廊 ---------- */
.zw-gal-box{max-width:min(94vw,520px);text-align:center;}
.zw-gal-stage{margin:8px auto 2px;touch-action:pan-y;}
.zw-gal-box .zw-gal-canvas{height:min(45vh,380px);width:auto;max-width:min(74vw,320px);border-radius:var(--radius);box-shadow:0 8px 28px rgba(0,0,0,.28);background:#0d1015;}
.zw-gal-nav{display:flex;align-items:center;justify-content:center;gap:16px;margin:10px 0 4px;}
.zw-gal-arrow{min-width:44px;height:44px;border-radius:50%;font-size:22px;line-height:1;padding:0;}
.zw-gal-count{font-size:14px;color:#8a7f6f;min-width:56px;font-variant-numeric:tabular-nums;}
.zw-gal-dots{display:flex;gap:7px;justify-content:center;margin:2px 0 4px;flex-wrap:wrap;}
.zw-gal-dot{width:8px;height:8px;border-radius:50%;background:#D8CEBB;cursor:pointer;display:block;transition:.18s;}
.zw-gal-dot.on{background:#B03A22;transform:scale(1.35);}
body.theme-dark .zw-gal-dot{background:#3a4350;}
body.theme-dark .zw-gal-dot.on{background:#E8C66B;}
body.theme-dark .zw-gal-count{color:#9aa4b2;}
body.theme-dark .zw-gal-box .zw-gal-canvas{background:#0b0e13;}

/* ---------- AI 分享卡 ---------- */
.zw-share-canvas{width:270px;height:338px;display:block;margin:0 auto 12px;border-radius:var(--radius);
  box-shadow:0 6px 24px rgba(0,0,0,.25);background:#0d0b14;}

/* ---------- 本命飛星耗損來源（化忌沖命） ---------- */
.zw-drain-note{margin-top:10px;border:1px solid #E5C4B8;border-radius:var(--radius);background:#FBEDE8;
  padding:9px 12px;font-size:13px;line-height:1.7;color:#7a3322;}
.zw-drain-lab{color:#B03A22;font-weight:600;}
/* 化忌沖命來源宮的判詞：標紅列舉，直接對應「這些宮位的判詞」 */
.zw-drain-list{margin:8px 0 2px;padding:0 0 0 4px;list-style:none;}
.zw-drain-list li{font-size:13px;line-height:1.85;margin-bottom:6px;color:#5a3a30;}
.zw-drain-list li b{color:#B03A22;}
.zw-drain-v{color:#B03A22;font-weight:600;}
body.theme-dark .zw-drain-note{background:#2a1917;border-color:#5a2f28;color:#F0A98F;}
body.theme-dark .zw-drain-lab{color:#F0A98F;font-weight:600;}
body.theme-dark .zw-drain-list li{color:#F0A98F;}
body.theme-dark .zw-drain-list li b{color:#F0775B;}
body.theme-dark .zw-drain-v{color:#F0A98F;}
body.theme-dark .zw-fly-ji-life{color:#F0A98F;background:rgba(240,169,143,.09);}
body.theme-dark .zw-fly-ji-life b{color:#F0775B!important;}

/* ================= 八字子平法（bz-*） ================= */
.bz-form{max-width:420px;}
.bz-pillars{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0;justify-content:center;}
.bz-pillar{flex:1;min-width:74px;max-width:110px;text-align:center;border:1px solid var(--paper-3);border-radius:var(--radius);
  padding:12px 6px;background:var(--paper);}
.bz-pillar.day{background:#FBEFD8;border-color:#C9A227;}
.bz-p-lab{font-size:11px;color:#6B6A65;margin-bottom:4px;}
.bz-p-gz{display:flex;flex-direction:column;gap:4px;align-items:center;}
.bz-p-gz b{font-size:26px;color:#2C3E50;line-height:1.2;font-weight:600;}
.bz-p-gz i{font-size:26px;color:#C23B22;line-height:1.2;font-style:normal;font-weight:600;}
.bz-p-ss{margin-top:5px;font-size:11px;color:#8A5A2B;}
.bz-solar{margin-bottom:6px;}
.bz-h3{font-size:14px;font-weight:600;color:#2C3E50;margin:16px 0 8px;}
.bz-dayun{display:flex;gap:6px;flex-wrap:wrap;}
.bz-dy{display:flex;flex-direction:column;align-items:center;border:1px solid var(--paper-3);border-radius:var(--radius);
  padding:5px 9px;background:var(--paper);min-width:52px;}
.bz-dy i{font-size:10px;color:#6B6A65;font-style:normal;}
.bz-dy b{font-size:15px;color:#2C3E50;font-weight:600;}
.bz-chips{display:flex;gap:8px;flex-wrap:wrap;}
.bz-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;border:1px solid var(--paper-3);
  border-radius:var(--radius);background:var(--paper);padding:8px 12px;cursor:pointer;font:inherit;text-align:left;}
.bz-chip:hover{border-color:#C9A227;}
.bz-chip-lab{font-size:11px;color:#6B6A65;}
.bz-chip-val{font-size:14px;color:#2C3E50;font-weight:600;}
.bz-chip-conf{font-size:10px;color:#9A958A;font-style:normal;}
.bz-dimbox{display:none;margin-top:10px;border:1px solid var(--paper-3);border-radius:var(--radius);background:var(--paper);padding:12px;}
.bz-dim-head{font-size:14px;font-weight:600;color:#C23B22;margin-bottom:6px;}
.bz-dim-text{font-size:13px;line-height:1.8;color:#2C3E50;}
.bz-dim-ev{margin-top:8px;font-size:12px;line-height:1.7;color:#6B6A65;}
.bz-dim-band{margin-top:8px;font-size:12px;line-height:1.7;color:#8a6d2f;border-left:3px solid #C9A227;padding:4px 8px;background:rgba(201,162,39,0.07);border-radius:4px;}
.bz-dim-tier{display:inline-block;margin-top:8px;font-size:13px;font-weight:700;line-height:1.5;color:#7a4b00;background:linear-gradient(135deg,#F6E7B8,#E9C96A);border:1px solid #C9A227;padding:3px 12px;border-radius:20px;letter-spacing:.5px;}
.bz-dim-adv{margin-top:8px;font-size:12px;line-height:1.7;color:#3A5A40;}
/* 名詞白話對照（摺疊塊） */
.bz-gloss{margin-top:10px;border:1px dashed var(--paper-3,#D8CFC0);border-radius:6px;padding:6px 10px;background:rgba(201,162,39,0.05);}
.bz-gloss summary{cursor:pointer;font-size:12px;font-weight:600;color:#8a6d2f;user-select:none;}
.bz-gloss ul{margin:6px 0 2px;padding-left:18px;font-size:12px;line-height:1.8;color:#6B6A65;}
.bz-gloss b{color:#2C3E50;}
.bz-ai{margin-top:14px;}
.bz-ai-text{margin-top:10px;font-size:13px;line-height:1.9;color:#2C3E50;white-space:pre-wrap;}
/* 規則先行 · 模型流式生成中的脈衝指示點 */
.gx-stream-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--el-fire,#C23B22);margin-right:6px;vertical-align:middle;animation:gxPulse 1.1s ease-in-out infinite;}
.gx-dot-warn{background:#C9A227;animation:none;}
@keyframes gxPulse{0%{opacity:.25;transform:scale(.85);}50%{opacity:1;transform:scale(1);}100%{opacity:.25;transform:scale(.85);}}
body.theme-dark .gx-stream-dot{background:#E07A5F;}

/* 八字詳解面板：十神落宫 · 干支作用（對標紫微四化飛星） */
.bz-xiang{margin-top:16px;border:1px solid var(--paper-3);border-radius:var(--radius);background:var(--paper);padding:12px 14px;}
.bz-xiang-note{margin:4px 0 10px;color:#6B6A65;font-size:12px;line-height:1.6;}
.bz-xiang-sec{margin-top:8px;}
.bz-xiang-h{font-size:13px;font-weight:700;color:#C23B22;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px dashed var(--paper-3);}
.bz-xiang-group{margin:6px 0 8px;}
.bz-xiang-gh{font-size:12px;font-weight:600;color:#8a6d2f;margin:6px 0 3px;}
.bz-xiang-list{list-style:none;margin:0;padding:0;}
.bz-xiang-list li{font-size:13px;line-height:1.75;color:#2C3E50;margin:3px 0;padding-left:10px;border-left:2px solid var(--paper-3);}
.bz-xiang-god{display:inline-block;font-weight:700;color:#2C3E50;margin-right:4px;background:rgba(201,162,39,0.12);border:1px solid rgba(201,162,39,0.35);border-radius:5px;padding:0 6px;font-size:12px;line-height:1.6;}
.bz-xiang-acts li{border-left-color:#C9A227;}
body.theme-dark .bz-xiang{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-xiang-note{color:#9a958a;}
body.theme-dark .bz-xiang-h{color:#E08A6E;border-bottom-color:#2c3440;}
body.theme-dark .bz-xiang-gh{color:#E8C66B;}
body.theme-dark .bz-xiang-list li{color:#D8D4CA;border-left-color:#2c3440;}

/* 城市組合框：可輸入 + 自繪下拉（聚焦列全部、輸入過濾、支援自訂地點） */
.zw-city-wrap{position:relative;flex:1;min-width:0;}
.zw-city-dd{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:60;max-height:250px;overflow-y:auto;
  background:#fff;border:1px solid var(--paper-3);border-radius:8px;box-shadow:0 8px 24px rgba(44,62,80,.14);padding:4px;}
.zw-city-it{display:block;width:100%;text-align:left;background:none;border:0;border-radius:6px;cursor:pointer;
  padding:7px 10px;font-size:14px;color:#2C3E50;font-family:inherit;line-height:1.5;}
.zw-city-it:hover,.zw-city-it:focus{background:rgba(201,162,39,.14);outline:none;}
.zw-city-none{padding:8px 10px;font-size:12px;color:#6B6A65;line-height:1.6;}
.zw-city-it{display:flex;align-items:baseline;gap:8px;}
.zw-city-it .zw-city-region{margin-left:auto;font-size:11px;color:#8a857a;white-space:nowrap;}
body.theme-dark .zw-city-it .zw-city-region{color:#7e7a70;}
body.theme-dark .zw-city-dd{background:#1c222b;border-color:#2c3440;box-shadow:0 8px 24px rgba(0,0,0,.5);}
body.theme-dark .zw-city-it{color:#D8D4CA;}
body.theme-dark .zw-city-it:hover,body.theme-dark .zw-city-it:focus{background:rgba(201,162,39,.18);}
body.theme-dark .zw-city-none{color:#9a958a;}
body.theme-dark .bz-xiang-god{color:#F6E7B8;background:rgba(201,162,39,0.18);border-color:#6b531a;}

body.theme-dark .bz-pillar{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-pillar.day{background:#2a2214;border-color:#6b5a22;}
body.theme-dark .bz-p-gz b{color:#E8E4DA;}
body.theme-dark .bz-p-gz i{color:#E08A6E;}
body.theme-dark .bz-h3{color:#E8E4DA;}
body.theme-dark .bz-dy{background:#161a20;border-color:#2c3440;}

/* 日記中的八字迷你預覽 */
.bz-mini{display:flex;gap:5px;align-items:center;background:#F5F0E8;border:1px solid var(--paper-3);border-radius:var(--radius);padding:8px 10px;min-width:104px;}
.bz-mini-p{display:flex;flex-direction:column;align-items:center;line-height:1.15;padding:0 3px;}
.bz-mini-p i{font-style:normal;font-size:10px;color:#9a958a;}
.bz-mini-p b{font-size:15px;color:#2C3E50;font-weight:700;}
.bz-mini-p.dm b{color:#C23B22;}
.bz-mini-p.dm{background:#FBEFD8;border-radius:6px;padding:2px 4px;}
body.theme-dark .bz-mini{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-mini-p i{color:#8a8478;}
body.theme-dark .bz-mini-p b{color:#E8E4DA;}
body.theme-dark .bz-mini-p.dm b{color:#E08A6E;}
body.theme-dark .bz-mini-p.dm{background:#2a2214;}
body.theme-dark .bz-dy b{color:#E8E4DA;}
body.theme-dark .bz-chip{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-chip-val{color:#E8E4DA;}
body.theme-dark .bz-dimbox{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-dim-text{color:#D8D4CA;}
body.theme-dark .bz-dim-band{color:#E8C66B;border-left-color:#C9A227;background:rgba(201,162,39,0.12);}
body.theme-dark .bz-dim-tier{color:#F6E7B8;background:linear-gradient(135deg,#4a3c12,#6b531a);border-color:#C9A227;}
body.theme-dark .bz-ai-text{color:#D8D4CA;}

/* 大運軸可點擊 */
.bz-dy{cursor:pointer;background:#FFFFFF;border:1px solid var(--paper-3);text-align:center;font:inherit;}
.bz-dy:hover,.bz-dy.active{background:#FBEFD8;border-color:#C9A227;}
.bz-dy-tip{font-size:12px;color:#8a8378;margin-top:-6px;margin-bottom:6px;}
.bz-dy-areas{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0;}
.bz-dy-area{background:#F5F0E8;border:1px solid var(--paper-3);border-radius:var(--radius);padding:8px 10px;}
.bz-dy-area b{display:block;font-size:13px;color:#8a6d3b;margin-bottom:4px;}
.bz-dy-area p{margin:0;font-size:13px;line-height:1.55;color:#4a4a4a;}
.bz-dy-nodes{margin:10px 0;background:#F5F0E8;border:1px solid var(--paper-3);border-radius:var(--radius);padding:8px 12px;}
.bz-dy-nodes>b{display:block;font-size:13px;color:#8a6d3b;margin-bottom:4px;}
.bz-dy-nodes ul{margin:0;padding-left:18px;font-size:13px;line-height:1.7;color:#4a4a4a;}
body.theme-dark .bz-dy{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-dy:hover,body.theme-dark .bz-dy.active{background:#2a2214;border-color:#8a6d3b;}
body.theme-dark .bz-dy-area,body.theme-dark .bz-dy-nodes{background:#161a20;border-color:#2c3440;}
body.theme-dark .bz-dy-area p,body.theme-dark .bz-dy-nodes li{color:#D8D4CA;}

/* ===== 雙軸判詞 GX_AXIS ===== */
.gx-axis{margin:14px 0;border:1px solid var(--paper-3);border-radius:var(--radius);background:#FBF8F2;padding:12px;}
body.theme-dark .gx-axis{background:#12161c;border-color:#2c3440;}
.gx-axis-tabs{display:flex;gap:8px;margin-bottom:10px;}
.gx-tab{border:1px solid var(--paper-3);background:var(--paper);color:#5b5346;border-radius:20px;padding:6px 16px;font-size:13px;cursor:pointer;}
.gx-tab.active{background:#8a6d3b;color:#fff;border-color:#8a6d3b;}
body.theme-dark .gx-tab{background:#1a1f27;border-color:#2c3440;color:#cfc8ba;}
body.theme-dark .gx-tab.active{background:#8a6d3b;color:#fff;}
.gx-sec{margin:10px 0;}
.gx-sec-h{font-size:13px;color:#8a6d3b;margin-bottom:6px;font-weight:600;}
.gx-row{display:flex;flex-wrap:wrap;gap:6px;}
.gx-chip{border:1px solid var(--paper-3);background:var(--paper);color:#4a4a4a;border-radius:var(--radius);padding:5px 10px;font-size:12px;cursor:pointer;}
.gx-chip.on{background:#f3e6cf;border-color:#8a6d3b;color:#8a6d3b;font-weight:600;}
body.theme-dark .gx-chip{background:#1a1f27;border-color:#2c3440;color:#cfc8ba;}
body.theme-dark .gx-chip.on{background:#2a2214;border-color:#8a6d3b;color:#e7c98a;}
.gx-mod-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;margin-top:8px;}
.gx-mod-card{border:1px solid var(--paper-3);border-radius:var(--radius);background:var(--paper);padding:8px;}
.gx-mod-name{font-size:13px;color:#5b5346;margin-bottom:4px;}
body.theme-dark .gx-mod-card{background:#161a20;border-color:#2c3440;}
.gx-lv{display:inline-block;font-size:11px;padding:1px 6px;border-radius:6px;margin:2px 3px 0 0;}
.gx-lv-strong{background:#e8f3e0;color:#3b6d11;}
.gx-lv-mid{background:#eef1f5;color:#185fa5;}
.gx-lv-weak{background:#fbece7;color:#993c1d;}
.gx-lv-flat{background:#f1efea;color:#888780;}
body.theme-dark .gx-lv-strong{background:#1d2a14;color:#97c459;}
body.theme-dark .gx-lv-mid{background:#11233a;color:#85b7eb;}
body.theme-dark .gx-lv-weak{background:#2a1410;color:#f0997b;}
body.theme-dark .gx-lv-flat{background:#1a1f27;color:#888780;}
.gx-ev{display:inline-block;font-size:11px;padding:1px 6px;border-radius:6px;margin:2px 3px 0 0;background:#f1efea;color:#4a4a4a;}
.gx-ev-love{background:#fbeaf0;color:#993556;}
.gx-ev-marry{background:#eaf3de;color:#3b6d11;font-weight:600;}
.gx-ev-separate{background:#fbece7;color:#993c1d;}
.gx-ev-remarry{background:#e1f5ee;color:#0f6e56;font-weight:600;}
.gx-ev-flat{background:#f1efea;color:#888780;}
.gx-ev-organ{background:#fff4e0;color:#9a5b00;border:1px solid #e7c98a;font-weight:600;}
.gx-ev-detail{background:#eef3f8;color:#2f6aa8;border:1px solid #c5d8ec;font-weight:600;}
body.theme-dark .gx-ev-organ{background:#2a2415;color:#e0a64b;border:1px solid #5c4a1e;}
body.theme-dark .gx-ev-detail{background:#13202b;color:#7fb0e0;border:1px solid #29465c;}
body.theme-dark .gx-ev{background:#1a1f27;color:#cfc8ba;}
body.theme-dark .gx-ev-love{background:#2a1420;color:#ed93b1;}
body.theme-dark .gx-ev-marry{background:#1d2a14;color:#97c459;}
body.theme-dark .gx-ev-separate{background:#2a1410;color:#f0997b;}
body.theme-dark .gx-ev-remarry{background:#0f2a22;color:#5dcaa5;}
body.theme-dark .gx-ev-organ{background:#2a2415;color:#e0a64b;border:1px solid #5c4a1e;}
.gx-year-detail{margin-top:10px;border-top:1px dashed var(--paper-3);padding-top:8px;}
.gx-month-wrap{display:flex;flex-direction:column;gap:4px;margin-top:8px;}
.gx-mchip{border:1px solid var(--paper-3);background:var(--paper);border-radius:6px;padding:4px 8px;font-size:12px;text-align:left;cursor:pointer;color:#4a4a4a;}
body.theme-dark .gx-mchip{background:#1a1f27;border-color:#2c3440;color:#cfc8ba;}
.gx-mpanel{border-left:3px solid #8a6d3b;background:#fbf8f2;padding:6px 10px;margin:4px 0 8px;font-size:12px;color:#4a4a4a;}
body.theme-dark .gx-mpanel{background:#161a20;color:#cfc8ba;}
.gx-mod-mini{margin:2px 0;}
.gx-events{margin-top:8px;}
.gx-event{border:1px solid var(--paper-3);border-radius:var(--radius);background:var(--paper);padding:8px 10px;margin-bottom:6px;}
.gx-ev-head{font-size:13px;margin-bottom:3px;}
.gx-ev-text{font-size:12px;color:#4a4a4a;line-height:1.5;}
body.theme-dark .gx-event{background:#161a20;border-color:#2c3440;}
body.theme-dark .gx-ev-text{color:#cfc8ba;}
.gx-axis-disc{font-size:11px;color:#888780;margin-top:8px;}
.gx-axis-host:empty{display:none;}
.gx-legend{font-size:12px;margin-bottom:10px;border:1px solid var(--paper-3);border-radius:var(--radius);background:#fff;padding:8px 10px;}
body.theme-dark .gx-legend{background:#161a20;border-color:#2c3440;}
.gx-legend summary{cursor:pointer;font-weight:600;color:#8a6d3b;outline:none;}
/* 子女「生育／緣動／波動」事件 chip（2026-10-07 新增 birth 類） */
.gx-ev-birth{background:#fde3ec;color:#c01f5a;border:1px solid #f0a8c4;font-weight:700;}
.gx-ev-child{background:#f3e9fb;color:#7a2fa0;border:1px solid #d9bcec;font-weight:600;}
.gx-ev-child-fluct{background:#f1efea;color:#8a8478;border:1px solid #ddd9d0;}
body.theme-dark .gx-ev-birth{background:#33121f;color:#f29bc0;border:1px solid #5c2238;}
body.theme-dark .gx-ev-child{background:#1f1230;color:#c79be8;border:1px solid #3a2350;}
body.theme-dark .gx-ev-child-fluct{background:#1a1f27;color:#9a948a;border:1px solid #2c3440;}
body.theme-dark .gx-legend summary{color:#e7c98a;}
.gx-legend-body{margin-top:6px;}
.gx-legend-row{display:flex;gap:8px;align-items:flex-start;margin:5px 0;line-height:1.45;}
.gx-legend-row>span:first-child{flex:none;min-width:30px;text-align:center;}
.gx-legend-row>span:last-child{color:#4a4a4a;flex:1;}
body.theme-dark .gx-legend-row>span:last-child{color:#cfc8ba;}

/* ---------- 銅鏡門戶 ---------- */
:root{--gx-orbit:min(31.7vw,152px);}
.gx-mirror-wrap{width:100%;display:flex;flex-direction:column;align-items:center;padding:10px 0 40px;}
.gx-mirror-stage{
  width:min(92vw,440px);height:min(92vw,440px);perspective:1200px;margin-top:10px;
}
.gx-mirror{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .8s cubic-bezier(.4,.2,.2,1.4);}
.gx-mirror.flipped{transform:rotateY(180deg);}
.gx-mirror.flipped .gx-back{pointer-events:none;}
.gx-mirror:not(.flipped) .gx-front{pointer-events:none;}
.gx-face{position:absolute;inset:0;border-radius:50%;backface-visibility:hidden;-webkit-backface-visibility:hidden;}

.gx-back{
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='copper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' seed='12'/%3E%3CfeColorMatrix type='matrix' values='0.6 0 0 0 0.25 0 0.5 0 0 0.15 0 0 0.35 0 0.08 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23copper)' opacity='0.55'/%3E%3C/svg%3E"),
    radial-gradient(circle at 48% 45%,rgba(255,255,255,.20) 0%,transparent 38%),
    radial-gradient(circle at 52% 55%,rgba(0,0,0,.22) 0%,transparent 40%),
    conic-gradient(from 0deg,#7a5228,#b88a4d,#e8c87a,#b88a4d,#7a5228,#5c3d1e,#7a5228,#b88a4d,#7a5228);
  background-blend-mode:multiply,screen,multiply,normal;
  box-shadow:
    inset 0 0 70px rgba(60,35,15,.60),
    inset -20px -20px 50px rgba(0,0,0,.38),
    inset 20px 20px 50px rgba(255,220,160,.22),
    0 30px 60px rgba(60,35,15,.35),
    0 0 0 8px rgba(139,98,57,.12),
    0 0 0 16px rgba(139,98,57,.06);
  overflow:hidden;
}
.gx-back::before{
  content:"";position:absolute;inset:0;border-radius:50%;pointer-events:none;
  background:repeating-radial-gradient(circle at 50% 50%,transparent 0,transparent 12px,rgba(60,40,20,.06) 13px,transparent 14px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.05' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='6'/%3E%3C/filter%3E%3Cg filter='url(%23p)' opacity='0.16' fill='none' stroke='%233d2817' stroke-width='1'%3E%3Cpath d='M20,60 Q80,40 150,70 T280,50'/%3E%3Cpath d='M30,120 Q90,100 160,130 T270,110'/%3E%3Cpath d='M40,200 Q100,180 170,210 T260,190'/%3E%3Cpath d='M60,260 Q120,240 180,270 T250,250'/%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode:multiply;opacity:.7;
}
.gx-back::after{
  content:"";position:absolute;inset:0;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle at 35% 35%,rgba(255,245,210,.18) 0%,transparent 45%),
             radial-gradient(circle at 70% 75%,rgba(58,90,70,.12) 0%,transparent 35%);
  mix-blend-mode:screen;
}
.gx-back-inner{position:absolute;inset:0;animation:gxShine 72s linear infinite;}
@keyframes gxShine{
  0%{filter:brightness(1) saturate(1);transform:rotate(0deg);}
  50%{filter:brightness(1.05) saturate(1.04);}
  100%{filter:brightness(1) saturate(1);transform:rotate(360deg);}
}
@media (prefers-reduced-motion:reduce){ .gx-back-inner{animation:none;} }

.gx-sun-knob{
  position:absolute;left:50%;top:50%;width:17%;height:17%;
  transform:translate(-50%,-50%);z-index:5;border-radius:50%;
  background:radial-gradient(circle at 32% 32%,#fff8e0 0%,#f0d878 12%,#e8c87a 30%,#a67c36 55%,#5c3d1e 92%);
  box-shadow:0 0 0 3px rgba(255,255,255,.35),0 0 22px rgba(240,200,110,.55),0 0 40px rgba(200,150,70,.30),inset 0 0 10px rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;
  font-size:clamp(12px,3.4vw,18px);font-weight:700;color:#3d2817;letter-spacing:1px;
  animation:gxSunGlow 5s ease-in-out infinite;
}
.gx-sun-knob::before{
  content:"";position:absolute;inset:8%;border-radius:50%;
  background:linear-gradient(135deg,transparent 40%,rgba(255,255,255,.55) 48%,rgba(255,255,255,.2) 52%,transparent 60%);
  pointer-events:none;
}
@keyframes gxSunGlow{
  0%,100%{box-shadow:0 0 0 3px rgba(255,255,255,.35),0 0 22px rgba(240,200,110,.5),0 0 40px rgba(200,150,70,.28),inset 0 0 10px rgba(0,0,0,.45);}
  50%{box-shadow:0 0 0 3px rgba(255,255,255,.45),0 0 30px rgba(240,200,110,.7),0 0 56px rgba(200,150,70,.42),inset 0 0 10px rgba(0,0,0,.45);}
}

.gx-portal{
  position:absolute;left:50%;top:50%;width:18%;height:18%;margin:-9% 0 0 -9%;
  border-radius:50%;border:0;padding:0;cursor:pointer;display:flex;flex-direction:column;align-items:center;
  justify-content:flex-start;color:#fff;background:transparent;z-index:6;
}
.gx-portal-inner{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;animation:gxBreathe 3s ease-in-out infinite;}
@keyframes gxBreathe{
  0%,100%{filter:drop-shadow(0 0 10px var(--p-glow));}
  50%{filter:drop-shadow(0 0 20px var(--p-glow));}
}
.gx-planet{
  width:min(16vw,72px);height:min(16vw,72px);border-radius:50%;position:relative;
  box-shadow:inset 0 0 12px rgba(255,255,255,.25),0 6px 16px rgba(0,0,0,.35),0 0 18px var(--p-glow);
  transition:transform .25s,filter .25s;
}
.gx-portal:hover .gx-planet,.gx-portal:focus .gx-planet{transform:scale(1.10);filter:brightness(1.12);outline:none;}
.gx-planet::after{content:"";position:absolute;inset:0;border-radius:50%;pointer-events:none;}
.gx-venus{background:radial-gradient(circle at 35% 35%,#fff8d6 0%,#e6c87a 35%,#8a6d3c 78%,#4a3218 100%);}
.gx-venus::after{background:repeating-linear-gradient(-15deg,transparent 0 6px,rgba(122,90,42,.18) 6px 8px);}
.gx-mars{background:radial-gradient(circle at 35% 35%,#ffdede 0%,#d85c4a 35%,#962a1a 78%,#55150a 100%);}
.gx-mars::after{background:repeating-linear-gradient(12deg,transparent 0 8px,rgba(100,20,10,.18) 8px 10px);}
.gx-jupiter{background:radial-gradient(circle at 35% 35%,#d6f0e0 0%,#a8c9a8 35%,#5a7a58 78%,#2a3f2a 100%);}
.gx-jupiter::after{background:repeating-linear-gradient(0deg,transparent 0 8px,rgba(58,90,86,.22) 8px 10px),radial-gradient(circle at 62% 30%,#c94a32 0%,transparent 24%);}
.gx-mercury{background:radial-gradient(circle at 35% 35%,#f7f2e9 0%,#d8ccc0 35%,#8a7a6e 78%,#4a3f36 100%);}
.gx-mercury::after{background:radial-gradient(circle at 26% 34%,rgba(90,74,66,.35) 0%,transparent 12%),radial-gradient(circle at 66% 60%,rgba(90,74,66,.28) 0%,transparent 9%),radial-gradient(circle at 48% 74%,rgba(90,74,66,.30) 0%,transparent 8%);}
.gx-saturn{background:radial-gradient(circle at 35% 35%,#fff0a8 0%,#e0b85c 35%,#9a6e2c 78%,#5a3a12 100%);}
.gx-saturn::before{content:"";position:absolute;inset:-18%;border-radius:50%;border:10px solid rgba(200,150,70,.55);border-top-color:transparent;transform:rotateX(70deg) rotateY(20deg);filter:drop-shadow(0 2px 2px rgba(0,0,0,.3));}
.gx-p-label{
  margin-top:8px;font-size:clamp(11px,3vw,15px);font-weight:700;letter-spacing:2px;
  color:#f8f0e0;text-shadow:0 1px 4px rgba(0,0,0,.65);
  background:rgba(60,40,20,.55);padding:2px 10px;border-radius:999px;white-space:nowrap;
}

.gx-front{
  transform:rotateY(180deg);
  background:radial-gradient(circle at 50% 40%,rgba(255,255,255,.9) 0%,rgba(230,220,205,.85) 60%,rgba(180,160,140,.75) 100%);
  box-shadow:inset 0 0 80px rgba(255,255,255,.6),inset 0 0 30px rgba(139,98,57,.25),0 30px 60px rgba(60,35,15,.35),0 0 0 8px rgba(139,98,57,.12);
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  padding:clamp(16px,4.2vw,26px);text-align:center;color:#3d2817;
  overflow:hidden;
  transition:border-radius .35s ease .1s,inset .35s ease .1s;
}
.gx-mirror.flipped .gx-front{inset:4%;border-radius:24px;overflow:hidden;}
.gx-front-h{font-size:clamp(20px,5.4vw,28px);font-weight:700;letter-spacing:3px;margin:6px 0 3px;flex-shrink:0;}
.gx-front-sub{font-size:clamp(12px,3vw,14px);opacity:.75;margin-bottom:10px;flex-shrink:0;}
.gx-front-grid{
  width:100%;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
  display:grid;grid-template-columns:repeat(2,1fr);gap:10px;align-content:start;
  -ms-overflow-style:none;scrollbar-width:none;
}
.gx-front-grid::-webkit-scrollbar{display:none;}
.gx-front-grid-single{grid-template-columns:1fr;}
.gx-front-grid-dense{gap:8px;}
.gx-fcard{
  background:rgba(255,255,255,.86);border-radius:var(--radius);padding:12px 8px;
  box-shadow:0 4px 12px rgba(60,35,15,.12);border:1px solid rgba(139,98,57,.12);
  cursor:pointer;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column;align-items:center;gap:6px;
}
.gx-fcard:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(60,35,15,.2);}
.gx-fcard-icon{font-size:26px;}
.gx-fcard-title{font-size:14px;font-weight:600;}
.gx-fcard-note{font-size:11px;opacity:.7;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.gx-front-grid-dense .gx-fcard{padding:10px 6px;border-radius:var(--radius);gap:4px;}
.gx-front-grid-dense .gx-fcard-icon{font-size:22px;}
.gx-front-grid-dense .gx-fcard-title{font-size:12px;}
.gx-front-grid-dense .gx-fcard-note{font-size:9px;line-height:1.25;-webkit-line-clamp:1;}
.gx-front-back{
  margin-top:auto;flex-shrink:0;background:transparent;border:1px solid rgba(139,98,57,.4);
  color:inherit;padding:8px 22px;border-radius:999px;cursor:pointer;font-size:13px;letter-spacing:1px;transition:.2s;
}
.gx-front-back:hover{background:rgba(139,98,57,.12);}
.gx-slogan{margin-top:26px;font-size:clamp(16px,4.5vw,22px);letter-spacing:4px;font-weight:500;color:#5c3d1e;opacity:.85;text-align:center;}
.gx-hint-text{margin-top:14px;font-size:12px;opacity:.6;text-align:center;max-width:360px;color:#5c3d1e;}
.gx-my-btn{
  position:fixed;left:18px;bottom:18px;width:56px;height:56px;border-radius:50%;border:0;cursor:pointer;
  background:radial-gradient(circle at 35% 35%,#e8c87a,#a67c36 55%,#5c3d1e);
  box-shadow:0 6px 18px rgba(60,35,15,.35),0 0 0 4px rgba(255,255,255,.15);
  display:flex;align-items:center;justify-content:center;font-size:24px;color:#3d2817;z-index:100;transition:transform .2s;
}
.gx-my-btn:hover{transform:scale(1.08);}
.gx-my-label{position:absolute;bottom:-20px;font-size:11px;color:#5c3d1e;white-space:nowrap;letter-spacing:1px;}

/* 暗色主題 */
body.theme-dark .gx-front{background:radial-gradient(circle at 50% 40%,rgba(80,72,64,.95) 0%,rgba(50,44,38,.9) 60%,rgba(30,26,22,.9) 100%);color:#e8e0d4;}
body.theme-dark .gx-fcard{background:rgba(40,35,30,.92);border-color:rgba(255,255,255,.08);}
body.theme-dark .gx-slogan,body.theme-dark .gx-hint-text,body.theme-dark .gx-my-label{color:#e8e0d4;}
body.theme-dark .gx-p-label{background:rgba(30,20,10,.65);color:#e8e0d4;}

@media (max-width:360px){ .gx-p-label{display:none;} }

/* ---------- 銅鏡下級模塊（稱骨/小六壬/相術/風水/奇門） ---------- */
.gx-form{max-width:420px;margin:18px auto 0;display:flex;flex-direction:column;gap:8px;}
.gx-field-label{font-size:13px;color:#6b4a25;margin-top:6px;letter-spacing:1px;}
.gx-form .field{width:100%;}
.gx-res-card{max-width:480px;margin:20px auto 0;background:rgba(255,250,240,.85);border:1px solid rgba(139,98,57,.25);
  border-radius:var(--radius);padding:16px 18px;box-shadow:0 4px 14px rgba(90,60,25,.12);}
.gx-res-row{display:flex;justify-content:space-between;gap:12px;font-size:14px;padding:6px 0;border-bottom:1px dashed rgba(139,98,57,.2);}
.gx-res-row span{color:#6b4a25;}
.gx-res-row b{color:#3d2817;text-align:right;}
.gx-res-band{margin-top:12px;font-size:16px;font-weight:700;color:#8b6239;letter-spacing:2px;}
.gx-res-text{margin:8px 0 0;font-size:14px;line-height:1.8;color:#4a3a28;}
.gx-disclaimer{max-width:480px;margin:16px auto 0;font-size:12px;line-height:1.7;color:#9a7a52;opacity:.9;text-align:center;}
.gx-consent{max-width:520px;margin:18px auto 0;background:rgba(255,247,235,.9);border:1px solid rgba(200,120,60,.3);
  border-radius:var(--radius);padding:14px 16px;}
.gx-consent-title{font-weight:700;color:#b5481f;font-size:14px;letter-spacing:1px;margin-bottom:6px;}
.gx-consent-body{font-size:13px;line-height:1.8;color:#5a4632;}
.gx-consent-check{display:block;margin-top:10px;font-size:13px;color:#6b4a25;cursor:pointer;}
.gx-tabs{max-width:560px;margin:18px auto 0;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;}
.gx-tab{border:1px solid rgba(139,98,57,.3);background:rgba(255,250,240,.7);color:#6b4a25;border-radius:999px;
  padding:7px 16px;font-size:13px;cursor:pointer;transition:.2s;letter-spacing:1px;}
.gx-tab.on{background:linear-gradient(135deg,#a67c36,#5c3d1e);color:#fff;border-color:transparent;box-shadow:0 3px 10px rgba(90,60,25,.25);}
.gx-tab-body{max-width:560px;margin:16px auto 0;}
.gx-upload{max-width:420px;margin:0 auto;background:rgba(255,250,240,.8);border:1px dashed rgba(139,98,57,.4);
  border-radius:var(--radius);padding:18px;text-align:center;}
.gx-upload-label{display:block;font-size:13px;color:#6b4a25;margin-bottom:10px;letter-spacing:1px;}
.gx-upload input[type=file]{font-size:13px;}
.gx-upload-note{margin-top:12px;font-size:13px;color:#9a7a52;line-height:1.7;}
.gx-tab-body .gx-form{max-width:420px;}
.small-btn{padding:6px 16px;font-size:13px;border-radius:999px;}
body.theme-dark .gx-res-card{background:rgba(45,38,32,.92);border-color:rgba(255,255,255,.08);}
body.theme-dark .gx-res-row span{color:#c9bca8;} body.theme-dark .gx-res-row b{color:#f0e6d6;}
body.theme-dark .gx-res-band{color:#e8c87a;}
body.theme-dark .gx-res-text{color:#d8cdb8;}
body.theme-dark .gx-disclaimer{color:#a89478;}
body.theme-dark .gx-consent{background:rgba(45,38,32,.92);border-color:rgba(255,255,255,.08);}
body.theme-dark .gx-consent-title{color:#f0a07a;} body.theme-dark .gx-consent-body{color:#cbbda6;}
body.theme-dark .gx-consent-check{color:#cbbda6;}
body.theme-dark .gx-tab{background:rgba(45,38,32,.9);border-color:rgba(255,255,255,.12);color:#cbbda6;}
body.theme-dark .gx-upload{background:rgba(45,38,32,.9);border-color:rgba(255,255,255,.14);}
body.theme-dark .gx-field-label{color:#cbbda6;}

/* ---------- 手相模塊 (palmistry) ---------- */
.gx-card{max-width:560px;margin:16px auto 0;background:rgba(255,250,240,.82);border:1px solid rgba(139,98,57,.22);
  border-radius:var(--radius);padding:14px 16px;box-shadow:0 4px 14px rgba(90,60,25,.1);}
.gx-card-h{font-weight:700;color:#8b6239;font-size:14px;letter-spacing:1px;margin-bottom:10px;}
.gx-pick-row{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 8px;}
.gx-pick{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#4a3a28;background:rgba(255,255,255,.55);
  border:1px solid rgba(139,98,57,.25);border-radius:999px;padding:6px 12px;cursor:pointer;transition:.18s;}
.gx-pick:hover{background:rgba(255,255,255,.85);}
.gx-pick input{accent-color:#a67c36;}
.gx-pick:has(input:checked){background:linear-gradient(135deg,#a67c36,#5c3d1e);color:#fff;border-color:transparent;}
/* 形煞勾選：白話說明小字（普通人／外國人看得懂） */
.gx-sha-pick{flex-direction:column;align-items:flex-start;gap:5px;border-radius:14px;max-width:280px;}
.gx-sha-pick .gx-pick-line{display:inline-flex;align-items:center;gap:6px;}
.gx-sha-desc{display:block;font-size:11.5px;line-height:1.55;color:#8a7f6f;padding-left:22px;opacity:.95;}
.gx-sha-pick:has(input:checked) .gx-sha-desc{color:rgba(255,255,255,.85);}
.gx-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px;margin-top:6px;}
.gx-grid2 .field{width:100%;}
.gx-palm-btns{display:flex;gap:10px;margin-top:14px;}
.gx-palm-photo-row{display:flex;gap:16px;align-items:flex-start;}
.gx-palm-imgwrap{width:120px;height:150px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;
  border:1px dashed rgba(139,98,57,.45);border-radius:var(--radius);background:rgba(255,255,255,.4);overflow:hidden;}
.gx-palm-imgwrap img{max-width:100%;max-height:100%;object-fit:contain;}
.gx-palm-none{font-size:12px;color:#9a7a52;}
.gx-palm-photo-side{flex:1 1 auto;}
.gx-palm-res{display:grid;grid-template-columns:1fr;gap:12px;margin-top:18px;max-width:560px;margin-left:auto;margin-right:auto;}
.gx-res-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px;}
.gx-res-name{font-size:15px;font-weight:700;color:#5c3d1e;letter-spacing:1px;}
.gx-res-advice{margin:6px 0 0;font-size:13px;line-height:1.7;color:#6b4a25;}
.gx-res-advice b{color:#b5481f;}
@media (max-width:480px){ .gx-grid2{grid-template-columns:1fr;} .gx-palm-photo-row{flex-direction:column;} }
body.theme-dark .gx-card{background:rgba(45,38,32,.9);border-color:rgba(255,255,255,.08);}
body.theme-dark .gx-card-h{color:#e8c87a;}
body.theme-dark .gx-pick{background:rgba(55,46,38,.8);color:#d8cdb8;border-color:rgba(255,255,255,.12);}
body.theme-dark .gx-pick:hover{background:rgba(70,58,48,.9);}
body.theme-dark .gx-pick:has(input:checked){background:linear-gradient(135deg,#a67c36,#5c3d1e);color:#fff;}
body.theme-dark .gx-palm-imgwrap{background:rgba(55,46,38,.6);border-color:rgba(255,255,255,.14);}
body.theme-dark .gx-palm-none{color:#a89478;}
body.theme-dark .gx-res-name{color:#e8c87a;}
body.theme-dark .gx-res-advice{color:#cbbda6;} body.theme-dark .gx-res-advice b{color:#f0a07a;}

/* 相術自動識別：標灰只讀項 + 自動標籤 + 說明段落 */
.gx-feat{margin:10px 0;}
.gx-auto{opacity:.78;filter:saturate(.6);}
.gx-auto .gx-pick{cursor:not-allowed;border-style:dashed;background:rgba(166,124,54,.10);}
.gx-auto .gx-pick:has(input:checked){background:linear-gradient(135deg,#a67c36,#5c3d1e);color:#fff;opacity:1;filter:none;}
.gx-auto-tag{display:none;margin-left:6px;font-size:11px;color:#fff;background:#7a9b6e;border-radius:999px;padding:1px 7px;letter-spacing:.5px;vertical-align:middle;}
.gx-auto .gx-auto-tag{display:inline;}
.gx-auto-hint{font-size:12.5px;line-height:1.7;color:#7a6a55;background:rgba(166,124,54,.08);border:1px solid rgba(166,124,54,.2);
  border-radius:10px;padding:8px 12px;margin:4px 0 10px;}
/* 手相：表單引導 + 選項「怎麼看」圖例 + 掌紋線「在哪裡」說明 */
.gx-help-intro{font-size:12.5px;line-height:1.7;color:#6b4a25;background:rgba(166,124,54,.10);
  border:1px solid rgba(166,124,54,.22);border-radius:10px;padding:8px 12px;margin:2px 0 12px;}
.gx-help-legend{margin:2px 0 10px;padding-left:18px;font-size:11.5px;line-height:1.6;color:#8a7f6f;}
.gx-help-legend li{margin:2px 0;}
.gx-help-legend li b{color:#8b6239;font-weight:700;}
.gx-line-wrap{margin:2px 0 4px;}
.gx-line-where{font-size:11.5px;line-height:1.6;color:#8a7f6f;margin-top:3px;}
body.theme-dark .gx-auto .gx-pick{background:rgba(122,155,110,.12);}
body.theme-dark .gx-auto-tag{background:#5e7a52;}
body.theme-dark .gx-auto-hint{color:#b6a78f;background:rgba(122,155,110,.08);border-color:rgba(255,255,255,.1);}
body.theme-dark .gx-help-intro{color:#cbbda6;background:rgba(122,155,110,.08);border-color:rgba(255,255,255,.1);}
body.theme-dark .gx-help-legend{color:#b6a78f;}
body.theme-dark .gx-help-legend li b{color:#e8c87a;}
body.theme-dark .gx-line-where{color:#b6a78f;}

/* ===== 相術（面相/痣相/骨相）通用 ===== */
.gx-physio .hint{margin:6px 0;}
.gx-ethnic-card{margin-top:16px;}
.gx-ethnic-card .field{width:100%;}
.gx-notes{margin:16px auto 0;max-width:560px;display:grid;gap:10px;}
.gx-note{background:rgba(214,178,120,.16);border:1px solid rgba(170,120,60,.3);border-radius:var(--radius);
  padding:10px 14px;font-size:13px;line-height:1.7;color:#6b4a25;}
.gx-note b{color:#b5481f;}
body.theme-dark .gx-note{background:rgba(90,70,40,.35);border-color:rgba(255,255,255,.12);color:#d8cdb8;}
body.theme-dark .gx-note b{color:#f0a07a;}
.gx-palm-photo{margin-top:16px;}
.gx-ai-status{margin-top:12px;font-size:13px;line-height:1.6;color:#6b8a3a;background:rgba(120,160,60,.12);
  border:1px solid rgba(120,160,60,.3);border-radius:var(--radius);padding:8px 12px;min-height:18px;}
body.theme-dark .gx-ai-status{color:#cfe39a;background:rgba(120,160,60,.18);border-color:rgba(180,210,120,.28);}

/* ===== 奇門遁甲 九宮格 ===== */
.gx-qm-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px;}
.gx-qm-cell{position:relative;background:linear-gradient(160deg,#fbf3e2,#f3e3c6);border:1px solid #d9b886;border-radius:var(--radius);padding:10px 8px;min-height:84px;text-align:center;box-shadow:inset 0 1px 0 rgba(255,255,255,.6);}
.gx-qm-pal{position:absolute;top:4px;right:6px;font-size:11px;color:#9a6a2f;opacity:.7;}
.gx-qm-di{font-size:18px;font-weight:700;color:#7a4a18;margin-top:6px;}
.gx-qm-tian{font-size:15px;color:#334;margin-top:2px;}
.gx-qm-men{display:inline-block;margin-top:3px;padding:1px 8px;border-radius:var(--radius);font-size:13px;background:#e9d3a6;color:#5a3a14;}
.gx-qm-shen{font-size:11px;color:#8a6a3a;margin-top:3px;opacity:.85;}
body.theme-dark .gx-qm-cell{background:linear-gradient(160deg,#2a2620,#211d18);border-color:#4a3f2c;}
body.theme-dark .gx-qm-pal{color:#b89a6a;}
body.theme-dark .gx-qm-di{color:#e0c089;}
body.theme-dark .gx-qm-tian{color:#bcd;}
body.theme-dark .gx-qm-men{background:#3a3228;color:#e6cfa0;}
body.theme-dark .gx-qm-shen{color:#a98f66;}

/* ===== 七政四余 星卡 ===== */
.gx-qz-h{font-size:15px;margin:18px 0 8px;color:#7a4a18;border-left:3px solid #d9b886;padding-left:8px;}
body.theme-dark .gx-qz-h{color:#e0c089;}
.gx-qz-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;}
.gx-qz-card{background:linear-gradient(160deg,#fbf3e2,#f3e3c6);border:1px solid #d9b886;border-radius:var(--radius);padding:10px;text-align:center;box-shadow:inset 0 1px 0 rgba(255,255,255,.6);}
.gx-qz-card.approx{opacity:.92;}
.gx-qz-name{font-size:14px;font-weight:700;color:#7a4a18;}
.gx-qz-sign{font-size:13px;color:#5a3a14;margin-top:3px;}
.gx-qz-dz{font-size:11px;color:#9a6a2f;margin-left:3px;}
.gx-qz-dig{font-size:12px;margin-top:4px;padding:1px 6px;border-radius:var(--radius);display:inline-block;}
.gx-qz-dig.gx-lv-strong{background:#cfe9c2;color:#2f6b20;}
.gx-qz-dig.gx-lv-weak{background:#f0d2cf;color:#9a3320;}
.gx-qz-dig.gx-lv-mid{background:#e9d3a6;color:#5a3a14;}
.gx-qz-pals{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px;}
.gx-qz-pal{background:#f7ecd6;border:1px solid #e3cda0;border-radius:var(--radius);padding:6px;min-height:54px;}
.gx-qz-pal-h{font-size:12px;color:#7a4a18;font-weight:700;}
.gx-qz-pal-b{font-size:12px;color:#5a3a14;margin-top:3px;line-height:1.4;}
body.theme-dark .gx-qz-card{background:linear-gradient(160deg,#2a2620,#211d18);border-color:#4a3f2c;}
body.theme-dark .gx-qz-name{color:#e0c089;}
body.theme-dark .gx-qz-sign{color:#d8cdb8;}
body.theme-dark .gx-qz-dig.gx-lv-strong{background:#2f4a22;color:#c7e8b0;}
body.theme-dark .gx-qz-dig.gx-lv-weak{background:#4a2620;color:#f0b0a0;}
body.theme-dark .gx-qz-dig.gx-lv-mid{background:#3a3228;color:#e6cfa0;}
body.theme-dark .gx-qz-pal{background:#211d18;border-color:#4a3f2c;}
body.theme-dark .gx-qz-pal-h{color:#e0c089;}
body.theme-dark .gx-qz-pal-b{color:#d8cdb8;}
/* 七政四余 自有容器/按鈕（原借用 gx-physio / gx-palm-btns，現獨立語義化） */
.gx-qz-wrap .hint{margin:6px 0;}
.gx-qz-btns{display:flex;gap:10px;margin-top:14px;}

/* ===== 玄空九宮飛星盤（可點擊） ===== */
.gx-fs9{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-width:420px;margin:10px auto;}
.gx-fs9-cell{position:relative;border:1px solid var(--paper-3);border-radius:var(--radius);background:var(--paper);
  padding:8px 6px;cursor:pointer;text-align:center;transition:transform .12s,box-shadow .12s,background .12s;}
.gx-fs9-cell:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.12);}
.gx-fs9-cell.gx-fs9-on{outline:2px solid #b8892b;background:#fff8e8;}
.gx-fs9-h{font-size:12px;font-weight:700;color:#7a5c2a;margin-bottom:4px;}
.gx-fs9-h small{font-weight:400;color:#8a8a8a;margin-left:3px;}
.gx-fs9-nums{display:grid;grid-template-columns:1fr 1fr;gap:2px 6px;font-size:11px;}
.gx-fs9-nums span{color:#6b6b6b;}
.gx-fs9-nums b{color:#2a2a2a;font-size:13px;margin-left:2px;}
.gx-fs9-tag{display:inline-block;margin-top:5px;font-size:10px;padding:1px 6px;border-radius:var(--radius);background:#eee;color:#666;}
.gx-fs9-cell.gx-lv-good{background:#f2f8ee;border-color:#a8c898;}
.gx-fs9-cell.gx-lv-bad{background:#fdf2ee;border-color:#e0b0a0;}

/* ===================== 東方美學 · 通用分隔與洛書盤框 ===================== */
/* 回紋分隔（朱砂菱心 + 雙漸隱細線） */
.gx-rule{ display:flex; align-items:center; gap:12px; margin:24px 0; }
.gx-rule::before,.gx-rule::after{ content:""; height:1px; flex:1;
  background:linear-gradient(90deg,transparent,var(--line) 18%,var(--line) 82%,transparent); }
.gx-rule i{ width:9px; height:9px; background:var(--zhu); transform:rotate(45deg);
  border-radius:1px; box-shadow:0 0 0 3px var(--paper) inset; flex:0 0 auto; }
.gx-rule span{ font-size:12px; letter-spacing:3px; color:var(--zhu); }

/* 回紋帶（朱砂節奏紋，用於頁眉/頁腳裝飾） */
.gx-fret{ height:12px; margin:18px 0; opacity:.55;
  background-image:repeating-linear-gradient(90deg, var(--zhu) 0 2px, transparent 2px 11px);
  background-position:bottom; background-size:100% 9px; background-repeat:repeat-x;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);
          mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); }

/* 洛書盤框：玄空九宮外包一層細朱砂框，呼應「盤」之感 */
.gx-fs9{ padding:7px; border:1px solid var(--line); border-radius:var(--radius);
  background:rgba(194,59,34,.035); max-width:434px; }
body.theme-dark .gx-fs9{ background:rgba(194,59,34,.08); }
.gx-fs9-cell.gx-lv-evil{background:#fbeae5;border-color:#d89080;}
.gx-fs9-cell.gx-fs9-mid{background:#f4f4f4;border-color:#ccc;color:#8a7a5a;}
.gx-fs9-mid-t{font-size:12px;color:#8a7a5a;padding:6px 0;}
.gx-fs9-tip{font-size:11px;color:#8a7a5a;text-align:center;margin-top:6px;}
body.theme-dark .gx-fs9-cell{background:#242019;border-color:#4a3f2c;}
body.theme-dark .gx-fs9-cell:hover{box-shadow:0 4px 12px rgba(0,0,0,.5);}
body.theme-dark .gx-fs9-cell.gx-fs9-on{background:#332a1c;}
body.theme-dark .gx-fs9-h{color:#e0c089;}
body.theme-dark .gx-fs9-nums b{color:#e8ddc8;}
body.theme-dark .gx-fs9-cell.gx-lv-good{background:#22301e;border-color:#4a6b3c;}
body.theme-dark .gx-fs9-cell.gx-lv-bad{background:#33221e;border-color:#6b4038;}
body.theme-dark .gx-fs9-cell.gx-lv-evil{background:#3a201c;border-color:#7a4438;}
body.theme-dark .gx-fs9-cell.gx-fs9-mid{background:#2a2620;color:#a89878;}

/* ---------- 風水模塊自有語義 class（P2：不再借用相面 gx-physio / 掌紋 gx-palm-*） ---------- */
.gx-feng .hint{margin:6px 0;}
.gx-feng-btns{display:flex;gap:10px;margin-top:14px;}
.gx-feng-res{display:grid;grid-template-columns:1fr;gap:12px;margin-top:18px;max-width:560px;margin-left:auto;margin-right:auto;}

/* ---------- 模型設定：來源切換 + 雲端面板（Phase B/C） ---------- */
.mt-src{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap;}
.mt-src-opt{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;color:#2f2a23;background:#FCF8F0;
  border:1px solid #D8C9A8;border-radius:999px;padding:6px 14px;cursor:pointer;}
.mt-src-opt input{accent-color:#8a2f1e;}
.mt-src-opt:has(input:checked){border-color:#8a2f1e;background:#FBF4E4;box-shadow:0 0 0 2px rgba(138,47,30,.12);}
.mt-pane{margin-top:2px;}
.mt-mem{margin-bottom:10px;font-size:12.5px;color:#2F6B54;background:#EEF8F2;border:1px solid #BFDCCF;
  border-radius:var(--radius);padding:6px 10px;line-height:1.6;}
.mt-field{display:flex;flex-direction:column;gap:5px;margin-top:10px;}
.mt-field>label{font-size:12.5px;color:#7a6f60;font-weight:600;}
.mt-field .field{font-size:13.5px;padding:8px 10px;border:1px solid #D8C9A8;border-radius:var(--radius);
  background:var(--paper);color:#2f2a23;}
.mt-test-res{font-size:12.5px;align-self:center;}
.mt-test-res.ok{color:#2F6B54;}
.mt-test-res.bad{color:#B03A22;}
body.theme-dark .mt-src-opt{background:#141a21;border-color:rgba(255,255,255,.18);color:#e9e2d2;}
body.theme-dark .mt-src-opt:has(input:checked){border-color:#C9A227;background:#1e2731;box-shadow:0 0 0 2px rgba(201,162,39,.2);}
body.theme-dark .mt-mem{background:#16302a;color:#7FD1B0;border-color:#26584a;}
body.theme-dark .mt-field>label{color:#9aa3b0;}
body.theme-dark .mt-field .field{background:#0c1117;border-color:rgba(255,255,255,.18);color:#e9e2d2;}

/* ---------- 綜合分析報告（ai-report.js 渲染） ---------- */
.rp-host{margin-top:26px;background:var(--paper);border:1px solid var(--paper-3);border-radius:calc(var(--radius) + 4px);padding:18px 18px 22px;box-shadow:0 6px 22px rgba(60,40,20,.06);}
.rp-head{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.rp-title{margin:0;font-size:19px;font-weight:800;letter-spacing:.06em;color:#8a2f1e;flex:1;}
.rp-regen{font-size:12.5px;padding:6px 14px;}
.rp-status{font-size:12.5px;color:#8a7f6f;margin:2px 0 12px;min-height:18px;display:flex;align-items:center;gap:6px;}
.rp-body{font-size:14.5px;line-height:1.95;color:#2f2a23;}
.rp-body h2.rp-h2{font-size:17px;font-weight:800;color:#6b3a1e;margin:20px 0 8px;padding-bottom:5px;border-bottom:2px solid #EADFC6;letter-spacing:.05em;}
.rp-body h3.rp-h3{font-size:15.5px;font-weight:800;color:#8a2f1e;margin:16px 0 6px;letter-spacing:.04em;}
.rp-body h4.rp-h4{font-size:14px;font-weight:700;color:#5a5040;margin:12px 0 4px;}
.rp-body p{margin:6px 0;}
.rp-body ul.rp-ul{margin:6px 0;padding-left:20px;}
.rp-body ul.rp-ul li{margin:3px 0;line-height:1.85;}
.rp-body blockquote.rp-quote{margin:12px 0;padding:8px 12px;background:#FBF6EA;border-left:3px solid #C9A227;border-radius:0 8px 8px 0;font-size:12.5px;color:#8a7f6f;line-height:1.8;}
.rp-table-wrap{margin:10px 0 14px;overflow-x:auto;}
.rp-table-wrap table.rp-table{border-collapse:collapse;width:100%;font-size:13.5px;background:#fff;border:1px solid #EADFC6;border-radius:8px;overflow:hidden;}
.rp-table-wrap table.rp-table th{background:#FBF4E4;color:#6b3a1e;font-weight:700;padding:7px 10px;text-align:left;border-bottom:1px solid #EADFC6;}
.rp-table-wrap table.rp-table td{padding:6px 10px;border-bottom:1px solid #F1E9D6;color:#3a342c;}
.rp-table-wrap table.rp-table tr:last-child td{border-bottom:none;}
.rp-table-wrap table.rp-table tbody tr:nth-child(even){background:#FCF8EF;}
body.theme-dark .rp-host{background:#141a21;border-color:rgba(255,255,255,.14);box-shadow:none;}
body.theme-dark .rp-title{color:#E8C66B;}
body.theme-dark .rp-status{color:#9aa3b0;}
body.theme-dark .rp-body{color:#dcd6c8;}
body.theme-dark .rp-body h2.rp-h2{color:#E8C66B;border-bottom-color:rgba(201,162,39,.4);}
body.theme-dark .rp-body h3.rp-h3{color:#E8C66B;}
body.theme-dark .rp-body h4.rp-h4{color:#cfc7b6;}
body.theme-dark .rp-body blockquote.rp-quote{background:#1b222b;border-left-color:#C9A227;color:#9aa3b0;}
body.theme-dark .rp-table-wrap table.rp-table{background:#0f151b;border-color:rgba(255,255,255,.14);}
body.theme-dark .rp-table-wrap table.rp-table th{background:#1b222b;color:#E8C66B;}
body.theme-dark .rp-table-wrap table.rp-table td{border-bottom-color:#222b34;color:#dcd6c8;}
body.theme-dark .rp-table-wrap table.rp-table tbody tr:nth-child(even){background:#131a21;}

/* ===== 命理智能體對話面板（tool-use agent） ===== */
.gx-agent-host{margin-top:16px;}
.gx-agent{background:#FCF8EF;border:1px solid #EADFC6;border-radius:var(--radius,12px);padding:14px 15px;box-shadow:0 1px 3px rgba(60,40,20,.05);}
.gx-agent.rtl{direction:rtl;text-align:right;}
.gx-agent-h{margin-bottom:8px;}
.gx-agent-t{font-size:16px;font-weight:800;letter-spacing:.05em;color:#8a2f1e;}
.gx-agent-sub{font-size:12px;color:#8a7f6f;margin-top:2px;}
.gx-agent-msgs{display:flex;flex-direction:column;gap:8px;max-height:380px;overflow-y:auto;margin:10px 0;padding-right:4px;}
.gx-agent-bubble{padding:8px 11px;border-radius:11px;font-size:13.5px;line-height:1.72;max-width:92%;word-break:break-word;white-space:normal;}
.gx-agent-bubble.gx-u{align-self:flex-end;background:#EAF0F4;border:1px solid #D6E2EA;color:#22303a;}
.gx-agent-bubble.gx-a{align-self:flex-start;background:#FBF4E4;border:1px solid #EADFC6;color:#2f2a23;}
.gx-agent-bubble.gx-t{align-self:flex-start;font-size:12px;background:#F3EFE4;border:1px dashed #D8CDB4;color:#7a6f5c;max-width:96%;}
.gx-agent-bubble .gx-btext{white-space:pre-wrap;}
.gx-btool{font-weight:600;color:#6b5a3e;}
.gx-bresult{margin-top:4px;font-size:11.5px;color:#8a7f6f;}
.gx-bresult summary{cursor:pointer;user-select:none;}
.gx-agent-sug{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 2px;}
.gx-agent-chip{background:#fff;border:1px solid #E2D6BC;color:#6b3a1e;border-radius:15px;padding:4px 11px;font-size:12px;cursor:pointer;transition:.15s;}
.gx-agent-chip:hover{background:#FBF4E4;border-color:#C9A227;}
.gx-agent-input{display:flex;gap:8px;margin-top:8px;}
.gx-agent-input .field{flex:1;min-width:0;}
.gx-agent-note{font-size:11.5px;color:#b07b3a;margin-top:4px;display:inline-block;}
.gx-dot-warn{display:inline-block;width:8px;height:8px;border-radius:50%;background:#C23B22;margin-right:5px;vertical-align:middle;}
.gx-agent-bubble.gx-a .gx-stream-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#C9A227;margin-right:5px;vertical-align:middle;animation:gxblink 1s infinite;}
@keyframes gxblink{0%,100%{opacity:.3}50%{opacity:1}}
/* dark theme */
body.theme-dark .gx-agent{background:#141a21;border-color:rgba(255,255,255,.14);box-shadow:none;}
body.theme-dark .gx-agent-t{color:#E8C66B;}
body.theme-dark .gx-agent-sub{color:#9aa3b0;}
body.theme-dark .gx-agent-bubble.gx-u{background:#1b2530;border-color:#2a3845;color:#dcd6c8;}
body.theme-dark .gx-agent-bubble.gx-a{background:#1b222b;border-color:rgba(201,162,39,.35);color:#dcd6c8;}
body.theme-dark .gx-agent-bubble.gx-t{background:#161d25;border-color:#2a3845;color:#9aa3b0;}
body.theme-dark .gx-agent-chip{background:#0f151b;border-color:rgba(255,255,255,.18);color:#E8C66B;}
body.theme-dark .gx-agent-chip:hover{background:#1b222b;}
body.theme-dark .gx-agent-note{color:#E8C66B;}

/* 時辰交界提示（真太陽時距時辰交界 <15 分鐘） */
.gx-bnd-note{ margin:8px 0 16px; padding:9px 12px; border-radius:8px;
  background:rgba(230,162,60,.12); border:1px solid rgba(198,133,44,.42);
  color:#8a5a1c; font-size:14px; line-height:1.7; }
body.theme-dark .gx-bnd-note{ background:rgba(232,198,107,.10); border-color:rgba(232,198,107,.34); color:#E8C66B; }

/* 自動存盤輕提示 */
.gx-toast{ position:fixed; left:50%; bottom:34px; transform:translateX(-50%) translateY(16px);
  background:#2b2b26; color:#F3EDDF; padding:9px 18px; border-radius:999px;
  font-size:14px; opacity:0; pointer-events:none; transition:all .28s ease; z-index:9999;
  box-shadow:0 6px 18px rgba(0,0,0,.22); }
.gx-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
body.theme-dark .gx-toast{ background:#E8C66B; color:#1b1b17; }
