/* ============================================================
   组件层
   ============================================================ */

/* ------------------------------------------------------------
   1. 品牌区 / 朱砂印章
   记忆点之一：所有标题旁边都挂一枚歪着的印章，
   这个元素贯穿全站，是小程序的视觉签名。
   ------------------------------------------------------------ */

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 10px;
}

.seal {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  background: var(--cinnabar);
  border-radius: 9px;
  display: grid;
  place-items: center;
  transform: rotate(-6deg);
  box-shadow:
    0 3px 0 var(--cinnabar-deep),
    var(--sh2);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 印章的斑驳感：叠一层同色噪点，模拟油墨不均 */
.seal::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='40' height='40' filter='url(%23s)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.seal span {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: #FFF7E8;
  line-height: 1;
  transform: translateY(-1px);
  position: relative;
  z-index: 1;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.3;
  color: var(--ink);
}

.brand-slogan {
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ------------------------------------------------------------
   2. 问候语
   ------------------------------------------------------------ */

.greet {
  padding: 10px 0 20px;
}

.greet h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.42;
  color: var(--ink);
}

.greet h1 em {
  font-style: normal;
  color: var(--cinnabar);
  position: relative;
  white-space: nowrap;
}

/* 手绘下划线：不用 border，用旋转的细块，更像马克笔划的 */
.greet h1 em::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 1px;
  height: 7px;
  background: rgba(206, 90, 72, .16);
  border-radius: 3px;
  transform: rotate(-.6deg);
  z-index: -1;
}

.greet p {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .03em;
}

/* ------------------------------------------------------------
   3. 福团 IP
   ------------------------------------------------------------ */

.fuwa-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 4px 0 14px;
}

.fuwa {
  width: 152px;
  height: 152px;
  overflow: visible;
  animation: fuwa-float 4.4s ease-in-out infinite;
}

@keyframes fuwa-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(1.5deg); }
}

.fuwa .slip {
  transform-origin: 120px 210px;
  animation: slip-wave 3.6s ease-in-out infinite;
}

@keyframes slip-wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-2.2deg); }
}

/* 眨眼：靠 scaleY 压缩，比换两套眼睛省事且不易穿帮 */
.fuwa .eye {
  transform-origin: center;
  animation: blink 5.6s infinite;
}

.fuwa .eye-r {
  animation-delay: .04s;
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97% { transform: scaleY(.12); }
}

/* 飘浮的小装饰：位置跟着福团走，用 calc 锚在中心两侧 */
.spark {
  position: absolute;
  border-radius: 50%;
  background: var(--gold);
  opacity: .7;
  animation: spark-float 5s ease-in-out infinite;
}

.spark:nth-of-type(1) { width: 7px; height: 7px; left: calc(50% - 98px); top: 16px; animation-delay: 0s; }
.spark:nth-of-type(2) { width: 5px; height: 5px; right: calc(50% - 102px); top: 40px; animation-delay: .8s; background: var(--blush); }
.spark:nth-of-type(3) { width: 6px; height: 6px; right: calc(50% - 118px); bottom: 24px; animation-delay: 1.6s; background: var(--jade); }

@keyframes spark-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: .55; }
  50% { transform: translateY(-12px) scale(1.25); opacity: .95; }
}

/* 宽屏矮窗口（笔记本半屏、带书签栏的浏览器）：
   装饰再让一步，保证表单至少露到输入框。
   594px 高的窗口装不下全部内容，这是物理限制，但"只露一个白边"是可避免的。 */
@media (min-width: 521px) and (max-height: 720px) {
  .brand { padding: 12px 0 8px; }
  .greet { padding: 6px 0 14px; }
  .greet h1 { font-size: 21px; }
  .greet p { margin-top: 6px; font-size: 12px; }
  .fuwa-wrap { padding: 0 0 10px; }
  .fuwa { width: 110px; height: 110px; }
}

/* 小屏手机（iPhone SE 一类，可用高度不足 640px）：
   装饰让位给操作，别让用户滑半屏才看到输入框。
   限定窄屏，避免宽屏矮窗口被误伤。 */
@media (max-width: 520px) and (max-height: 640px) {
  .brand { padding: 10px 0 8px; }
  .seal { width: 44px; height: 44px; }
  .seal span { font-size: 25px; }
  .brand-name { font-size: 18px; }
  .greet { padding: 6px 0 14px; }
  .greet h1 { font-size: 22px; }
  .greet p { margin-top: 6px; font-size: 12px; }
  .fuwa-wrap { padding: 0 0 8px; }
  .fuwa { width: 118px; height: 118px; }
}

/* ------------------------------------------------------------
   4. 表单
   ------------------------------------------------------------ */

.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5) var(--s4);
  box-shadow: var(--sh1), var(--sh-in);
}

.field + .field {
  margin-top: var(--s5);
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--ink-3);
  margin-bottom: 9px;
}

.field-label b {
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .1em;
}

.field-label i {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
  opacity: .75;
}

.date-input {
  width: 100%;
  height: 56px;
  background: var(--paper-warm);
  border: 1.5px solid var(--line-mid);
  border-radius: var(--r-md);
  padding: 0 18px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition:
    border-color var(--dur-fast) ease-out,
    background var(--dur-fast) ease-out,
    box-shadow var(--dur-fast) ease-out;
}

.date-input::placeholder {
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: .06em;
}

.date-input:hover {
  border-color: var(--line-strong);
}

.date-input:focus {
  outline: none;
  border-color: var(--cinnabar);
  background: #FFFDF9;
  box-shadow: 0 0 0 4px var(--cinnabar-ghost);
}

.date-input.is-empty {
  border-color: var(--cinnabar);
  animation: shake 360ms ease-in-out;
}

/* 名字输入：比日期轻一档，视觉上明确它是选填 */
.name-input {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .04em;
}

.name-input::placeholder {
  font-weight: 400;
  letter-spacing: .04em;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* 性别：两个大胶囊，比下拉框好点，也比开关有趣 */
.gender-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pill {
  height: 56px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-mid);
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-2);
  transition:
    background var(--dur-fast) ease-out,
    border-color var(--dur-fast) ease-out,
    color var(--dur-fast) ease-out,
    transform var(--dur-fast) var(--ease-back);
}

.pill:hover {
  border-color: var(--line-strong);
}

.pill:active {
  transform: scale(.97);
}

.pill svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill.is-on {
  background: var(--cinnabar-soft);
  border-color: var(--cinnabar);
  color: var(--cinnabar-deep);
  box-shadow: inset 0 0 0 1px var(--cinnabar);
}

/* ------------------------------------------------------------
   5. 主按钮
   ------------------------------------------------------------ */

.btn-main {
  width: 100%;
  height: 58px;
  margin-top: var(--s5);
  border-radius: var(--r-md);
  background: var(--cinnabar);
  color: #FFF7E8;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .18em;
  box-shadow:
    0 4px 0 var(--cinnabar-deep),
    var(--sh2);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--dur-fast) var(--ease-back),
    box-shadow var(--dur-fast) ease-out,
    background var(--dur-fast) ease-out;
}

.btn-main:hover {
  background: #E14630;
}

.btn-main:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--cinnabar-deep), var(--sh1);
}

.btn-main:disabled {
  background: var(--ink-3);
  box-shadow: 0 4px 0 #8C7F72;
  cursor: not-allowed;
}

/* 光扫：只在悬停时跑一次，不循环，避免廉价感 */
.btn-main::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}

.btn-main:hover::after {
  animation: sweep 620ms ease-out;
}

@keyframes sweep {
  to { left: 130%; }
}

/* ------------------------------------------------------------
   6. 卦算中
   ------------------------------------------------------------ */

.divining {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s5);
  background: rgba(251, 243, 228, .96);
  z-index: 20;
  backdrop-filter: blur(6px);
}

.divining.is-on {
  display: flex;
}

.tube {
  width: 92px;
  height: 132px;
  position: relative;
  animation: tube-shake 480ms ease-in-out infinite;
  transform-origin: 50% 90%;
}

@keyframes tube-shake {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}

.tube-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 96px;
  background: var(--cinnabar);
  border-radius: 10px 10px 16px 16px;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, .12),
    0 4px 0 var(--cinnabar-deep);
}

.tube-rim {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: 20px;
  border-radius: 50%;
  background: var(--cinnabar-deep);
}

.stick {
  position: absolute;
  bottom: 88px;
  width: 9px;
  background: var(--gold-soft);
  border: 1.5px solid #B98A2E;
  border-radius: 3px;
  left: 50%;
}

.stick:nth-child(1) { height: 66px; margin-left: -24px; transform: rotate(-11deg); }
.stick:nth-child(2) { height: 78px; margin-left: -8px; transform: rotate(3deg); }
.stick:nth-child(3) { height: 70px; margin-left: 10px; transform: rotate(13deg); }

.divining-text {
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--ink-2);
  text-align: center;
}

.divining-text b {
  display: block;
  font-size: 17px;
  letter-spacing: .2em;
  color: var(--cinnabar);
  margin-bottom: 8px;
  font-weight: 700;
}

.dots::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "·"; }
  50% { content: "··"; }
  75% { content: "···"; }
}

/* ------------------------------------------------------------
   7. 结果头部
   ------------------------------------------------------------ */

.result-head {
  text-align: center;
  padding: var(--s3) 0 var(--s5);
  position: relative;
}

.result-date {
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--ink-3);
  margin-bottom: 14px;
}

/* 签等：宋体大标 + 朱砂，中式感主要靠这里 */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px 9px 16px;
  background: var(--paper);
  border: 1.5px solid var(--accent-live);
  border-radius: var(--r-full);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .05), var(--sh1);
}

.rank-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.rank-badge .rank-text {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--accent-live);
  line-height: 1;
}

.rank-line {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .06em;
}

/* 顺遂指数：一条细长的刻度，不是圆环图，避免"仪表盘"味 */
.score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-3);
}

.score-track {
  flex: 0 0 auto;
  width: 116px;
  height: 5px;
  background: var(--cream-deep);
  border-radius: var(--r-full);
  overflow: hidden;
}

.score-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent-live));
  border-radius: var(--r-full);
  width: 0;
  transition: width 900ms var(--ease-out) 300ms;
}

.score-num {
  flex: 0 0 auto;
  min-width: 24px;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-live);
  font-variant-numeric: tabular-nums;
  text-align: left;
}

/* ------------------------------------------------------------
   8. 幸运数字
   ------------------------------------------------------------ */

.nums {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding: var(--s4) 0 calc(var(--s5) + 16px);
}

.num {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--line-mid);
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  box-shadow: var(--sh1);
  position: relative;
  animation: num-pop 520ms var(--ease-back) backwards;
}

.num:nth-child(2) { animation-delay: 90ms; }
.num:nth-child(3) { animation-delay: 160ms; }
.num:nth-child(4) { animation-delay: 230ms; }

@keyframes num-pop {
  from { transform: scale(.4) rotate(-14deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* 主数字：更大、朱砂、微微歪，视觉权重压过另外两个 */
.num.is-lead {
  width: 84px;
  height: 84px;
  font-size: 42px;
  color: #FFF7E8;
  background: var(--cinnabar);
  border-color: var(--cinnabar-deep);
  transform: rotate(-4deg);
  box-shadow: 0 5px 0 var(--cinnabar-deep), var(--sh2);
}

.num.is-lead::after {
  content: "主";
  position: absolute;
  bottom: -20px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--cinnabar);
}

.num.is-sub::after {
  content: "辅";
  position: absolute;
  bottom: -18px;
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--ink-3);
}

/* ------------------------------------------------------------
   9. 小信息条（幸运色 / 吉时）
   ------------------------------------------------------------ */

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: var(--s5);
}

/* 三列时每列只有 ~124px，横排塞不下"圆点+文字"，
   所以改成竖向：图标在上，标签、值、小注依次往下 */
.chip-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 8px 13px;
  box-shadow: var(--sh1), var(--sh-in);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-height: 112px;
}

.chip-dot {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(43, 35, 32, .18);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .08);
}

.chip-dot.icon {
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  border-color: var(--gold);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: #8A5E14;
  line-height: 1;
}

/* 主幸运数字。用描边款而非实心红 —— 幸运色恰好是朱砂时，
   两个实心圆会糊成一片，描边能把它们分开 */
.chip-dot.num {
  display: grid;
  place-items: center;
  background: #FFFDF9;
  border: 1.5px solid var(--cinnabar);
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 700;
  color: var(--cinnabar);
  line-height: 1;
}

.chip-k {
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--ink-3);
  line-height: 1.4;
  white-space: nowrap;
}

.chip-v {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
  line-height: 1.35;
  white-space: nowrap;
}

.chip-hint {
  font-size: 9px;
  color: var(--ink-3);
  line-height: 1.5;
  letter-spacing: .01em;
  opacity: .85;
}

/* ------------------------------------------------------------
   10. 内容卡
   ------------------------------------------------------------ */

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: var(--s6) 0 var(--s3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .26em;
  color: var(--ink-3);
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--sh1), var(--sh-in);
}

.card + .card {
  margin-top: 10px;
}

/* 吉事：编号 + 正文，编号用朱砂小方块 */
.good-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.good-idx {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.good-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink);
  letter-spacing: .02em;
}

/* 提醒：整张卡换成暖黄底，和吉事区分开 */
.card.caution {
  background: var(--gold-soft);
  border-color: rgba(217, 155, 52, .34);
  box-shadow: none;
}

.card.caution .good-idx {
  background: rgba(217, 155, 52, .3);
  color: #8A5E14;
}

.card.caution .good-text {
  color: #5A3F14;
}

/* 宜 / 忌：两列对照，用字块而不是列表，读起来更快 */
.yiji {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.yiji-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--sh1);
}

.yiji-col .tag {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.yiji-col.yi .tag {
  background: var(--jade-soft);
  color: var(--jade);
}

.yiji-col.ji .tag {
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
}

.yiji-col ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yiji-col li {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: var(--r-full);
  background: var(--paper-warm);
  color: var(--ink-2);
  letter-spacing: .04em;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   11. 吉祥话 —— 全场最该被截图的地方
   所以要做得像一张"签纸"：宋体、朱砂、竖线、纸纹
   ------------------------------------------------------------ */

.blessing {
  margin-top: var(--s6);
  padding: 26px 22px 24px;
  background:
    linear-gradient(180deg, #FFFAEE, #FFF5E0);
  border-radius: var(--r-lg);
  border: 1px solid rgba(217, 155, 52, .3);
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh2);
}

/* 左上角的金色描边角，模拟信笺 */
.blessing::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(217, 155, 52, .28);
  border-radius: 16px;
  pointer-events: none;
}

.blessing-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--gold);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.blessing-label::before,
.blessing-label::after {
  content: "";
  height: 1px;
  background: rgba(217, 155, 52, .35);
  flex: 1;
}

.blessing-text {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 2;
  letter-spacing: .1em;
  color: #6B3A1E;
  text-align: justify;
  position: relative;
  z-index: 1;
}

.blessing-text::before {
  content: "「";
  color: var(--cinnabar);
  opacity: .45;
  margin-right: 1px;
}

.blessing-text::after {
  content: "」";
  color: var(--cinnabar);
  opacity: .45;
  margin-left: 1px;
}

.blessing-foot {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* 一个叶子就够了，多了整个页面的气质就散了 */
.blessing-leaf {
  font-size: 11px;
  margin-left: 3px;
  opacity: .75;
  vertical-align: 1px;
}

.blessing-hook {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: .07em;
  /* ink-3 在米黄底上几乎糊没了，等于没写；用 ink-2 降一点透明度 */
  color: var(--ink-2);
  opacity: .78;
  position: relative;
  z-index: 1;
}

.blessing-sign {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--gold);
}

.stamp-small {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--cinnabar);
  display: grid;
  place-items: center;
  transform: rotate(7deg);
  box-shadow: 0 2px 0 var(--cinnabar-deep);
  opacity: .9;
}

.stamp-small span {
  font-family: var(--font-serif);
  font-size: 19px;
  color: #FFF7E8;
  line-height: 1;
  font-weight: 700;
}

/* ------------------------------------------------------------
   11.5 姓名卦象
   只在填了名字时出现，没填的人看不到这块
   ------------------------------------------------------------ */

.name-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.name-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--cinnabar);
  color: #FFF7E8;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  transform: rotate(-4deg);
  box-shadow: 0 2px 0 var(--cinnabar-deep);
  flex: 0 0 auto;
}

.name-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.name-full {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--ink);
  line-height: 1.3;
}

.name-sub {
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink-3);
  line-height: 1.4;
}

.name-level {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--gold-soft);
  color: #8A5E14;
  border: 1px solid rgba(217, 155, 52, .4);
}

/* 五格横排，人格加粗强调 —— 姓名学里人格是主格 */
.name-grids {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

.name-grid {
  background: var(--paper-warm);
  border-radius: var(--r-sm);
  padding: 9px 4px 8px;
  text-align: center;
  border: 1px solid transparent;
}

.name-grid.is-main {
  background: #FFF6E4;
  border-color: rgba(217, 155, 52, .45);
}

.name-grid-k {
  display: block;
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--ink-3);
  line-height: 1.4;
}

.name-grid-n {
  display: block;
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1px;
}

.name-grid-lv {
  display: block;
  font-size: 9px;
  letter-spacing: .04em;
  line-height: 1.4;
  opacity: .85;
}

/* 吉凶配色：不用红绿，红绿在这个产品里是"涨跌"，不是吉凶 */
.lv-3 { color: #B5621B; }
.lv-2 { color: #8A6A2E; }
.lv-1 { color: #8C8177; }
.lv-0 { color: #9A8B80; }

.name-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-2);
  letter-spacing: .02em;
}

/* ------------------------------------------------------------
   12. 星座运势
   用星座符号当视觉锚点，比放图标更省事也更准
   ------------------------------------------------------------ */

.sign {
  position: relative;
  overflow: hidden;
}

/* 右上角一枚大符号，压低透明度当水印 */
.sign::after {
  content: attr(data-symbol);
  position: absolute;
  right: -6px;
  top: -18px;
  font-size: 84px;
  line-height: 1;
  color: var(--cinnabar);
  opacity: .06;
  pointer-events: none;
}

.sign-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.sign-symbol {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #8A5E14;
  line-height: 1;
  flex: 0 0 auto;
}

.sign-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sign-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink);
  line-height: 1.3;
}

.sign-span {
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink-3);
  line-height: 1.4;
}

.sign-text {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
  letter-spacing: .02em;
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   12.5 存签图
   ------------------------------------------------------------ */

.share-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 10px;
  transition: background var(--dur-fast) ease-out, border-color var(--dur-fast) ease-out;
}

.share-btn:hover {
  background: var(--paper-warm);
  border-color: var(--ink-3);
}

/* 签图弹层：压在手机上，不跳新页 */
.poster-mask {
  /* 隐藏时必须彻底不接收点击，某些移动端内核对 visibility 过渡处理不一致 */
  pointer-events: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(28, 22, 18, .80);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) ease-out, visibility 0s linear var(--dur-base);
}

.poster-mask.is-on {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-base) ease-out, visibility 0s;
}

.poster-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.poster-frame {
  display: flex;
  min-height: 0;
  flex: 0 1 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .42);
}

.poster-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.poster-tip {
  margin-top: 15px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: rgba(255, 247, 232, .84);
  letter-spacing: .06em;
  flex: 0 0 auto;
}

.poster-tip span {
  font-size: 10px;
  opacity: .55;
}

.poster-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #FFF7E8;
  font-size: 21px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background var(--dur-fast) ease-out;
}

.poster-close:hover {
  background: rgba(255, 255, 255, .26);
}

/* ------------------------------------------------------------
   13. 随喜入口
   ------------------------------------------------------------ */

.merit-block {
  margin-top: var(--s6);
  text-align: center;
}

.merit-btn {
  width: 100%;
  height: 54px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .16em;
  box-shadow: 0 4px 0 #171310, var(--sh2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dur-fast) var(--ease-back), box-shadow var(--dur-fast);
}

.merit-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #171310;
}

.merit-btn .coin {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--gold);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #5A3F14;
  font-weight: 700;
}

.merit-hint {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.9;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.merit-hint b {
  color: var(--ink-2);
  font-weight: 600;
}

/* ------------------------------------------------------------
   13. 底部弹层（随喜）
   ------------------------------------------------------------ */

.sheet-mask {
  /* 隐藏时必须彻底不接收点击，某些移动端内核对 visibility 过渡处理不一致 */
  pointer-events: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(43, 35, 32, .42);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) ease-out, visibility 0s linear var(--dur-base);
  z-index: 40;
  display: flex;
  align-items: flex-end;
}

.sheet-mask.is-on {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-base) ease-out, visibility 0s;
}

.sheet {
  width: 100%;
  background: var(--cream);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 14px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  box-shadow: 0 -12px 40px rgba(43, 35, 32, .18);
  max-height: 88%;
  overflow-y: auto;
  position: relative;
}

/* 显式关闭：光靠点遮罩关闭，很多人找不到出口 */
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  transition: background var(--dur-fast) ease-out, color var(--dur-fast) ease-out;
}

.sheet-close:hover {
  background: rgba(43, 35, 32, .06);
  color: var(--ink);
}

/* 退出路径做实：整行可点的描边卡片，不是一行小字 */
.sheet-skip {
  width: 100%;
  margin-top: 14px;
  padding: 15px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 252, 245, .6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: background var(--dur-fast) ease-out;
}

.sheet-skip:hover {
  background: var(--paper-warm);
}

.sheet-skip__t {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .08em;
}

.sheet-skip__s {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.sheet-mask.is-on .sheet {
  transform: none;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  margin: 0 auto 18px;
}

.sheet h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
}

.sheet-sub {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
  letter-spacing: .04em;
}

/* 金额选择 */
.amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: var(--s5) 0 var(--s3);
}

.amount {
  height: 56px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-mid);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all var(--dur-fast) ease-out;
}

.amount .a-num {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.amount .a-num i {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-right: 2px;
}

.amount .a-tip {
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: .08em;
  line-height: 1;
}

.amount:hover {
  border-color: var(--line-strong);
}

.amount.is-on {
  border-color: var(--cinnabar);
  background: var(--cinnabar-soft);
  box-shadow: inset 0 0 0 1px var(--cinnabar);
}

.amount.is-on .a-num,
.amount.is-on .a-num i {
  color: var(--cinnabar-deep);
}

/* 自定义金额 */
.custom-amount {
  display: none;
  margin-bottom: var(--s3);
}

.custom-amount.is-on {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-amount .cur {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-2);
}

.custom-amount input {
  flex: 1;
  height: 50px;
  background: var(--paper);
  border: 1.5px solid var(--cinnabar);
  border-radius: var(--r-sm);
  padding: 0 14px;
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  outline: none;
  box-shadow: 0 0 0 4px var(--cinnabar-ghost);
}

/* 二维码区 */
.qr-box {
  margin-top: var(--s4);
  padding: 20px;
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

/* 收款码是 3:4 的竖版海报，容器按比例给，别用正方形硬套 */
.qr-img {
  width: 186px;
  height: 254px;
  border-radius: var(--r-sm);
  background: var(--paper-warm);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(107, 78, 42, .10);
}

.qr-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
}

/* 收款码大图。
   缩略图只有 186px 宽，二维码在里面约 100px，微信认不出来；
   放大到屏宽后约 300px，识别率才够。 */
.qr-zoom {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(12, 9, 7, .985);
  z-index: 88;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-base) ease-out, visibility 0s linear var(--dur-base);
}

.qr-zoom.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-base) ease-out, visibility 0s;
}

.qr-zoom img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 74%;
  background: #fff;
  border-radius: 10px;
  /* 别加 box-shadow：某些机型会把阴影算进可长按区域，反而干扰识别 */
}

.qr-zoom p {
  flex: 0 0 auto;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: rgba(255, 247, 232, .9);
}

.qr-zoom p span {
  font-size: 11px;
  opacity: .55;
}

/* 保底方案：长按识别在部分安卓微信上不出选项，就存图再扫码 */
.qr-save {
  flex: 0 0 auto;
  padding: 11px 26px;
  border-radius: 100px;
  background: rgba(255, 247, 232, .14);
  border: 1px solid rgba(255, 247, 232, .34);
  color: #FFF7E8;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast) ease-out;
}

.qr-save:active {
  background: rgba(255, 247, 232, .26);
}

/* 缩略图可点击，给个明确的触感 */
.qr-box .qr-img {
  cursor: pointer;
}

.qr-tip b {
  color: var(--ink);
  font-weight: 700;
}

.qr-tip {
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-2);
  letter-spacing: .03em;
  max-width: 240px;
}

.qr-tip b {
  color: var(--cinnabar);
  font-weight: 600;
}

/* 合规声明：不能是淡灰小字。
   这既是审核要求，也是用户该看清的东西 —— 所以加深、加粗、留足行距。 */
.notice {
  margin-top: var(--s4);
  padding: 14px 16px 15px;
  background: #FBF0D9;
  border: 1px solid rgba(217, 155, 52, .28);
  border-radius: var(--r-sm);
}

.notice-title {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #7A4E12;
  margin-bottom: 9px;
}

.notice-line {
  font-size: 12px;
  line-height: 1.85;
  font-weight: 600;
  color: #5F4A2E;
  letter-spacing: .01em;
  margin-bottom: 5px;
}

.notice-line:last-child {
  margin-bottom: 0;
}

.notice-line b {
  color: #8A3A12;
  font-weight: 800;
}

/* ------------------------------------------------------------
   14. 历史记录（我的）
   ------------------------------------------------------------ */

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--sh1);
  width: 100%;
  min-width: 0;
  text-align: left;
  transition: transform var(--dur-fast) var(--ease-back), box-shadow var(--dur-fast);
}

.history-item:hover {
  transform: translateX(2px);
  box-shadow: var(--sh2);
}

.history-item + .history-item {
  margin-top: 9px;
}

.h-date {
  flex: 0 0 auto;
  width: 46px;
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.h-date .d-day {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.h-date .d-mon {
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-top: 3px;
}

.h-body {
  flex: 1;
  min-width: 0;
}

/* 注意：这里是 span，必须显式 block。
   inline 元素上的 overflow: hidden / text-overflow 是不生效的，
   加了 ellipsis 也会被 nowrap 的文字直接撑宽父容器。 */
.h-rank {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--cinnabar);
}

.h-snippet {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  letter-spacing: .02em;
}

.h-arrow {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 16px;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: var(--s7) var(--s4);
}

.empty p {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: .06em;
  margin-top: 16px;
  line-height: 2;
}

/* ------------------------------------------------------------
   15. 我的页 · 设置项
   ------------------------------------------------------------ */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-k {
  font-size: 14px;
  color: var(--ink);
  letter-spacing: .04em;
}

.setting-k small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .02em;
  margin-top: 3px;
  line-height: 1.6;
}

.setting-v {
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .04em;
  text-align: right;
}

/* 开关 */
.switch {
  width: 46px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--line-mid);
  position: relative;
  transition: background var(--dur-fast) ease-out;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--sh1);
  transition: transform var(--dur-fast) var(--ease-back);
}

.switch.is-on {
  background: var(--cinnabar);
}

.switch.is-on::after {
  transform: translateX(18px);
}

/* 价格设置 */
.price-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-warm);
  border: 1.5px solid var(--line-mid);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 42px;
}

.price-edit span {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--ink-3);
  font-weight: 600;
}

.price-edit input {
  width: 62px;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
