
:root{
  --bg:#0E0F12; --page:#FFFFFF; --card:#F8F8FA; --divider:#E5E7EC; --ink:#1B1F2A;
  --muted:#5C6275; --subtle:#8D93A5; --accent:#D4AF37;
  --radius:18px; --shadow:0 10px 30px rgba(0,0,0,0.08);
}

#nmc-bazi{ max-width:960px; margin:24px auto; padding:0 20px; color:var(--ink); }

/* Card */
.bazi-card{ background:var(--page); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px; }
.bazi-card .title{ margin:0 0 12px; font-size:22px; line-height:1.25; }

/* Form grid */
.grid{ display:grid; gap:12px; grid-template-columns:1fr 1fr; }
@media (max-width:680px){ .grid{ grid-template-columns:1fr; } }
.field label{ display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
.field input,.field select{
  width:100%; padding:10px 12px; border:1px solid var(--divider); border-radius:12px; background:#fff; color:var(--ink);
}
.field input:focus,.field select:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(212,175,55,0.2); }

/* Toggles & button */
.toggles{ display:flex; gap:16px; flex-wrap:wrap; margin:12px 0; color:var(--muted); font-size:13px; }
.toggles input{ margin-right:6px; }
.primary{ background:var(--accent); color:#111; border:none; padding:10px 16px; border-radius:999px; font-weight:600; cursor:pointer; }
.primary:hover{ filter:brightness(0.95); }
.primary:active{ transform:translateY(1px); }

/* Output */
.bazi-output{ margin-top:16px; }
.hidden{ display:none !important; }

/* Tabs */
.tabs{ display:flex; gap:8px; margin-bottom:12px; }
.tabs button{
  background:#fff; border:1px solid var(--divider); padding:8px 12px; border-radius:999px; cursor:pointer; font-weight:600;
}
.tabs button.active{ border-color:var(--accent); box-shadow:0 0 0 3px rgba(212,175,55,0.2); }

/* Pillars grid */
.pillars-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
@media (max-width:740px){ .pillars-grid{ grid-template-columns:repeat(2,1fr); } }
.pillar{ background:var(--card); border:1px solid var(--divider); border-radius:14px; padding:12px; }
.pillar .stem{ font-weight:800; font-size:22px; }
.pillar .branch{ color:var(--muted); margin-bottom:8px; }
.pillar .hidden{ display:flex; flex-wrap:wrap; gap:6px; }
.pillar .hidden .chip{ font-size:12px; padding:3px 8px; border-radius:999px; background:#fff; border:1px solid var(--divider); }

.day-master{ margin:12px 0; font-weight:700; }

/* Element bar */
.element-bar{ margin:12px 0; }
.element-bar .bar{ display:flex; height:12px; border-radius:8px; overflow:hidden; border:1px solid var(--divider); background:#fff; }
.element-bar .legend{ display:flex; gap:12px; flex-wrap:wrap; margin-top:6px; font-size:13px; color:var(--muted); }
.element-bar .legend span{ padding-left:6px; border-left-width:8px; border-left-style:solid; }

/* Da Yun */
#dayunTab .dy{
  display:flex; gap:10px; justify-content:space-between; align-items:center;
  background:var(--card); border:1px solid var(--divider); border-radius:12px; padding:10px 12px; margin:6px 0;
}
#dayunTab .dy strong{ font-weight:700; }
#dayunTab .dy .tg{ font-style:normal; color:var(--subtle); }
#dayunTab .direction,#dayunTab .start-age{ color:var(--muted); margin:4px 0; }

/* Insight */
#insightTab .summary{ margin-bottom:10px; color:var(--ink); }
#insightTab .book-link{
  display:inline-block; text-decoration:none; background:#111; color:#fff; padding:8px 14px; border-radius:10px;
  border:1px solid #111;
}
#insightTab .book-link:hover{ filter:brightness(1.05); }

/* Utilities */
hr.div{ border:0; border-top:1px solid var(--divider); margin:12px 0; }
.small{ font-size:12px; color:var(--muted); }
