:root {
  --ink: #2f2416;
  --deep: #4d3922;
  --muted: #8c7655;
  --paper: #fff8ec;
  --card: #fffdf7;
  --gold-soft: #fff2d9;
  --gold: #d78719;
  --gold-bright: #e6a339;
  --gold-dark: #a96308;
  --line: #ecd7b7;
  --shadow: rgba(124, 77, 14, 0.18);
  --vermilion: #b7432d;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(230, 163, 57, 0.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(215, 135, 25, 0.12), transparent 30rem),
    #f7ecdc;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 248, 236, 0.98)),
    var(--paper);
  box-shadow: 0 24px 80px rgba(91, 55, 9, 0.22);
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 18px 18px 94px;
}

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

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

.brand-hero {
  position: relative;
  padding: 20px 0 12px;
  text-align: center;
}

.brand-hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--deep);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-dark);
  font-size: 13px;
}

.cloud {
  position: absolute;
  width: 74px;
  height: 28px;
  border: 1px solid rgba(215, 135, 25, 0.38);
  border-left: 0;
  border-right: 0;
  opacity: 0.75;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(215, 135, 25, 0.38);
  border-radius: 999px;
}

.cloud::before {
  width: 24px;
  height: 15px;
  left: 10px;
  top: -5px;
}

.cloud::after {
  width: 34px;
  height: 19px;
  right: 8px;
  top: 10px;
}

.cloud-left {
  left: -18px;
  top: 12px;
}

.cloud-right {
  right: -18px;
  top: 18px;
}

.trust-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--deep);
  font-size: 12px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.mini-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-dark);
  font-size: 8px;
  text-transform: uppercase;
}

.landscape-card {
  position: relative;
  height: 155px;
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid rgba(236, 215, 183, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 242, 217, 0.88)),
    linear-gradient(135deg, rgba(230, 163, 57, 0.12), transparent 50%);
}

.landscape-card::before,
.landscape-card::after {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: 0;
  height: 70px;
  background: rgba(150, 111, 62, 0.12);
  clip-path: polygon(0 80%, 12% 42%, 24% 68%, 36% 28%, 52% 78%, 66% 34%, 80% 68%, 100% 28%, 100% 100%, 0 100%);
}

.landscape-card::after {
  bottom: 28px;
  height: 78px;
  opacity: 0.7;
  background: rgba(120, 104, 75, 0.12);
  transform: scaleX(1.05);
}

.sun {
  position: absolute;
  right: 70px;
  top: 42px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f2d19a, #d78719);
  opacity: 0.55;
}

.tower {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 30px;
  height: 56px;
  transform: translateX(-50%);
  border-bottom: 20px solid rgba(95, 62, 30, 0.48);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
}

.tower::before,
.tower::after {
  content: "";
  position: absolute;
  left: -18px;
  width: 36px;
  border-top: 5px solid rgba(95, 62, 30, 0.48);
}

.tower::before {
  top: 10px;
}

.tower::after {
  top: 24px;
}

.consult-card,
.progress-card,
.tip-card,
.conclusion-card,
.report-block,
.module-hero,
.birth-form,
.palm-form,
.phone-form,
.home-feng-form,
.palm-service-hint,
.service-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 12px 34px var(--shadow);
}

.consult-card {
  padding: 18px;
}

.consult-card h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.consult-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.input-row input,
.composer input,
.birth-form input,
.birth-form select,
.palm-form textarea,
.phone-form input,
.phone-form select,
.phone-form textarea,
.home-feng-form input,
.home-feng-form select,
.home-feng-form textarea {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button,
.composer button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: white;
  font-size: 11px;
  box-shadow: 0 7px 18px rgba(215, 135, 25, 0.34);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.quick-grid button {
  min-height: 54px;
  border: 1px solid rgba(215, 135, 25, 0.35);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--gold-dark);
  font-size: 12px;
}

.primary-button,
.outline-button {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  border: 0;
  background: linear-gradient(180deg, #eca83c, #c8710b);
  color: white;
  box-shadow: 0 12px 24px rgba(199, 113, 11, 0.28);
}

.outline-button {
  border: 1px solid var(--gold);
  background: white;
  color: var(--gold-dark);
}

.micro-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-bottom: 16px;
}

.page-header.compact {
  margin-bottom: 12px;
}

.page-header.centered {
  display: block;
  text-align: center;
  margin-top: 42px;
}

.page-header h2 {
  margin: 0;
  font-size: 20px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

.page-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.back-button,
.share-button,
.small-ghost {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.back-button {
  width: 34px;
  height: 34px;
  font-size: 28px;
  line-height: 1;
}

.small-ghost {
  margin-left: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-dark);
  font-size: 12px;
}

.service-list {
  display: grid;
  gap: 11px;
}

.service-card {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
}

.service-card.is-selected {
  background: var(--gold-soft);
  border-color: rgba(215, 135, 25, 0.45);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 135, 25, 0.55);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 800;
}

.service-card strong,
.service-card small {
  display: block;
}

.service-card strong {
  margin-bottom: 4px;
}

.service-card small {
  color: var(--muted);
}

.service-card em {
  display: none;
  color: var(--gold);
  font-style: normal;
  font-weight: 800;
}

.service-card.is-selected em {
  display: block;
}

.dock-button {
  margin-top: 18px;
}

.palm-service-hint {
  margin-top: 14px;
  padding: 14px;
  background: #fff7e9;
}

.palm-service-hint[hidden] {
  display: none;
}

.palm-service-hint strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-dark);
  font-size: 14px;
}

.palm-service-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.module-hero {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(230, 163, 57, 0.18), transparent 9rem),
    linear-gradient(135deg, rgba(255, 242, 217, 0.96), rgba(255, 253, 247, 0.92));
}

.module-logo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(215, 135, 25, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.82), transparent 1.4rem),
    linear-gradient(160deg, #f6d79c, var(--gold));
  color: white;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(199, 113, 11, 0.28);
}

.module-copy {
  min-width: 0;
}

.module-kicker {
  margin: 0 0 3px;
  color: var(--gold-dark);
  font-size: 11px;
}

.module-copy h3 {
  margin: 0;
  color: var(--deep);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 22px;
  line-height: 1.18;
}

.module-copy p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.module-guide {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(236, 215, 183, 0.78);
}

.module-guide strong {
  color: var(--gold-dark);
  font-size: 12px;
}

.prompt-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.prompt-chips::-webkit-scrollbar {
  display: none;
}

.prompt-chips button {
  flex: 0 0 auto;
  max-width: 260px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(215, 135, 25, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--deep);
  font-size: 12px;
  white-space: nowrap;
}

.palm-module-hero {
  margin-bottom: 14px;
}

.progress-card {
  padding: 12px;
  margin-bottom: 14px;
}

.progress-card span {
  display: block;
  font-size: 12px;
  color: var(--gold-dark);
}

.progress-track {
  height: 7px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #f2dfc2;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.progress-card small {
  color: var(--muted);
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 88px;
}

.message {
  position: relative;
  display: grid;
  gap: 4px;
  max-width: 86%;
}

.message p {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.58;
}

.message time {
  color: var(--muted);
  font-size: 10px;
}

.message.bot {
  grid-template-columns: 28px 1fr;
}

.message.bot p {
  grid-column: 2;
  border: 1px solid var(--line);
  background: white;
}

.message.bot time {
  grid-column: 2;
}

.message.user {
  align-self: flex-end;
}

.message.user p {
  background: #fce9c8;
}

.message.user time {
  text-align: right;
}

.avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 800;
}

.composer {
  position: fixed;
  left: 50%;
  bottom: 74px;
  z-index: 6;
  display: flex;
  gap: 8px;
  width: min(calc(100vw - 36px), 394px);
  padding: 7px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 12px 28px var(--shadow);
}

.birth-form,
.palm-form,
.phone-form,
.home-feng-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 12px;
}

.birth-form label,
.birth-form fieldset,
.palm-form label,
.palm-form fieldset,
.phone-form label,
.phone-form fieldset,
.home-feng-form label,
.home-feng-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.birth-form span,
.birth-form legend,
.palm-form span,
.palm-form legend,
.phone-form span,
.phone-form legend,
.home-feng-form span,
.home-feng-form legend {
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
}

.birth-form input,
.birth-form select,
.palm-form textarea,
.phone-form input,
.phone-form select,
.phone-form textarea,
.home-feng-form input,
.home-feng-form select,
.home-feng-form textarea {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.palm-form textarea,
.phone-form textarea,
.home-feng-form textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

.palm-uploader,
.home-uploader {
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1px dashed rgba(215, 135, 25, 0.55);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(230, 163, 57, 0.12), transparent 10rem),
    #fffaf2;
}

.palm-empty,
.home-empty {
  padding: 22px;
  text-align: center;
}

.palm-empty strong,
.home-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--gold-dark);
}

.palm-empty p,
.home-empty p {
  max-width: 270px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.palm-uploader img,
.home-uploader img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: white;
}

.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upload-status,
.form-status {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.upload-status.is-error,
.form-status.is-error {
  color: var(--vermilion);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented label:has(input:checked) {
  border-color: rgba(215, 135, 25, 0.65);
  background: #fde8bf;
  color: var(--gold-dark);
}

.fineprint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.compass {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 42px auto 24px;
}

.ring {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(215, 135, 25, 0.25);
  border-radius: 50%;
}

.ring-one {
  animation: spin 18s linear infinite;
  background:
    conic-gradient(from 0deg, transparent 0 12deg, rgba(215, 135, 25, 0.55) 12deg 14deg, transparent 14deg 36deg);
}

.ring-two {
  inset: 56px;
  animation: spinReverse 14s linear infinite;
  border-style: dashed;
}

.yin-yang {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #fff9ec;
  color: var(--gold);
  font-size: 38px;
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px var(--shadow);
}

.element {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: white;
  color: var(--gold);
  font-family: "Songti SC", serif;
  font-weight: 800;
  box-shadow: 0 0 0 1px var(--line);
}

.fire {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.wood {
  left: 24px;
  top: 66px;
}

.earth {
  right: 24px;
  top: 66px;
}

.metal {
  right: 56px;
  bottom: 20px;
}

.water {
  left: 56px;
  bottom: 20px;
}

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

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

.wait-copy {
  text-align: center;
  color: var(--muted);
}

.stepper,
.step-labels {
  display: grid;
  grid-template-columns: 32px 1fr 32px 1fr 32px 1fr 32px;
  align-items: center;
  gap: 8px;
}

.stepper {
  margin-top: 26px;
}

.stepper span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
}

.stepper .done,
.stepper .active {
  border-color: var(--gold);
  background: var(--gold);
  color: white;
}

.stepper i {
  height: 2px;
  background: var(--line);
}

.step-labels {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.step-labels small {
  text-align: center;
}

.tip-card {
  margin-top: 24px;
  padding: 14px;
  background: #fff7e9;
}

.tip-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.conclusion-card {
  position: relative;
  padding: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 242, 217, 0.95), rgba(255, 253, 247, 0.88)),
    white;
}

.conclusion-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -18px;
  width: 150px;
  height: 84px;
  border-top: 1px solid rgba(215, 135, 25, 0.28);
  border-radius: 50%;
}

.conclusion-card h3,
.report-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.conclusion-card p {
  margin: 0;
  color: var(--deep);
  font-size: 14px;
  line-height: 1.65;
}

.conclusion-card strong {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold-dark);
  font-size: 13px;
}

.report-block {
  margin-top: 14px;
  padding: 14px;
}

.block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.block-title h3 {
  margin: 0;
}

.block-title button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.focus-grid article {
  min-height: 70px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: center;
}

.focus-grid b,
.focus-grid span {
  display: block;
}

.focus-grid b {
  margin-bottom: 6px;
  color: var(--gold-dark);
  font-size: 12px;
}

.focus-grid span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.fortune-list {
  display: grid;
  gap: 10px;
}

.fortune-list p {
  display: grid;
  grid-template-columns: 44px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--deep);
  font-size: 13px;
}

.fortune-list span {
  color: var(--gold-dark);
  font-weight: 800;
}

.fortune-list strong {
  font-weight: 500;
}

.fortune-list em {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.raw-report p {
  max-height: min(52vh, 460px);
  margin: 0;
  overflow: auto;
  color: var(--deep);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100vw, 430px);
  min-height: 66px;
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(14px);
}

.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.tabbar span {
  display: block;
  margin-bottom: 2px;
  font-size: 19px;
}

.tabbar button.is-active {
  color: var(--gold);
  font-weight: 800;
}

@media (min-width: 700px) {
  body {
    padding: 28px 0;
  }

  .app-shell {
    min-height: calc(100vh - 56px);
    border: 1px solid rgba(236, 215, 183, 0.9);
    border-radius: 28px;
  }

  .screen {
    min-height: calc(100vh - 56px);
  }

  .composer,
  .tabbar {
    position: absolute;
  }
}
