/* ============================================================
   杏林送福 · 幸运大抽奖 —— 中医淡雅风格
   宣纸米色底 / 墨褐文字 / 竹青·茶褐点缀 / 朱砂仅作印章式提亮
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  color: #4a3b2c;
  background:
    radial-gradient(ellipse 60% 30% at 12% 4%, rgba(122, 143, 112, .10), transparent 60%),
    radial-gradient(ellipse 50% 26% at 88% 12%, rgba(166, 124, 82, .10), transparent 60%),
    radial-gradient(ellipse 70% 32% at 50% 100%, rgba(122, 143, 112, .08), transparent 65%),
    linear-gradient(180deg, #f6f1e4 0%, #f1ead9 55%, #ede4d0 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
#app { max-width: 430px; margin: 0 auto; min-height: 100vh; padding-bottom: 26px; }

/* ============ 通用按钮 ============ */
.btn-primary {
  display: inline-block; border: none; outline: none; cursor: pointer;
  background: linear-gradient(180deg, #b25a4b, #93402f);       /* 朱砂 */
  color: #fdf6e8; font-size: 16px; font-weight: 600; letter-spacing: 3px;
  padding: 12px 28px; border-radius: 10px;
  border: 1px solid #8a3a2a;
  box-shadow: 0 3px 8px rgba(120, 60, 40, .28), inset 0 1px 0 rgba(255, 246, 224, .35);
  transition: transform .12s ease, opacity .2s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.btn-ghost {
  border: 1px solid #a5784e; background: transparent; color: #8a6238;
  font-size: 15px; font-weight: 600; letter-spacing: 2px;
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
  background: rgba(255, 253, 246, .7);
}

/* ============ 关注引导页 ============ */
.gate { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 24px 18px; }
.gate-card {
  width: 100%; text-align: center;
  background: #fffdf6; border: 1px solid #ddd0b4; border-radius: 14px;
  box-shadow: 0 8px 26px rgba(110, 88, 56, .14);
  padding: 36px 24px 22px;
  position: relative;
}
.gate-card::before {  /* 内描边框，仿装裱 */
  content: ""; position: absolute; inset: 7px;
  border: 1px solid #e8ddc4; border-radius: 9px; pointer-events: none;
}
.gate-logo {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%;
  background: linear-gradient(150deg, #e9f0e2, #c6d4b8);
  border: 1px solid #b3c4a4;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  box-shadow: 0 4px 10px rgba(96, 118, 84, .22);
}
.gate-title { font-size: 23px; color: #4a3b2c; letter-spacing: 2px; font-weight: 700; }
.gate-sub { font-size: 13px; color: #9b8a6d; margin: 9px 0 26px; letter-spacing: 1px; }
.gate-tip { font-size: 12px; color: #b3a385; margin-top: 14px; line-height: 1.7; }
.follow-tip { font-size: 15px; color: #93402f; font-weight: 600; margin-bottom: 16px; letter-spacing: 1px; }
.qrcode { margin-bottom: 20px; }
.qr-img { width: 170px; height: 170px; border-radius: 8px; border: 1px solid #e3d8bf; }
.qr-fake {
  width: 170px; height: 170px; margin: 0 auto; border-radius: 8px;
  border: 1px dashed #c9ba97;
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(0deg, rgba(74, 59, 44, .55) 0 5px, transparent 5px 12px),
    repeating-linear-gradient(90deg, rgba(74, 59, 44, .55) 0 5px, #fbf7ec 5px 12px);
  position: relative;
}
.qr-fake span {
  background: #fffdf6; padding: 4px 10px; border-radius: 4px;
  font-size: 12px; color: #8a7a5f; position: relative; z-index: 1; border: 1px solid #e3d8bf;
}
.qr-tip { font-size: 12px; color: #a79677; margin-top: 10px; }
.demo-tag { font-size: 11px; color: #bcae8f; margin-top: 18px; }

/* ============ 顶部横幅 ============ */
.banner { text-align: center; padding: 30px 12px 4px; }
.banner-orn { font-size: 12px; color: #b7a683; letter-spacing: 4px; margin-bottom: 8px; }
.banner h1 {
  font-size: 27px; font-weight: 700; letter-spacing: 3px; color: #47402f;
  text-shadow: 0 1px 0 rgba(255, 252, 240, .9);
}
.banner p { font-size: 13px; color: #8a7a5c; margin-top: 8px; letter-spacing: 2px; }

/* ============ 用户信息卡片 ============ */
.user-card {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 14px 0; padding: 12px 14px;
  background: #fffdf6; border: 1px solid #e2d7bd; border-radius: 12px;
  box-shadow: 0 4px 14px rgba(110, 88, 56, .10);
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, #e9f0e2, #c6d4b8);
  border: 1px solid #b3c4a4;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.nick { font-size: 16px; font-weight: 600; color: #4a3b2c; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; letter-spacing: 1px; }
.sub-badge.ok { background: #eaf1e3; color: #5c7a52; border: 1px solid #c2d4b4; }
.sub-badge.no { background: #f6e8e2; color: #a04a38; border: 1px solid #e2c4b6; }
.chance-chip {
  flex: none; text-align: center; font-size: 11px; color: #7c6743; line-height: 1.5;
  background: linear-gradient(180deg, #f7f0dd, #efe4c8);
  border: 1px solid #ddcb9f; border-radius: 10px; padding: 6px 10px;
}
.chance-chip b { font-size: 18px; color: #93402f; }

/* ============ 转盘 ============ */
.wheel-area { display: flex; flex-direction: column; align-items: center; padding: 26px 0 4px; }
.wheel-ring {
  position: relative;
  width: 320px; height: 320px; border-radius: 50%; padding: 13px;
  background: linear-gradient(160deg, #d8c193, #b08d55 55%, #8f6f3e);  /* 茶褐描金 */
  border: 1px solid #9c7c48;
  box-shadow: 0 8px 24px rgba(110, 88, 56, .28), inset 0 2px 3px rgba(255, 248, 226, .55);
}
.wheel {
  width: 100%; height: 100%; border-radius: 50%; position: relative; overflow: hidden;
  background: conic-gradient(
    #fffdf4 0deg 45deg,   #f6eedb 45deg 90deg,
    #fffdf4 90deg 135deg, #f6eedb 135deg 180deg,
    #fffdf4 180deg 225deg,#f6eedb 225deg 270deg,
    #fffdf4 270deg 315deg,#f6eedb 315deg 360deg
  );
  box-shadow: inset 0 0 0 3px rgba(156, 124, 72, .30);
  transition: transform 4.6s cubic-bezier(.16, .68, .1, .995);
  will-change: transform;
}
.prize-item {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-92px);
  pointer-events: none;
}
.prize-item .p-icon { font-size: 25px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(110, 88, 56, .22)); }
.prize-item .p-name { font-size: 13px; font-weight: 700; color: #7a4a33; letter-spacing: 1px; }
.prize-item .p-desc { font-size: 10px; color: #a08a64; white-space: nowrap; }

.wheel-pointer {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  color: #a5493f; font-size: 25px; line-height: 1;
  text-shadow: 0 2px 3px rgba(90, 50, 30, .4); z-index: 3;
}
.wheel-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 88px; height: 88px; border-radius: 50%;
  border: 3px solid #ecdcba; outline: none; cursor: pointer;
  background: radial-gradient(circle at 32% 26%, #bd6252, #93402f 72%);  /* 朱砂印章 */
  color: #fdf3e0; font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: 3px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  box-shadow: 0 5px 12px rgba(110, 50, 30, .4), inset 0 2px 3px rgba(255, 240, 214, .45);
  z-index: 4; transition: transform .12s;
}
.wheel-btn:active { transform: translate(-50%, -50%) scale(.94); }
.wheel-btn[disabled] { filter: grayscale(.6); cursor: not-allowed; }
.wheel-btn.spinning { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(.96); } }

.bulb {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px;
  border-radius: 50%; background: #f4e7c3; z-index: 2;
  box-shadow: 0 0 5px rgba(238, 220, 170, .9);
  animation: blink 1.2s ease-in-out infinite alternate;
}
@keyframes blink { from { opacity: 1; } to { opacity: .3; } }

.wheel-tip { font-size: 12px; color: #a08a64; margin-top: 14px; letter-spacing: 1px; }

/* ============ 通用卡片（规则 / 中奖名单） ============ */
.card {
  margin: 16px 14px 0; background: #fffdf6;
  border: 1px solid #e2d7bd; border-radius: 12px;
  padding: 16px; box-shadow: 0 4px 14px rgba(110, 88, 56, .10);
  position: relative;
}
.card h3 {
  font-size: 16px; color: #47402f; margin-bottom: 10px; letter-spacing: 2px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card h3::before { content: ""; width: 4px; height: 15px; background: #9c7c48; border-radius: 2px; }
.rules ol { padding-left: 18px; }
.rules li { font-size: 13px; color: #7c6b50; line-height: 1.95; }
.rules b { color: #93402f; }

/* ============ 中奖名单（所有用户） ============ */
.records-head { display: flex; align-items: baseline; justify-content: space-between; }
.rec-stats { font-size: 12px; color: #a08a64; }
.rec-list { list-style: none; }
.rec-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px dashed #e8ddc4;
}
.rec-list li:last-child { border-bottom: none; }
.rec-list li.mine { background: linear-gradient(90deg, rgba(199, 178, 128, .10), transparent); border-radius: 8px; }
.rec-icon {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: linear-gradient(150deg, #f4eeda, #ece0c2);
  border: 1px solid #e0d2ae;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.rec-main { flex: 1; min-width: 0; }
.rec-name { font-size: 14px; font-weight: 600; color: #4a3b2c; display: flex; align-items: center; gap: 6px; }
.me-badge {
  flex: none; font-size: 10px; color: #fdf3e0; background: #a5493f;
  border-radius: 4px; padding: 1px 5px; letter-spacing: 1px;
}
.rec-prize { font-size: 12px; color: #8a7351; margin-top: 3px; }
.rec-time { font-size: 11px; color: #b3a385; margin-top: 2px; }
.rec-badge {
  flex: none; font-size: 11px; padding: 3px 9px; border-radius: 999px; letter-spacing: 1px;
  background: #f4ecd6; color: #8a6a2f; border: 1px solid #e0cfa2;
}
.empty { text-align: center; font-size: 13px; color: #b3a385; padding: 26px 0 8px; }
.records-note { text-align: center; font-size: 11px; color: #c2b394; margin-top: 8px; letter-spacing: 1px; }
.records-foot { text-align: center; margin-top: 8px; }
.records-foot a { font-size: 11px; color: #c2b394; text-decoration: underline; }

.foot { text-align: center; font-size: 11px; color: #b3a385; margin-top: 20px; padding: 0 20px; letter-spacing: 1px; }

/* ============ 结果弹窗 ============ */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(58, 46, 30, .55);
  display: flex; align-items: center; justify-content: center; padding: 30px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 320px; text-align: center;
  background: #fffdf6; border: 1px solid #ddd0b4; border-radius: 14px;
  padding: 30px 22px 22px; position: relative;
  box-shadow: 0 18px 50px rgba(50, 38, 20, .4);
  animation: pop .28s cubic-bezier(.34, 1.56, .64, 1);
}
.modal::before {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid #e8ddc4; border-radius: 9px; pointer-events: none;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.modal-emoji { font-size: 52px; line-height: 1; }
.modal h2 { font-size: 22px; color: #93402f; margin: 12px 0 8px; letter-spacing: 2px; }
.modal-prize { font-size: 15px; color: #4a3b2c; font-weight: 600; }
.modal-note { font-size: 12px; color: #a08a64; margin: 10px 0 18px; }
.modal-btns { display: flex; gap: 12px; justify-content: center; position: relative; }

/* ============ Toast ============ */
#toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%) translateY(8px);
  background: rgba(58, 46, 30, .85); color: #f6efdd; font-size: 13px;
  padding: 10px 18px; border-radius: 8px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .25s ease;
  max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
