/* ============================================================
   玄机阁 v4 · 「星宿仪」视觉
   雾紫底 · 黛紫主色 · 琥珀点缀 · 青碧辅色 · 珊瑚表凶
   字形图标 · 星盘仪表 · 九宫入口 · 杂志式栏目
   ============================================================ */

:root {
  --brand: #c40c18;
  --brand-deep: #960910;
  --bg: #f8f4ef;
  --bg-soft: #f0e8df;
  --surface: #ffffff;
  --surface-soft: #fcf9f5;
  --ink: #231a1a;
  --ink-2: #584a46;
  --ink-3: #96887f;
  --line: #ece3d9;
  --line-2: #dccdbf;

  /* 主色（沿用变量名以覆盖全站） */
  --red: #c40c18;
  --red-2: #d61f2a;
  --red-soft: #fbe7e8;
  --jade: #149c92;
  --jade-soft: #dff3f1;
  --gold: #b8862f;
  --gold-soft: #fbeedb;
  --indigo: #2f6fb8;
  --indigo-soft: #e2ecf8;

  /* 表凶专用 */
  --coral: #2f2321;
  --coral-soft: #ece5df;

  --wood: #2e9a6b; --wood-soft: #e1f2e9;
  --fire: #e0563b; --fire-soft: #fce6e1;
  --earth: #c0862a; --earth-soft: #f8edda;
  --metal: #7e7f99; --metal-soft: #eeeef4;
  --water: #2f6fb8; --water-soft: #e2ecf8;

  --sh-1: 0 1px 2px rgba(70, 20, 20, .05), 0 4px 14px rgba(70, 20, 20, .04);
  --sh-2: 0 1px 2px rgba(70, 20, 20, .05), 0 20px 40px -26px rgba(70, 20, 20, .45);
  --sh-3: 0 2px 6px rgba(70, 20, 20, .05), 0 36px 70px -34px rgba(70, 20, 20, .45);
  --r-lg: 18px;
  --r-xl: 24px;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(196, 12, 24, .12) 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 80px, rgba(196, 12, 24, .1) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 70px 140px, rgba(184, 134, 47, .16) 50%, transparent 51%);
  background-size: 180px 180px;
}
::selection { background: #f7cfd1; color: var(--ink); }

/* 品牌、按钮、导航 */
.seal {
  background: linear-gradient(150deg, #d61f2a, #960910);
  box-shadow: 0 4px 12px -3px rgba(150, 10, 20, .55);
  border-radius: 10px;
}
.brand-seal {
  background: #c40c18 url("../assets/logo-192.png") center / cover no-repeat;
  color: transparent;
  font-size: 0;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  box-shadow: 0 6px 14px -6px rgba(150, 10, 20, .7), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.footer .brand-seal { box-shadow: 0 4px 10px -4px rgba(150, 10, 20, .6); }
.btn-primary {
  --btn-bg: linear-gradient(135deg, #d61f2a 0%, #960910 100%);
  box-shadow: 0 1px 2px rgba(150, 10, 20, .3), 0 10px 24px -14px rgba(150, 10, 20, .9);
}
.btn-primary:hover { box-shadow: 0 2px 4px rgba(150, 10, 20, .25), 0 18px 32px -16px rgba(150, 10, 20, .9); }
.btn { border-radius: 999px; }
.btn-sm { border-radius: 999px; }
.site-nav { background: rgba(248, 244, 239, .86); }
.site-nav.is-stuck { background: rgba(253, 251, 248, .93); }
.nav-menu a.is-active::after { background: var(--gold); width: 14px; height: 3px; border-radius: 2px; }
.tabbar { background: rgba(253, 251, 248, .96); }
.tabbar a.is-active, .tabbar a.is-active svg { color: var(--red); stroke: var(--red); }
.toast { background: rgba(43, 21, 21, .95); }
.toast--warn { background: rgba(176, 58, 40, .96); }
.eyebrow::before { background: var(--gold); }

/* 表凶语义改用珊瑚 */
.yiji-j b, .yj-j { background: var(--coral) !important; }
.yiji-j span { background: var(--coral-soft); color: var(--coral); }
.yiji-y b, .yj-y { background: var(--jade) !important; }
.kong-on, .field-err { color: var(--coral); }
.field.has-error .input, .field.has-error .select { border-color: var(--coral); background: var(--coral-soft); }
.rel-六冲, .rel-天干相冲, .rel-相刑, .rel-自刑, .rel-三刑 { border-color: rgba(47, 35, 33, .25); background: var(--coral-soft); color: var(--coral); }
.gb--bad { background: var(--coral-soft); color: #2f2321; }
.gb--good { background: var(--jade-soft); color: #0d6e67; }

/* 深色块统一为黛色 */
.cta-band, .profile-card, .wallet-card { background: linear-gradient(135deg, #2b1515, #5c1016); }
.cta-band::before { background: radial-gradient(circle, rgba(184, 134, 47, .35), transparent 68%); }
.h-avatar, .mz-ava { background: linear-gradient(150deg, #f0b45a, #d98a1c); }

/* 渐变条 */
.dim-track i, .term-track i { background: linear-gradient(90deg, #c40c18, #149c92); }
.progress-line i { background: linear-gradient(90deg, #c40c18, #e0682f); }
.ring-bar { stroke: var(--red); }
.ring-track { stroke: var(--bg-soft); }

/* 抽签筒换色 */
.tube-body { background: linear-gradient(160deg, #c40c18, #7c070e); border-color: rgba(80, 8, 12, .6); box-shadow: 0 22px 34px -22px rgba(110, 8, 16, .8), inset 0 2px 0 rgba(255, 255, 255, .16); }
.tube-body strong { color: #f5e2bd; }
.lot-stage { background: radial-gradient(circle at 50% 22%, rgba(184, 134, 47, .16), transparent 62%), linear-gradient(180deg, #fdfaf6, #f5ece2); border-color: var(--line-2); }
.slip-grade { background: var(--red); }

/* 卡牌、罗盘换色 */
.card-back { background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .14), transparent 55%), repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .06) 0 10deg, transparent 10deg 20deg), linear-gradient(150deg, #d61f2a, #7c070e); box-shadow: 0 24px 40px -24px rgba(110, 8, 16, .9); }
.compass-dial { background: radial-gradient(circle, #fff 0 38%, #f0e8df 38% 39%, #fdfbf8 39% 64%, #dccdbf 64% 65%, #f8f4ef 65%); border-color: var(--red); }
.compass-center { border-color: var(--red); }
.compass-dial span.is-main { color: var(--red); }
.cmp-xi { background: var(--coral); }

/* ---------------- 字形图标 ---------------- */
.ti {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px 12px 12px 4px;
  background: var(--ps, #fbe7e8);
  color: var(--pc, #c40c18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
}
.ti b {
  font-family: var(--f-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}
.ti::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pc, #c40c18);
  opacity: .55;
}
.ti--sm { width: 34px; height: 34px; border-radius: 10px 10px 10px 3px; }
.ti--sm b { font-size: 16px; }
.ti--sm::after { width: 4px; height: 4px; right: 4px; top: 4px; }
.ti--lg { width: 52px; height: 52px; }
.ti--lg b { font-size: 25px; }
.ti--xxl { width: 76px; height: 76px; border-radius: 22px 22px 22px 6px; }
.ti--xxl b { font-size: 38px; }
.record-tool .ti { width: 34px; height: 34px; }

/* ---------------- 首页 v4 ---------------- */
.home-v4 { padding-top: 18px; }

/* 命主栏 */
.mz-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mz-who {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font: inherit;
  transition: border-color .18s, box-shadow .18s;
}
.mz-who:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.mz-ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--f-display); font-size: 15px; flex: none; }
.mz-who b { display: block; font-size: 13.5px; font-weight: 600; }
.mz-who small { display: block; font-size: 11px; color: var(--ink-3); }
.mz-who i { font-style: normal; font-size: 11.5px; color: var(--red); padding: 4px 10px; border-radius: 999px; background: var(--red-soft); margin-left: 6px; }
.mz-live { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); }
.mz-live b { font-family: var(--f-num); color: var(--ink); font-weight: 600; }

/* 星盘 hero */
.astro {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 52px);
  align-items: center;
  padding: clamp(18px, 3vw, 34px);
  border-radius: 32px;
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(196, 12, 24, .10), transparent 60%),
    radial-gradient(50% 70% at 100% 100%, rgba(184, 134, 47, .12), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
}
.astro-dial { display: grid; justify-items: center; gap: 14px; }
.dial { width: 100%; max-width: 380px; height: auto; display: block; }
.dl-rim { fill: #fdfbf8; stroke: var(--line-2); stroke-width: 1.5; }
.dl-tick { stroke: var(--line-2); stroke-width: 1; }
.dl-tick-m { stroke: var(--ink-3); stroke-width: 1.4; }
.dl-br { font-family: var(--f-display); font-size: 15px; fill: var(--ink-2); }
.dl-br.is-on { fill: #fff; font-weight: 700; }
.dl-now { fill: var(--gold); }
.dl-track { fill: none; stroke: var(--bg-soft); }
.dl-score, .dl-love, .dl-work, .dl-money { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.dl-score { stroke: var(--red); }
.dl-love { stroke: #e8798a; }
.dl-work { stroke: #2f6fb8; }
.dl-money { stroke: var(--gold); }
.dl-core { fill: var(--surface); stroke: var(--line); }
.dl-num { font-family: var(--f-num); font-size: 44px; font-weight: 700; fill: var(--ink); }
.dl-cap { font-size: 12px; fill: var(--ink-3); letter-spacing: .2em; }
.dial-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 12px; color: var(--ink-3); }
.dial-legend li { display: inline-flex; align-items: center; gap: 6px; }
.dial-legend i { width: 14px; height: 4px; border-radius: 2px; }
.dial-legend b { font-family: var(--f-num); color: var(--ink); }
.lg-score i { background: var(--red); } .lg-love i { background: #e8798a; } .lg-work i { background: #2f6fb8; } .lg-money i { background: var(--gold); }

.astro-date { display: flex; align-items: flex-end; gap: 14px; }
.astro-date > b { font-family: var(--f-num); font-size: clamp(54px, 7vw, 84px); font-weight: 300; line-height: .9; letter-spacing: -.04em; color: var(--ink); }
.astro-date > b span { color: var(--gold); font-weight: 400; margin: 0 2px; }
.astro-date p { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; padding-bottom: 6px; }
.astro-line { margin-top: 20px; font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 32px); line-height: 1.4; font-weight: 600; letter-spacing: .02em; }
.astro-desc { margin-top: 12px; font-size: 14.5px; line-height: 1.9; color: var(--ink-2); max-width: 36em; }
.astro-yj { display: grid; gap: 8px; margin-top: 18px; }
.astro-yj p { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.yj-y, .yj-j { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-family: var(--f-display); font-size: 13px; flex: none; }
.astro-hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 18px; max-width: 460px; }
.astro-hours span { display: grid; place-items: center; height: 30px; border-radius: 8px; font-family: var(--f-display); font-size: 13px; color: var(--ink-3); background: var(--bg-soft); }
.astro-hours span.is-good { background: var(--jade-soft); color: var(--jade); }
.astro-hours span.is-now { background: var(--gold); color: #fff; box-shadow: 0 6px 14px -6px rgba(184, 134, 47, .9); }
.astro-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* 实时单行流 */
.ticker {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  margin-top: 14px; padding: 10px 12px 10px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.ticker-tag { padding: 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; letter-spacing: .1em; }
.ticker-list { padding-left: 14px; display: flex; gap: 22px; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tk { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.tk em { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-3); }
.tk-chain em { background: var(--gold-soft); color: var(--gold); }
.tk-me em { background: var(--red-soft); color: var(--red); }
.tk time { font-family: var(--f-num); font-size: 11px; color: var(--ink-3); }
.tk.is-new { animation: tkIn .45s var(--ease); }
.ticker-more { font-size: 12.5px; color: var(--red); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
@keyframes tkIn { from { transform: translateX(-12px); } to { transform: none; } }

/* 杂志式栏目头 */
.mag-head { display: flex; align-items: flex-start; gap: 14px; margin: clamp(40px, 6vw, 64px) 0 18px; }
.mag-no {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--ink); font-family: var(--f-display); font-size: 18px;
}
.mag-head h2 { font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: .06em; line-height: 1.2; }
.mag-head p { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.mag-head .more, .edit-col h3 .more { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 3px; font-weight: 400; font-family: var(--f-sans); }

/* 九宫 */
.nine-wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
.nine-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 8px; width: 100%; aspect-ratio: 1; align-self: start; position: sticky; top: 90px; padding: 8px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.pal {
  position: relative; display: grid; align-content: center; justify-items: center; gap: 4px; padding: 8px;
  border-radius: 18px; border: 1px solid transparent; background: var(--ps); color: var(--pc); cursor: pointer;
  font: inherit; transition: transform .18s var(--ease), box-shadow .18s, background .18s, color .18s;
}
.pal:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -16px var(--pc); }
.pal-tri { font-size: 26px; line-height: 1; }
.pal b { font-family: var(--f-display); font-size: 18px; font-weight: 700; letter-spacing: .1em; color: var(--ink); }
.pal small { font-size: 11px; color: var(--ink-3); }
.pal em { position: absolute; top: 8px; right: 10px; font-style: normal; font-family: var(--f-num); font-size: 11px; opacity: .7; }
.pal.is-on { background: var(--pc); color: #fff; box-shadow: 0 16px 28px -14px var(--pc); }
.pal.is-on b, .pal.is-on small { color: #fff; }
.pal--center { border: 1.5px dashed var(--pc); }
.pal--center.is-on { border-style: solid; }
.pal-panel { padding: 22px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); border-top: 4px solid var(--pc); }
.pal-panel.is-swap { animation: pageIn .35s var(--ease) both; }
.pp-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pp-tri { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: var(--ps); color: var(--pc); flex: none; }
.pp-head h3 { font-family: var(--f-display); font-size: 22px; font-weight: 700; letter-spacing: .06em; display: flex; align-items: baseline; gap: 10px; }
.pp-head h3 small { font-family: var(--f-sans); font-size: 12px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.pp-head p { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.pp-list { display: grid; }
.pp-list li a { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 11px 6px; border-bottom: 1px dashed var(--line); border-radius: 12px; transition: background .15s; color: var(--ink); }
.pp-list li:last-child a { border-bottom: none; }
.pp-list li a:hover { background: var(--surface-soft); }
.pp-list li a > svg { color: var(--ink-3); }
.pp-list b { display: block; font-size: 14.5px; font-weight: 600; }
.pp-list small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.6; }
.pp-list--side li a { padding: 8px 4px; gap: 10px; }
.pp-list--side b { font-size: 13.5px; font-weight: 500; }

/* 四面镜 */
.mirror-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-2); }
.mirror { display: grid; align-content: start; gap: 8px; padding: 22px 20px 20px; border-right: 1px solid var(--line-2); color: var(--ink); transition: background .2s; }
.mirror:last-child { border-right: none; }
.mirror:hover { background: rgba(255, 255, 255, .7); }
.mirror > span { font-size: 11.5px; letter-spacing: .24em; color: var(--ink-3); }
.mirror > b { font-family: var(--f-display); font-size: 24px; font-weight: 700; letter-spacing: .04em; color: var(--red); }
.mirror p { font-size: 13px; line-height: 1.8; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mirror em { font-style: normal; font-size: 12px; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }

/* 读物与节令 */
.edit-cols { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr; gap: 18px; }
.edit-col { padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.edit-col h3 { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-display); font-size: 17px; font-weight: 700; letter-spacing: .06em; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.toc li a { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 11px 2px; border-bottom: 1px dashed var(--line); color: var(--ink); }
.toc li:last-child a { border-bottom: none; }
.toc li a:hover .toc-t b { color: var(--red); }
.toc-n { font-family: var(--f-num); font-size: 13px; color: var(--gold); font-weight: 600; }
.toc-t b { display: block; font-size: 14px; font-weight: 600; transition: color .15s; }
.toc-t small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.countdown li { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 6px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.countdown li:last-child { border-bottom: none; }
.countdown li > b { font-family: var(--f-num); font-size: 26px; font-weight: 300; color: var(--red); min-width: 34px; text-align: right; line-height: 1; }
.countdown li > span { font-size: 11px; color: var(--ink-3); }
.countdown strong { display: block; font-size: 14px; font-weight: 600; margin-left: 6px; }
.countdown small { display: block; font-size: 11px; color: var(--ink-3); margin-left: 6px; }

/* 工具页微调 */
.tool-head .ti--xxl { box-shadow: var(--sh-2); }
.tr-verdict { background: var(--red); border-radius: 999px; }
.tr-secs h4 { color: var(--gold); }
.quiz-opts button { border-radius: 999px; }
.quiz-opts button.is-on { background: var(--red); border-color: var(--red); }
.hour.is-now { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 134, 47, .16); }
.big-card { border-radius: 26px 26px 26px 8px; }

/* 响应式 */
@media (max-width: 1080px) {
  .edit-cols { grid-template-columns: 1fr 1fr; }
  .edit-col:last-child { grid-column: 1 / -1; }
  .mirror-row { grid-template-columns: 1fr 1fr; }
  .mirror:nth-child(2) { border-right: none; }
  .mirror:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
}
@media (max-width: 900px) {
  .astro { grid-template-columns: 1fr; border-radius: 26px; }
  .astro-dial { order: 2; }
  .dial { max-width: 320px; }
  .nine-wrap { grid-template-columns: 1fr; }
  .nine-grid { max-width: 520px; width: 100%; margin: 0 auto; position: static; }
}
@media (max-width: 720px) {
  .mz-live { display: none; }
  .astro-date > b { font-size: 56px; }
  .astro-hours span { height: 26px; font-size: 12px; }
  .ticker { grid-template-columns: auto 1fr; border-radius: 18px; }
  .ticker-more { display: none; }
  .ticker-list { flex-direction: column; gap: 6px; }
  .tk:nth-child(n+3) { display: none; }
  .pal b { font-size: 15px; letter-spacing: .04em; }
  .pal-tri { font-size: 20px; }
  .pal small { font-size: 10px; }
  .edit-cols { grid-template-columns: 1fr; }
  .mirror { padding: 16px 12px; }
  .mirror > b { font-size: 19px; }
  .mag-no { width: 36px; height: 36px; font-size: 15px; }
}
