/* ============================================================
   恋爱姓名配对（ndmetaphysics/aimate）本地复刻 - 首页样式
   布局单位 rem：1rem = 视口宽度 / 10（见 static/js/rem.js）
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html,
body {
  width: 100%;
  overflow-x: hidden;
  background: #f5f5f5;
  font-family: "PingFang SC", "PingFangSC-Regular", "Microsoft YaHei", Arial, sans-serif;
  /* 原站 body 字号 16px，rem 只作用在 html 上 */
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body { -webkit-tap-highlight-color: transparent; }

img { display: block; border: 0; }

button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ---------- 页面容器 ---------- */

.mate-app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding-bottom: 1.11rem;
  background: #ffd6ce;
}

/* 右上角飘带装饰 */
.mate-app::before {
  content: "";
  position: absolute;
  top: 6.44rem;
  right: 0.28rem;
  width: 1.01rem;
  height: 1.61rem;
  background: url(../img/deco-frame.png) no-repeat center / contain;
}

/* ---------- 顶部 tab ---------- */

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 1.19rem;
  padding: 0 0.41rem;
  background: hsla(0, 0%, 100%, 0.3);
  -webkit-backdrop-filter: blur(0.2415rem);
  backdrop-filter: blur(0.2415rem);
}

.top-bar-item {
  font-size: 0.46rem;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.top-bar-item.active {
  color: #000;
  font-weight: 600;
}

/* ---------- tab 面板 ---------- */

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 原站顶部大图是行内元素，行盒会在图片下方留出约 4px 间隙，这里用固定外边距等效 */
.top-bg { display: block; width: 100%; margin-bottom: 4px; }

/* ---------- 姓名配对：输入卡 ---------- */

.profile-wrap { position: relative; }

.info-wrap {
  position: relative;
  width: 96%;
  height: 3.87rem;
  margin: -1.47rem auto 0.68rem;
  background: url(../img/input-name.png) no-repeat center / contain;
}

.info-wrap.input-fate {
  width: 100%;
  height: 4.91rem;
  margin: -1.21rem auto 0.68rem;
  background-image: url(../img/input-fate.png);
}

.name-input {
  position: absolute;
  bottom: 0.66rem;
  width: 3.05rem;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.41rem;
  font-weight: 500;
  text-align: center;
}

.name-input.male { left: 1.04rem; color: #016aaf; }
.name-input.female { right: 1.04rem; color: #ab2555; }

.name-input.male::placeholder { color: #016aaf; font-weight: 400; opacity: 0.6; }
.name-input.female::placeholder { color: #ab2555; font-weight: 400; opacity: 0.6; }

/* ---------- 缘分指数：姓名 + 出生时间 ---------- */

.lite-name-input {
  position: absolute;
  bottom: 1.69rem;
  width: 3.3rem;
  padding: 0.2rem 0.32rem;
  border-radius: 0.25rem;
  outline: none;
  font-family: inherit;
  font-size: 0.38rem;
  font-weight: 500;
  line-height: 0.48rem;
  text-align: center;
}

.lite-name-input.male {
  left: 0.64rem;
  border: 0.03rem solid #a5cbf2;
  background-color: #f6f9fd;
  color: #016aaf;
}

.lite-name-input.female {
  right: 0.63rem;
  border: 0.03rem solid #f2a5b3;
  background-color: #fdf6f6;
  color: #ab2555;
}

.lite-name-input.male::placeholder { color: #016aaf; font-weight: 400; opacity: 0.6; }
.lite-name-input.female::placeholder { color: #ab2555; font-weight: 400; opacity: 0.6; }

.lite-birth {
  position: absolute;
  bottom: 0.48rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 4.02rem;
  padding: 0.2rem 0.56rem;
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 0.36rem;
  font-weight: 500;
  line-height: 0.48rem;
  text-align: center;
}

.lite-birth.male {
  left: 0.64rem;
  border: 0.03rem solid #a5cbf2;
  background-color: #f6f9fd;
  color: #016aaf;
}

.lite-birth.female {
  right: 0.63rem;
  border: 0.03rem solid #f2a5b3;
  background-color: #fdf6f6;
  color: #ab2555;
}

.lite-birth .birth-icon,
.lite-birth .birth-arrow {
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.4rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.lite-birth .birth-icon.male { background-image: url(../img/birth-male.png); }
.lite-birth .birth-icon.female { background-image: url(../img/birth-female.png); }
.lite-birth .birth-arrow.male { background-image: url(../img/birth-arrow-male.png); }
.lite-birth .birth-arrow.female { background-image: url(../img/birth-arrow-female.png); }

.lite-birth .birth-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lite-birth.empty .birth-text { font-weight: 400; opacity: 0.6; }

/* ---------- 真爱画像 / 恋爱指南：资料表 ---------- */

.profile-container {
  width: 100%;
  padding: 0 0.63rem;
}

.profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: content-box;
  height: 1.4rem;
  border-bottom: 0.02rem solid #b3703a;
}

.profile-item:last-child { border-bottom: none; }

.profile-item .label {
  flex-shrink: 0;
  font-size: 0.38rem;
  font-weight: 500;
  color: #401001;
  text-align: justify;
}

.profile-item .optional {
  font-size: 0.3rem;
  font-weight: 400;
  color: #8d6252;
}

.profile-item .row-value {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin-left: 0.16rem;
}

.profile-item .text-input {
  flex: 1;
  min-width: 0;
  margin-right: 0.16rem;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.38rem;
  font-weight: 400;
  text-align: right;
  color: #000;
}

.profile-item .text-input::placeholder { color: #6d6d6d; opacity: 1; }

.gender-toggle {
  display: flex;
  flex-shrink: 0;
  padding: 0.08rem;
  border-radius: 5.33rem;
  background: #fffcf7;
}

.gender-option {
  width: 0.96rem;
  height: 0.66rem;
  border-radius: 5.33rem;
  font-size: 0.32rem;
  font-weight: 400;
  line-height: 0.66rem;
  text-align: center;
  color: #6d6d6d;
}

.gender-option.selected-male { background: #cde6ff; color: #000; }
.gender-option.selected-female { background: #ffd5cd; color: #000; }

.value-with-icon {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.value-with-icon .value-text {
  display: inline-block;
  max-width: 5.15rem;
  overflow: hidden;
  font-size: 0.38rem;
  font-weight: 400;
  line-height: 0.38rem;
  color: #000;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.value-with-icon .value-text.placeholder { color: #6d6d6d; }

.value-with-icon .arrow {
  flex-shrink: 0;
  width: 0.49rem;
  height: 0.43rem;
  margin-left: 0.12rem;
  background: url(../img/arrow.png) no-repeat center / 100%;
}

/* 资料表左下角花瓣 */
.profile-wrap-bg::after {
  content: "";
  position: absolute;
  bottom: 1.52rem;
  left: 0;
  width: 0.88rem;
  height: 1.52rem;
  background: url(../img/deco-petal.png) no-repeat center / contain;
}

/* ---------- 开始按钮 ---------- */

.destiny-btn {
  display: block;
  width: 7.81rem;
  height: 1.46rem;
  margin: 0.26rem auto 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: all 0.5s ease;
  animation: breathing 1.5s infinite;
}

.destiny-btn-name { background-image: url(../img/btn-name.png); }
.destiny-btn-fate { background-image: url(../img/btn-fate.png); margin-top: 0.3rem; }
.destiny-btn-destiny { background-image: url(../img/btn-destiny.png); }
.destiny-btn-explain { background-image: url(../img/btn-explain.png); }

.profile-container .destiny-btn { margin-top: 0.62rem; }

@keyframes breathing {
  0% { opacity: 0.9; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0.9; transform: scale(0.98); }
}

/* ---------- 能力六宫格 ---------- */

.prediction-ability {
  position: relative;
  width: 100%;
  height: 13.53rem;
  margin-top: 0.53rem;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.prediction-ability.tab-name { height: 14.2rem; margin-top: 0.84rem; background-image: url(../img/panel-name.png); }
.prediction-ability.tab-fate { background-image: url(../img/panel-fate.png); }
.prediction-ability.tab-destiny { background-image: url(../img/panel-destiny.png); }
.prediction-ability.tab-explain { background-image: url(../img/panel-explain.png); }

.ability-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-row-gap: 0.24rem;
  grid-column-gap: 0.24rem;
  width: 100%;
  height: 100%;
  padding: 1.44rem 0.8rem 0.66rem 0.78rem;
}

.prediction-ability.tab-name .ability-groups { padding-top: 1.74rem; }

.ability-item {
  width: 4.08rem;
  height: 3.71rem;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* ---------- 底部免责 ---------- */

.ai-tips {
  margin-top: 0.28rem;
  font-size: 0.26rem;
  font-weight: 400;
  line-height: 0.37rem;
  text-align: center;
  color: hsla(0, 0%, 44%, 0.88);
}

.ai-tips-name { color: #ff7192; }

/* ---------- 出生时间选择器（底部弹层） ---------- */

.picker-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.picker-sheet {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 1001;
  width: 10rem;
  height: 8.89rem;
  padding: 0.25rem 0.44rem 0;
  overflow-y: auto;
  border-radius: 0.38rem 0.38rem 0 0;
  background: #fff;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.picker-mask.show,
.picker-sheet.show { opacity: 1; transform: none; }

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.picker-header .btn-cancel,
.picker-header .btn-confirm {
  font-size: 0.33rem;
  font-weight: 400;
}

.picker-header .btn-cancel { color: #1f1f1f; }
.picker-header .btn-confirm { color: #a02600; }

.calendar-toggle {
  display: flex;
  border: 0.02rem solid #dc4823;
  border-radius: 0.39rem;
  background: #f5f5f5;
  box-shadow: 0 1px 0.0966rem rgba(255, 107, 53, 0.08);
}

.calendar-toggle .toggle-btn {
  padding: 0.15rem 0.36rem;
  border-radius: 0.39rem;
  font-size: 0.33rem;
  font-weight: 500;
  line-height: 100%;
  color: #1f1f1f;
}

.calendar-toggle .toggle-btn.active { background: #dc4823; color: #fff; }

.time-wheels {
  position: relative;
  display: flex;
  margin-top: 0.41rem;
}

.time-wheels::before,
.time-wheels::after {
  content: "";
  position: absolute;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 1.2rem;
  pointer-events: none;
}

.time-wheels::before {
  top: 0;
  background: linear-gradient(180deg, #fff, hsla(0, 0%, 100%, 0));
}

.time-wheels::after {
  bottom: 0;
  background: linear-gradient(180deg, hsla(0, 0%, 100%, 0), #fff);
}

.wheel-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  text-align: center;
}

.wheel-container {
  flex: 1;
  max-height: 6.78rem;
  overflow: hidden;
}

.wheel-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: none;
}

.wheel-scroll::-webkit-scrollbar { display: none; }

.wheel-spacer { width: 100%; flex-shrink: 0; }

.wheel-item {
  margin: 0.04rem 0.14rem;
  padding: 0.24rem 0.12rem;
  font-size: 0.34rem;
  line-height: 0.57rem;
  color: #666;
  white-space: nowrap;
  scroll-snap-align: center;
  transition: all 0.2s ease;
}

.wheel-item.selected { color: #1f1f1f; font-weight: 600; transform: scale(1.05); }

/* ---------- 轻提示 ---------- */

/* 备案信息（后台配置后显示） */
.site-foot {
  padding: 0.24rem 0 0.5rem;
  text-align: center;
  font-size: 0.22rem;
  color: rgba(0, 0, 0, 0.35);
}

.site-foot a {
  color: inherit;
  text-decoration: none;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 3000;
  max-width: 70%;
  padding: 0.3rem 0.5rem;
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.36rem;
  line-height: 0.51rem;
  text-align: center;
  white-space: pre-wrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.toast.show { opacity: 1; }

/* ---------- 出生地点选择（两级列表） ---------- */

.region-sheet .region-cols {
  display: flex;
  height: 5.27rem;
  margin-top: 0.41rem;
}

.region-col {
  flex: 1;
  overflow-y: auto;
  font-size: 0.34rem;
  line-height: 0.9rem;
  text-align: center;
}

.region-col::-webkit-scrollbar { display: none; }

.region-col .region-item { color: #666; }

.region-col .region-item.active { color: #a02600; font-weight: 600; }
