.zy-report {
  position: fixed;
  z-index: 1700;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #24211d;
  background: #f7f5ef;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  pointer-events: auto;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  -webkit-user-select: text;
  user-select: text;
}
.zy-report-disclaimer{margin:28px 0 8px;padding:18px 20px;border:1px solid rgba(180,135,54,.28);border-radius:12px;color:#7a8792;background:rgba(248,244,234,.72);font:14px/1.7 system-ui,"PingFang SC",sans-serif}.zy-report-disclaimer a{margin-left:8px;color:#9b6b18;text-underline-offset:3px}

.zy-report[hidden],
.zy-report [hidden] {
  display: none !important;
}

.zy-report *,
.zy-report *::before,
.zy-report *::after {
  box-sizing: border-box;
}

.zy-report button {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

.zy-report button:focus-visible {
  outline: 2px solid #6f2933;
  outline-offset: 4px;
}

.zy-document-section:focus,
.zy-directory:focus {
  outline: none;
}

.zy-report-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  min-height: calc(58px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 14px 0;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  border-bottom: 1px solid #d8d2c5;
  background: #f7f5ef;
}

.zy-report-header strong {
  min-width: 0;
  overflow: visible;
  color: #27231f;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 18px;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.zy-report-header button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: #6f2933;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.zy-report-header button:first-child {
  text-align: left;
}

.zy-report-header button:last-child {
  text-align: right;
}

.zy-report-main {
  width: 100%;
}

.zy-report-document {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 54px 34px calc(96px + env(safe-area-inset-bottom, 0px));
}

.zy-document-title {
  padding-bottom: 42px;
  border-bottom: 1px solid #bdb5a7;
  text-align: center;
}

.zy-document-title h1 {
  margin: 0 0 22px;
  color: #211e1a;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(34px, 7vw, 54px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .03em;
}

.zy-document-title p {
  margin: 4px 0;
  color: #585149;
  font-size: 15px;
}

.zy-document-title small {
  display: block;
  margin-top: 18px;
  color: #7b746c;
  font-size: 13px;
}

.zy-directory {
  padding: 50px 0 54px;
  scroll-margin-top: 76px;
}

.zy-directory h2,
.zy-document-section > h2 {
  margin: 0;
  color: #211e1a;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.45;
}

.zy-directory ol {
  margin: 28px 0 0;
  padding: 0;
  list-style-position: inside;
}

.zy-directory li {
  padding: 10px 0;
  border-bottom: 1px solid #ded9cf;
  color: #6f2933;
}

.zy-directory button {
  padding: 0;
  border: 0;
  color: #302b26;
  background: transparent;
  text-align: left;
}

.zy-directory button:active {
  color: #6f2933;
}

.zy-document-section {
  padding: 62px 0;
  border-top: 1px solid #bdb5a7;
  scroll-margin-top: 76px;
}

.zy-document-section > h2 {
  margin-bottom: 36px;
}

.zy-document-section > h3,
.zy-text-chapter > h3,
.zy-topic > h3 {
  margin: 42px 0 18px;
  color: #302b26;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 23px;
  line-height: 1.5;
}

.zy-text-chapter {
  margin: 0;
  padding: 34px 0 18px;
}

.zy-text-chapter + .zy-text-chapter {
  border-top: 1px solid #ded9cf;
}

.zy-text-chapter > h4,
.zy-palace-chapter > h4 {
  margin: 0 0 16px;
  color: #39322c;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
  line-height: 1.55;
}

.zy-basic-info {
  margin: 0 0 46px;
  border-top: 1px solid #d5cfc3;
}

.zy-basic-info div {
  display: grid;
  padding: 13px 0;
  grid-template-columns: 150px minmax(0, 1fr);
  border-bottom: 1px solid #d5cfc3;
}

.zy-basic-info dt {
  color: #766e65;
  white-space: nowrap;
}

.zy-basic-info dd {
  margin: 0;
  color: #26221e;
  font-weight: 600;
}

.zy-chart-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zy-chart-card {
  overflow: hidden;
  border: 1px solid #cfc6b7;
  border-radius: 14px;
  background: #f2eee5;
}

.zy-chart-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #d8d0c4;
  background: #e8e0d3;
}

.zy-chart-card h4 {
  margin: 0;
  color: #302b26;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 19px;
}

.zy-chart-card header span {
  padding: 3px 9px;
  border: 1px solid #8d4e56;
  border-radius: 999px;
  color: #6f2933;
  font-size: 11px;
  font-weight: 700;
}

.zy-chart-card dl {
  margin: 0;
  padding: 8px 18px 14px;
}

.zy-chart-card dl div {
  display: grid;
  gap: 12px;
  padding: 10px 0;
  grid-template-columns: 76px minmax(0, 1fr);
  border-bottom: 1px solid #ded7cb;
}

.zy-chart-card dl div:last-child {
  border-bottom: 0;
}

.zy-chart-card dt {
  color: #786f64;
  font-size: 13px;
}

.zy-chart-card dd {
  margin: 0;
  color: #292520;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.zy-method-note {
  margin: 18px 0 0;
  color: #766e65;
  font-size: 12px;
  line-height: 1.7;
}

.zy-dual-validation {
  margin: 44px 0 8px;
  padding: 28px;
  border: 1px solid #c9b491;
  border-radius: 16px;
  background: linear-gradient(145deg, #f3eee3, #ebe3d6);
}

.zy-dual-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.zy-dual-heading span {
  color: #7a303a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.zy-dual-heading h3 {
  margin: 0;
  color: #2d2924;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
}

.zy-dual-verdict {
  margin: 0 0 22px;
  color: #6f2933;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.85;
}

.zy-confirmation-list {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}

.zy-confirmation-list section {
  padding: 18px;
  border-left: 3px solid #8a3a44;
  background: rgba(255, 253, 247, .62);
}

.zy-confirmation-list h4,
.zy-dual-subtitle {
  margin: 0 0 12px;
  color: #352f29;
  font-size: 17px;
}

.zy-confirmation-list p {
  margin: 7px 0;
  color: #514a42;
  font-size: 14px;
  line-height: 1.75;
}

.zy-confirmation-list .zy-confirmed {
  color: #6f2933;
}

.zy-report-copy p {
  margin: 0 0 24px;
  color: #2e2a25;
  font-size: 17px;
  line-height: 1.95;
  text-align: justify;
  text-wrap: pretty;
}

.zy-judgment,
.zy-verdict {
  margin: 0 0 22px;
  color: #6f2933;
  font-weight: 700;
  line-height: 1.85;
}

.zy-period {
  margin: -22px 0 18px;
  color: #696159;
  font-size: 15px;
}

.zy-reference {
  margin: 30px 0 12px;
  padding: 18px 0 4px 18px;
  border-left: 2px solid #8b4a52;
  color: #575048;
}

.zy-reference strong {
  display: block;
  margin-bottom: 10px;
  color: #6f2933;
  font-size: 14px;
}

.zy-reference ul {
  margin: 0;
  padding-left: 20px;
}

.zy-reference li {
  margin: 7px 0;
  font-size: 14px;
  line-height: 1.75;
}

.zy-palace-chapter > h3 {
  color: #6f2933;
}

.zy-topic {
  margin-top: 34px;
}

.zy-topic > h3 {
  margin-bottom: 12px;
  font-size: 21px;
}

.zy-period-cross-validation {
  padding: 22px 24px 2px;
  border: 1px solid #d2c09f;
  border-left: 4px solid #7a303a;
  border-radius: 12px;
  background: #f2ebdf;
}

.zy-period-cross-validation > h3 {
  color: #6f2933;
}

.zy-period-cross-validation .zy-report-copy p {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
}

.zy-document-closing {
  padding-bottom: 12px;
}

.zy-report-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 24px auto 0;
  padding: 12px 16px;
  border: 1px solid #d2c09f;
  border-radius: 999px;
  background: rgba(255, 253, 247, .72);
}

.zy-report button.zy-report-download {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid #6f2933;
  border-radius: 999px;
  color: #fffaf2;
  background: #6f2933;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.zy-report button.zy-report-download:hover {
  background: #552028;
}

.zy-report button.zy-report-download:disabled {
  cursor: wait;
  opacity: .65;
}

.zy-report-download-status {
  min-width: 0;
  max-width: 100%;
  color: #756c62;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

.zy-report-pdf-host {
  position: absolute !important;
  z-index: -1 !important;
  top: 0 !important;
  left: -10000px !important;
  width: 794px !important;
  min-height: 1px !important;
  height: auto !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.zy-report-pdf-host .zy-report-document,
.zy-report-document.zy-report-pdf-chunk {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 34px 42px 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.zy-report-document.zy-report-pdf-chunk,
.zy-report-document.zy-report-pdf-chunk *,
.zy-report-document.zy-report-pdf-chunk *::before,
.zy-report-document.zy-report-pdf-chunk *::after {
  box-sizing: border-box !important;
}

.zy-report-document.zy-report-pdf-chunk {
  color: #24211d;
  background: #f7f5ef;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

.zy-report-pdf-host .zy-report-actions {
  display: none !important;
}

.zy-report-pdf-host .zy-pdf-keep,
.zy-report-pdf-chunk .zy-pdf-keep {
  break-inside: avoid;
  page-break-inside: avoid;
}

.zy-report-pdf-host .zy-chart-card,
.zy-report-pdf-host .zy-topic-analysis-card,
.zy-report-pdf-host .zy-dual-validation,
.zy-report-pdf-host .zy-period-cross-validation,
.zy-report-pdf-host .zy-reference,
.zy-report-pdf-chunk .zy-chart-card,
.zy-report-pdf-chunk .zy-topic-analysis-card,
.zy-report-pdf-chunk .zy-dual-validation,
.zy-report-pdf-chunk .zy-period-cross-validation,
.zy-report-pdf-chunk .zy-reference {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  break-inside: auto;
  page-break-inside: auto;
}

.zy-report-state {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 110px 30px;
}

.zy-report-state h1 {
  margin: 0 0 24px;
  color: #211e1a;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 36px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.zy-report-state p {
  margin: 0;
  color: #4c4640;
  font-size: 17px;
  line-height: 1.95;
}

.zy-report-state-note {
  display: flex;
  max-width: 520px;
  margin: 34px auto 0;
  padding: 16px 18px;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(184, 132, 48, .26);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
  text-align: left;
}

.zy-report-state-note > div { min-width: 0; }

.zy-report-state-note > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  color: #a87127;
  background: #f6e8c8;
  box-shadow: 0 0 0 5px rgba(231, 203, 151, .19);
}

.zy-report-state-note strong,
.zy-report-state-note small {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
}

.zy-report-state-note strong {
  color: #75501b;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 16px;
}

.zy-report-state-note small {
  margin-top: 4px;
  color: #6c777e;
  font-size: 12px;
  line-height: 1.65;
}

.zy-report-state-link {
  display: inline-flex;
  margin-top: 22px;
  color: #9b6b18;
  font-size: 14px;
  font-weight: 650;
  text-underline-offset: 4px;
}

.zy-report-state .zy-report-retry {
  min-height: 46px;
  margin-top: 30px;
  padding: 0 24px;
  border: 1px solid #6f2933;
  border-radius: 999px;
  color: #fffaf2;
  background: #6f2933;
  font-size: 15px;
  font-weight: 650;
}

.zy-report-state .zy-report-retry:active {
  background: #552028;
}

@media (max-width: 560px) {
  .zy-report-document {
    padding: 38px 20px calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .zy-chart-grid {
    grid-template-columns: 1fr;
  }

  .zy-dual-validation {
    padding: 22px 18px;
  }

  .zy-report-actions {
    border-radius: 18px;
  }

  .zy-report-state {
    padding: 76px 20px;
  }

  .zy-report-state h1 {
    font-size: 30px;
  }

  .zy-report-state p {
    font-size: 15px;
  }

  .zy-report-state-note {
    margin-top: 26px;
    padding: 14px;
  }

  .zy-report-state-note small {
    font-size: 11px;
  }

  .zy-report-download-status {
    width: 100%;
    text-align: center;
  }

  .zy-dual-heading {
    display: block;
  }

  .zy-dual-heading h3 {
    margin-top: 8px;
  }

  .zy-document-title {
    padding-bottom: 34px;
  }

  .zy-document-title h1 {
    font-size: 30px;
  }

  .zy-directory {
    padding: 42px 0 46px;
  }

  .zy-document-section {
    padding: 52px 0;
  }

  .zy-directory h2,
  .zy-document-section > h2 {
    font-size: 29px;
  }

  .zy-document-section > h3,
  .zy-text-chapter > h3,
  .zy-topic > h3 {
    font-size: 21px;
  }

  .zy-report-copy p {
    font-size: 16px;
    line-height: 1.92;
    text-align: left;
  }

  .zy-basic-info div {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zy-report {
    scroll-behavior: auto;
  }
}

/* 云海仙宫主题：报告正文继续保持高可读的纸张排版。 */
.zy-report {
  color: #253c52;
  background:
    linear-gradient(rgba(239, 246, 248, .94), rgba(247, 245, 239, .97)),
    url("../assets/images/celestial-palace-clouds-v3.webp") center / cover fixed;
}

.zy-report-header {
  border-bottom-color: rgba(184, 132, 48, .35);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 8px 30px rgba(61, 85, 105, .08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.zy-report-header strong,
.zy-document-title h1,
.zy-directory h2,
.zy-document-section > h2,
.zy-document-section > h3,
.zy-text-chapter > h3,
.zy-topic > h3,
.zy-text-chapter > h4,
.zy-palace-chapter > h4,
.zy-chart-card h4,
.zy-dual-heading h3,
.zy-report-state h1 {
  color: #173657;
}

.zy-report-header button,
.zy-directory li,
.zy-palace-chapter > h3,
.zy-judgment,
.zy-verdict,
.zy-dual-verdict,
.zy-reference strong,
.zy-period-cross-validation > h3 {
  color: #95651f;
}

.zy-report-document {
  width: min(calc(100% - 40px), 860px);
  margin: 34px auto;
  padding: 58px 52px calc(96px + env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(184, 132, 48, .26);
  border-radius: 22px;
  background: rgba(255, 254, 250, .94);
  box-shadow: 0 30px 80px rgba(59, 82, 101, .13), inset 0 1px 0 #fff;
}

.zy-document-title,
.zy-document-section,
.zy-basic-info,
.zy-basic-info div {
  border-color: rgba(102, 125, 143, .28);
}

.zy-document-title p,
.zy-report-copy p,
.zy-basic-info dd,
.zy-chart-card dd,
.zy-report-state p {
  color: #2b4054;
}

.zy-document-title small,
.zy-basic-info dt,
.zy-chart-card dt,
.zy-method-note,
.zy-period,
.zy-reference {
  color: #657687;
}

.zy-chart-card {
  border-color: rgba(184, 132, 48, .28);
  background: rgba(246, 249, 248, .9);
  box-shadow: 0 10px 28px rgba(58, 84, 104, .06);
}

.zy-chart-card header {
  border-bottom-color: rgba(184, 132, 48, .22);
  background: linear-gradient(180deg, #fffdf7, #f1f5f4);
}

.zy-chart-card header span {
  border-color: rgba(169, 111, 31, .5);
  color: #95651f;
}

.zy-dual-validation,
.zy-period-cross-validation {
  border-color: rgba(184, 132, 48, .32);
  background: linear-gradient(145deg, rgba(255, 253, 247, .98), rgba(235, 244, 244, .92));
}

.zy-confirmation-list section {
  border-left-color: #b8863e;
  background: rgba(255, 255, 255, .68);
}

.zy-report-state .zy-report-retry {
  border-color: #a87127;
  color: #fffdf8;
  background: linear-gradient(180deg, #d9ad5d, #ad762a);
}

.zy-basic-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.zy-basic-facts p {
  display: flex;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(184, 132, 48, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .68);
}

.zy-basic-facts strong,
.zy-basic-palace h3 {
  color: #243d51;
}

.zy-basic-palaces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.zy-basic-palace {
  min-height: 128px;
  padding: 16px;
  border: 1px solid rgba(184, 132, 48, .28);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 253, 247, .98), rgba(235, 244, 244, .92));
}

.zy-basic-palace h3 {
  margin: 0 0 10px;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 18px;
}

.zy-basic-palace h3 small,
.zy-basic-palace > small {
  color: #876f50;
  font-size: 12px;
  font-weight: 500;
}

.zy-basic-palace p {
  margin: 0 0 8px;
  color: #4b4033;
  font-size: 14px;
  line-height: 1.65;
}

.zy-basic-ai-note {
  border-color: rgba(184, 132, 48, .34);
  background: rgba(255, 252, 243, .88);
}

.zy-basic-ai-note .zy-report-retry {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #a87127;
  border-radius: 999px;
  color: #fffdf8;
  background: linear-gradient(180deg, #d9ad5d, #ad762a);
  font-weight: 700;
}

/* 双盘基础排盘：十二宫采用四列环形命盘，八字采用四柱、完整大运与流年分层。 */
.zy-base-charts-section > h3 {
  margin: 34px 0 18px;
  color: #243d51;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px;
}

.zy-base-chart-block {
  margin-top: 54px;
}

.zy-base-chart-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.zy-base-chart-heading > span {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(169, 111, 31, .52);
  border-radius: 50%;
  color: #95651f;
  background: #fffdf7;
  font: 700 13px/1 system-ui, "PingFang SC", sans-serif;
}

.zy-base-chart-heading h3,
.zy-base-chart-heading p {
  margin: 0;
}

.zy-base-chart-heading h3 {
  color: #243d51;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
}

.zy-base-chart-heading p {
  margin-top: 4px;
  color: #657687;
  font-size: 13px;
}

.zy-astrolabe-scroll {
  overflow-x: auto;
  padding: 4px 4px 12px;
  scrollbar-color: rgba(169, 111, 31, .5) transparent;
}

.zy-astrolabe-scroll:focus-visible {
  outline: 2px solid #b8863e;
  outline-offset: 4px;
}

.zy-astrolabe {
  display: grid;
  min-width: 680px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(142px, auto));
  gap: 8px;
}

.zy-astrolabe-palace {
  display: flex;
  min-width: 0;
  padding: 11px 12px;
  grid-row: var(--zy-grid-row);
  grid-column: var(--zy-grid-column);
  flex-direction: column;
  border: 1px solid rgba(184, 132, 48, .32);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 253, 247, .99), rgba(235, 244, 244, .94));
  box-shadow: 0 7px 18px rgba(49, 72, 90, .055);
}

.zy-astrolabe-palace > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(102, 125, 143, .2);
}

.zy-astrolabe-palace h4 {
  margin: 0;
  color: #243d51;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 17px;
}

.zy-astrolabe-palace > header span,
.zy-astrolabe-palace footer {
  color: #876f50;
  font-size: 11px;
}

.zy-palace-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.zy-palace-tags b {
  padding: 2px 5px;
  border-radius: 999px;
  color: #fffdf8;
  background: #9a6a26;
  font-size: 10px;
}

.zy-astrolabe-palace .zy-palace-major {
  margin: 8px 0 4px;
  color: #8c3f36;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.zy-astrolabe-palace .zy-palace-minor {
  margin: 0;
  color: #657687;
  font-size: 11px;
  line-height: 1.5;
}

.zy-astrolabe-palace footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 7px;
}

.zy-astrolabe-center {
  display: grid;
  padding: 28px;
  grid-row: 2 / span 2;
  grid-column: 2 / span 2;
  place-content: center;
  border: 1px solid rgba(184, 132, 48, .38);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .96), rgba(241, 246, 244, .9) 64%),
    #f8f5ec;
  text-align: center;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .52);
}

.zy-astrolabe-center > strong {
  color: #243d51;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 27px;
}

.zy-astrolabe-center > p {
  margin: 6px 0 0;
  color: #8f682c;
  font-size: 13px;
}

.zy-astrolabe-center dl {
  display: grid;
  margin: 20px 0 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.zy-astrolabe-center dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.zy-astrolabe-center dt {
  color: #657687;
  font-size: 11px;
}

.zy-astrolabe-center dd {
  margin: 0;
  color: #2b4054;
  font-size: 12px;
  font-weight: 700;
}

.zy-bazi-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.zy-bazi-pillar {
  min-height: 148px;
  padding: 18px 12px;
  border: 1px solid rgba(184, 132, 48, .3);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8, #eef4f3);
  text-align: center;
}

.zy-bazi-pillar h4,
.zy-bazi-pillar p,
.zy-bazi-pillar small {
  margin: 0;
}

.zy-bazi-pillar h4 {
  color: #657687;
  font-size: 13px;
}

.zy-bazi-pillar strong {
  display: block;
  margin: 14px 0 10px;
  color: #8c3f36;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 27px;
  letter-spacing: .12em;
}

.zy-bazi-pillar p,
.zy-bazi-pillar small {
  display: block;
  color: #657687;
  font-size: 11px;
  line-height: 1.6;
}

.zy-bazi-summary {
  margin-top: 18px;
  grid-template-columns: 1fr;
}

.zy-base-subtitle {
  margin: 36px 0 16px;
  color: #243d51;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
}

.zy-luck-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.zy-luck-item {
  min-height: 126px;
  padding: 14px;
  border: 1px solid rgba(102, 125, 143, .28);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
}

.zy-luck-item > span {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  color: #657687;
  background: #edf2f1;
  font-size: 10px;
  font-weight: 700;
}

.zy-luck-item h4 {
  margin: 10px 0 5px;
  color: #243d51;
  font: 700 20px/1.3 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.zy-luck-item p,
.zy-luck-item small {
  display: block;
  margin: 4px 0 0;
  color: #657687;
  font-size: 11px;
  line-height: 1.45;
}

.zy-luck-item.is-previous,
.zy-luck-item.is-next {
  border-color: rgba(184, 132, 48, .42);
}

.zy-luck-item.is-current {
  border-color: #a87127;
  background: linear-gradient(145deg, #fff9e9, #edf5f3);
  box-shadow: inset 0 0 0 1px rgba(184, 132, 48, .2);
}

.zy-luck-item.is-current > span {
  color: #fff;
  background: #a87127;
}

.zy-annual-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.zy-annual-item {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid rgba(184, 132, 48, .28);
  border-radius: 10px;
  background: rgba(255, 253, 247, .88);
  text-align: center;
}

.zy-annual-item > span,
.zy-annual-item > strong,
.zy-annual-item > small {
  display: block;
}

.zy-annual-item > span {
  color: #657687;
  font-size: 11px;
}

.zy-annual-item > strong {
  margin: 7px 0;
  color: #8c3f36;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
}

.zy-annual-item > small,
.zy-annual-item > p {
  margin: 4px 0 0;
  color: #657687;
  font-size: 10px;
  line-height: 1.45;
}

.zy-empty-chart-note,
.zy-legacy-note,
.zy-section-lead {
  color: #657687;
  font-size: 14px;
  line-height: 1.75;
}

.zy-section-lead {
  margin: -18px 0 30px;
}

.zy-legacy-note {
  margin: -18px 0 18px;
  padding: 12px 14px;
  border-left: 3px solid #b8863e;
  background: rgba(255, 253, 247, .82);
}

.zy-topic-analysis-list {
  display: grid;
  gap: 22px;
}

.zy-topic-analysis-card {
  display: grid;
  padding: 28px;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid rgba(184, 132, 48, .3);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 253, 247, .98), rgba(239, 246, 245, .94));
}

.zy-topic-index {
  color: rgba(149, 101, 31, .58);
  font: 700 25px/1.2 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.zy-topic-content > h3 {
  margin: 0 0 16px;
  color: #243d51;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
}

.zy-topic-content .zy-period-cross-validation {
  margin: 22px 0;
}

.zy-decadal-unavailable {
  padding: 24px;
  border: 1px dashed rgba(102, 125, 143, .38);
  border-radius: 12px;
  background: rgba(244, 248, 247, .72);
}

.zy-decadal-unavailable strong {
  color: #243d51;
}

.zy-decadal-unavailable p {
  margin: 8px 0 0;
  color: #657687;
  line-height: 1.7;
}

.zy-period-title {
  margin: -22px 0 26px !important;
  color: #8f682c !important;
  font-size: 18px !important;
}

.zy-report-copy p {
  orphans: 3;
  widows: 3;
}

/* 个人报告八字：与姻缘报告统一为传统四柱层级、紧凑事实格和时间轴。 */
.zy-bazi-base {
  padding: 20px;
  border: 1px solid #c9bfae;
  border-radius: 12px;
  color: #39332d;
  background: #fffdf8;
}

.zy-bazi-legend,
.zy-base-subtitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.zy-bazi-legend {
  margin-bottom: 10px;
}

.zy-bazi-legend strong,
.zy-base-subtitle > span {
  color: #4b443d;
  font: 700 15px/1.4 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.zy-bazi-legend span,
.zy-base-subtitle small {
  color: #948b80;
  font: 400 10px/1.4 system-ui, sans-serif;
}

.zy-bazi-pillars {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #c8bfb1;
  background: #fff;
}

.zy-bazi-pillar {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 10px 7px 9px;
  border: 0;
  border-right: 1px solid #ded7cc;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.zy-bazi-pillar:last-child {
  border-right: 0;
}

.zy-bazi-pillar.is-day {
  background: #fbf5e8;
}

.zy-bazi-pillar.is-day::before {
  position: absolute;
  top: -1px;
  right: -1px;
  left: -1px;
  height: 3px;
  background: #9e4b44;
  content: "";
}

.zy-bazi-pillar-role {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: #736b61;
  font-size: 10px;
}

.zy-bazi-pillar-role b {
  color: #4f4942;
  font-size: 11px;
  font-weight: 600;
}

.zy-bazi-pillar-glyphs {
  display: grid;
  padding: 7px 0 8px;
  gap: 1px;
}

.zy-bazi-pillar .zy-bazi-stem,
.zy-bazi-pillar .zy-bazi-branch {
  display: block;
  margin: 0;
  color: #26221f;
  font: 700 35px/1.05 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  letter-spacing: 0;
}

.zy-bazi-pillar .zy-bazi-branch {
  margin-top: 3px;
}

.zy-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.zy-element-glyph.is-metal,
.five-element-text.is-metal { color: #a87600 !important; }
.zy-element-glyph.is-wood,
.five-element-text.is-wood { color: #247a58 !important; }
.zy-element-glyph.is-water,
.five-element-text.is-water { color: #296fac !important; }
.zy-element-glyph.is-fire,
.five-element-text.is-fire { color: #b83f46 !important; }
.zy-element-glyph.is-earth,
.five-element-text.is-earth { color: #865329 !important; }

.five-element-text {
  font-weight: 700;
}

.zy-hidden-stems {
  padding-top: 8px;
  border-top: 1px solid #ebe6de;
}

.zy-hidden-stems > small {
  display: block;
  margin-bottom: 5px;
  color: #8b8379;
  font-size: 9px;
  letter-spacing: .12em;
}

.zy-hidden-stems > div {
  display: flex;
  min-height: 31px;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}

.zy-hidden-stem {
  display: grid;
  min-width: 0;
  justify-items: center;
}

.zy-hidden-stem b {
  font: 700 13px/1.2 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.zy-hidden-stem em {
  margin-top: 2px;
  color: #726b63;
  font-size: 9px;
  font-style: normal;
  line-height: 1.2;
  white-space: nowrap;
}

.zy-hidden-stem.is-empty {
  color: #a49c91;
  font-size: 10px;
}

.zy-bazi-facts {
  display: grid;
  margin-top: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #ded7cc;
  border-top: 0;
}

.zy-bazi-facts > div {
  min-width: 0;
  padding: 8px 7px;
  border-right: 1px solid #e4ded4;
  border-bottom: 1px solid #e4ded4;
  text-align: center;
}

.zy-bazi-facts > div:nth-child(4n) { border-right: 0; }
.zy-bazi-facts > div:nth-last-child(-n + 4) { border-bottom: 0; }

.zy-bazi-facts small,
.zy-bazi-facts strong {
  display: block;
}

.zy-bazi-facts small {
  color: #837a70;
  font-size: 9px;
}

.zy-bazi-facts strong {
  margin-top: 3px;
  overflow: hidden;
  color: #39332d;
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zy-base-subtitle {
  margin: 22px 0 8px;
}

.zy-luck-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  overscroll-behavior-inline: contain;
  scrollbar-color: #c6b99f #f1ece3;
}

.zy-luck-scroll:focus-visible {
  outline: 2px solid #a87127;
  outline-offset: 3px;
}

.zy-luck-track {
  min-width: calc(var(--zy-luck-count, 1) * 70px);
  grid-template-columns: repeat(var(--zy-luck-count, 1), minmax(70px, 1fr));
  gap: 0;
  border: 1px solid #d5cec3;
  background: #fff;
}

.zy-luck-item {
  min-width: 0;
  min-height: 0;
  padding: 7px 4px 8px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid #e2ddd4;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.zy-luck-item:last-child { border-right: 0; }

.zy-luck-item.is-previous,
.zy-luck-item.is-next {
  border-color: #e2ddd4;
}

.zy-luck-item.is-current {
  border-color: #e2ddd4;
  background: #fff6d9;
  box-shadow: inset 0 3px 0 #b98532;
}

.zy-luck-item > span,
.zy-luck-item.is-current > span {
  display: block;
  padding: 0;
  border-radius: 0;
  color: #766f67;
  background: transparent;
  font-size: 8px;
}

.zy-luck-glyphs {
  display: grid;
  margin: 4px 0 2px;
}

.zy-luck-glyphs b {
  font: 700 17px/1.05 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.zy-luck-item h4 {
  margin: 5px 0 2px;
  font-size: 13px;
}

.zy-luck-item p,
.zy-luck-item small {
  margin: 2px 0 0;
  font-size: 8px;
  line-height: 1.3;
}

.zy-annual-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #d5cec3;
  background: #fff;
}

.zy-annual-item {
  min-width: 0;
  padding: 8px 6px 9px;
  border: 0;
  border-right: 1px solid #e2ddd4;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.zy-annual-item:last-child { border-right: 0; }

.zy-annual-item > span { font-size: 9px; }

.zy-annual-item > strong {
  display: flex;
  margin: 5px 0 2px;
  justify-content: center;
  gap: 1px;
  font-size: 18px;
}

.zy-annual-item > strong b {
  font: inherit;
}

.zy-annual-item > small,
.zy-annual-item > p {
  margin: 2px 0 0;
  font-size: 8px;
  line-height: 1.3;
}

.zy-report-pdf-host .zy-astrolabe-scroll,
.zy-report-pdf-chunk .zy-astrolabe-scroll {
  overflow: visible !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.zy-report-pdf-host .zy-astrolabe,
.zy-report-pdf-chunk .zy-astrolabe {
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.zy-report-pdf-host .zy-bazi-facts strong,
.zy-report-pdf-chunk .zy-bazi-facts strong {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .zy-report {
    background:
      linear-gradient(rgba(244, 249, 250, .95), rgba(251, 249, 244, .98)),
      url("../assets/images/celestial-palace-clouds-mobile-v3.webp") center top / cover fixed;
  }

  .zy-report-document {
    width: 100%;
    margin: 0;
    padding: 38px 20px calc(78px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .zy-basic-facts,
  .zy-basic-palaces {
    grid-template-columns: 1fr;
  }

  .zy-basic-palace {
    min-height: 0;
  }

  .zy-base-chart-heading {
    align-items: flex-start;
  }

  .zy-base-chart-heading h3 {
    font-size: 21px;
  }

  .zy-astrolabe-scroll {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .zy-bazi-base {
    margin-right: 0;
    margin-left: 0;
    padding: 14px 10px;
    border-radius: 9px;
  }

  .zy-bazi-legend span,
  .zy-base-subtitle small {
    display: none;
  }

  .zy-bazi-pillars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .zy-bazi-pillar {
    padding: 8px 4px;
  }

  .zy-bazi-pillar-role {
    min-height: 26px;
    display: block;
  }

  .zy-bazi-pillar-role span,
  .zy-bazi-pillar-role b {
    display: block;
  }

  .zy-bazi-pillar-role b {
    margin-top: 2px;
    font-size: 10px;
  }

  .zy-bazi-pillar .zy-bazi-stem,
  .zy-bazi-pillar .zy-bazi-branch {
    font-size: 29px;
  }

  .zy-hidden-stems > div {
    min-height: 30px;
    gap: 2px;
  }

  .zy-hidden-stem b { font-size: 11px; }
  .zy-hidden-stem em { font-size: 7px; }

  .zy-bazi-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .zy-bazi-facts > div {
    padding: 7px 3px;
  }

  .zy-bazi-facts strong {
    overflow: visible;
    font-size: 10px;
    text-overflow: clip;
    white-space: normal;
  }

  .zy-luck-track {
    grid-template-columns: repeat(var(--zy-luck-count, 1), minmax(70px, 1fr));
  }

  .zy-annual-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .zy-annual-item {
    display: block;
    padding: 7px 2px;
    text-align: center;
  }

  .zy-annual-item > strong {
    margin: 4px 0 2px;
    font-size: 16px;
  }

  .zy-annual-item > p,
  .zy-annual-item > small {
    margin: 2px 0 0;
    font-size: 7px;
  }

  .zy-topic-analysis-card {
    padding: 22px 18px;
    grid-template-columns: 1fr;
  }

  .zy-topic-index {
    font-size: 18px;
  }
}
