* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "DFKai-SB", "標楷體", "華康少女文字W7", "Microsoft JhengHei", sans-serif;
  color: #5c447d;
  line-height: 1.6;
  background:
    radial-gradient(circle at top, rgba(255, 230, 247, 0.95), transparent 34%),
    radial-gradient(circle at bottom right, rgba(214, 233, 255, 0.8), transparent 26%),
    linear-gradient(180deg, #fff7fd 0%, #f9f1ff 55%, #f4edff 100%);
}

.頁面 {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 18px;
}

.卡片 {
  width: 100%;
  max-width: 820px;
  padding: 36px 38px 32px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(224, 204, 255, 0.95);
  box-shadow:
    0 24px 50px rgba(142, 104, 187, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.標題列 {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.幸運圖示 {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-size: 1.75rem;
  color: #ff7db8;
  background: linear-gradient(135deg, #ffe4f2, #f4ddff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 125, 184, 0.12),
    0 10px 18px rgba(255, 165, 205, 0.2);
}

h1 {
  margin: 0 0 8px;
  font-size: 2.15rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.說明 {
  margin: 0;
  color: #7a6497;
}

label {
  display: block;
  margin: 18px 0 10px;
  font-size: 1.03rem;
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  min-height: 68px;
  padding: 0 20px;
  border-radius: 20px;
  border: 1px solid #e0cff8;
  font-size: 1.05rem;
  color: #5c447d;
  background: #fff;
}

input {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input::placeholder {
  color: #b199c4;
}

select {
  appearance: none;
  padding-right: 48px;
  background-image:
    linear-gradient(45deg, transparent 50%, #a779ea 50%),
    linear-gradient(135deg, #a779ea 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  outline: 3px solid rgba(192, 155, 255, 0.35);
  border-color: #caa7ff;
}

.選擇區 {
  margin-top: 8px;
}

button {
  margin-top: 18px;
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #c89bff, #a777ff 55%, #9d6bf5);
  box-shadow:
    0 14px 22px rgba(145, 101, 219, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 24px rgba(145, 101, 219, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

button:active {
  transform: scale(0.98);
}

.按下動畫 {
  animation: 按鈕彈一下 0.22s ease;
}

.次要按鈕 {
  background: linear-gradient(135deg, #fff1fb, #f2e6ff);
  color: #875fc0;
  border: 1px solid #e0cff8;
  box-shadow: none;
}

.次要按鈕:hover {
  background: linear-gradient(135deg, #ffeaf8, #eadcff);
}

.結果區 {
  margin-top: 22px;
  padding: 22px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 248, 253, 0.95), rgba(247, 240, 255, 0.98));
  border: 1px solid #e3d1fb;
  min-height: 116px;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
}

.結果區::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(146, 98, 195, 0.035) 0,
      rgba(146, 98, 195, 0.035) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%);
  opacity: 0.8;
}

.結果卡 {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: 20px;
  animation: 淡入上升 0.5s ease;
  font-family: "DFKai-SB", "標楷體", "華康少女文字W7", "Microsoft JhengHei", sans-serif;
}

.分析卡 {
  background: linear-gradient(180deg, rgba(255, 246, 253, 0.98), rgba(248, 236, 255, 0.98));
  border: 1px solid rgba(232, 204, 247, 0.95);
}

.療癒卡 {
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(235, 243, 255, 0.98));
  border: 1px solid rgba(205, 224, 250, 0.95);
}

.小卡圖標題 {
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: #b490cf;
  letter-spacing: 0.08em;
  text-align: center;
}

.小卡圖包 {
  position: relative;
  padding: 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px dashed rgba(190, 160, 231, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.裝飾 {
  position: absolute;
  top: 10px;
  z-index: 2;
  font-size: 1.2rem;
  color: rgba(255, 132, 176, 0.9);
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.7);
  animation: 浮動 3.2s ease-in-out infinite;
}

.裝飾左 {
  left: 10px;
}

.裝飾右 {
  right: 12px;
  color: rgba(159, 122, 255, 0.85);
  animation-delay: 1.1s;
}

.小卡圖 {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 255, 0.98), rgba(248, 242, 255, 0.96));
  border: 1px solid rgba(227, 209, 251, 0.9);
  box-shadow:
    0 12px 26px rgba(142, 104, 187, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  transform: rotate(-1.2deg);
}

.分析卡 .小卡圖 {
  box-shadow:
    0 12px 26px rgba(142, 104, 187, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(255, 214, 236, 0.18);
}

.療癒卡 .小卡圖 {
  box-shadow:
    0 12px 26px rgba(142, 104, 187, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(225, 240, 255, 0.18);
}

.小卡圖::before,
.小卡圖::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 208, 245, 0.95);
  top: -9px;
  box-shadow: 0 2px 6px rgba(142, 104, 187, 0.08);
}

.小卡圖::before {
  left: 18px;
}

.小卡圖::after {
  right: 18px;
  box-shadow:
    0 2px 6px rgba(142, 104, 187, 0.08),
    0 0 0 6px rgba(255, 255, 255, 0.18);
}

.療癒卡 .小卡圖::before,
.療癒卡 .小卡圖::after {
  background: rgba(245, 249, 255, 0.96);
  border-color: rgba(205, 224, 250, 0.95);
}

.小卡圖 img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  filter: saturate(0.98) contrast(0.98);
  animation: 圖片浮動 4.5s ease-in-out infinite;
  transform-origin: center center;
}

.小角標 {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 8px 14px;
  border-radius: 999px 999px 999px 12px;
  background: linear-gradient(135deg, rgba(255, 214, 236, 0.98), rgba(239, 224, 255, 0.98));
  color: #8e5fbf;
  border: 1px solid rgba(223, 208, 245, 0.9);
  box-shadow: 0 8px 16px rgba(142, 104, 187, 0.10);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  transform: rotate(-2deg);
}

.小角標::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-left: 1px solid rgba(223, 208, 245, 0.9);
  border-bottom: 1px solid rgba(223, 208, 245, 0.9);
  transform: rotate(45deg);
  border-bottom-left-radius: 2px;
}

.小角標藍 {
  background: linear-gradient(135deg, rgba(225, 240, 255, 0.96), rgba(235, 245, 255, 0.96));
  color: #6f8eb5;
}

.結果區 h2 {
  margin: 0 0 10px;
  color: #9a64d1;
  font-size: 1.08rem;
}

.結果區 p {
  margin: 0 0 10px;
}

.結果區 p:last-child {
  margin-bottom: 0;
}

@keyframes 淡入上升 {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes 浮動 {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(4deg);
  }
}

@keyframes 按鈕彈一下 {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes 圖片浮動 {
  0%, 100% {
    transform: translateY(0) rotate(-1deg) scale(1);
  }
  50% {
    transform: translateY(-5px) rotate(1deg) scale(1.01);
  }
}

@media (max-width: 640px) {
  .頁面 {
    align-items: flex-start;
    padding: 14px;
  }

  .卡片 {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .標題列 {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  h1 {
    font-size: 1.72rem;
  }

  input,
  select,
  button {
    min-height: 62px;
    font-size: 1rem;
    border-radius: 18px;
  }

  .結果區 {
    padding: 18px;
    border-radius: 18px;
  }
}
