:root {
  --bg: #f7efe5;
  --paper: rgba(255, 250, 244, 0.8);
  --panel: rgba(255, 253, 249, 0.92);
  --line: rgba(67, 49, 36, 0.12);
  --text: #2e221b;
  --muted: #6f5f54;
  --accent: #d86b4b;
  --accent-deep: #8d3b2f;
  --teal: #255f5a;
  --gold: #e2b85d;
  --shadow: 0 20px 60px rgba(84, 50, 29, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 216, 170, 0.7), transparent 30%),
    linear-gradient(180deg, #fef6ec 0%, #f6ecdf 48%, #f0e5d8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(255, 243, 228, 0.84)),
    var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow,
.step-tag {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-deep);
}

.hero h1,
.panel h2,
.reading-output h3,
.tarot-card h3 {
  font-family: "HanziPen SC", "STKaiti", "KaiTi", cursive;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 78px);
  line-height: 0.95;
}

.hero-text {
  max-width: 560px;
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.8;
  color: var(--muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(37, 95, 90, 0.15);
  background: rgba(37, 95, 90, 0.08);
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

.hero-art {
  position: relative;
  min-height: 280px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 237, 175, 0.95), transparent 24%),
    linear-gradient(160deg, #1e4a48 0%, #295d59 40%, #c96f55 100%);
}

.moon {
  position: absolute;
  right: 28px;
  top: 24px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8d1, #f6cb70 80%);
  box-shadow: 0 0 24px rgba(255, 221, 149, 0.45);
}

.pet {
  position: absolute;
  bottom: 24px;
  width: 150px;
  height: 180px;
}

.pet .face {
  position: absolute;
  inset: 34px 0 0;
  border-radius: 46% 46% 42% 42%;
  background: #fff1dc;
  border: 3px solid rgba(46, 34, 27, 0.12);
}

.pet .face::before,
.pet .face::after {
  content: "";
  position: absolute;
  top: 54px;
  width: 14px;
  height: 18px;
  border-radius: 50%;
  background: #2e221b;
}

.pet .face::before {
  left: 42px;
}

.pet .face::after {
  right: 42px;
}

.pet .face {
  box-shadow: inset 0 -18px 0 rgba(255, 215, 162, 0.45);
}

.pet .face span {
  display: none;
}

.ear {
  position: absolute;
  top: 0;
  width: 54px;
  height: 82px;
  background: #fff1dc;
  border: 3px solid rgba(46, 34, 27, 0.12);
}

.pet-cat {
  left: 30px;
}

.pet-cat .ear-left {
  left: 12px;
  transform: rotate(-24deg);
  border-radius: 24px 6px 10px 10px;
}

.pet-cat .ear-right {
  right: 12px;
  transform: rotate(24deg);
  border-radius: 6px 24px 10px 10px;
}

.pet-dog {
  right: 30px;
}

.pet-dog .ear-left,
.pet-dog .ear-right {
  top: 18px;
  height: 92px;
  border-radius: 32px;
  background: #e6b081;
}

.pet-dog .ear-left {
  left: -6px;
  transform: rotate(18deg);
}

.pet-dog .ear-right {
  right: -6px;
  transform: rotate(-18deg);
}

.spark {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 62% 36%, 100% 50%, 62% 63%, 50% 100%, 38% 64%, 0% 50%, 38% 36%);
  opacity: 0.9;
}

.spark-one {
  left: 42%;
  top: 30%;
}

.spark-two {
  left: 56%;
  top: 18%;
}

.spark-three {
  left: 68%;
  top: 42%;
}

.content-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 24px;
  margin-top: 24px;
}

.panel {
  padding: 24px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-heading h2 {
  margin: 0;
  font-size: 34px;
}

.panel-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.uploader {
  margin-top: 20px;
}

.upload-box {
  display: block;
  position: relative;
  min-height: 280px;
  padding: 16px;
  border-radius: 26px;
  border: 2px dashed rgba(37, 95, 90, 0.2);
  background:
    radial-gradient(circle at top, rgba(255, 237, 198, 0.85), rgba(255, 255, 255, 0.9)),
    var(--paper);
  cursor: pointer;
  overflow: hidden;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#photoPreview {
  width: 100%;
  height: 248px;
  object-fit: cover;
  border-radius: 18px;
}

.upload-placeholder {
  min-height: 248px;
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.upload-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(216, 107, 75, 0.12);
  color: var(--accent);
  font-size: 36px;
  font-weight: 500;
}

.field {
  display: block;
  margin-top: 20px;
}

.field span {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(46, 34, 27, 0.12);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  color: var(--text);
  line-height: 1.8;
}

textarea:focus {
  outline: 2px solid rgba(216, 107, 75, 0.24);
  border-color: rgba(216, 107, 75, 0.3);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

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

.primary-button,
.ghost-button {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 18px;
  font-weight: 800;
}

.primary-button {
  flex: 1;
  color: #fff9f1;
  background: linear-gradient(135deg, #d86b4b, #8d3b2f);
  box-shadow: 0 14px 24px rgba(141, 59, 47, 0.22);
}

.ghost-button {
  color: var(--teal);
  background: rgba(37, 95, 90, 0.08);
}

.helper-text {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.reading-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 22px;
}

.pet-chip,
.question-card,
.reading-output,
.tarot-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.pet-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
}

.pet-chip-avatar {
  flex: none;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(226, 184, 93, 0.95), rgba(216, 107, 75, 0.95));
  color: #fffdf5;
  font-weight: 800;
  font-size: 28px;
  background-size: cover;
  background-position: center;
}

.pet-chip strong,
.question-card span {
  display: block;
}

.pet-chip p,
.question-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.question-card {
  padding: 16px;
  border-radius: 20px;
}

.question-card span {
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tarot-card {
  min-height: 260px;
  padding: 18px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(54, 39, 28, 0.08);
}

.tarot-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

.card-topline {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 249, 241, 0.86);
  text-transform: uppercase;
}

.card-icon {
  margin-top: 14px;
  font-size: 52px;
}

.tarot-card h3 {
  margin: 16px 0 10px;
  font-size: 28px;
  line-height: 1.1;
}

.card-orientation,
.card-keywords {
  margin: 8px 0 0;
  line-height: 1.7;
}

.placeholder-card {
  grid-column: 1 / -1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 95, 90, 0.92), rgba(216, 107, 75, 0.82));
  color: #fff9f2;
}

.reading-output {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
}

.empty-state p,
.reading-output p,
.reading-output li {
  color: var(--muted);
  line-height: 1.8;
}

.reading-summary {
  display: grid;
  gap: 18px;
}

.reading-block {
  padding: 16px;
  border-radius: 18px;
  background: rgba(248, 239, 229, 0.7);
}

.reading-block h3,
.reading-block h4 {
  margin: 0;
}

.reading-block h4 {
  font-size: 18px;
}

.reading-block p {
  margin: 8px 0 0;
}

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

.reading-block strong {
  color: var(--accent-deep);
}

@media (max-width: 980px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 240px;
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .panel-heading h2 {
    font-size: 28px;
  }

  .actions {
    flex-direction: column;
  }

  .pet {
    transform: scale(0.85);
    transform-origin: bottom;
  }
}
