:root {
  --bg: #0b0905;
  --deep: #171006;
  --panel: rgba(18, 13, 7, .76);
  --panel-strong: rgba(25, 17, 8, .9);
  --line: rgba(238, 202, 127, .78);
  --line-soft: rgba(211, 169, 84, .34);
  --text: #fff4d6;
  --muted: rgba(246, 226, 182, .74);
  --blue: #8b6530;
  --button: #241609;
  --gold: #e5bf70;
  --gold-strong: #f6db9a;
  --ink: #120d07;
  --seal-font: "MoquGufeng", serif;
}

@font-face {
  font-family: "MoquGufeng";
  src:
    url("https://cdn226633.oss-cn-chengdu.aliyuncs.com/22.ttf") format("truetype"),
    url("./assets/fonts/moqugufeng.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  color: var(--text);
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei", "PingFang SC", serif;
  background:
    linear-gradient(rgba(7, 5, 3, .18), rgba(7, 5, 3, .48)),
    var(--bg) url("./assets/refined-profile.webp") center top / cover fixed no-repeat;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(10, 7, 3, .06), rgba(5, 4, 3, .72) 70%),
    linear-gradient(90deg, rgba(0, 0, 0, .24), transparent 22%, transparent 78%, rgba(0, 0, 0, .24));
  opacity: 1;
  pointer-events: none;
}

body[data-screen="homeScreen"] {
  background:
    linear-gradient(rgba(255, 236, 172, .08), rgba(46, 29, 10, .04)),
    var(--bg) url("./assets/home-bg.webp") center top / cover fixed no-repeat;
  font-family: var(--seal-font);
}

body[data-screen="homeScreen"]::before {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 231, 151, .1), rgba(5, 4, 3, .18) 72%),
    linear-gradient(90deg, rgba(0, 0, 0, .08), transparent 18%, transparent 82%, rgba(0, 0, 0, .08));
  opacity: .28;
}

body[data-screen="profileScreen"] {
  background:
    linear-gradient(rgba(5, 3, 2, .04), rgba(5, 3, 2, .12)),
    var(--bg) url("./assets/profile-bg.webp") center top / cover fixed no-repeat;
  font-family: var(--seal-font);
}

body[data-screen="testScreen"] {
  background:
    linear-gradient(rgba(5, 3, 2, .04), rgba(5, 3, 2, .12)),
    var(--bg) url("./assets/profile-bg.webp") center top / cover fixed no-repeat;
  font-family: var(--seal-font);
}

body[data-screen="resultScreen"] {
  background:
    linear-gradient(rgba(5, 3, 2, .04), rgba(5, 3, 2, .12)),
    var(--bg) url("./assets/profile-bg.webp") center top / cover fixed no-repeat;
}

body[data-screen="ziweiScreen"] {
  background:
    linear-gradient(rgba(5, 3, 2, .04), rgba(5, 3, 2, .12)),
    var(--bg) url("./assets/profile-bg.webp") center top / cover fixed no-repeat;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
}

@keyframes wheel-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-screen {
  display: none;
}

.app-screen:not(.is-active) {
  display: none;
}

.hero-screen.app-screen.is-active,
.calculator-screen.app-screen.is-active {
  display: grid;
}

.hero-screen.app-screen.is-active {
  display: block;
}

.hero-screen {
  position: relative;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

.hero-art {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.brand-seal {
  position: absolute;
  top: clamp(40px, 6.4vh, 118px);
  left: clamp(48px, 7.2vw, 84px);
  width: clamp(210px, 26vw, 300px);
  height: clamp(390px, 46vh, 550px);
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  z-index: 1;
}

.brand-column,
.module-tab {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  color: #f9dc8a;
  font-family: var(--seal-font);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
  line-height: 1.06;
  -webkit-text-stroke: .35px rgba(255, 239, 179, .62);
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 rgba(68, 43, 14, .36),
    0 0 10px rgba(246, 219, 154, .18);
}

.brand-column {
  position: absolute;
  top: 0;
  font-size: clamp(48px, 7.8vw, 92px);
  transform: scaleX(.78);
  transform-origin: top center;
}

.brand-column-main {
  left: 0;
}

.brand-column-sub {
  top: clamp(170px, 20vh, 248px);
  left: clamp(96px, 10vw, 136px);
}

.hero-tabs {
  position: absolute;
  top: clamp(216px, 24vh, 318px);
  left: clamp(455px, 49vw, 585px);
  z-index: 1;
  display: block;
  width: clamp(320px, 39vw, 470px);
  height: clamp(390px, 42vh, 530px);
  margin: 0;
}

.module-tab {
  position: absolute;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #f9dc8a;
  background: transparent;
  font-size: clamp(38px, 5.3vw, 64px);
}

.module-tab.active {
  color: #f9dc8a;
}

.module-tab:nth-child(1) {
  left: 0;
  top: 0;
}

.module-tab:nth-child(2) {
  left: clamp(92px, 11vw, 132px);
  top: clamp(162px, 16vh, 214px);
}

.module-tab:nth-child(3) {
  left: clamp(190px, 21vw, 254px);
  top: clamp(258px, 24vh, 326px);
}

.display-tabs .module-tab {
  cursor: default;
  pointer-events: none;
}

.hero-note {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(14px, 2.2vh, 32px);
  transform: translateX(-50%);
  width: min(82vw, 620px);
  margin: 0;
  color: rgba(255, 250, 235, .86);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(13px, 2vw, 18px);
  line-height: 1.65;
  text-align: left;
  text-shadow: 0 2px 3px rgba(0, 0, 0, .72);
}

.start-link {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(86px, 10vh, 136px);
  transform: translateX(-50%);
  width: clamp(330px, 43vw, 548px);
  height: clamp(58px, 6vh, 86px);
  min-height: 0;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(238, 202, 127, .95);
  border-radius: 14px;
  color: #1b1107;
  text-decoration: none;
  background:
    radial-gradient(circle at 9% 50%, transparent 0 20px, rgba(238, 202, 127, .92) 21px 23px, transparent 24px),
    radial-gradient(circle at 91% 50%, transparent 0 20px, rgba(238, 202, 127, .92) 21px 23px, transparent 24px),
    linear-gradient(90deg, rgba(238, 202, 127, .9), rgba(255, 245, 205, .96), rgba(218, 167, 86, .92));
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 213, .34),
    inset 0 0 0 5px rgba(114, 77, 28, .18),
    0 18px 34px rgba(0, 0, 0, .36);
  font-family: var(--seal-font);
  font-synthesis: none;
  font-size: clamp(42px, 5vw, 70px);
  font-weight: 400;
  line-height: 1;
  -webkit-text-stroke: .45px rgba(14, 8, 3, .74);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}

.start-link::before,
.start-link::after {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(50px, 6vw, 78px);
  height: clamp(44px, 5.3vw, 68px);
  border: 3px solid rgba(238, 202, 127, .95);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.start-link::before {
  left: -35px;
}

.start-link::after {
  right: -35px;
}

.arrow-action {
  position: relative;
}

.arrow-action::after {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  margin-left: .35em;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: var(--gold);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: .72em;
  line-height: 1;
}

.calculator-screen {
  position: relative;
  min-height: 100vh;
  padding: 38px 22px 42px;
  background: transparent;
  align-content: start;
}

.profile-screen {
  position: relative;
  min-height: 100vh;
  padding: clamp(28px, 4vh, 58px) clamp(18px, 5vw, 70px) clamp(34px, 5vh, 76px);
  align-content: start;
}

.profile-prophecy {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  column-gap: clamp(28px, 5vw, 68px);
  row-gap: 8px;
  margin: 0 auto clamp(38px, 6vh, 78px);
  color: #fff7ed;
  font-family: var(--seal-font);
  font-size: clamp(28px, 4.8vw, 58px);
  line-height: 1.05;
  text-align: center;
  -webkit-text-stroke: 1.4px rgba(18, 13, 7, .94);
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, .82),
    0 0 12px rgba(255, 248, 226, .28);
}

.profile-workspace {
  width: min(100%, 860px);
}

.profile-frame {
  position: relative;
  min-height: clamp(650px, 72vh, 940px);
  padding: clamp(50px, 6vh, 82px) clamp(34px, 7vw, 86px) clamp(34px, 4vh, 56px);
  border: 2px solid rgba(202, 160, 64, .88);
  border-left-width: 4px;
  border-right-width: 4px;
  background: linear-gradient(180deg, rgba(3, 4, 2, .08), rgba(3, 4, 2, .16));
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 139, .52),
    0 0 24px rgba(0, 0, 0, .22);
}

.profile-frame::before,
.profile-frame::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 48px;
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(238, 201, 95, .86) 9%, rgba(238, 201, 95, .86) 91%, transparent);
  pointer-events: none;
}

.profile-frame::before {
  top: 10px;
}

.profile-frame::after {
  bottom: 10px;
}

.profile-head {
  display: block;
  width: 100%;
  margin: 0 0 clamp(56px, 7vh, 84px);
  text-align: center;
}

.profile-head h1 {
  color: #fffaf1;
  font-family: var(--seal-font);
  font-size: clamp(44px, 7.2vw, 82px);
  font-weight: 400;
  letter-spacing: .18em;
  -webkit-text-stroke: .8px rgba(20, 14, 7, .92);
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, .7),
    0 0 18px rgba(255, 246, 219, .2);
}

.profile-head p,
.profile-head .status-pill {
  display: none;
}

.profile-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.profile-panel::before,
.profile-panel .panel-title {
  display: none;
}

.profile-panel .form-grid {
  gap: clamp(30px, 4.2vh, 54px);
}

.profile-panel .field {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 5vw, 58px);
}

.profile-panel .field label {
  color: #fffaf1;
  font-family: "STKaiti", "KaiTi", "楷体", "华文楷体", serif;
  font-size: clamp(30px, 5.2vw, 56px);
  font-weight: 400;
  line-height: 1;
  -webkit-text-stroke: .7px rgba(20, 14, 7, .92);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .72);
}

.profile-panel .field input,
.profile-panel .field select {
  min-height: clamp(44px, 5.4vh, 62px);
  border: 0;
  border-bottom: 1px solid rgba(255, 248, 226, .48);
  border-radius: 0;
  padding: 4px 2px 7px;
  color: #fffaf1;
  background: rgba(0, 0, 0, .08);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(17px, 3vw, 25px);
  box-shadow: none;
}

.profile-panel .field input::placeholder {
  color: rgba(255, 248, 226, .48);
}

.profile-panel .field input:focus,
.profile-panel .field select:focus {
  border-bottom-color: rgba(255, 235, 157, .95);
  box-shadow: 0 6px 18px rgba(223, 178, 80, .1);
}

.profile-panel .field select option {
  color: #1c1208;
  background: #f5dfab;
}

.profile-panel .birthday-control {
  display: grid;
  grid-template-columns: minmax(82px, 108px) minmax(132px, 1fr) minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-panel .birthday-control select,
.profile-panel .birthday-control input {
  min-width: 0;
}

.profile-panel .birthplace-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-panel .birthplace-control select {
  min-width: 0;
}


.profile-panel .form-note {
  margin: clamp(30px, 4vh, 50px) auto 0;
  max-width: 720px;
  color: #fffaf1;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(18px, 3.2vw, 28px);
  line-height: 1.75;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .72);
}

.profile-panel .form-actions {
  justify-content: center;
  gap: 18px;
  margin-top: clamp(28px, 4vh, 52px);
}

.profile-panel .primary-btn,
.profile-panel .ghost-btn {
  flex: 0 1 320px;
  min-height: clamp(54px, 6vh, 76px);
  border-radius: 14px;
  font-family: var(--seal-font);
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 400;
}

.profile-panel .arrow-action::after {
  display: none;
}

.profile-panel .ghost-btn {
  flex-basis: 180px;
  color: rgba(255, 250, 241, .86);
  border-color: rgba(255, 235, 157, .42);
  background: rgba(14, 9, 5, .34);
  box-shadow: inset 0 0 0 1px rgba(255, 235, 157, .16);
  font-size: clamp(22px, 3.8vw, 34px);
}

.test-screen {
  position: relative;
  min-height: 100vh;
  padding: clamp(44px, 6vh, 84px) clamp(18px, 5vw, 70px) clamp(34px, 5vh, 76px);
  align-content: start;
}

.test-workspace {
  width: min(100%, 920px);
}

.test-frame {
  position: relative;
  min-height: clamp(760px, 82vh, 1080px);
  padding: clamp(30px, 4.6vh, 56px) clamp(34px, 7vw, 86px) clamp(34px, 4vh, 56px);
  border: 2px solid rgba(202, 160, 64, .88);
  border-left-width: 4px;
  border-right-width: 4px;
  background: linear-gradient(180deg, rgba(3, 4, 2, .08), rgba(3, 4, 2, .16));
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 139, .52),
    0 0 24px rgba(0, 0, 0, .22);
}

.test-frame::before,
.test-frame::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 48px;
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(238, 201, 95, .86) 9%, rgba(238, 201, 95, .86) 91%, transparent);
  pointer-events: none;
}

.test-frame::before {
  top: 10px;
}

.test-frame::after {
  bottom: 10px;
}

.test-head {
  display: block;
  width: 100%;
  margin: 0 0 clamp(48px, 6vh, 78px);
  text-align: center;
}

.test-head h1 {
  color: #fffaf1;
  font-family: var(--seal-font);
  font-size: clamp(62px, 10vw, 118px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .12em;
  -webkit-text-stroke: 1.8px rgba(18, 13, 7, .94);
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, .82),
    0 0 16px rgba(255, 248, 226, .3);
}

.test-head p,
.test-head .status-pill {
  display: none;
}

.test-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.test-panel::before,
.test-panel .panel-title {
  display: none;
}

.test-panel .test-grid {
  gap: clamp(190px, 22vh, 300px);
}

.test-panel .question-section {
  gap: 18px;
}

.test-panel .question-section h3 {
  position: relative;
  width: max-content;
  margin: 0 auto;
  padding-left: 1.35em;
  color: #fffaf1;
  font-family: "STKaiti", "KaiTi", "楷体", "华文楷体", serif;
  font-size: clamp(30px, 5.4vw, 58px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .72);
}

.test-panel .question-section h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: .72em;
  height: .72em;
  border-radius: 50%;
  background: #fffaf1;
  transform: translateY(-50%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .55);
}

.test-panel .question-card {
  border-color: rgba(255, 235, 157, .25);
  background: rgba(5, 4, 2, .28);
}

.test-panel .question-title {
  color: rgba(255, 248, 226, .88);
}

.test-panel .question-card p,
.test-panel .option-grid label {
  color: rgba(255, 250, 241, .94);
}

.test-panel .form-actions {
  justify-content: center;
  margin-top: clamp(42px, 5vh, 72px);
}

.test-panel .primary-btn {
  flex: 0 1 390px;
  min-height: clamp(54px, 6vh, 76px);
  border-radius: 14px;
  font-family: var(--seal-font);
  font-size: clamp(34px, 5.4vw, 60px);
  font-weight: 400;
}

.test-panel .arrow-action::after {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 28px;
  width: min(100%, 900px);
}

.page-head h1 {
  margin: 0;
  color: #fff3cf;
  font-size: clamp(46px, 10vw, 86px);
  line-height: 1;
  text-shadow:
    -2px 0 0 #120b05,
    2px 0 0 #120b05,
    0 2px 0 #120b05,
    0 0 26px rgba(229, 191, 112, .32);
}

.page-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.7;
}

.status-pill,
.module-mark {
  flex: 0 0 auto;
  border: 1px solid rgba(229, 191, 112, .55);
  border-radius: 999px;
  padding: 8px 12px;
  color: #ffe8ad;
  background: rgba(22, 14, 7, .72);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.25fr);
  gap: 20px;
  align-items: start;
  width: min(100%, 900px);
  margin: 0 auto;
}

.single-workspace {
  width: min(100%, 900px);
  margin: 0 auto;
}

.ornate-panel {
  position: relative;
  border: 2px solid rgba(214, 163, 77, .74);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255, 238, 184, .32), inset 0 0 32px rgba(214, 163, 77, .08), 0 18px 36px rgba(0, 0, 0, .42);
  backdrop-filter: blur(5px);
}

.ornate-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(229, 191, 112, .46);
  pointer-events: none;
}

.input-panel,
.result-panel {
  padding: 28px 24px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h2,
.report-head h2 {
  margin: 0;
  color: #ffe5a3;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #ffe5a3;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(229, 191, 112, .5);
  border-radius: 0;
  padding: 9px 12px;
  color: #fff6df;
  background: rgba(15, 10, 6, .72);
  outline: none;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #ffe5a3;
  box-shadow: 0 0 0 3px rgba(229, 191, 112, .16);
}

.field select option {
  color: #211407;
  background: #f7e4b7;
}

.form-note {
  margin: 16px 0 0;
  color: rgba(232, 240, 252, .74);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  line-height: 1.7;
}

.test-grid {
  display: grid;
  gap: 18px;
}

.question-section {
  display: grid;
  gap: 12px;
}

.question-section h3 {
  margin: 0;
  color: #ffe5a3;
  font-size: clamp(26px, 5vw, 38px);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}

.question-card {
  border: 1px solid rgba(229, 191, 112, .34);
  background: rgba(15, 10, 6, .58);
  padding: 14px;
}

.question-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: rgba(255, 232, 174, .78);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
}

.question-title strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(229, 191, 112, .46);
  border-radius: 50%;
  color: #fff;
}

.question-card p {
  margin: 10px 0 12px;
  color: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

.option-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(229, 191, 112, .28);
  padding: 8px 10px;
  background: rgba(255, 232, 174, .06);
  color: rgba(255, 244, 214, .92);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
}

.option-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.loading-text {
  margin: 0;
  color: rgba(246, 250, 255, .86);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

.form-actions,
.tool-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.flow-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  width: min(100%, 900px);
  margin: 18px auto 0;
  padding: 10px;
  border: 1px solid rgba(229, 191, 112, .42);
  background: rgba(12, 8, 5, .88);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(12px);
}

.flow-btn {
  position: relative;
  min-height: 50px;
  border: 1px solid rgba(229, 191, 112, .3);
  border-radius: 8px;
  padding: 0 22px 0 12px;
  color: rgba(255, 244, 214, .86);
  background: rgba(28, 18, 8, .88);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.flow-btn::after {
  content: ">";
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, .62);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.flow-btn.active {
  color: #fff1c9;
  border-color: rgba(213, 189, 134, .82);
  background: linear-gradient(165deg, rgba(89, 58, 20, .96), rgba(22, 14, 7, .96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.flow-btn.active::after {
  color: var(--gold);
}

.primary-btn,
.ghost-btn {
  min-height: 58px;
  border: 1px solid rgba(255, 226, 158, .7);
  border-radius: 8px;
  padding: 0 22px;
  color: #1b1107;
  background: linear-gradient(90deg, rgba(238, 201, 125, .96), rgba(255, 243, 198, .98), rgba(202, 143, 62, .96));
  box-shadow: inset 0 0 0 2px rgba(90, 55, 18, .18), 0 12px 22px rgba(0, 0, 0, .32);
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .46);
}

.primary-btn {
  flex: 1 1 190px;
}

.primary-btn:disabled {
  opacity: .7;
  cursor: progress;
}

.report-head {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

#resultScreen .result-head {
  display: none;
}

#resultScreen .report-head {
  display: none;
}

#ziweiScreen .ziwei-head,
#ziweiScreen .report-head {
  display: none;
}

#ziweiScreen .single-workspace {
  display: grid;
  justify-items: center;
}

#ziweiReportArea {
  width: min(100%, 900px);
}

.section-dot {
  position: relative;
  margin: 0 0 14px;
  padding-left: 28px;
  color: #ffe5a3;
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}

.section-dot::before {
  content: "";
  position: absolute;
  left: 0;
  top: .18em;
  width: .72em;
  height: .72em;
  border-radius: 50%;
  background: var(--gold);
}

.screen-loading-banner {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 226, 158, .72);
  padding: 10px 12px;
  color: #fff3c6;
  background: linear-gradient(135deg, rgba(91, 54, 17, .96), rgba(30, 18, 8, .96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 0, 0, .24);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.screen-loading-banner[hidden] {
  display: none !important;
}

.screen-loading-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: #1d1208;
  background: #f2c767;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.screen-loading-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid rgba(29, 18, 8, .35);
  border-top-color: #1d1208;
  animation: loadingSpin .85s linear infinite;
}

.screen-loading-banner strong {
  min-width: 0;
  color: #fff8dc;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.score-ring {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(229, 191, 112, .76);
  border-radius: 50%;
  color: #ffe5a3;
  background: rgba(19, 12, 6, .68);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.summary-band div,
.result-block {
  border: 1px solid rgba(229, 191, 112, .46);
  background: rgba(16, 10, 6, .58);
  padding: 12px;
}

.summary-band span {
  display: block;
  color: rgba(255, 232, 174, .76);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
}

.summary-band strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.pillar-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.pillar-board .bazi-chart-board,
.pillar-board .ziwei-h5-board {
  grid-column: 1 / -1;
}

.bazi-chart-board {
  width: 100%;
  border: 1px solid rgba(229, 191, 112, .5);
  background: rgba(14, 9, 5, .72);
  overflow-x: hidden;
}

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

.bazi-profile div {
  border: 1px solid rgba(229, 191, 112, .28);
  background: rgba(255, 232, 174, .06);
  padding: 9px;
}

.bazi-profile span {
  display: block;
  color: rgba(255, 232, 174, .72);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
}

.bazi-profile strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.bazi-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(229, 191, 112, .24);
}

.bazi-extra div {
  border: 1px solid rgba(229, 191, 112, .24);
  background: rgba(16, 10, 6, .42);
  padding: 10px;
}

.bazi-extra span {
  display: block;
  color: rgba(255, 232, 174, .72);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
}

.bazi-extra strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bazi-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.bazi-table th,
.bazi-table td {
  border: 2px solid rgba(43, 27, 10, .92);
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
}

.bazi-table thead th,
.bazi-table tbody th {
  color: #ffe7a9;
  background: #2a1909;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  font-weight: 800;
}

.bazi-table td {
  color: #221407;
  background: rgba(247, 226, 184, .94);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bazi-table tbody tr:nth-child(2) td,
.bazi-table tbody tr:nth-child(3) td {
  color: #3b2109;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 28px;
  font-weight: 800;
}

.bazi-vertical-list {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 100%;
  line-height: 1.25;
}

.bazi-vertical-list span {
  display: block;
  min-height: 1.2em;
}

.wuxing-token {
  display: inline-block;
  min-width: .9em;
  font-weight: 800;
}

.wuxing-wood {
  color: #00b879;
}

.wuxing-fire {
  color: #e94a31;
}

.wuxing-earth {
  color: #8f4318;
}

.wuxing-metal {
  color: #df7a00;
}

.wuxing-water {
  color: #2f65ff;
}

.wuxing-palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(229, 191, 112, .24);
  background: rgba(247, 226, 184, .9);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.wuxing-palette-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid rgba(77, 48, 18, .18);
  background: rgba(255, 255, 255, .52);
  color: #6b5740;
  font-size: 13px;
}

.wuxing-palette-item em {
  color: #6b5740;
  font-style: normal;
  font-size: 12px;
}

.wuxing-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .72), 0 0 0 3px currentColor;
  background: currentColor;
}

.pillar-card {
  min-height: 126px;
  border: 1px solid rgba(229, 191, 112, .56);
  padding: 12px 8px;
  text-align: center;
  background: rgba(247, 226, 184, .92);
  color: #2b1807;
}

.pillar-card span {
  display: block;
  color: #6a4113;
  font-size: 18px;
  font-weight: 800;
}

.pillar-card strong {
  display: block;
  margin: 10px 0 8px;
  color: #351d08;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1;
}

.pillar-card em {
  color: #6a4113;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-style: normal;
  font-size: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-block.wide {
  grid-column: 1 / -1;
}

.paid-section {
  position: relative;
  margin-top: 18px;
}

.paid-section.is-locked > :not(#baziPayOverlay):not(#ziweiPayOverlay) {
  display: none;
}

#baziPayOverlay,
#ziweiPayOverlay {
  display: none;
}

.paid-section.is-locked #baziPayOverlay,
.paid-section.is-locked #ziweiPayOverlay {
  display: block;
}

.paywall-card {
  position: relative;
  border: 2px solid #d8b46a;
  border-radius: 12px;
  padding: 24px 20px 22px;
  color: #2a1a0b;
  background: linear-gradient(180deg, #fffaf0, #fff4dd);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, .28),
    inset 0 0 0 1px rgba(255, 245, 210, .9),
    inset 0 0 24px rgba(216, 180, 106, .15);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  text-align: center;
}

.paywall-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(216, 180, 106, .5);
  border-radius: 8px;
  pointer-events: none;
}

.paywall-card h2 {
  margin: 0 0 16px;
  color: #8b5a1a;
  font-family: var(--seal-font);
  font-size: clamp(26px, 6vw, 42px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .08em;
  text-shadow: 0 2px 0 rgba(255, 236, 180, .7);
}

.paywall-offer,
.paywall-proof {
  border: 1px solid #e5c78a;
  background: linear-gradient(180deg, #fff9ea, #fff2d6);
}

.paywall-offer {
  display: block;
  padding: 14px 14px 12px;
  text-align: center;
}

.paywall-offer span {
  color: #2a1a0b;
  font-size: 16px;
  font-weight: 700;
}

.paywall-offer strong {
  color: #e83e2f;
  font-size: 28px;
  font-weight: 900;
}

.paywall-offer strong small {
  margin-left: 2px;
  font-size: 16px;
  color: #e83e2f;
}

.paywall-offer em {
  display: inline;
  margin-left: 8px;
  color: #7a5a30;
  font-style: normal;
  text-decoration: line-through;
  font-size: 14px;
}

.paywall-price {
  display: inline-block;
  margin: 0 6px;
  color: #e83e2f;
}

.paywall-countdown {
  display: block;
  margin-top: 6px;
  color: #5a3a10 !important;
  font-size: 14px !important;
  font-weight: 600;
  letter-spacing: 0;
}

.paywall-proof {
  margin-top: -1px;
  padding: 12px 14px;
  color: #2a1a0b;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.paywall-proof strong {
  color: #e83e2f;
  font-size: 15px;
  font-weight: 800;
}

.paywall-pay-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #1fa8f0, #0a84d1);
  box-shadow: 0 6px 18px rgba(10, 132, 209, .28), inset 0 -2px 0 rgba(0, 0, 0, .15);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
}

.paywall-pay-btn::before {
  content: "支";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 6px;
  color: #1fa8f0;
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.paywall-wechat-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #1aad19, #0a8f0f);
  box-shadow: 0 6px 18px rgba(10, 143, 15, .28), inset 0 -2px 0 rgba(0, 0, 0, .15);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
}

.paywall-wechat-btn::before {
  content: "微";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 6px;
  color: #1aad19;
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.paywall-return {
  margin: 12px 0 14px;
  color: #d8341c;
  font-size: 13px;
  font-weight: 700;
}

.paywall-benefits {
  margin-top: 14px;
  padding: 16px 16px 4px;
  border-top: 1px solid #e5c78a;
  background: linear-gradient(180deg, rgba(255, 246, 220, .8), rgba(255, 238, 200, .5));
  text-align: left;
}

.paywall-benefits h3 {
  display: block;
  margin: 0 auto 14px;
  padding: 0;
  color: #e83e2f;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  text-align: center;
  border: none;
  background: none;
  text-shadow: 0 2px 4px rgba(232, 62, 47, .18);
}

.pay-benefit {
  margin: 10px 0 12px;
  color: #2a1a0b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.85;
  text-align: left;
}

.pay-benefit strong {
  font-size: 16px;
  font-weight: 700;
  color: #e83e2f;
}

.result-block h3 {
  margin-bottom: 9px;
  color: #ffe5a3;
  font-size: clamp(24px, 4vw, 34px);
}

.result-block p,
.analysis-list {
  margin-bottom: 0;
  color: rgba(255, 244, 214, .9);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.8;
}

.analysis-item {
  border-top: 1px solid rgba(229, 191, 112, .24);
  padding: 12px 0;
}

.analysis-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.analysis-item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.analysis-item summary::-webkit-details-marker {
  display: none;
}

.analysis-item strong {
  display: block;
  color: #ffe5a3;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
  line-height: 1.35;
}

.analysis-toggle {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 5px;
  border: 1px solid rgba(229, 191, 112, .48);
  border-radius: 50%;
  position: relative;
}

.analysis-toggle::before,
.analysis-toggle::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  width: 8px;
  height: 1px;
  background: #ffe5a3;
}

.analysis-toggle::after {
  transform: rotate(90deg);
}

.analysis-item[open] .analysis-toggle::after {
  transform: rotate(0deg);
}

.analysis-body {
  padding-top: 8px;
}

.analysis-body p {
  margin: 0 0 10px;
}

.analysis-body p:last-child {
  margin-bottom: 0;
}

.tool-row {
  justify-content: center;
  width: min(100%, 900px);
  margin: 26px auto 0;
}

.tool-row .ghost-btn {
  min-height: 54px;
  font-size: 24px;
}

.ziwei-h5-board {
  border: 1px solid rgba(229, 191, 112, .42);
  padding: 12px;
  background: rgba(14, 9, 5, .72);
}

.ziwei-h5-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.ziwei-h5-head span,
.ziwei-stat-grid span,
.ziwei-detail-h5 span {
  display: block;
  color: rgba(255, 232, 174, .72);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
}

.ziwei-h5-head strong {
  display: block;
  margin-top: 3px;
  font-size: 28px;
}

.ziwei-h5-head em {
  border: 1px solid rgba(229, 191, 112, .42);
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffe5a3;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-style: normal;
  background: rgba(255, 232, 174, .08);
}

.ziwei-stat-grid,
.ziwei-detail-h5 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.ziwei-stat-grid div,
.ziwei-detail-h5 div {
  border: 1px solid rgba(229, 191, 112, .24);
  padding: 8px;
  background: rgba(255, 232, 174, .05);
}

.ziwei-stat-grid strong,
.ziwei-detail-h5 strong {
  display: block;
  margin: 4px 0;
  color: #fff4d6;
  overflow-wrap: anywhere;
}

.ziwei-stat-grid small {
  color: rgba(255, 232, 174, .64);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
}

.ziwei-traditional-grid-h5 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 7px;
  overflow: hidden;
  padding-bottom: 2px;
  aspect-ratio: 1 / 1.08;
}

.ziwei-palace-h5,
.ziwei-center-h5 {
  min-height: 126px;
  border: 1px solid rgba(229, 191, 112, .46);
  background: rgba(35, 22, 9, .8);
}

.ziwei-palace-h5 {
  position: relative;
  width: 100%;
  color: #222;
  text-align: left;
  padding: 22px 8px 8px;
  display: grid;
  align-content: start;
  gap: 6px;
  appearance: none;
  background: linear-gradient(180deg, rgba(247, 226, 176, .96), rgba(226, 198, 137, .94));
  border-color: rgba(63, 37, 12, .58);
}

.ziwei-palace-h5.is-active {
  z-index: 3;
  border-color: #d62828;
  background: linear-gradient(180deg, rgba(255, 236, 176, 1), rgba(239, 197, 105, .98));
  box-shadow: inset 0 0 0 3px #d62828, 0 0 0 4px rgba(255, 225, 131, .78), 0 12px 26px rgba(0, 0, 0, .38);
  transform: translateY(-1px);
}

.ziwei-palace-h5.is-opposite {
  border-color: #0066cc;
  background: linear-gradient(180deg, rgba(238, 218, 170, .98), rgba(203, 174, 112, .96));
  box-shadow: inset 0 0 0 3px #0066cc, 0 0 0 2px rgba(0, 102, 204, .22);
}

.ziwei-palace-h5.is-surrounded {
  border-color: #39b54a;
  background: linear-gradient(180deg, rgba(241, 222, 177, .98), rgba(212, 183, 120, .96));
  box-shadow: inset 0 0 0 3px rgba(57, 181, 74, .9), 0 0 0 2px rgba(57, 181, 74, .18);
}

.ziwei-palace-h5.is-origin-palace .palace-title strong {
  color: #222;
  text-shadow: 0 1px 0 rgba(255, 245, 210, .35);
}

.ziwei-palace-h5.is-body-palace {
  outline: 1px solid rgba(130, 201, 144, .72);
  outline-offset: -3px;
}

.ziwei-palace-h5.is-decade-palace {
  box-shadow: inset 0 0 0 2px #8fc7ff, 0 0 0 1px rgba(0, 82, 204, .28);
}

.ziwei-palace-h5.is-year-palace {
  background: linear-gradient(rgba(214, 40, 40, .24), rgba(214, 40, 40, .1)), linear-gradient(180deg, rgba(247, 226, 176, .98), rgba(226, 198, 137, .96));
}

.ziwei-palace-h5.is-year-palace .palace-title strong,
.ziwei-palace-h5.is-decade-palace .palace-title strong {
  font-weight: 900;
}

.ziwei-palace-h5.is-active,
.ziwei-palace-h5.is-active.is-decade-palace,
.ziwei-palace-h5.is-active.is-year-palace {
  z-index: 7;
  border-color: #d62828;
  background: linear-gradient(180deg, rgba(255, 236, 176, 1), rgba(239, 197, 105, .98));
  box-shadow: inset 0 0 0 3px #d62828, 0 0 0 4px rgba(255, 225, 131, .78), 0 12px 26px rgba(0, 0, 0, .38);
}

.ziwei-palace-h5.is-opposite,
.ziwei-palace-h5.is-opposite.is-decade-palace,
.ziwei-palace-h5.is-opposite.is-year-palace {
  border-color: #0066cc;
  box-shadow: inset 0 0 0 3px #0066cc, 0 0 0 2px rgba(0, 102, 204, .22);
}

.ziwei-palace-h5.is-surrounded,
.ziwei-palace-h5.is-surrounded.is-decade-palace,
.ziwei-palace-h5.is-surrounded.is-year-palace {
  border-color: #39b54a;
  box-shadow: inset 0 0 0 3px rgba(57, 181, 74, .9), 0 0 0 2px rgba(57, 181, 74, .18);
}

.palace-relation-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 2;
  min-width: 38px;
  border-radius: 999px;
  padding: 3px 7px;
  color: #fff;
  background: rgba(34, 34, 34, .76);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .28);
}

.ziwei-palace-h5.is-active .palace-relation-badge {
  background: #d62828;
}

.ziwei-palace-h5.is-opposite .palace-relation-badge {
  background: #0066cc;
}

.ziwei-palace-h5.is-surrounded .palace-relation-badge {
  background: #208a32;
}

.palace-corner {
  position: absolute;
  top: 6px;
  color: rgba(34, 34, 34, .72);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
}

.palace-corner.left {
  left: 8px;
}

.palace-corner.right {
  right: 8px;
}

.palace-title {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.palace-title strong {
  color: #222;
  font-size: 18px;
}

.palace-title em {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #0d274d;
  background: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.palace-stars {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.palace-stars.major {
  color: #222;
  font-weight: 700;
}

.palace-stars.minor {
  color: #333;
}

.ziwei-star {
  color: #333;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .32);
}

.ziwei-star.star-main {
  color: #c8102e;
}

.ziwei-star.star-assist {
  color: #0073e6;
}

.ziwei-star.star-minor {
  color: #333;
}

.ziwei-star.mutagen-lu {
  color: #39b54a;
}

.ziwei-star.mutagen-quan {
  color: #0066cc;
}

.ziwei-star.mutagen-ke {
  color: #82c990;
}

.ziwei-star.mutagen-ji {
  color: #e6212a;
}

.ziwei-star.is-bright {
  font-weight: 900;
  filter: saturate(1.25);
}

.ziwei-star.is-weak {
  opacity: .62;
  filter: grayscale(.22);
}

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

.palace-tags span,
.center-chips span,
.center-focus em {
  border: 1px solid rgba(63, 37, 12, .32);
  border-radius: 999px;
  padding: 2px 6px;
  color: rgba(34, 34, 34, .78);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 10px;
  font-style: normal;
}

.ziwei-center-h5 .center-chips span,
.ziwei-center-h5 .center-focus em {
  border-color: rgba(255, 232, 174, .42);
  color: rgba(255, 239, 196, .94);
  background: rgba(255, 232, 174, .08);
}

.ziwei-center-h5 {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  min-height: 0;
  padding: 16px;
  border: 2px solid rgba(246, 219, 154, .8);
  background:
    linear-gradient(180deg, rgba(18, 12, 6, .96), rgba(10, 7, 4, .94));
  box-shadow: inset 0 0 0 1px rgba(255, 232, 174, .22);
}

.ziwei-center-skip {
  display: none;
}

.center-top {
  display: flex;
  justify-content: space-between;
  color: #ffe5a3;
  font-size: 22px;
  font-weight: 800;
}

.center-lines {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  color: rgba(255, 232, 174, .92);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
}

.center-chips,
.center-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.center-focus {
  margin-top: 10px;
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(255, 232, 174, .24);
  padding-top: 9px;
}

.center-focus small {
  color: #ffe5a3;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-weight: 700;
}

.center-focus strong {
  color: #fff3c1;
  font-size: 28px;
  line-height: 1.05;
}

.center-focus span {
  color: rgba(255, 244, 214, .96);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: block;
  }

  .status-pill {
    display: inline-block;
    margin-top: 12px;
  }
}

@media (max-width: 620px) {
  .hero-screen {
    min-height: 100svh;
    padding: 0;
  }

  .brand-seal {
    top: clamp(26px, 5.2svh, 52px);
    left: clamp(18px, 5.2vw, 34px);
    width: 39vw;
    height: 42svh;
  }

  .brand-column {
    font-family: "MoquGufeng", var(--seal-font);
    font-size: clamp(36px, 11.2vw, 54px);
    line-height: 1.08;
  }

  .brand-column-sub {
    top: clamp(105px, 16svh, 162px);
    left: clamp(72px, 20vw, 98px);
  }

  .hero-tabs {
    top: clamp(84px, 12.5svh, 132px);
    left: clamp(166px, 47vw, 230px);
    width: 48vw;
    height: 42svh;
  }

  .module-tab {
    min-height: 0;
    font-family: "MoquGufeng", var(--seal-font);
    font-size: clamp(28px, 8.8vw, 43px);
    line-height: 1.05;
  }

  .module-tab:nth-child(1) {
    left: 0;
    top: 0;
  }

  .module-tab:nth-child(2) {
    left: clamp(62px, 17vw, 88px);
    top: clamp(88px, 13.5svh, 136px);
  }

  .module-tab:nth-child(3) {
    left: clamp(122px, 32vw, 162px);
    top: clamp(142px, 21svh, 218px);
  }

  .start-link {
    width: min(72vw, 360px);
    height: 62px;
    bottom: 86px;
  }

  .hero-note {
    bottom: 14px;
    width: min(82vw, 360px);
    font-size: clamp(13px, 3.5vw, 16px);
    line-height: 1.55;
  }

  .start-link::before {
    left: -26px;
  }

  .start-link::after {
    right: -26px;
  }

  .calculator-screen {
    padding: 28px 10px 32px;
  }

  .profile-screen {
    padding: 24px 18px 34px;
  }

  .profile-prophecy {
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
    row-gap: 8px;
    width: min(100%, 400px);
    margin: 0 auto 10px;
    border: 1px solid rgba(255, 221, 139, .82);
    padding: 10px 12px;
    color: #fff5d6;
    background: rgba(12, 8, 5, .68);
    box-shadow: inset 0 0 0 1px rgba(255, 246, 210, .18), 0 8px 18px rgba(0, 0, 0, .3);
    font-family: "MoquGufeng", var(--seal-font);
    font-size: clamp(24px, 7vw, 34px);
    font-weight: 400;
    line-height: 1.08;
    -webkit-text-stroke: .8px rgba(18, 13, 7, .9);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .72), 0 0 8px rgba(255, 248, 226, .22);
    paint-order: stroke fill;
  }

  .profile-prophecy span {
    display: block;
    white-space: nowrap;
  }

  .profile-frame {
    min-height: 620px;
    padding: 42px 24px 30px;
  }

  .profile-frame::before,
  .profile-frame::after {
    left: 28px;
    right: 28px;
  }

  .profile-head {
    margin-bottom: 42px;
  }

  .profile-head h1 {
    font-size: clamp(38px, 11vw, 58px);
    letter-spacing: .1em;
  }

  .profile-panel .form-grid {
    gap: 24px;
  }

  .profile-panel .field {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-panel .field label {
    font-size: clamp(28px, 8vw, 42px);
  }

  .profile-panel .birthday-control {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-panel .birthplace-control {
    grid-template-columns: 1fr;
    gap: 8px;
  }


  .profile-panel .form-note {
    font-size: clamp(16px, 4.5vw, 22px);
  }

  .input-panel,
  .result-panel {
    padding: 22px 16px;
  }

  .paywall-card {
    padding: 16px 12px 18px;
  }

  .paywall-offer {
    padding: 12px 12px 10px;
  }

  .paywall-proof,
  .pay-benefit p {
    font-size: 12px;
  }

  .profile-panel {
    padding: 0;
  }

  .test-panel {
    padding: 0;
  }

  .summary-band,
  .result-grid,
  .bazi-profile,
  .ziwei-stat-grid,
  .ziwei-detail-h5 {
    grid-template-columns: 1fr;
  }

  .pillar-board {
    grid-template-columns: repeat(2, 1fr);
  }

  #resultScreen .pillar-board {
    grid-template-columns: 1fr;
  }

  #resultScreen .bazi-chart-board {
    overflow-x: hidden;
  }

  #resultScreen .bazi-profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }

  #resultScreen .bazi-profile div,
  #resultScreen .bazi-extra div {
    padding: 6px;
  }

  #resultScreen .bazi-profile span,
  #resultScreen .bazi-extra span {
    font-size: 10px;
  }

  #resultScreen .bazi-profile strong,
  #resultScreen .bazi-extra strong {
    font-size: 11px;
    line-height: 1.35;
  }

  #resultScreen .bazi-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #resultScreen .bazi-table th,
  #resultScreen .bazi-table td {
    border-width: 1px;
    padding: 5px 2px;
    font-size: 10px;
    line-height: 1.25;
  }

  #resultScreen .bazi-table thead th,
  #resultScreen .bazi-table tbody th {
    font-size: 13px;
  }

  #resultScreen .bazi-table thead th:first-child,
  #resultScreen .bazi-table tbody th {
    width: 15%;
  }

  #resultScreen .bazi-table tbody tr:nth-child(2) td,
  #resultScreen .bazi-table tbody tr:nth-child(3) td {
    font-size: 19px;
  }

  #resultScreen .bazi-vertical-list {
    gap: 1px;
    line-height: 1.1;
  }

  #resultScreen .wuxing-palette {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 6px;
  }

  #resultScreen .wuxing-palette-item {
    min-height: 28px;
    gap: 2px;
    font-size: 10px;
  }

  #resultScreen .bazi-extra {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 6px;
  }

  #ziweiScreen .pillar-board {
    grid-template-columns: 1fr;
  }

  #ziweiScreen .summary-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  #ziweiScreen .summary-band div {
    padding: 6px;
  }

  #ziweiScreen .summary-band span {
    font-size: 10px;
  }

  #ziweiScreen .summary-band strong {
    font-size: 12px;
  }

  #ziweiScreen .ziwei-h5-board {
    width: 100%;
    padding: 6px;
    overflow: hidden;
  }

  #ziweiScreen .ziwei-h5-head,
  #ziweiScreen .ziwei-stat-grid,
  #ziweiScreen .ziwei-detail-h5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  #ziweiScreen .ziwei-h5-head {
    display: grid;
  }

  #ziweiScreen .ziwei-h5-head strong {
    font-size: 18px;
  }

  #ziweiScreen .ziwei-h5-head em {
    width: max-content;
    justify-self: end;
    padding: 4px 7px;
    font-size: 10px;
  }

  #ziweiScreen .ziwei-traditional-grid-h5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(112px, auto));
    gap: 4px;
    overflow: visible;
    aspect-ratio: auto;
  }

  #ziweiScreen .ziwei-palace-h5,
  #ziweiScreen .ziwei-center-h5 {
    min-height: 112px;
    padding: 17px 4px 18px;
    gap: 3px;
  }

  #ziweiScreen .ziwei-center-h5 {
    min-height: 228px;
    padding: 7px;
    border-width: 2px;
    box-shadow: inset 0 0 0 1px rgba(255, 232, 174, .34), 0 0 0 2px rgba(255, 232, 174, .16);
    overflow: hidden;
  }

  #ziweiScreen .palace-relation-badge {
    right: 3px;
    bottom: 3px;
    min-width: 30px;
    padding: 2px 5px;
    font-size: 9px;
    line-height: 1.15;
  }

  #ziweiScreen .palace-corner {
    top: 3px;
    font-size: 8px;
  }

  #ziweiScreen .palace-corner.left {
    left: 3px;
  }

  #ziweiScreen .palace-corner.right {
    right: 3px;
  }

  #ziweiScreen .palace-title {
    gap: 2px;
  }

  #ziweiScreen .palace-title strong {
    font-size: 12px;
    line-height: 1.05;
  }

  #ziweiScreen .palace-title em {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
  }

  #ziweiScreen .palace-stars {
    font-size: 9px;
    line-height: 1.25;
  }

  #ziweiScreen .palace-tags {
    gap: 2px;
  }

  #ziweiScreen .palace-tags span,
  #ziweiScreen .center-chips span,
  #ziweiScreen .center-focus em {
    padding: 1px 3px;
    font-size: 7px;
  }

  #ziweiScreen .center-chips span,
  #ziweiScreen .center-focus em {
    padding: 2px 4px;
    font-size: 8px;
    line-height: 1.2;
    border-color: rgba(255, 232, 174, .5);
    color: rgba(255, 239, 196, .96);
    background: rgba(255, 232, 174, .1);
  }

  #ziweiScreen .center-top {
    font-size: 13px;
    line-height: 1.1;
  }

  #ziweiScreen .center-lines,
  #ziweiScreen .center-focus span {
    font-size: 9px;
    line-height: 1.18;
  }

  #ziweiScreen .center-lines {
    gap: 2px;
    margin: 5px 0;
  }

  #ziweiScreen .center-chips {
    gap: 3px;
  }

  #ziweiScreen .center-focus strong {
    font-size: 17px;
    line-height: 1.05;
  }

  #ziweiScreen .center-focus {
    gap: 3px;
    margin-top: 5px;
    padding-top: 5px;
  }

  #ziweiScreen .ziwei-palace-h5.is-active {
    z-index: 8;
    box-shadow: inset 0 0 0 3px #d62828, 0 0 0 3px rgba(255, 220, 91, .85), 0 7px 18px rgba(0, 0, 0, .34);
  }

  #ziweiScreen .ziwei-palace-h5.is-opposite {
    z-index: 5;
    box-shadow: inset 0 0 0 3px #0066cc, 0 0 0 2px rgba(0, 102, 204, .35);
  }

  #ziweiScreen .ziwei-palace-h5.is-surrounded {
    z-index: 4;
    box-shadow: inset 0 0 0 3px #39b54a, 0 0 0 2px rgba(57, 181, 74, .28);
  }

  .tool-row {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0 10px;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }
}

.mobile-debug-panel {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 9999;
  border: 1px solid rgba(255, 221, 139, .9);
  border-radius: 8px;
  background: rgba(5, 5, 5, .92);
  color: #fff4d6;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.mobile-debug-toggle {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid rgba(255, 221, 139, .35);
  color: #1b1107;
  background: #e5bf70;
  font-size: 13px;
  font-weight: 800;
}

.mobile-debug-output {
  max-height: 42vh;
  margin: 0;
  overflow: auto;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.45;
}

.mobile-debug-panel.is-collapsed {
  right: auto;
  width: 72px;
}

.mobile-debug-panel.is-collapsed .mobile-debug-output {
  display: none;
}

@media print {
  body {
    background: #0b0905;
  }

  .hero-screen,
  .input-panel,
  .tool-row {
    display: none;
  }

  .calculator-screen {
    padding: 0;
  }

  .workspace {
    display: block;
  }
}
