/* ============================================================
 *  纪念日网页 · 样式表（粉色调）
 *  布局：100dvh 动态高度，字号/padding 随视口自适应，
 *        保证手机浏览器地址栏出现时所有内容仍在屏幕内
 * ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;       /* iOS Safari 动态视口高度，跟随地址栏变化 */
  overflow: hidden;      /* 禁止上下滑动 */
}

body {
  background: linear-gradient(160deg, #ffc9d6 0%, #ffdfe6 50%, #ffb8cc 100%);
  /* 微信同款字体栈：中文用苹方，数字用 DIN/SF */
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #8a2a4a;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* ---------- 外层容器（透明背景，只起布局作用） ---------- */
.wrapper {
  width: 100%;
  max-width: 540px;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 16px);
}

/* ---------- 卡片通用：flex:1 自动等高 ---------- */
.card {
  width: 100%;
  flex: 1;
  min-height: 0;       /* 允许 flex 子项收缩，关键 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4vh, 36px) clamp(14px, 4vw, 24px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(150, 40, 80, 0.15);
  text-align: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(200, 100, 130, 0.2);
}

/* ---------- 卡片小标题 ---------- */
.label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: clamp(13px, 2.2vh, 16px);
  font-weight: 500;
  letter-spacing: 1px;
  color: #d4789a;
  margin-bottom: clamp(4px, 1.2vh, 14px);
}
.label svg {
  color: #e88aa8;
  flex-shrink: 0;
  width: clamp(14px, 2.2vh, 18px);
  height: auto;
}

/* ---------- 生日卡片时间 ---------- */
.birthday-card .time {
  /* 微信数字风格：DIN Alternate / SF Pro 等宽数字 */
  font-family: "DIN Alternate", "SF Pro Display", "Helvetica Neue", "SF Mono",
               "Roboto Mono", "Menlo", monospace;
  font-size: clamp(18px, 4.5vh, 32px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: #c2507a;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1.2;
  margin-bottom: clamp(6px, 1.5vh, 18px);
}
.birthday-card .divider {
  margin-bottom: clamp(4px, 1.2vh, 12px);
}

/* ---------- 中间纪念日卡片 ---------- */
.anniversary-card {
  background: rgba(255, 255, 255, 0.85);
}
.anniversary-card .label {
  font-size: clamp(15px, 2.5vh, 18px);
  font-weight: 600;
  color: #c2507a;
}

/* 超大天数 */
.big-days {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 12px);
  margin: clamp(2px, 1vh, 8px) 0 clamp(4px, 1.2vh, 14px);
}
.big-days .days {
  font-family: "DIN Alternate", "SF Pro Display", "Helvetica Neue", "Roboto", sans-serif;
  font-size: clamp(44px, 11vh, 110px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #c2507a;
  line-height: 1;
  letter-spacing: 1px;
}
.big-days .days-unit {
  font-size: clamp(14px, 3vh, 24px);
  color: #d4789a;
  font-weight: 500;
}

/* 分隔线 */
.divider {
  width: 60%;
  height: 1px;
  margin: 0 auto clamp(4px, 1.2vh, 12px);
  background: linear-gradient(90deg, transparent, rgba(212, 120, 154, 0.5), transparent);
}

/* 起始日期 */
.sub-date {
  font-size: clamp(11px, 1.8vh, 14px);
  color: #d4789a;
  letter-spacing: 1px;
  margin-bottom: clamp(4px, 1.2vh, 16px);
}

/* 今日已过去的时分秒 */
.sub-time {
  font-family: "DIN Alternate", "SF Pro Display", "Helvetica Neue", "SF Mono",
               "Roboto Mono", "Menlo", monospace;
  font-size: clamp(18px, 4.5vh, 32px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: #c2507a;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1.2;
}

/* ---------- 逐位数字动画 ---------- */
.digit {
  display: inline-block;
  min-width: 0.62em;
  text-align: center;
  will-change: transform, opacity;
}
.digit.changed {
  animation: digitChange 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes digitChange {
  0%   { opacity: 0.2; transform: translateY(-6px); }
  100% { opacity: 1;   transform: translateY(0); }
}
.colon {
  display: inline-block;
  padding: 0 0.08em;
  opacity: 0.7;
}

/* 生日当天替换文字 */
.wish-text {
  font-size: clamp(16px, 3.5vh, 22px);
  font-weight: 600;
  color: #d2607c;
  padding: 10px 0;
}

/* ---------- 底部随机情话 ---------- */
.love-quote {
  text-align: center;
  font-size: clamp(11px, 2vh, 14px);
  line-height: 1.6;
  color: #6b1f3a;
  padding: clamp(4px, 1vh, 6px) 12px 2px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  max-width: 100%;
  font-weight: 500;
  height: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}
.love-quote .quote-text {
  display: inline-block;
  padding-right: 3em;   /* 两段之间的间隔 */
}

/* 长文案跑马灯：track 整体从右往左循环 */
.love-quote.marquee {
  justify-content: flex-start;
}
.love-quote .marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marqueeScroll 15s linear infinite;
}
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 加载小转圈 */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(107, 31, 58, 0.25);
  border-top-color: #6b1f3a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
 *  生日祝福特效
 * ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(120, 40, 70, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.overlay.show {
  display: flex;
  opacity: 1;
}
.overlay .wish {
  position: relative;
  z-index: 2;
  font-size: clamp(22px, 5vh, 32px);
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 4px 20px rgba(255, 150, 180, 0.8);
  animation: wishPop 1.2s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}
@keyframes wishPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.confetti {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  opacity: 0.9;
  z-index: 1;
  animation: confettiFall linear infinite;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.7; }
}
