/* Approved parchment reference applied to real, server-calculated BaZi cards. */
.bazi-manuscript {
  --ms-paper:#f5eedf; --ms-paper-light:#fbf8ef; --ms-ink:#214b3a;
  --ms-text:#313b32; --ms-muted:#536457; --ms-line:#d4c49e; --ms-gold:#b99a63;
  --bz-card-bg:var(--ms-paper); --bz-border:var(--ms-line); --bz-jade:var(--ms-ink);
  --bz-text:var(--ms-text); --bz-text-soft:var(--ms-muted); --bz-text-mute:#636b5c;
  color:var(--ms-text);
  background:radial-gradient(ellipse at 10% 5%,#ffffff88,transparent 38%),#eae8dd;
}
.bazi-manuscript .container { max-width:1440px; }
.bazi-manuscript .site-header { background:#faf7efed; border-color:var(--ms-line); }
.bazi-manuscript .site-header .btn-ghost { color:var(--ms-ink); border-color:#bba97f; }
.bazi-manuscript .calc-hero { background:none; padding-bottom:12px; }
.bazi-manuscript .calc-hero__title { color:var(--ms-ink); }
.bazi-manuscript .calc-hero__subtitle { color:var(--ms-muted); }
.bazi-manuscript .calc-layout { grid-template-columns:300px minmax(0,1fr); gap:26px; }
.bazi-manuscript .calc-form { background:var(--ms-paper-light); border:1px solid var(--ms-line); padding:25px; border-radius:18px; }
.bazi-manuscript .form-control { background:#fffdf7; border-color:#cabfa7; color:var(--ms-text); }
.bazi-manuscript .form-hint,.bazi-manuscript .calc-form__subtitle { color:var(--ms-muted); }
.bazi-manuscript .calc-result,.bazi-manuscript .bazi-result { min-width:0; }
.bazi-manuscript .result-placeholder { background:var(--ms-paper-light); border:1px dashed #bbaa86; }
.bazi-manuscript .bz-card {
  position:relative; isolation:isolate; margin-bottom:25px; padding:30px;
  background:radial-gradient(ellipse at 12% 0,#fff8,transparent 50%),var(--ms-paper);
  border:1px solid var(--ms-line); border-radius:19px;
  box-shadow:0 6px 21px #384e3510;
  scroll-margin-top:150px; overflow-wrap:anywhere;
}
.bazi-manuscript .bz-card::before {
  content:''; position:absolute; inset:7px; border:1px solid #cfc2a37a;
  border-radius:12px; pointer-events:none; z-index:-1;
}
.bazi-manuscript .bz-card__head { border-color:var(--ms-line); align-items:flex-start; }
.bazi-manuscript .bz-card__title { font-family:Georgia,'Times New Roman',serif; font-size:clamp(21px,2vw,28px); line-height:1.25; font-weight:500; }
.bazi-manuscript .bz-card__title--main { font-size:clamp(28px,3vw,40px); }
.bazi-manuscript .bz-card__badge { background:#e6e5cc; color:#385741; white-space:normal; max-width:100%; }
.bazi-manuscript .bz-card__badge--warn { background:#f5e3c6; color:#75401d; }
.bazi-manuscript .manuscript-eyebrow { margin:0 0 10px; color:var(--ms-muted); font-size:11px; letter-spacing:.14em; text-transform:uppercase; }
.bazi-manuscript .manuscript-nav {
  display:flex; gap:6px; overflow-x:auto; position:sticky; top:78px; z-index:12;
  margin:0 0 22px; padding:7px; background:#faf7efed; border:1px solid #d9cfb7;
  border-radius:12px; scrollbar-width:thin; box-shadow:0 4px 14px #293a2a12;
}
.bazi-manuscript .manuscript-nav a { display:flex; flex:none; min-height:44px; align-items:center; padding:8px 13px; border-radius:7px; text-decoration:none; color:var(--ms-ink); font-size:13px; font-weight:600; }
.bazi-manuscript .manuscript-nav a:hover { background:#e5e9d9; }
.bazi-manuscript :is(a,button,input,summary):focus-visible { outline:3px solid #27634c; outline-offset:3px; }
.bazi-manuscript .bz-card:focus-visible { outline:2px solid var(--ms-ink); outline-offset:3px; }
.bazi-manuscript .bz-pillars-grid { gap:12px; }
.bazi-manuscript .bz-pillar { min-width:0; padding:18px 9px 12px; background:#fbf8ed; border:1px solid #d8ccaf; border-radius:11px; }
.bazi-manuscript .bz-pillar::before { background:#b9c0a7; height:3px; }
.bazi-manuscript .bz-pillar__label { color:var(--ms-muted); letter-spacing:.1em; font-size:12px; }
.bazi-manuscript .manuscript-day-pillar { background:#f0ead1; border:2px solid var(--ms-gold); }
.bazi-manuscript .manuscript-day-pillar::before { background:var(--ms-gold); }
.bazi-manuscript .bz-pillar__stem-char,.bazi-manuscript .bz-pillar__branch-char { font-family:'Microsoft YaHei','Noto Serif CJK SC',serif; color:#263f30; font-size:clamp(42px,4vw,64px); }
.bazi-manuscript .bz-pillar__branch { border-top:1px solid #d9ceb3; padding-top:12px; margin-top:13px; }
.bazi-manuscript .bz-pillar__stem-ru,.bazi-manuscript .bz-pillar__branch-ru,.bazi-manuscript .bz-pillar__stem-el { color:#536457; font-size:12px; }
.bazi-manuscript .bz-pillar__branch-animal { color:var(--ms-ink); font-size:14px; font-weight:600; }
.bazi-manuscript .bz-pillar__hidden { border-color:#d9ceb3; }
.bazi-manuscript .bz-hidden-stem { background:#eee8d5; border-color:#d6cbaa; }
.bazi-manuscript .bz-pillar .bz-tengod-cell { margin-top:12px; padding:11px 3px 0; border:0; border-top:1px solid #d9ceb3; border-radius:0; background:transparent; }
.bazi-manuscript .bz-tengod-cell__char { color:var(--ms-ink); font-size:23px; }
.bazi-manuscript .bz-tengod-cell__name { font-size:12px; color:var(--ms-muted); }
.bazi-manuscript .bz-dm-hero { background:#eee7cf; border:1px solid #d8caa7; border-radius:12px; }
.bazi-manuscript .bz-dm-hero__char { color:var(--ms-ink); }
.bazi-manuscript .bz-dm-hero__name { color:var(--ms-ink); }
.bazi-manuscript .bz-dm-scale { background:#fbf8ed; border:1px solid #d9ceb3; }
.bazi-manuscript .bz-dm-favor { background:#e8ecdc; }
.bazi-manuscript .bz-dm-against { background:#f0e3d4; }
.bazi-manuscript .bz-root { background:#f8f4e5; }
.bazi-manuscript .bz-yong-card-item { background:#fbf8ed; border-color:#d9ceb3; border-top-width:4px; }
.bazi-manuscript .bz-yong-card-item[data-el=wood] { border-top-color:#5f9b59; }
.bazi-manuscript .bz-yong-card-item[data-el=fire] { border-top-color:#ce5547; }
.bazi-manuscript .bz-yong-card-item[data-el=earth] { border-top-color:#b28b61; }
.bazi-manuscript .bz-yong-card-item[data-el=metal] { border-top-color:#85979e; }
.bazi-manuscript .bz-yong-card-item[data-el=water] { border-top-color:#4e87cb; }
.bazi-manuscript .bz-yong-card-item__role { color:var(--ms-muted); }
.bazi-manuscript .bz-yong-card-item__el { font-family:Georgia,serif; font-size:25px; }
.bazi-manuscript .bz-rec { background:#fbf8ed; border:1px solid #d9ceb3; border-radius:10px; padding:13px; }
.bazi-manuscript .bz-rec__chip { background:#ede7d3; color:var(--ms-ink); }
.bazi-manuscript .bz-structure-hero { background:#ece7d0; }
.bazi-manuscript .bz-archetype { background:#e6ebd9; }
.bazi-manuscript .bz-palaces-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); overflow:visible; }
.bazi-manuscript .bz-palace { min-width:0; background:#fbf8ed; border-color:#d9ceb3; }
.bazi-manuscript .bz-palace__head { background:#eee8d5; padding:10px 7px; }
.bazi-manuscript .bz-palace__name { font-size:11px; }
.bazi-manuscript .bz-palace__hint { color:var(--ms-muted); font-size:12px; }
.bazi-manuscript .bz-inter { background:#fbf8ed; border-color:#d9ceb3; }
.bazi-manuscript .bz-shensha { background:#fbf8ed; border-color:#d9ceb3; }
.bazi-manuscript .bz-shensha__desc { color:var(--ms-muted); }
.bazi-manuscript .bz-shensha-section summary { min-height:44px; padding-block:10px; }
.bazi-manuscript .bz-dayun-timeline { padding-top:18px; scrollbar-width:thin; }
.bazi-manuscript .bz-dayun-period { background:#fbf8ed; border:1px solid #d9ceb3; border-top:4px solid #a7af9a; border-radius:10px; }
.bazi-manuscript .bz-dayun-period--current { background:#eee8ce; border:2px solid var(--ms-ink); border-top:5px solid var(--ms-gold); }
.bazi-manuscript .bz-dayun-period__badge { background:var(--ms-ink); color:#fffdf4; }
.bazi-manuscript .bz-liunian-year { background:#fbf8ed; border-color:#d9ceb3; }
.bazi-manuscript .bz-saved-banner { background:#e9eedf; border-color:#b8c7ad; }
.bazi-manuscript .bz-actions { flex-wrap:wrap; }
.bazi-manuscript .bz-elements-card { padding:0; overflow:hidden; }
.bazi-manuscript .gj-elements-scroll { margin:0; border:0; border-radius:19px; padding:30px; box-shadow:none; font-family:inherit; --ink-soft:var(--ms-muted); }
.bazi-manuscript .gj-elements-scroll h2 { font-size:clamp(23px,2.5vw,30px); }
.bazi-manuscript .gj-elements-scroll__track { height:205px; }
.bazi-manuscript .gj-elements-scroll__distribution { gap:25px; padding:22px; }
.bazi-manuscript .gj-elements-scroll__legend-item { gap:9px; }
.bazi-manuscript .gj-elements-scroll__name { color:#3b5140; }
.bazi-manuscript .gj-elements-scroll__method-link { color:var(--ms-muted); }
.bazi-manuscript .manuscript-donut { background:none; }
.bazi-manuscript .manuscript-donut::after { display:none; }
.bazi-manuscript .manuscript-ring { position:absolute; inset:0; width:100%; height:100%; }
.bazi-manuscript .site-footer { background:#e1dfd1; }
@media(max-width:1150px) {
  .bazi-manuscript .calc-layout { grid-template-columns:1fr; }
  .bazi-manuscript .calc-form { position:relative; top:0; }
  .bazi-manuscript .bz-palaces-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:700px) {
  .bazi-manuscript .bz-card { padding:23px 19px; }
  .bazi-manuscript .gj-elements-scroll { padding:24px 18px; }
  .bazi-manuscript .gj-elements-scroll__distribution { grid-template-columns:1fr; padding:17px 12px; }
  .bazi-manuscript .gj-elements-scroll__legend-item { grid-template-columns:12px minmax(0,1fr) auto; }
  .bazi-manuscript .gj-elements-scroll__legend-value { grid-column:2; }
  .bazi-manuscript .gj-elements-scroll__legend-percent { grid-column:3; grid-row:span 2; }
  .bazi-manuscript .gj-elements-scroll__track { height:160px; }
  .bazi-manuscript .bz-palaces-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bazi-manuscript .manuscript-nav { top:72px; }
  .bazi-manuscript .bz-card__head { gap:12px; }
}
@media(max-width:420px) {
  .bazi-manuscript .bz-dm-hero { padding:14px; gap:12px; }
  .bazi-manuscript .bz-dm-hero__char { font-size:55px; }
  .bazi-manuscript .bz-dm-hero__name { font-size:17px; }
  .bazi-manuscript .bz-yong-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bazi-manuscript .gj-elements-scroll__bars { gap:8px; }
  .bazi-manuscript .gj-elements-scroll__icon-disc { width:36px; height:36px; }
  .bazi-manuscript .gj-elements-scroll__name { font-size:12px; }
  .bazi-manuscript .gj-elements-scroll__bar-share { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  .bazi-manuscript *, .bazi-manuscript *::before,.bazi-manuscript *::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; }
}
@media print {
  .bazi-manuscript .site-header,.bazi-manuscript .calc-hero,.bazi-manuscript .calc-form,.bazi-manuscript [data-export-hide],.bazi-manuscript .site-footer { display:none !important; }
  .bazi-manuscript .calc-layout { display:block; padding:0; }
  .bazi-manuscript .bz-card { break-inside:avoid; box-shadow:none; }
}
