/* ==========================================================================
   公共基础样式：10rem 移动端自适应框架（PC 居中 540px，手机全宽）
   ========================================================================== */

@font-face {
  font-family: "FZYanSongS-B-GB";
  src: url("/assets/fonts/fz.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "kaiti";
  src: url("/assets/fonts/kaiti.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ALMM";
  src: url("/assets/fonts/almm.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #f5f5f5;
  --bg-brown: #5a2908;
  --bg-result: #622600;
  --bg-card: #fff1d1;
  --bg-card-inner: #fff8e7;
  --border-gold: #ffc12b;
  --accent-orange: #f78000;
  --accent-red: #ef5011;
  --text-dark: #34230b;
  --text-body: #3e3a38;
  --text-gold: #f9e397;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  /* JS 会动态同步为 min(window.innerWidth, 540) / 10，确保 10rem 精准适配 */
  font-size: 54px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-page);
  color: var(--text-dark);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 0.37333rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  border: 0;
}

button,
input {
  font-family: inherit;
  outline: none;
}

.app-shell {
  width: 10rem;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

/* 按钮呼吸缩放动画 */
@keyframes btnPulse {
  from { transform: scale(1); }
  to { transform: scale(0.92); }
}

@keyframes marqueeScroll {
  0% { transform: translateX(10rem); }
  100% { transform: translateX(-100%); }
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-0.1rem); }
  40% { transform: translateX(0.1rem); }
  60% { transform: translateX(-0.08rem); }
  80% { transform: translateX(0.08rem); }
}

@keyframes bouncePop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* 顶部公告跑马灯 */
.top-marquee {
  width: 100%;
  height: 0.64rem;
  background: #3d2c16;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 20;
}

.top-marquee__track {
  white-space: nowrap;
  color: #a58e64;
  font-size: 0.29333rem;
  display: inline-block;
  animation: marqueeScroll 24s linear infinite;
}

/* 公共页脚 */
.public-footer {
  width: 100%;
  padding: 0.4rem 0.4rem 0.6rem;
  text-align: center;
}

.public-footer__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  font-size: 0.37333rem;
  color: #fff;
}

.public-footer__line {
  width: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 233, 168, 0.7), transparent);
}

.public-footer__serve {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1rem;
  font-size: 0.32rem;
  color: #fff;
  margin: 0.3rem 0 0.36rem;
}

.public-footer__serve .link-btn {
  color: #e58f00;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: inherit;
}

.public-footer__honesty {
  width: 3.65333rem;
  display: block;
  margin: 0 auto 0.42rem;
}

.public-footer__disclaimer {
  width: 9.2rem;
  margin: 0 auto;
  background: #fae687;
  color: #5a2908;
  border-radius: 0.2rem;
  padding: 0.34rem 0.4rem;
  text-align: left;
  font-size: 0.3rem;
  line-height: 1.65;
}

.public-footer__disclaimer h4 {
  text-align: center;
  font-size: 0.36rem;
  margin-bottom: 0.14rem;
  font-weight: 700;
}

/* 子页面顶部导航条 */
.sub-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 1.06667rem;
  background: #3d1d06;
  border-bottom: 1px solid rgba(249, 227, 151, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.36rem;
  color: #f9e397;
}

.sub-navbar__btn {
  color: #f9e397;
  text-decoration: none;
  font-size: 0.34667rem;
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  cursor: pointer;
  background: none;
  border: none;
}

.sub-navbar__title {
  font-size: 0.42667rem;
  font-weight: 700;
  font-family: "FZYanSongS-B-GB", "PingFang SC", serif;
  color: #ffe9a8;
}

/* Toast 轻提示 */
.ui-toast {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  max-width: 8rem;
  background: rgba(20, 12, 5, 0.86);
  color: #fff8e7;
  padding: 0.28rem 0.5rem;
  border-radius: 0.18rem;
  font-size: 0.36rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ui-toast.show {
  opacity: 1;
}

/* 通用模态弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
}

.modal-mask.open {
  display: flex;
}

.modal-card {
  width: 8.6rem;
  max-height: 80vh;
  background: #fffbf1;
  border: 1px solid #d9a441;
  border-radius: 0.32rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #34230b;
}

.modal-card__head {
  padding: 0.36rem 0.44rem;
  background: linear-gradient(180deg, #fce2a6, #f5cf7b);
  font-size: 0.42667rem;
  font-weight: 700;
  text-align: center;
  color: #5a2908;
  position: relative;
}

.modal-card__close {
  position: absolute;
  right: 0.32rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 0.52rem;
  color: #5a2908;
  cursor: pointer;
  line-height: 1;
}

.modal-card__body {
  padding: 0.42rem;
  overflow-y: auto;
  font-size: 0.34667rem;
  line-height: 1.7;
  color: #4a351c;
}

.modal-card__foot {
  padding: 0.24rem 0.42rem 0.38rem;
  text-align: center;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  height: 0.96rem;
  padding: 0 0.56rem;
  border-radius: 0.48rem;
  border: none;
  background: linear-gradient(180deg, #f79d1e, #d9570c);
  color: #fff9e3;
  font-size: 0.38rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-gold:active {
  transform: scale(0.96);
}

/* ==========================================================================
   自定义公历/农历 4 列滚轮日期时间选择器弹窗
   ========================================================================== */

.picker-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.58);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.picker-mask.open {
  display: flex;
}

.picker-sheet {
  width: 10rem;
  background: #fffbf1;
  border-radius: 0.36rem 0.36rem 0 0;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.4rem;
  border-bottom: 1px solid #ead8b1;
  background: #fdf3dc;
}

.picker-btn {
  background: none;
  border: none;
  font-size: 0.38rem;
  cursor: pointer;
  padding: 0.08rem 0.16rem;
}

.picker-btn--cancel {
  color: #8b6f47;
}

.picker-btn--confirm {
  color: #d9570c;
  font-weight: 700;
}

.picker-tabs {
  display: inline-flex;
  border: 1px solid #c98e3b;
  border-radius: 0.44rem;
  overflow: hidden;
  background: #fff;
}

.picker-tab {
  padding: 0.1rem 0.42rem;
  font-size: 0.34667rem;
  border: none;
  background: transparent;
  color: #6b4319;
  cursor: pointer;
}

.picker-tab.active {
  background: #e56a12;
  color: #fff;
  font-weight: 700;
}

.picker-preview {
  text-align: center;
  padding: 0.2rem 0.3rem;
  font-size: 0.32rem;
  color: #8c5a20;
  background: #fff8e7;
  border-bottom: 1px solid #f0e1bf;
}

.picker-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1.95fr;
  height: 5.2rem;
  position: relative;
  background: #fffbf1;
}

.picker-col {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 2.08rem 0;
  scrollbar-width: none;
}

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

.picker-option {
  height: 1.04rem;
  line-height: 1.04rem;
  text-align: center;
  font-size: 0.34667rem;
  color: #9e8a6c;
  scroll-snap-align: center;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 0.08rem;
  transition: color 0.15s, font-weight 0.15s;
}

.picker-option.selected {
  color: #34230b;
  font-weight: 700;
  font-size: 0.37333rem;
}

.picker-highlight-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 2.08rem;
  height: 1.04rem;
  border-top: 1px solid #e5c382;
  border-bottom: 1px solid #e5c382;
  background: rgba(247, 128, 0, 0.08);
  pointer-events: none;
}
