:root {
  --bg: #0D0A1A;
  --red: #E8472A;
  --red2: #FF6B4A;
  --red-light: #FF9B85;
  --red-dark: #B83420;
  --ink: #0D0A1A;
  --ink2: #1A1530;
  --ink3: #252040;
  --parchment: #12102A;
  --parchment2: #1E1B3A;
  --parchment3: #2D2850;
  --gold: #F0B429;
  --gold-light: #FFD666;
  --text-dark: #F0E6FF;
  --text-mid: #C4B8E0;
  --text-muted: #8A7FAA;
  --purple: #6C3DC8;
  --purple2: #8B5CF6;
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --glow1: rgba(108, 61, 200, 0.15);
  --glow2: rgba(232, 71, 42, 0.1);
  --glow3: rgba(240, 180, 41, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 深色神秘背景 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 20%, var(--glow1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, var(--glow2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 10%, var(--glow3) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
}

/* ─── HERO IMAGE ─── */
.hero-img-wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto 8px;
  position: relative;
  line-height: 0;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.hero-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-img-cover {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent, rgba(30, 27, 58, 0.6));
  pointer-events: none;
}

.hero-img-cover-top {
  display: none;
}

.hero-img-cover-left {
  display: none;
}

.hero-img-cover-right {
  display: none;
}

/* ─── CONTAINER ─── */
.container {
  max-width: 572px;
  margin: 0 auto;
  padding: 0 18px 60px;
}

/* ─── 頂部標題區 ─── */
.top-section {
  text-align: center;
  padding: 10px 0 24px;
  position: relative;
}

.dynasty-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dynasty-badge span {
  font-size: 17px;
  letter-spacing: 6px;
  color: var(--gold-light);
  font-weight: 700;
  font-family: 'Noto Serif TC', serif;
}

.dynasty-badge::before,
.dynasty-badge::after {
  content: '';
  display: inline-block;
  width: 30px;
  height: 1px;
  background: var(--parchment3);
}

.main-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 42px;
  font-weight: 900;
  color: var(--red);
  line-height: 1.15;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 rgba(123, 36, 28, 0.15);
}

.sub-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  color: var(--text-mid);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.hook-text {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1.9;
  max-width: 340px;
  margin: 0 auto;
}

/* ─── 數據欄 ─── */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid var(--parchment3);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid var(--parchment3);
}

.stat-item:last-child {
  border-right: none;
}

.stat-num {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  display: block;
}

.stat-label {
  font-size: 18px;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

/* ─── 表單卡片 ─── */
.form-card {
  background: white;
  border: 1px solid var(--parchment3);
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 2px 20px rgba(44, 26, 14, 0.07);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '緣';
  position: absolute;
  right: -10px;
  top: -20px;
  font-family: 'Noto Serif TC', serif;
  font-size: 120px;
  font-weight: 900;
  color: rgba(192, 57, 43, 0.04);
  pointer-events: none;
  line-height: 1;
}

.card-heading {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  color: var(--red);
  text-align: center;
  margin-bottom: 22px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-heading::before,
.card-heading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--red-light);
}

.section-tag {
  font-size: 20px;
  color: white;
  background: var(--red);
  padding: 3px 12px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 14px;
  letter-spacing: 1px;
  font-family: 'Noto Serif TC', serif;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 16px;
  color: var(--text-mid);
  margin-bottom: 7px;
  font-weight: 500;
}

input[type="text"],
select {
  width: 100%;
  background: var(--parchment);
  border: 1px solid var(--parchment3);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text-dark);
  font-size: 15px;
  font-family: 'Noto Sans TC', sans-serif;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  -webkit-appearance: none;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

input::placeholder {
  color: var(--parchment3);
}

/* 下拉選項與模板色調統一：深底淺字（與 select 本身一致） */
select option {
  background: var(--parchment);
  color: var(--text-dark);
}

.date-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 8px;
}
.gender-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border: 1.5px solid var(--parchment3);
  border-radius: 8px;
  background: var(--parchment);
  color: var(--text-mid);
  font-size: 15px;
  font-family: 'Noto Sans TC', sans-serif;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.gender-btn .icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.gender-btn .text {
  line-height: 1;
}

.gender-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.gender-btn.active {
  border-color: var(--red);
  background: rgba(192, 57, 43, 0.06);
  color: var(--red);
  font-weight: 500;
}

/* 中間分隔 */
.partner-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}

.partner-sep::before,
.partner-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--parchment3);
}

.partner-sep-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  color: var(--text-muted);
  font-family: 'Noto Serif TC', serif;
}

/* ─── 疑惑單選（卦籤式，配合復刻配色） ─── */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}

.topic {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  border: 1.5px solid var(--parchment3);
  border-radius: 8px;
  background: var(--parchment);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  user-select: none;
}

.topic input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.topic .ti {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: 'Noto Serif TC', serif;
  font-size: 17px;
  color: var(--text-mid);
  border: 1px solid var(--parchment3);
  background: rgba(255, 255, 255, 0.03);
}

.topic .tt {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  color:    #fff;   
  letter-spacing: 1px;
}

/* .topic:hover {
  border-color: var(--text-muted);
} */

.topic:has(input:checked) {
  border-color: var(--red);
  color: var(--red);
  background: rgba(192, 57, 43, 0.08);
  font-weight: 500;
}

.topic:has(input:checked) .ti {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}



/* 表單提示 */
.form-hint {
  display: none;
  margin: 14px 0 0;
  padding: 12px 18px;
  border: 1px solid rgba(232, 71, 42, 0.5);
  border-radius: 10px;
  background: rgba(232, 71, 42, 0.12);
  color: var(--gold-light);
  font-size: 13px;
  letter-spacing: 1px;
  text-align: center;
}

.form-hint.show {
  display: block;
  animation: lmf .25s ease;
}

@keyframes lmf {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 提交按鈕 */
.btn-submit {
  width: 100%;
  padding: 18px;
  background: var(--red);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 18px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 3px;
  transition: all 0.3s;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}

.btn-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: sweep 2.5s infinite;
}

@keyframes sweep {
  to {
    left: 150%;
  }
}

.btn-submit:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(192, 57, 43, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-note span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── 信任徽章 ─── */
.trust-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.trust-item {
  flex: 1;
  min-width: 80px;
  background: white;
  border: 1px solid var(--parchment3);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  color: #000 ;
}

.trust-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

/* ─── 評價 ─── */
.review-card {
  background: white;
  border: 1px solid var(--parchment3);
  border-left: 3px solid var(--red);
  border-radius: 11px;
  padding: 16px;
  margin-bottom: 12px;
}

.review-stars {
  color: var(--gold);
  font-size: 12px;
  margin-bottom: 6px;
}

.review-text {
  font-size: 13px;
  color:  #000 ; /*  var(--text-mid);*/
  line-height: 1.8;
  margin-bottom: 8px;
}

.review-author {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── LOADING ─── */
#loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 10, 26, 0.97);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.loading-symbol {
  width: 90px;
  height: 90px;
  margin: 0 auto 28px;
  position: relative;
}

.loading-ring {
  width: 90px;
  height: 90px;
  border: 2px solid rgba(232, 71, 42, 0.2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
  position: absolute;
  top: 0;
  left: 0;
}

.loading-ring2 {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(240, 180, 41, 0.2);
  border-bottom-color: var(--gold);
  border-radius: 50%;
  animation: spin 2s linear infinite reverse;
  position: absolute;
  top: 10px;
  left: 10px;
}

.loading-char {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Serif TC', serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--red);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.loading-progress {
  width: 240px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 0 auto 20px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.loading-steps {
  list-style: none;
  text-align: left;
  display: inline-block;
}

.loading-steps li {
  font-size: 13px;
  color: rgba(240, 230, 255, 0.4);
  padding: 5px 0 5px 22px;
  position: relative;
  transition: color 0.4s;
}

.loading-steps li::before {
  content: '○';
  position: absolute;
  left: 0;
  font-size: 10px;
  top: 6px;
}

.loading-steps li.done {
  color: var(--text-dark);
}

.loading-steps li.done::before {
  content: '●';
  color: var(--red);
}

/* ─── 結果頁 ─── */
#result-page {
  display: none;
}

.result-header {
  text-align: center;
  padding: 28px 0 20px;
}

.result-seal {
  width: 64px;
  height: 64px;
  background: var(--red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  transform: rotate(8deg);
  box-shadow: 3px 3px 0 var(--red-dark);
}

.result-seal span {
  font-family: 'Noto Serif TC', serif;
  font-size: 28px;
  font-weight: 900;
  color: white;
  transform: rotate(-8deg);
  display: block;
}

.result-names-row {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.result-names-row .name {
  color: var(--red);
  font-size: 26px;
  font-weight: 700;
}

.result-subtitle {
  font-size: 18px;
  color: var(--text-muted);
}

/* 命理數字卡 */
.num-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.num-card {
  background: white;
  border: 1px solid var(--parchment3);
  border-radius: 14px;
  padding: 22px 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.num-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--red);
}

.num-card .nk {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  color: #000;    /*var(--text-muted);*/
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.num-card .nv {
  font-family: 'Noto Serif TC', serif;
  font-size: 48px;
  font-weight: 900;
  color: var(--red);
  line-height: 1.1;
  margin-bottom: 6px;
}

.num-card .nt {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
}

/* 師傅卡 */
.master-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

/* CTA卡 */
.cta-card {
  background: var(--red);
  border-radius: 20px;
  padding: 30px 24px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '緣';
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-family: 'Noto Serif TC', serif;
  font-size: 160px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.06);
  line-height: 1;
  pointer-events: none;
}

.cta-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.cta-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  margin-bottom: 22px;
}

.cta-list {
  list-style: none;
  text-align: left;
  margin-bottom: 22px;
  display: inline-block;
}

.cta-list li {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  padding: 5px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cta-list li::before {
  content: '◆';
  font-size: 9px;
  color: var(--gold-light);
  margin-top: 3px;
  flex-shrink: 0;
}

.btn-line {
  display: block;
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #06C755 0%, #04a844 100%);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 18px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s;
  margin-bottom: 10px;
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.45);
  animation: btnPulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.btn-line::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255, 255, 255, 0.25);
  transform: skewX(-20deg);
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnPulse {

  0%,
  100% {
    box-shadow: 0 6px 20px rgba(6, 199, 85, 0.45);
  }

  50% {
    box-shadow: 0 8px 28px rgba(6, 199, 85, 0.7);
  }
}

@keyframes btnShine {
  0% {
    left: -60%;
  }

  50%,
  100% {
    left: 120%;
  }
}

.btn-line:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(6, 199, 85, 0.3);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 16px 24px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.95;
  letter-spacing: 0.5px;
}

.footer .footer-copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 1.5px;
  display: block;
}

.footer .footer-line {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: rgba(240, 180, 41, 0.4);
  vertical-align: middle;
  margin: 0 8px;
}

.footer .footer-disclaimer {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 2;
  max-width: 360px;
  margin: 0 auto;
}

.footer .footer-warn {
  color: #FFB59D;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.footer .footer-company {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 2;
  letter-spacing: 0.5px;
}

.footer .footer-company a {
  color: var(--gold-light);
  text-decoration: none;
}

.footer .footer-company a:hover {
  text-decoration: underline;
}

/* ─── 右下角懸浮按鈕（保留） ─── */
.fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  background: linear-gradient(180deg, var(--red2), var(--red));
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232, 71, 42, 0.55), 0 0 0 2px rgba(240, 180, 41, 0.25);
  animation: fabpulse 2.6s ease-in-out infinite;
}

.fab:hover {
  box-shadow: 0 8px 26px rgba(240, 180, 41, 0.5), 0 0 0 2px rgba(240, 180, 41, 0.4);
}

.fab .fab-ico {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--gold-light);
  border: 1px solid rgba(240, 180, 41, 0.6);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
}

@keyframes fabpulse {

  0%,
  100% {
    box-shadow: 0 6px 20px rgba(232, 71, 42, 0.55), 0 0 0 2px rgba(240, 180, 41, 0.25);
  }

  50% {
    box-shadow: 0 6px 26px rgba(232, 71, 42, 0.8), 0 0 0 5px rgba(240, 180, 41, 0.12);
  }
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.55s ease forwards;
}

.delay-1 {
  animation-delay: 0.1s;
  opacity: 0;
}

.delay-2 {
  animation-delay: 0.2s;
  opacity: 0;
}

.delay-3 {
  animation-delay: 0.3s;
  opacity: 0;
}

.delay-4 {
  animation-delay: 0.45s;
  opacity: 0;
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

@media (max-width: 400px) {
  .main-title {
    font-size: 34px;
  }

  .num-card .nv {
    font-size: 38px;
  }

  .date-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .fab {
    padding: 11px 14px;
    font-size: 13px;
    letter-spacing: 1px;
    right: 10px;
    bottom: 10px;
  }

  .fab .fab-ico {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
}

.f_name{
  font-size: 16px;
}