.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", "Noto Sans CJK 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[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 {
  overflow: hidden;
  color: #27231f;
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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: "Songti SC", "STSong", 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: "Songti SC", "STSong", 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: "Songti SC", "STSong", 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: "Songti SC", "STSong", 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: 110px minmax(0, 1fr);
  border-bottom: 1px solid #d5cfc3;
}

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

.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: "Songti SC", "STSong", 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: "Songti SC", "STSong", 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-state {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 110px 30px;
}

.zy-report-state h1 {
  margin: 0 0 24px;
  color: #211e1a;
  font-family: "Songti SC", "STSong", serif;
  font-size: 36px;
  line-height: 1.4;
}

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

.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-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: 82px 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.png") 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: "Songti SC", "STSong", 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;
}

@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.png") 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;
  }
}
