:root {
  color-scheme: dark;
  font-family: "Songti SC", "Noto Serif SC", "SimSun", "Microsoft YaHei", serif;
  background: #000;
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: #050505;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 24rem),
    #050505;
}

.phone-frame {
  width: min(100vw, 430px);
  height: 100vh;
  height: 100dvh;
  max-height: 940px;
  min-height: 560px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: clamp(0px, 5vw, 42px);
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.screen {
  position: absolute;
  inset: 0;
  background: #000;
  animation: screenIn 360ms ease both;
}

.scroll-screen {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(18px, env(safe-area-inset-top)) 22px 120px;
  scrollbar-width: thin;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.splash-screen {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(38px, env(safe-area-inset-bottom));
}

.brand-mark {
  width: 118px;
  min-height: 218px;
  aspect-ratio: 0.54;
  grid-row: 2;
  display: grid;
  place-items: center;
  font-size: clamp(48px, 15vw, 58px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.16));
  animation: riseIn 900ms ease both;
}

.splash-line {
  grid-row: 3;
  align-self: end;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  animation: fadeIn 1200ms ease 300ms both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.top-bar {
  height: 58px;
  display: grid;
  grid-template-columns: 54px 1fr 94px;
  align-items: center;
  position: relative;
  z-index: 3;
}

.top-bar h1 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
}

.round-button,
.pill-icon,
.round-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(35, 35, 38, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.pill-icon {
  width: 56px;
}

.round-placeholder {
  visibility: hidden;
}

.home-screen {
  padding-bottom: 44px;
}

.compass-bg {
  --compass-size: min(420px, calc(100vw - 28px));
  position: absolute;
  top: 128px;
  left: 50%;
  width: var(--compass-size);
  height: var(--compass-size);
  transform: translateX(-50%);
  opacity: 0.26;
  pointer-events: none;
}

.compass-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  animation: compassTurn 120s linear infinite;
}

.compass-ring::before,
.compass-ring::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transform: rotate(45deg);
}

.compass-ring::after {
  inset: 38px;
  border-radius: 50%;
  transform: none;
}

.ring-2 {
  inset: 54px;
  animation-duration: 96s;
  animation-direction: reverse;
}

.ring-3 {
  inset: 112px;
  animation-duration: 72s;
}

.compass-ticks,
.compass-marks,
.compass-cross,
.brand-seal {
  position: absolute;
  inset: 0;
}

.compass-ticks {
  animation: compassTurn 180s linear infinite;
}

.compass-ticks i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 34px;
  transform: rotate(var(--angle)) translateY(calc(var(--compass-size) / -2 + 8px));
  transform-origin: 0 0;
  background: rgba(255, 255, 255, 0.42);
}

.compass-ticks i:nth-child(3n) {
  height: 48px;
  background: rgba(255, 255, 255, 0.7);
}

.compass-marks {
  animation: compassTurn 132s linear infinite reverse;
}

.compass-marks span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-family: serif;
  font-size: 22px;
  transform: rotate(var(--angle)) translateY(calc(var(--compass-size) / -2 + 58px)) rotate(calc(var(--angle) * -1)) translate(-50%, -50%);
  transform-origin: 0 0;
}

.compass-cross::before,
.compass-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--compass-size) - 128px);
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%);
}

.compass-cross::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.brand-seal {
  display: grid;
  place-items: center;
  animation: slowSpin 60s linear infinite;
}

.brand-seal::before {
  content: "";
  position: absolute;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  transform: rotate(45deg);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 0 34px rgba(255, 255, 255, 0.1);
}

.brand-seal b,
.brand-seal span {
  position: relative;
  z-index: 1;
  font-family: serif;
  color: #fff;
  text-align: center;
}

.brand-seal b {
  margin-top: -12px;
  font-size: 54px;
  line-height: 1;
}

.brand-seal span {
  margin-top: 64px;
  margin-left: -62px;
  font-size: 18px;
  letter-spacing: 0;
  writing-mode: vertical-rl;
}

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

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

.section-title {
  color: #8f8f96;
  margin: 28px 4px 12px;
  font-size: 17px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feature-card {
  min-height: 86px;
  padding: 16px;
  border-radius: 30px;
  background: rgba(28, 28, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  position: relative;
  z-index: 2;
}

.feature-card:active {
  transform: scale(0.985);
}

.feature-card.wide {
  width: 100%;
  min-height: 92px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 900;
}

.feature-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.feature-card small {
  display: block;
  color: #8f8f96;
  margin-top: 6px;
  font-size: 13px;
}

.temple-grid {
  padding-bottom: 32px;
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 8px 0 22px;
}

.date-strip button {
  background: transparent;
  display: grid;
  gap: 8px;
  justify-items: center;
  color: #8f8f96;
}

.date-strip strong {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 22px;
  color: #fff;
}

.date-strip .active strong {
  background: #fff;
  color: #000;
}

.date-strip small {
  height: 14px;
}

.report-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  border: 2px solid #fff;
  outline: 1px solid rgba(255, 255, 255, 0.48);
  outline-offset: -10px;
  padding: 34px 24px;
  background: #020202;
  animation: reportReveal 420ms ease both;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 0 38px rgba(255, 255, 255, 0.04);
}

.report-frame::before,
.report-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-color: #fff;
  border-style: solid;
}

.report-frame::before {
  inset: 12px;
  border-width: 0 1px;
}

.report-frame::after {
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: calc(100% - 48px);
  transform: translateX(-50%);
  border-width: 1px 0;
  opacity: 0.72;
}

@keyframes reportReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.state-card {
  min-height: 86px;
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(24, 24, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px 14px;
  align-items: center;
}

.state-card strong {
  font-size: 18px;
}

.state-card > span:not(.loader) {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.state-card small {
  color: #8f8f96;
  grid-column: 2;
}

.state-card.error {
  border-color: rgba(255, 55, 95, 0.42);
}

.state-actions {
  grid-column: 2;
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.state-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-weight: 800;
}

.state-actions button + button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.network-banner {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 18px;
  right: 18px;
  z-index: 18;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(24, 24, 26, 0.96);
  color: #e7e7ea;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.network-banner.offline {
  border-color: rgba(255, 55, 95, 0.42);
}

.loader {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: spin 900ms linear infinite;
  grid-row: span 2;
}

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

.report-head,
.score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.report-head h2,
.report-frame h2 {
  margin: 0 0 8px;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.report-head p,
.muted {
  color: #8f8f96;
}

.ganzhi {
  text-align: center;
  line-height: 1.7;
}

.score-layout {
  padding-top: 22px;
  align-items: center;
}

.big-score {
  font-size: 58px;
  font-weight: 900;
}

.big-score small {
  font-size: 18px;
  color: #8f8f96;
}

.bars {
  width: min(170px, 100%);
  display: grid;
  gap: 12px;
}

.score-bar {
  display: grid;
  gap: 8px;
}

.score-bar div {
  display: flex;
  justify-content: space-between;
}

.score-bar i {
  height: 5px;
  border-radius: 999px;
  background: #2a2a2d;
  overflow: hidden;
}

.score-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.plate-info {
  padding: 28px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  color: #ddd;
}

.plate-title {
  font-size: 28px;
  font-weight: 900;
  writing-mode: vertical-rl;
  justify-self: end;
  grid-row: span 2;
}

.qimen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  margin-bottom: 26px;
  position: relative;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255, 255, 255, 0.1) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(255, 255, 255, 0.1) 50%, transparent 50.5%),
    rgba(0, 0, 0, 0.28);
}

.qimen-cell {
  min-width: 0;
  min-height: clamp(72px, 22vw, 86px);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: grid;
  gap: 2px;
  place-items: center;
  align-content: center;
  font-size: 12px;
  color: #d8d8d8;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: keep-all;
  position: relative;
  isolation: isolate;
}

.qimen-cell strong {
  max-width: 100%;
  font-size: clamp(13px, 4vw, 15px);
  color: #fff;
  overflow-wrap: anywhere;
}

.qimen-cell.focus {
  box-shadow: inset 0 0 0 2px #fff;
}

.qimen-cell.focus::before,
.round-cell.focus::before,
.layer-grid span.focus::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  pointer-events: none;
  animation: platePulse 2.8s ease-in-out infinite;
}

.qimen-cell.risk,
.round-cell.risk,
.layer-grid span.risk {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.76));
}

.qimen-cell.lucky,
.round-cell.lucky,
.layer-grid span.lucky {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.72));
}

.plate-badges {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  gap: 3px;
  max-width: calc(100% - 8px);
  flex-wrap: wrap;
  justify-content: flex-end;
  font-style: normal;
  z-index: 2;
}

.plate-badges b {
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

@keyframes platePulse {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 1;
  }
}

.cell-palace {
  color: #777;
  font-size: 11px;
}

.qimen-cell span {
  max-width: 100%;
  line-height: 1.15;
}

.layered-plate {
  height: 390px;
  margin: 18px 0 34px;
  position: relative;
  perspective: 900px;
}

.layer-grid {
  position: absolute;
  left: 7%;
  right: 7%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(3, 3, 3, 0.72);
  transform: rotateX(58deg) rotateZ(-38deg);
  transform-style: preserve-3d;
  box-shadow: 0 18px 28px rgba(255, 255, 255, 0.04);
}

.layer-grid.sky {
  top: 0;
}

.layer-grid.door {
  top: 92px;
}

.layer-grid.earth {
  top: 184px;
}

.layer-grid b {
  position: absolute;
  top: -32px;
  left: 0;
  color: #fff;
  font-size: 14px;
  transform: rotateZ(38deg) rotateX(-58deg);
}

.layer-grid span {
  min-height: 64px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  gap: 3px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.layer-grid small,
.round-cell small {
  color: #8f8f96;
  font-size: 10px;
}

.layer-grid strong {
  font-size: 13px;
  transform: rotateZ(38deg) rotateX(-58deg);
}

.layer-grid span.focus {
  box-shadow: inset 0 0 0 2px #fff;
}

.qimen-round-plate {
  aspect-ratio: 1;
  width: min(100%, 346px);
  margin: 8px auto 30px;
  position: relative;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    conic-gradient(from 22.5deg, rgba(255, 255, 255, 0.08), transparent 12.5%, rgba(255, 255, 255, 0.06) 25%, transparent 37.5%, rgba(255, 255, 255, 0.06) 50%, transparent 62.5%, rgba(255, 255, 255, 0.06) 75%, transparent 87.5%, rgba(255, 255, 255, 0.08)),
    radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 58%),
    #020202;
  overflow: hidden;
}

.qimen-round-plate::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.12), transparent 38%);
  opacity: 0.42;
  animation: plateSweep 18s linear infinite;
}

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

.round-ring {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.round-ring.middle {
  inset: 26%;
}

.round-ring.inner {
  inset: 42%;
}

.round-cell {
  position: absolute;
  width: 27%;
  min-width: 0;
  min-height: 56px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.74);
  display: grid;
  place-items: center;
  text-align: center;
  overflow-wrap: anywhere;
  overflow: hidden;
  z-index: 2;
}

.round-cell strong {
  font-size: 16px;
}

.round-cell span {
  color: #d8d8de;
  font-size: 11px;
}

.round-cell.focus {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.round-cell.pos-0 {
  top: 14%;
  left: 14%;
}

.round-cell.pos-1 {
  top: 5%;
  left: 36.5%;
}

.round-cell.pos-2 {
  top: 14%;
  right: 14%;
}

.round-cell.pos-3 {
  top: 36.5%;
  left: 5%;
}

.round-cell.pos-4 {
  top: 36.5%;
  left: 36.5%;
}

.round-cell.pos-5 {
  top: 36.5%;
  right: 5%;
}

.round-cell.pos-6 {
  bottom: 14%;
  left: 14%;
}

.round-cell.pos-7 {
  bottom: 5%;
  left: 36.5%;
}

.round-cell.pos-8 {
  right: 14%;
  bottom: 14%;
}

.report-section {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 24px 0 0;
}

.report-section h3 {
  color: #8f8f96;
  margin: 0 0 12px;
  font-size: 17px;
}

.report-section p,
.report-section li {
  font-size: 19px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.report-section ul {
  padding-left: 22px;
}

.advice {
  font-weight: 800;
}

.floating-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 24px 0 0;
  z-index: 4;
}

.floating-actions button {
  height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(35, 35, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 18px;
}

.hero-title {
  text-align: center;
  margin: 34px 0 28px;
}

.hero-title h2,
.temple-hero h2 {
  margin: 0;
  font-size: 44px;
}

.hero-title p,
.temple-hero p {
  color: #8f8f96;
  font-size: 17px;
  line-height: 1.7;
}

.question-box {
  height: 220px;
  border-radius: 22px;
  background: rgba(22, 22, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.question-box textarea {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 24px;
  font-size: 18px;
}

.question-box textarea::placeholder {
  color: #55565d;
}

.settings-mini,
.start-button {
  position: absolute;
  bottom: 18px;
  height: 44px;
  border-radius: 999px;
  background: rgba(55, 55, 58, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-mini {
  left: 18px;
  width: 44px;
}

.start-button {
  right: 18px;
  padding: 0 18px;
  color: #cfcfd4;
}

.start-button:disabled {
  color: #666870;
  cursor: not-allowed;
  opacity: 0.58;
}

.date-range-card,
.prompt-list button,
.history-list {
  background: rgba(24, 24, 26, 0.95);
  border-radius: 22px;
}

.date-range-card {
  margin: 36px 0;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.date-range-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 20px;
}

.date-range-card input {
  color: #fff;
  font: inherit;
  border-radius: 999px;
  border: 0;
  background: #303034;
  padding: 8px 16px;
  color-scheme: dark;
}

.prompt-list {
  margin-top: 28px;
}

.prompt-list h3 {
  color: #8f8f96;
  font-size: 17px;
}

.prompt-list button {
  width: 100%;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: #cacad0;
  font-size: 18px;
}

.result-summary {
  font-size: 22px;
  line-height: 1.6;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 28px 0;
}

.month-grid span.week {
  color: #777;
  text-align: center;
}

.month-grid .empty {
  min-height: 54px;
}

.month-grid button {
  height: 54px;
  background: transparent;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #35353a;
  font-size: 18px;
}

.month-grid .recommended {
  color: #fff;
  font-weight: 800;
}

.month-grid .selected {
  background: #fff;
  color: #000;
}

.month-grid small {
  font-size: 10px;
}

.reason-sheet {
  margin: 18px -12px 0;
  padding: 28px;
  border-radius: 30px 30px 0 0;
  background: rgba(30, 30, 32, 0.94);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 3;
}

.reason-sheet div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reason-sheet h3,
.reason-sheet h4 {
  margin: 0 0 16px;
  font-size: 22px;
}

.reason-sheet button {
  background: transparent;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.reason-sheet p {
  color: #babac0;
  font-size: 17px;
  line-height: 1.8;
}

.temple-hero {
  text-align: center;
  margin: 36px 0;
}

.deity-icon,
.mini-deity {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #000;
  font-size: 36px;
  font-weight: 900;
}

.deity-art {
  width: 172px;
  height: 172px;
  margin: 0 auto 20px;
  display: block;
  color: #fff;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.08));
}

.deity-art circle,
.deity-art path {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deity-art path.fine {
  stroke-width: 2.4;
  opacity: 0.78;
}

.deity-art text {
  fill: currentColor;
  font-size: 20px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

.deity-art.compact {
  width: 48px;
  height: 48px;
  margin: 0;
}

.deity-art.compact circle,
.deity-art.compact path {
  stroke-width: 6;
}

.deity-art.compact text {
  display: none;
}

.temple-report-head {
  display: grid;
  grid-template-columns: 42px 48px 1fr 48px 42px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding-bottom: 16px;
}

.temple-report-head h2 {
  text-align: center;
  font-size: 40px;
}

.temple-report-head span {
  text-align: center;
  color: #ddd;
  line-height: 1.5;
}

.mini-deity {
  width: 48px;
  height: 48px;
  margin: 0;
  font-size: 24px;
}

.summary-box {
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.summary-box span {
  color: #8f8f96;
}

.summary-box p {
  font-size: 22px;
  line-height: 1.8;
  font-weight: 800;
}

.illustration-panel {
  position: relative;
  overflow: hidden;
  height: 360px;
  margin: 28px 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  padding: 26px 14px;
  background:
    radial-gradient(circle at 32% 48%, rgba(255, 255, 255, 0.12), transparent 10rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent),
    #050505;
}

.illustration-panel::before,
.illustration-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transform: rotate(45deg);
}

.illustration-panel::before {
  width: 210px;
  height: 210px;
  left: -70px;
  top: 74px;
}

.illustration-panel::after {
  width: 160px;
  height: 160px;
  right: -62px;
  bottom: 44px;
  opacity: 0.54;
}

.panel-deity {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.panel-deity .deity-art {
  width: min(178px, 46vw);
  height: min(178px, 46vw);
  margin: 0;
  opacity: 0.92;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.1));
}

.illustration-panel > div:last-child {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.illustration-panel strong {
  font-size: 38px;
  line-height: 1.05;
  writing-mode: vertical-rl;
}

.illustration-panel span {
  color: #ddd;
}

.history-screen {
  padding-top: 64px;
}

.history-actions {
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
}

.history-actions button {
  height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  background: #1d1d20;
  font-size: 17px;
}

.history-actions .danger {
  color: #ff375f;
}

.history-screen h2 {
  font-size: 40px;
  margin: 36px 0 18px;
}

.history-search {
  width: 100%;
  height: 48px;
  margin: 0 0 16px;
  padding: 0 18px;
  border-radius: 999px;
  background: #1d1d20;
  color: #fff;
  font: inherit;
}

.history-list {
  overflow: hidden;
}

.history-entry {
  display: grid;
  grid-template-columns: 1fr 44px 54px;
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-list .history-open {
  width: 100%;
  min-height: 88px;
  padding: 14px 20px;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 4px 12px;
  text-align: left;
}

.history-favorite {
  align-self: center;
  width: 38px;
  height: 38px;
  color: #8f8f96;
  background: transparent;
  font-size: 24px;
}

.history-favorite.active {
  color: #ffd60a;
}

.history-delete {
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #ff375f;
  background: rgba(255, 55, 95, 0.1);
  font-size: 16px;
}

.history-list span,
.history-list small {
  color: #8f8f96;
}

.history-list strong {
  font-size: 18px;
}

.history-list svg {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
}

.empty-state {
  margin-top: 80px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: #8f8f96;
  text-align: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.config-sheet {
  width: 100%;
  min-height: 74%;
  max-height: 92%;
  overflow-y: auto;
  padding: 22px;
  border-radius: 34px 34px 0 0;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: sheetIn 260ms ease both;
}

@keyframes sheetIn {
  from {
    transform: translateY(28px);
    opacity: 0;
  }
}

.config-sheet header {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  margin-bottom: 28px;
}

.config-sheet header h2 {
  margin: 0;
  text-align: center;
  font-size: 20px;
}

.config-sheet header button {
  border-radius: 999px;
  background: #2b2b2e;
  height: 42px;
}

.config-sheet h3 {
  color: #8f8f96;
  margin: 22px 0 12px;
}

.setting-card {
  overflow: hidden;
  border-radius: 24px;
  background: #2a2a2d;
}

.setting-row {
  width: 100%;
  min-height: 62px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 72px 26px;
  gap: 12px;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 20px;
}

.dimension-row {
  grid-template-columns: 1fr auto;
}

.dimension-row > button {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: transparent;
  color: inherit;
  font: inherit;
}

.dimension-row > div {
  display: flex;
  gap: 6px;
}

.dimension-row > div button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
}

.dimension-row > div button:active {
  background: #fff;
  color: #000;
}

.setting-row i {
  width: 58px;
  height: 34px;
  padding: 3px;
  border-radius: 999px;
  background: #5a5a61;
  transition: background 180ms ease;
}

.setting-row i b {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease;
}

.setting-row i.on {
  background: #30d158;
}

.setting-row i.on b {
  transform: translateX(24px);
}

.setting-row em {
  color: #8f8f96;
  font-style: normal;
}

.config-note {
  color: #8f8f96;
  line-height: 1.7;
}

.plate-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.plate-options button {
  min-height: 48px;
  border-radius: 16px;
  background: #2a2a2d;
  color: #d6d6dc;
}

.plate-options button.active {
  background: #fff;
  color: #000;
  font-weight: 800;
}

.ai-report {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.ai-report span {
  color: #8f8f96;
}

.ai-report h3 {
  margin: 8px 0 14px;
  font-size: 22px;
}

.ai-report ul {
  padding-left: 20px;
}

.ai-report li,
.ai-report p {
  line-height: 1.8;
  font-size: 17px;
}

.ai-report p {
  color: #8f8f96;
}

.structured-report {
  margin: 0 0 26px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
    #050505;
}

.compact-report {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.compact-report header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: end;
}

.compact-report header span {
  color: #8f8f96;
}

.compact-report h3 {
  margin: 0;
  font-size: 24px;
}

.compact-report header strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 38px;
}

.compact-report header small {
  font-size: 16px;
}

.compact-report p,
.compact-report li,
.compact-report small {
  line-height: 1.8;
}

.compact-report div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.compact-report div span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d6d6dc;
}

.compact-report ol {
  padding-left: 22px;
}

.compact-report small {
  color: #8f8f96;
}

.structured-report header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 16px;
}

.structured-report header span {
  color: #8f8f96;
}

.structured-report h3 {
  margin: 0;
  font-size: 24px;
}

.structured-report header strong {
  grid-row: 1 / 3;
  grid-column: 2;
  font-size: 44px;
}

.structured-report header small {
  color: #8f8f96;
  font-size: 16px;
}

.direct-answer {
  margin: 18px 0;
  font-size: 20px;
  line-height: 1.85;
  font-weight: 800;
}

.report-summary-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.report-summary-lines span {
  padding: 10px 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.05);
  color: #d8d8de;
  line-height: 1.6;
}

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

.detail-grid article {
  min-height: 132px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.detail-grid h4 {
  margin: 0 0 8px;
  font-size: 17px;
}

.detail-grid p {
  margin: 0;
  color: #d8d8de;
  line-height: 1.75;
  font-size: 15px;
}

.evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-list article,
.action-list {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.evidence-list em {
  color: #8f8f96;
  font-style: normal;
}

.evidence-list h4,
.action-list h4 {
  margin: 8px 0;
  font-size: 19px;
}

.evidence-list p,
.action-list li {
  color: #d8d8de;
  line-height: 1.8;
  font-size: 17px;
}

.action-list {
  margin-top: 12px;
}

.action-list ol {
  padding-left: 22px;
}

.safety-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.035);
}

.safety-note h4 {
  margin: 0 0 6px;
  color: #d8d8de;
  font-size: 16px;
}

.safety-note p {
  margin: 0;
  color: #8f8f96;
  line-height: 1.7;
  font-size: 15px;
}

.share-sheet {
  width: 100%;
  min-height: 72%;
  padding: 22px;
  border-radius: 34px 34px 0 0;
  background: #101012;
  animation: sheetIn 260ms ease both;
}

.share-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.share-sheet h2 {
  margin: 0;
  font-size: 22px;
}

.share-sheet header button,
.share-actions button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  background: #2b2b2e;
}

.share-card {
  min-height: 430px;
  padding: 28px;
  border: 2px solid #fff;
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: -10px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 18px;
  background: #000;
  text-align: center;
}

.share-card::before,
.share-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.share-card::before {
  width: 340px;
  height: 340px;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.035),
    0 0 0 84px rgba(255, 255, 255, 0.025),
    0 0 0 126px rgba(255, 255, 255, 0.018);
}

.share-card::after {
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.share-ornament {
  position: absolute;
  inset: 42px;
  pointer-events: none;
}

.share-ornament::before,
.share-ornament::after {
  content: "";
  position: absolute;
  width: 52px;
  height: 52px;
  border-color: rgba(255, 255, 255, 0.72);
  border-style: solid;
}

.share-ornament::before {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.share-ornament::after {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}

.share-brand,
.share-type,
.share-card h3,
.share-card strong,
.share-card p,
.share-tags,
.share-qr {
  position: relative;
  z-index: 1;
}

.share-brand {
  font-size: 30px;
  font-weight: 900;
}

.share-type {
  width: max-content;
  margin: 0 auto;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  color: #d8d8de;
  font-size: 13px;
  font-weight: 800;
}

.share-card h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.share-card strong {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.share-card p {
  margin: 0;
  color: #d8d8de;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.share-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.share-tags span {
  min-width: 54px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #eeeeef;
  font-size: 13px;
  font-weight: 800;
}

.share-qr {
  width: min(168px, 50vw);
  margin: 0 auto;
  display: grid;
  gap: 8px;
  place-items: center;
}

.share-qr img {
  width: 132px;
  height: 132px;
  padding: 8px;
  background: #fff;
  display: block;
}

.share-qr span {
  color: #d8d8de;
  font-size: 13px;
}

.share-card small {
  color: #8f8f96;
  line-height: 1.6;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.share-actions button:first-child {
  background: #fff;
  color: #000;
  font-weight: 800;
}

.share-actions button {
  flex: 1 1 auto;
}

@media (max-width: 380px) {
  .scroll-screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  .phone-frame {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .brand-mark {
    width: 104px;
    min-height: 194px;
    font-size: 48px;
  }

  .splash-line {
    font-size: 14px;
  }

  .feature-card strong {
    font-size: 17px;
  }

  .report-frame {
    padding: 28px 18px;
    outline-offset: -8px;
  }

  .report-frame::before {
    inset: 10px;
  }

  .report-frame::after {
    top: 10px;
    bottom: 10px;
    width: calc(100% - 38px);
  }

  .report-head,
  .score-layout {
    grid-template-columns: 1fr;
  }

  .ganzhi {
    text-align: left;
  }

  .big-score {
    font-size: 50px;
  }

  .bars {
    width: 100%;
  }

  .plate-info {
    grid-template-columns: 1fr;
  }

  .plate-title {
    writing-mode: horizontal-tb;
    justify-self: start;
    grid-row: auto;
  }

  .qimen-cell {
    min-height: 70px;
    padding: 5px 3px;
    font-size: 11px;
  }

  .qimen-cell strong {
    font-size: 13px;
  }

  .layered-plate {
    height: 330px;
  }

  .layer-grid.door {
    top: 78px;
  }

  .layer-grid.earth {
    top: 156px;
  }

  .round-cell {
    min-height: 48px;
    padding: 4px;
  }

  .round-cell strong {
    font-size: 14px;
  }

  .floating-actions {
    justify-content: stretch;
  }

  .floating-actions button {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 10px;
    font-size: 16px;
  }

  .share-sheet {
    padding: 18px 16px;
  }

  .share-card {
    min-height: 400px;
    padding: 24px 18px;
    gap: 14px;
  }

  .share-card h3 {
    font-size: 24px;
  }

  .share-card strong {
    font-size: 20px;
  }

  .share-card p {
    font-size: 15px;
  }

  .report-section p,
  .report-section li {
    font-size: 17px;
  }
}

.phone-frame.reduce-motion *,
.phone-frame.reduce-motion *::before,
.phone-frame.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

.phone-frame.reduce-motion .screen,
.phone-frame.reduce-motion .report-frame,
.phone-frame.reduce-motion .compass-ring,
.phone-frame.reduce-motion .compass-ticks,
.phone-frame.reduce-motion .compass-marks,
.phone-frame.reduce-motion .brand-seal {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .screen,
  .report-frame,
  .compass-ring,
  .compass-ticks,
  .compass-marks,
  .brand-seal {
    animation: none !important;
  }
}
