/* 小月亮 · 手机网页
   只有粉、灰、白三个颜色。浅灰白打底，粉做点缀，圆角大一点、边软一点。 */

:root {
  --paper: #F8F7F8;
  --paper-2: #F2F0F1;
  --card: #FFFFFF;
  --ink: #3D3437;
  --ink-2: #716468;
  --muted: #A99CA1;
  --line: #F2EAED;
  --line-strong: #E9DEE2;

  --rose: #F7B9CB;
  --rose-soft: #FDEEF3;
  --rose-mist: #FEF7F9;
  --rose-mid: #F29CB6;
  --rose-deep: #E0728F;
  --rose-deeper: #C85E7B;

  /* 四个阶段只用粉的深浅和灰区分 */
  --p-menstrual: #E4728F;
  --p-follicular: #F8C9D6;
  --p-ovulation: #F29CB6;
  --p-luteal: #C6BBBF;

  --r-card: 26px;
  --r-btn: 999px;
  --r-chip: 16px;
  --r-sheet: 30px;

  --shadow: 0 2px 6px rgba(200, 110, 135, 0.04), 0 14px 34px rgba(200, 110, 135, 0.07);
  --shadow-soft: 0 6px 18px rgba(200, 110, 135, 0.06);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}


button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 外壳 ── */

.app {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px 18px;
}

.topbar-date {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.crow {
  width: 46px;
  height: 52px;
  flex: 0 0 auto;
  display: block;
  animation: crow-float 4.8s ease-in-out infinite;
  transform-origin: 50% 70%;
}

.crow-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(61, 52, 55, 0.14));
}

@keyframes crow-float {
  0%,
  100% {
    transform: translateY(0) rotate(2deg);
  }
  50% {
    transform: translateY(-3px) rotate(-2deg);
  }
}

.topbar-hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}

/* ── 云朵团子（放在环里） ── */

.mascot {
  position: relative;
  width: 64px;
  height: 54px;
  margin: 4px auto 0;
  cursor: pointer;
  animation: mascot-float 4.4s ease-in-out infinite;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 5px 9px rgba(224, 114, 143, 0.16));
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 5px 9px rgba(224, 114, 143, 0.16));
}

.mascot-spark {
  position: absolute;
  top: -7px;
  right: -9px;
  font-size: 11px;
  line-height: 1;
  color: var(--rose-deep);
  animation: spark-twinkle 3.4s ease-in-out infinite;
}

@keyframes spark-twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) rotate(14deg);
  }
}

/* ── 内容 ── */

.view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
  animation: view-in 260ms var(--ease-out) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fffcfd 100%);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
}

.card-tight {
  padding: 17px;
}

/* ── 底部导航 ── */

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(251, 248, 249, 0.76) 0%, rgba(251, 248, 249, 0.97) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(233, 222, 226, 0.6);
  z-index: 30;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 6px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11px;
  background: transparent;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.tab svg {
  width: 22px;
  height: 22px;
  transition: transform 220ms var(--ease-bounce);
}

.tab.is-active {
  color: var(--rose-deeper);
  font-weight: 600;
  background: var(--rose-soft);
}

.tab.is-active svg {
  transform: translateY(-1px) scale(1.06);
}

/* ── 今日：主卡 ── */

.hero {
  position: relative;
  padding: 22px 20px 18px;
}


.hero > * {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-deeper);
  font-size: 13px;
  font-weight: 600;
}

.phase-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.hero-day {
  font-size: 13px;
  color: var(--muted);
}

.ring-wrap {
  position: relative;
  width: 100%;
  max-width: 258px;
  margin: 8px auto 2px;
  aspect-ratio: 1;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
  animation: ring-in 900ms var(--ease-out) both;
  filter: drop-shadow(0 6px 14px rgba(242, 156, 182, 0.18));
}

@keyframes ring-in {
  from {
    opacity: 0;
    transform: rotate(-90deg) scale(0.82);
  }
}

.ring circle {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  opacity: 0.78;
  transition: stroke-width 260ms var(--ease-out), opacity 260ms var(--ease-out);
}

.ring circle.is-current {
  stroke-width: 14;
  opacity: 1;
  animation: ring-breathe 3.2s ease-in-out infinite;
}

@keyframes ring-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  pointer-events: none;
}

.ring-emoji {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 3px;
  animation: pop-in 620ms var(--ease-bounce) 120ms both;
}

.ring-day {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  animation: pop-in 620ms var(--ease-bounce) 160ms both;
}

.ring-day b {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 1px;
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.66);
  }
  62% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.ring-phase {
  font-size: 14px;
  color: var(--ink-2);
  animation: pop-in 620ms var(--ease-bounce) 220ms both;
}

.ring-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.ring-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ring-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
}

/* 环上那颗小白点：今天走到哪儿了 */
.ring-dot {
  animation: dot-pulse 2.6s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.period-progress {
  margin-top: 8px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--rose-mid));
  transition: width 520ms var(--ease-out);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.hero-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.hero-num {
  text-align: center;
  min-width: 0;
}

.hero-num .k {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.hero-num .v {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-all;
}

.est {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--rose-soft);
  color: var(--rose-deeper);
  font-size: 10px;
  font-weight: 600;
  vertical-align: 2px;
}

/* ── 记录入口 ── */

.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-copy {
  min-width: 0;
}

.record-title {
  font-size: 15px;
  font-weight: 600;
}

.record-sub {
  margin-top: 3px;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(180deg, #F39BB5 0%, #E0728F 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(224, 114, 143, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-ghost {
  background: var(--card);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.btn-soft {
  background: var(--rose-soft);
  color: var(--rose-deeper);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 38px;
  padding: 0 15px;
  font-size: 13px;
  border-radius: var(--r-btn);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
}

/* ── 回看 ── */

.review {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.review-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: var(--rose-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.review-text {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
}

.review-text b {
  color: var(--ink);
  font-weight: 600;
}

/* ── 空状态 ── */

.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 14px;
}

.empty-emoji {
  font-size: 32px;
  margin-bottom: 10px;
  animation: mochi-float 4s ease-in-out infinite;
}

/* ── 日历 ── */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 14px;
}

.cal-month {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cal-nav {
  display: flex;
  gap: 6px;
}

.nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 13px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cal-weekday {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 2px 0 7px;
}

.day {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: 14px;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: transparent;
  transition: background 180ms var(--ease-out);
}

.day.is-blank {
  pointer-events: none;
}

.day.is-period {
  background: #FCE3EA;
  color: #9C4F64;
  font-weight: 600;
}

.day.is-predicted {
  background: var(--rose-mist);
  box-shadow: inset 0 0 0 1.5px var(--rose);
  color: var(--rose-deeper);
}

.day.is-today {
  box-shadow: inset 0 0 0 2px var(--rose-deeper);
}

.day.is-start::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose-deep);
}

.day.has-log::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose-deeper);
}

.day.is-period.has-log::after {
  background: #9C4F64;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  padding: 15px 2px 0;
  font-size: 11px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* ── 统计 ── */

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--rose), var(--rose-mid));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.stat-box {
  background: linear-gradient(180deg, #fef8fa 0%, #fdf3f6 100%);
  border-radius: 18px;
  padding: 14px 14px 12px;
  min-width: 0;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.stat-label {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.compare-line {
  margin-top: 13px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}

.compare-line b {
  color: var(--ink);
}

.length-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.length-chip {
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--rose-mist);
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.length-chip b {
  color: var(--ink);
}

.phase-table {
  display: flex;
  flex-direction: column;
}

.phase-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 4px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.phase-row:last-child {
  border-bottom: 0;
}

.phase-row.head {
  padding: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.phase-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.phase-name .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.phase-cell {
  text-align: right;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.phase-cell.dim {
  color: var(--muted);
}

.pain-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pain-bar {
  display: grid;
  grid-template-columns: 52px 1fr 34px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
}

.pain-bar .track {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.pain-bar .fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--rose-mid));
  transition: width 460ms var(--ease-out);
}

.pain-bar .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

.pain-bar.is-worst .fill {
  background: linear-gradient(90deg, var(--rose-mid), var(--rose-deep));
}

.mood-est {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mood-est-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 14px;
  background: var(--rose-soft);
  color: var(--rose-deeper);
  font-size: 13px;
  font-weight: 600;
}

.med-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.med-row:last-child {
  border-bottom: 0;
}

.med-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ── 设置 ── */

.field {
  margin-bottom: 17px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background 180ms var(--ease-out);
}

.field input:focus,
.field select:focus {
  border-color: var(--rose);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(247, 185, 203, 0.28);
}

.field .hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-row .btn {
  flex: 1 1 auto;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.setting-item:last-child {
  border-bottom: 0;
}

.setting-item .label {
  font-size: 14px;
}

.setting-item .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.danger-zone {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.danger-btn {
  color: var(--rose-deeper);
}

.clean-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.clean-row .field {
  flex: 1;
  margin-bottom: 0;
}

.clean-row .btn {
  flex: 0 0 auto;
}

.med-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 13px;
  margin: 0 6px 6px 0;
  transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.med-chip.is-on {
  background: var(--rose-soft);
  border-color: var(--rose);
  color: var(--rose-deeper);
}

.version {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 10px 0 4px;
}

/* ── 抽屉 ── */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

/* 关键：display:flex 会盖掉 [hidden] 自带的 display:none，
   不写这一行整个透明遮罩会一直盖在页面上，点哪儿都没反应 */
.sheet-wrap[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 52, 55, 0.26);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}

.sheet-wrap.is-open .sheet-backdrop {
  opacity: 1;
}

.sheet {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 440px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #fffbfc 100%);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform 360ms var(--ease-drawer);
  box-shadow: 0 -10px 44px rgba(200, 110, 135, 0.14);
}

.sheet-wrap.is-open .sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 10px auto 2px;
  flex: 0 0 auto;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 20px 10px;
  flex: 0 0 auto;
}

.sheet-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sheet-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: var(--paper-2);
  flex: 0 0 auto;
}

.sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 2px 20px 18px;
  -webkit-overflow-scrolling: touch;
}

.sheet-section {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.sheet-section:last-child {
  border-bottom: 0;
}

.sheet-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

.sheet-label .tip {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: var(--r-chip);
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 13px;
  color: var(--ink-2);
  transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

.chip.is-on {
  background: var(--rose-soft);
  border-color: var(--rose);
  color: var(--rose-deeper);
  font-weight: 600;
}

.chip .ico {
  font-size: 15px;
  line-height: 1;
}

/* 粉色水滴，代替原来系统渲染成蓝色的 💧 */
.drop {
  width: 13px;
  height: 13px;
  fill: currentColor;
  opacity: 0.55;
  flex: 0 0 auto;
}

.chip.is-on .drop {
  opacity: 1;
  fill: var(--rose-deeper);
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.flow-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 2px 9px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.flow-chip.is-on {
  background: var(--rose-soft);
  border-color: var(--rose);
}

.flow-dots {
  display: flex;
  gap: 2.5px;
}

.flow-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 180ms var(--ease-out);
}

.flow-dots i.on {
  background: var(--rose-mid);
}

.flow-chip.is-on .flow-dots i.on {
  background: var(--rose-deep);
}

.flow-label {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.flow-chip.is-on .flow-label {
  color: var(--rose-deeper);
  font-weight: 600;
}

.pain-dots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.pain-dot {
  height: 44px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 11px;
  color: var(--muted);
  transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.pain-dot b {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 600;
}

.pain-dot.is-on {
  background: var(--rose-soft);
  border-color: var(--rose);
}

.pain-dot.is-on b {
  color: var(--rose-deeper);
}

.med-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.med-entry {
  display: grid;
  grid-template-columns: 1fr 76px 72px 30px;
  gap: 6px;
  align-items: center;
  padding: 9px;
  border-radius: 15px;
  background: var(--rose-mist);
}

.med-entry .name {
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.med-entry input {
  width: 100%;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 0 8px;
  font-size: 13px;
  text-align: center;
  outline: none;
}

.med-entry input:focus {
  border-color: var(--rose);
}

.med-entry .unit {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.med-entry .remove {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.note-input {
  width: 100%;
  min-height: 78px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  padding: 11px 13px;
  font-size: 15px;
  resize: vertical;
  outline: none;
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.note-input:focus {
  border-color: var(--rose);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(247, 185, 203, 0.28);
}

.sheet-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 9px;
  padding: 13px 0 7px;
  margin-top: 2px;
  background: var(--card);
  border-top: 1px solid var(--line);
}

.sheet-actions .btn {
  flex: 1;
}

/* ── 登录 ── */

.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}

.login {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  text-align: center;
  animation: login-in 520ms var(--ease-out) both;
}

@keyframes login-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.login-mark {
  display: inline-flex;
  margin-bottom: 10px;
  animation: mochi-float 4.2s ease-in-out infinite;
}

.login h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.login-sub {
  margin: 7px 0 26px;
  font-size: 13px;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  height: 52px;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: var(--card);
  padding: 0 15px;
  font-size: 16px;
  text-align: center;
  outline: none;
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.login-form input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(247, 185, 203, 0.3);
}

.login-form button {
  width: 100%;
  height: 52px;
  margin-top: 11px;
  border-radius: 18px;
  background: linear-gradient(180deg, #F39BB5 0%, #E0728F 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(224, 114, 143, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.login-error {
  margin: 13px 0 0;
  font-size: 13px;
  color: var(--rose-deeper);
}

.login-foot {
  margin: 28px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ── toast ── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(102px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px) scale(0.96);
  max-width: 320px;
  padding: 11px 18px;
  border-radius: 16px;
  background: rgba(61, 52, 55, 0.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-bounce);
  z-index: 80;
  text-align: center;
  box-shadow: 0 10px 26px rgba(61, 52, 55, 0.2);
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ── 小屏 ── */

@media (max-width: 340px) {
  .app {
    padding-left: 13px;
    padding-right: 13px;
  }

  .card {
    padding: 16px;
  }

  .ring-day {
    font-size: 24px;
  }

  .ring-day b {
    font-size: 36px;
  }

  .hero-num .v {
    font-size: 12px;
  }

  .phase-row {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    font-size: 12px;
  }

  .pain-bar {
    grid-template-columns: 46px 1fr 30px;
  }

  .med-entry {
    grid-template-columns: 1fr 64px 60px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .mascot,
  .mascot-eye,
  .mascot-spark,
  .empty-emoji,
  .login-mark {
    animation: none !important;
  }

  .sheet {
    transform: none;
  }
}
