/* ==========================================================================
   例假鸭 · 视觉主题
   风格：浅色、雾面渐变（粉 → 紫 → 蓝），大圆角、极淡阴影、大量留白
   这个文件在 app.css / ui.css 之后加载，用来统一覆盖生成样式的取色与质感。
   ========================================================================== */

:root {
  /* 主色：柔和的粉（经期 / 主操作） */
  --pink: #F5829B;
  --pink-deep: #E86A86;
  --pink-soft: #FFF0F4;
  --pink-line: #FBD8E1;

  /* 次色：雾紫（易孕期 / 信息） */
  --lilac: #9B8BE8;
  --lilac-deep: #8271DC;
  --lilac-soft: #F5F2FE;
  --lilac-line: #E4DEFB;

  /* 点缀：淡蓝 */
  --blue: #8AB4F8;
  --blue-soft: #EEF5FF;

  /* 文字 */
  --ink: #2B2B33;
  --ink-2: #6B6B78;
  --ink-3: #A3A3AF;

  /* 线条与卡片 */
  --line: #F2F0F5;
  --card: #FFFFFF;

  /* 覆盖 app.css 里的小程序旧变量 */
  --coral: #F5829B;
  --coral-deep: #E86A86;
  --coral-soft: #FFF0F4;
  --coral-line: #FBD8E1;
  --purple: #9B8BE8;
  --purple-deep: #8271DC;
  --purple-soft: #F5F2FE;
  --text: #2B2B33;
  --text-sub: #6B6B78;
  --text-hint: #A3A3AF;
  --danger: #E4697C;
}

/* ---------- 基础 ---------- */

body {
  background: linear-gradient(180deg, #FBF9FC 0%, #F6F7FA 100%);
  color: var(--ink);
}

#app {
  background: #FFFFFF;
}

.page {
  padding-bottom: 8px;
}

/* ---------- 卡片：白底 + 极淡边 + 雾面阴影 ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(43, 43, 51, 0.02), 0 10px 24px -18px rgba(43, 43, 51, 0.16);
  transition: box-shadow 0.25s;
}

.card--flat {
  box-shadow: none;
  background: linear-gradient(135deg, #FFFBFC 0%, #FAF8FE 100%);
}

/* 重点卡片：淡粉蓝渐变（参考截图那种雾面感） */
.card--hero-soft {
  background: linear-gradient(135deg, #FFF7F9 0%, #F8F4FE 52%, #F2F8FF 100%);
  border-color: #F7EEF3;
}

.section-title {
  color: var(--ink);
}

.section-sub,
.hint {
  color: var(--ink-3);
}

/* ---------- 首页顶部：淡渐变卡 + 环 ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 20px;
  margin-bottom: 16px;
  border-radius: 26px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid #F7EEF3;
  box-shadow: 0 8px 30px -22px rgba(245, 130, 155, 0.5);
}

/* 右上角一团柔光 */
.hero::after {
  content: "";
  position: absolute;
  top: -70%;
  right: -18%;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.hero--coral {
  background: linear-gradient(135deg, #FFF3F6 0%, #FDEAF1 46%, #F6F1FE 100%);
  border-color: #FBE3EA;
}

.hero--purple {
  background: linear-gradient(135deg, #F7F3FE 0%, #F0F3FE 52%, #EDF6FF 100%);
  border-color: #E9E3FA;
}

.hero--calm {
  background: linear-gradient(135deg, #F8F8FB 0%, #F2F3F8 100%);
  border-color: #EFEFF4;
}

.hero--warn {
  background: linear-gradient(135deg, #FFF8EF 0%, #FDEEE1 100%);
  border-color: #F8E4D2;
}

.hero__ring {
  position: relative;
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  z-index: 1;
}

.hero__ring svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero__ring-bg {
  fill: none;
  stroke: rgba(43, 43, 51, 0.07);
  stroke-width: 7;
}

.hero__ring-fg {
  fill: none;
  stroke: url(#heroGrad);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero__ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hero__ring-day {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.hero__ring-unit {
  margin-top: 3px;
  font-size: 10px;
  color: var(--ink-3);
}

.hero__info {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.hero__tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--pink-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px -4px rgba(245, 130, 155, 0.5);
}

.hero--purple .hero__tag {
  color: var(--lilac-deep);
  box-shadow: 0 2px 8px -4px rgba(155, 139, 232, 0.5);
}

.hero--warn .hero__tag {
  color: #C77A2E;
}

.hero--calm .hero__tag {
  color: var(--ink-2);
}

.hero__title {
  margin-top: 9px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.hero__sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-2);
}

.hero__hint {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(43, 43, 51, 0.06);
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ---------- 日期状态（粉色系，低饱和） ---------- */

.p-calendar .num--recorded-period {
  background: linear-gradient(135deg, #F98BA4 0%, #F5829B 100%);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 3px 10px -6px rgba(245, 130, 155, 0.9);
}

.p-calendar .num--inferred-period {
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-weight: 600;
}

.p-calendar .num--predicted-period {
  background: #FFF8FA;
  border: 1.5px dashed var(--pink-line);
  color: var(--pink-deep);
  line-height: 47px;
}

.p-calendar .num--fertile {
  background: var(--lilac-soft);
  color: var(--lilac-deep);
}

.p-calendar .num--ovulation {
  background: #EFEBFE;
  color: var(--lilac-deep);
  font-weight: 600;
}

.p-calendar .num--today {
  animation: period-today-pulse 2.8s ease-in-out infinite;
}

.p-calendar .num--selected {
  animation: none;
  box-shadow: 0 0 0 4px rgba(43, 43, 51, 0.82);
}

@keyframes period-today-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245, 130, 155, 0.24); }
  50% { box-shadow: 0 0 0 7px rgba(245, 130, 155, 0.08); }
}

/* 测试数据保持灰色虚线（一眼能和真实的粉色分开） */
.p-calendar .cell--test .num--recorded-period,
.p-calendar .cell--test .num--inferred-period {
  background: transparent;
  border: 1.5px dashed #C2C2CE;
  color: var(--ink-3);
  box-shadow: none;
}

/* ---------- 按钮 ---------- */

.btn--primary {
  background: linear-gradient(135deg, #F98BA4 0%, #F5829B 55%, #EE7191 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 22px -12px rgba(245, 130, 155, 0.95);
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.15s;
}

.btn--primary:active {
  transform: scale(0.985);
  box-shadow: 0 4px 14px -10px rgba(245, 130, 155, 0.9);
}

.btn--ghost {
  background: #FFFFFF;
  color: var(--pink-deep);
  border: 1px solid var(--pink-line);
  transition: transform 0.12s, background 0.18s;
}

.btn--ghost:active {
  background: var(--pink-soft);
  transform: scale(0.985);
}

.btn--danger {
  color: var(--danger);
  border-color: #F6DCE0;
}

/* ---------- 选项 chip ---------- */

.chip {
  background: #F7F6F9;
  border: 1px solid #F0EEF3;
  color: var(--ink-2);
  border-radius: 999px;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s, box-shadow 0.2s;
}

.chip:active {
  transform: scale(0.94);
}

.chip--on {
  background: var(--pink-soft);
  border-color: var(--pink-line);
  color: var(--pink-deep);
  font-weight: 600;
  box-shadow: 0 4px 12px -8px rgba(245, 130, 155, 0.85);
}

/* ---------- 进度 / 徽章 / 分割 ---------- */

.badge {
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.divider {
  background: var(--line);
}

/* ---------- 动效：页面切换淡入 ---------- */

@keyframes period-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

#view.route-enter > .page {
  animation: period-page-in 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}

/* 卡片逐个淡入（同一页里按顺序轻微上浮，最多 6 张） */
@keyframes period-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

#view.route-enter > .page > .card,
#view.route-enter > .page > .hero {
  animation: period-card-in 0.32s cubic-bezier(0.32, 0.72, 0, 1) backwards;
}

#view.route-enter > .page > *:nth-child(1) { animation-delay: 0.02s; }
#view.route-enter > .page > *:nth-child(2) { animation-delay: 0.06s; }
#view.route-enter > .page > *:nth-child(3) { animation-delay: 0.1s; }
#view.route-enter > .page > *:nth-child(4) { animation-delay: 0.14s; }
#view.route-enter > .page > *:nth-child(5) { animation-delay: 0.18s; }
#view.route-enter > .page > *:nth-child(6) { animation-delay: 0.22s; }

/* ---------- 骨架屏 ---------- */

@keyframes period-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  border-radius: 22px;
  background: linear-gradient(90deg, #F7F6F9 25%, #FBFAFC 50%, #F7F6F9 75%);
  background-size: 200% 100%;
  animation: period-shimmer 1.4s linear infinite;
}

.skeleton--hero { height: 132px; margin-bottom: 16px; }
.skeleton--card { height: 180px; margin-bottom: 16px; }
.skeleton--line { height: 14px; border-radius: 8px; margin: 10px 0; }

/* ---------- 折叠区块（收起次要信息） ---------- */

.fold {
  border-radius: 18px;
  background: #FBFAFC;
  border: 1px solid var(--line);
  overflow: hidden;
}

.fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fold > summary::-webkit-details-marker { display: none; }

.fold > summary::after {
  content: "›";
  font-size: 16px;
  color: var(--ink-3);
  transition: transform 0.2s;
}

.fold[open] > summary::after {
  transform: rotate(90deg);
}

.fold__body {
  padding: 0 16px 14px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-3);
}

.fold__body p { margin: 0 0 8px; }
.fold__body p:last-child { margin-bottom: 0; }

/* ---------- 尊重减少动态效果 ---------- */

@media (prefers-reduced-motion: reduce) {
  .p-calendar .num--today,
  #view.route-enter > .page,
  #view.route-enter > .page > .card,
  #view.route-enter > .page > .hero,
  .skeleton {
    animation: none !important;
  }
  .hero__ring-fg { transition: none; }
}

/* ---------- 底部 tab：加图标 ---------- */

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 9px;
}

.tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.tab svg *[fill="currentColor"] {
  fill: currentColor;
  stroke: none;
}

.tab--on svg {
  stroke-width: 2.1;
  transform: translateY(-1px);
}

.tab__text {
  font-size: 10.5px;
  letter-spacing: 0.3px;
}

/* ---------- 日历：滑动区域 + 格子加大 ---------- */

.cal-swipe {
  will-change: transform;
  touch-action: pan-y;   /* 竖向滚动交给浏览器，横向手势留给我们切月 */
}

.p-calendar .cell { height: 50px; }

.p-calendar .num {
  width: 34px;
  height: 34px;
  line-height: 34px;
  font-size: 15px;
}

.p-calendar .num--predicted-period { line-height: 31px; }

.grid--mini .num {
  width: 26px;
  height: 26px;
  line-height: 26px;
  font-size: 12px;
}

.grid--mini .num--predicted-period { line-height: 23px; }

/* ---------- 空状态插画 ---------- */

.empty {
  padding: 64px 24px;
}

.empty__art {
  line-height: 0;
  margin-bottom: 16px;
}

.empty__art svg {
  filter: drop-shadow(0 12px 26px rgba(245, 130, 155, 0.18));
}

.empty__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.empty__desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------- 保存成功态 ---------- */

.btn--saved {
  background: linear-gradient(135deg, #86C9A8 0%, #57B98C 100%) !important;
  box-shadow: 0 8px 22px -12px rgba(87, 185, 140, 0.9) !important;
}

/* ---------- 折叠块间距 ---------- */

.fold { margin-bottom: 10px; }

/* ---------- 图例更轻 ---------- */

.legend {
  margin-top: 14px;
  opacity: 0.82;
}

.legend__text {
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ---------- 免责小字更淡 ---------- */

.disclaimer {
  color: #B8B8C2;
  font-size: 10.5px;
  line-height: 1.65;
}
