/* ============================================================
   月汐 MOONSHINE · 云栖
   一个文件装下全部样式：没有构建步骤、没有外部字体、没有第三方资源。
   ============================================================ */

:root {
  --rose: #e5678f;
  --rose-d: #c94a72;
  --plum: #b77acb;
  --plum-d: #9656ac;
  --ink: #3f3038;
  --ink2: #5f4b57;
  --gray: #74606c;
  --gray2: #7a6472;
  --bg1: #fff9f6;
  --bg2: #fdf0f5;
  --bg3: #f7effc;
  --card: rgba(255, 255, 255, 0.74);
  --card-solid: #fffafb;
  --line: rgba(255, 255, 255, 0.95);
  --hair: rgba(122, 100, 114, 0.16);
  --shadow: 0 14px 30px -20px rgba(120, 80, 100, 0.55);
  --shadow-lift: 0 18px 34px -22px rgba(104, 63, 84, 0.55);
  --max: 430px;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  color: var(--ink);
  background: #e8dfe4;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}

.views {
  -webkit-overflow-scrolling: touch;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 2px solid var(--plum-d);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 舞台与机身 ---------- */
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 18% 0%, #fff4f6 0%, rgba(255, 244, 246, 0) 62%),
    radial-gradient(700px 520px at 96% 100%, #efe4fb 0%, rgba(239, 228, 251, 0) 60%),
    #e9dfe6;
}

.shell {
  position: relative;
  width: 390px;
  max-width: var(--max);
  height: min(844px, calc(100vh - 48px));
  height: min(844px, calc(100dvh - 48px));
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(168deg, var(--bg1) 0%, var(--bg2) 42%, var(--bg3) 100%);
  box-shadow:
    0 40px 80px -30px rgba(104, 63, 84, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.shell::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(248, 163, 190, 0.4), rgba(248, 163, 190, 0) 68%);
  top: -190px;
  left: -120px;
  filter: blur(6px);
  z-index: 0;
}

.shell::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(186, 150, 235, 0.28), rgba(186, 150, 235, 0) 68%);
  bottom: -170px;
  right: -140px;
  filter: blur(8px);
  z-index: 0;
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  body {
    background: #fff;
  }
  .stage {
    padding: 0;
    display: block;
    background: #fff;
  }
  .shell {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---------- 滚动容器 ---------- */
.views {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}

.views::-webkit-scrollbar {
  display: none;
}

.view {
  display: none;
  padding: 0 0 4px;
  animation: fadeUp 0.34s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bottom-space {
  height: 18px;
}

/* ---------- 通用头部 ---------- */
.hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: calc(20px + env(safe-area-inset-top)) 26px 0;
}

.hd h1 {
  font-size: 23px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hd .sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--gray);
  letter-spacing: 0.3px;
}

.avatar {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: linear-gradient(140deg, #f9a8c4, #c99be8 70%, #a9c7f0);
  box-shadow: 0 8px 18px -6px rgba(196, 132, 168, 0.55), 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.avatar.static {
  cursor: default;
}

/* ---------- 今天 · 周期盘 ---------- */
.ringwrap {
  position: relative;
  width: min(322px, calc(100vw - 44px));
  aspect-ratio: 1;
  margin: 10px auto 0;
}

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

#ringProgress {
  transition: stroke-dasharray 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
}

#ringDots.intro circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: dotIn 0.5s cubic-bezier(0.22, 0.85, 0.3, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes dotIn {
  from {
    transform: scale(0.1);
  }
  to {
    transform: scale(1);
  }
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  margin-bottom: 8px;
  border-radius: 999px;
  border: 0.8px solid rgba(229, 103, 143, 0.4);
  background: rgba(255, 255, 255, 0.78);
  color: var(--rose-d);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  box-shadow: 0 4px 12px -6px rgba(226, 103, 143, 0.55);
}

.pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 3px rgba(240, 119, 159, 0.18);
}

.pill.plum {
  color: var(--plum-d);
  border-color: rgba(183, 122, 203, 0.45);
}

.pill.plum .dot {
  background: var(--plum);
  box-shadow: 0 0 0 3px rgba(183, 122, 203, 0.18);
}

.pill.gray {
  color: #6d5a66;
  border-color: rgba(116, 96, 108, 0.32);
}

.pill.gray .dot {
  background: #8b7582;
  box-shadow: 0 0 0 3px rgba(116, 96, 108, 0.14);
}

.bigday {
  font-family: "Didot", "Georgia", "Times New Roman", serif;
  font-size: clamp(62px, 21vw, 82px);
  line-height: 0.92;
  font-weight: 500;
  letter-spacing: -3px;
  padding-bottom: 4px;
  background: linear-gradient(165deg, #e8678f 10%, #c87fd9 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.daylab {
  margin-top: 3px;
  font-size: 12.5px;
  letter-spacing: 3px;
  color: var(--gray);
}

.countdown {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 0.8px solid rgba(226, 103, 143, 0.18);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: var(--gray);
}

.countdown b {
  margin: 0 3px;
  font-family: "Didot", "Georgia", serif;
  font-size: 16.5px;
  color: var(--rose-d);
  vertical-align: -1px;
}

/* ---------- 三宫格 ---------- */
.stats {
  display: flex;
  margin: 16px 22px 0;
  padding: 14px 0;
  border-radius: 22px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.stat {
  flex: 1;
  text-align: center;
  position: relative;
}

.stat + .stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14%;
  height: 72%;
  width: 0.7px;
  background: var(--hair);
}

.stat .v {
  font-family: "Didot", "Georgia", serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat .v small {
  margin-left: 2px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--gray);
}

.stat .k {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--gray);
}

.predline {
  margin: 10px 26px 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.3px;
  color: var(--gray);
}

/* ---------- 提示条 / 行动卡 ---------- */
.notice {
  margin: 14px 22px 0;
  padding: 13px 16px;
  border-radius: 18px;
  border: 0.8px solid rgba(47, 107, 94, 0.22);
  background: rgba(236, 246, 242, 0.82);
  color: #2d5c51;
}

.notice b {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.notice p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.65;
  color: #3e6a5f;
}

.notice.care {
  border-color: rgba(176, 138, 79, 0.28);
  background: rgba(252, 246, 235, 0.85);
  color: #7a5b2c;
}

.notice.care p {
  color: #7e6339;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 22px 0;
  padding: 16px 18px;
  border-radius: 20px;
  border: 0.8px solid rgba(229, 103, 143, 0.28);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(252, 232, 243, 0.85));
  box-shadow: var(--shadow);
}

.ac-copy b {
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.ac-copy p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray);
}

.ac-acts {
  display: flex;
  gap: 8px;
}

.ac-acts .btn {
  flex: 1;
}

/* ---------- 快捷记录 ---------- */
.quick {
  display: flex;
  justify-content: space-between;
  padding: 20px 30px 0;
}

.qitem {
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 11.5px;
  letter-spacing: 0.4px;
}

.qbtn {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 20px -12px rgba(120, 80, 100, 0.55);
  transition: transform 0.2s ease;
}

.qbtn svg {
  width: 24px;
  height: 24px;
  stroke: #9a6c84;
  fill: none;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qitem:active .qbtn {
  transform: scale(0.93);
}

.qitem:active .qbtn svg {
  stroke: var(--rose-d);
}

/* ---------- 贴士 ---------- */
.tip {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  overflow: hidden;
  margin: 20px 22px 0;
  padding: 16px 18px;
  border-radius: 20px;
  border: 0.8px solid var(--line);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(248, 225, 240, 0.8));
  box-shadow: var(--shadow);
}

.tip::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 155, 232, 0.26), transparent 70%);
}

.tip .ic {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #fbc7dc, #d9b6f0);
}

.tip .ic svg {
  width: 19px;
  height: 19px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tip .tx {
  flex: 1;
  position: relative;
  z-index: 1;
}

.tip .tx b {
  display: block;
  margin-bottom: 3px;
  font-size: 12.8px;
  letter-spacing: 0.3px;
  color: var(--ink);
}

.tip .tx p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray);
}

/* ---------- 区块标题 ---------- */
.sec-t {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 24px 26px 12px;
}

.sec-t h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ink);
}

.sec-t span {
  font-size: 11.5px;
  color: var(--gray);
  letter-spacing: 0.3px;
}

/* ---------- 时间线 ---------- */
.tl {
  margin: 0 22px;
}

.tlrow {
  display: flex;
  gap: 14px;
  width: 100%;
  padding: 0 0 14px;
  text-align: left;
  position: relative;
}

.tlrow::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 1px;
  background: rgba(200, 180, 195, 0.36);
}

.tlrow:last-child {
  padding-bottom: 0;
}

.tlrow:last-child::before {
  display: none;
}

.tldot {
  width: 31px;
  height: 31px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px -10px rgba(120, 80, 100, 0.6);
}

.tldot svg {
  width: 15px;
  height: 15px;
  stroke: var(--rose);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tlbody {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 10px 14px;
  border-radius: 16px;
  border: 0.8px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.tlbody .a {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tlbody .d {
  flex: none;
  font-size: 11px;
  color: var(--gray2);
  letter-spacing: 0.2px;
}

.tlbody .b {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.2px;
}

.tl-note {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 0.7px solid var(--hair);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-line {
  margin: 0 22px;
  padding: 18px;
  border: 0.8px dashed rgba(229, 103, 143, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.2px;
  color: var(--gray);
}

/* ---------- 日历 ---------- */
.mon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 26px 14px;
}

.mon-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.mon-title strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.mon-title em {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--gray2);
}

.mon-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mon-nav button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  border: 0.6px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--gray);
  font-size: 16px;
  line-height: 1;
}

.mon-nav .mon-today {
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: var(--ink2);
}

.mon-nav button:active {
  transform: scale(0.94);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 22px 4px;
}

.week span {
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--gray2);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 22px;
}

.d {
  position: relative;
  height: 47px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: "Didot", "Georgia", serif;
  font-size: 13px;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}

.d em {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  transition: background 0.2s ease, color 0.2s ease;
}

.d .mk {
  width: 4px;
  height: 4px;
  margin-top: 1px;
  border-radius: 50%;
  background: transparent;
}

.d .mk.period {
  background: var(--rose);
}

.d .mk.ovu {
  background: var(--plum);
}

.d .mk.pred {
  background: rgba(229, 103, 143, 0.45);
}

.d .mk.logged {
  background: #9bb8ae;
}

.d.period em {
  background: rgba(240, 119, 159, 0.16);
  color: var(--rose-d);
  font-weight: 600;
}

.d.ovu em {
  border: 1.4px solid var(--plum);
  color: var(--plum-d);
}

.d.pred em {
  border: 1.2px dashed var(--rose);
  color: #d383a2;
}

.d.today em {
  background: linear-gradient(150deg, #f0779f, #c87fd9);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 16px -8px rgba(226, 103, 143, 0.9);
}

.d.today .mk {
  background: var(--plum);
}

.d.sel em {
  outline: 2px solid rgba(232, 103, 143, 0.55);
  outline-offset: 1px;
}

.d.out {
  color: #b09ca8;
}

.d.out em {
  opacity: 0.65;
}

.d:active em {
  transform: scale(0.92);
}

.est-dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--rose);
  border-radius: 50%;
  opacity: 0.7;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 12px 12px 0;
  flex-wrap: wrap;
}

.lg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--gray);
}

.lg i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.lg i.period {
  background: rgba(240, 119, 159, 0.65);
}

.lg i.ovu {
  background: var(--plum);
}

.lg i.pred {
  border: 1.2px dashed var(--rose);
  background: transparent;
}

.lg i.logged {
  background: #9bb8ae;
}

.cal-sum {
  margin: 12px 26px 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.2px;
  color: var(--gray);
}

.daycard {
  margin: 14px 22px 0;
  padding: 18px;
  border-radius: 22px;
  border: 0.8px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.dc-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.dc-h b {
  font-size: 14px;
  letter-spacing: 0.4px;
}

.dc-h span {
  font-size: 11.5px;
  color: var(--gray);
}

.dc-b {
  font-size: 12px;
  line-height: 1.8;
  color: var(--gray);
}

.dc-b .kv {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dc-b .kv i {
  padding: 4px 9px;
  border-radius: 9px;
  background: rgba(240, 119, 159, 0.1);
  color: var(--rose-d);
  font-size: 11.5px;
  font-style: normal;
  letter-spacing: 0.2px;
}

.dc-b .kv i.plum {
  background: rgba(183, 122, 203, 0.12);
  color: var(--plum-d);
}

.dc-b .kv i.period {
  background: rgba(240, 119, 159, 0.18);
  color: var(--rose-d);
  font-weight: 600;
}

.dc-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink2);
}

.dc-acts {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.dc-acts .btn {
  flex: 1;
}

/* ---------- 记录 ---------- */
.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 22px 0;
}

.date-step {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--gray);
  font-size: 18px;
  line-height: 1;
  box-shadow: var(--shadow);
}

.date-step:disabled {
  opacity: 0.35;
  cursor: default;
}

.date-input {
  flex: none;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 0.8px solid rgba(229, 103, 143, 0.3);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow);
}

.date-nav .date-input {
  flex: 1;
}

.date-input.inline {
  text-align: center;
  font-weight: 600;
}

.grp {
  margin: 22px 22px 0;
}

.grp-t {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.grp-t b {
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.grp-t span {
  font-size: 11.5px;
  color: var(--gray);
  letter-spacing: 0.2px;
}

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

.chip {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 14px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink2);
  font-size: 12.5px;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 14px -12px rgba(120, 80, 100, 0.6);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.chip.active {
  border-color: rgba(229, 103, 143, 0.55);
  background: linear-gradient(135deg, rgba(240, 119, 159, 0.17), rgba(200, 127, 217, 0.16));
  color: var(--rose-d);
  font-weight: 600;
}

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

.moods {
  display: flex;
  gap: 8px;
}

.mood {
  flex: 1;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 18px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--gray);
  font-size: 11.5px;
  box-shadow: 0 8px 16px -14px rgba(120, 80, 100, 0.6);
  transition: 0.2s ease;
}

.mood svg {
  width: 24px;
  height: 24px;
  stroke: #a28194;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.mood.active {
  border-color: rgba(229, 103, 143, 0.5);
  background: linear-gradient(160deg, rgba(249, 168, 196, 0.28), rgba(217, 182, 240, 0.22));
  color: var(--rose-d);
  font-weight: 600;
}

.mood.active svg {
  stroke: var(--rose-d);
}

.water {
  display: flex;
  gap: 7px;
}

.cup {
  flex: 1;
  height: 38px;
  border-radius: 10px 10px 13px 13px;
  border: 1.4px solid rgba(122, 100, 114, 0.32);
  background: rgba(255, 255, 255, 0.7);
  position: relative;
  transition: 0.2s ease;
}

.cup.on {
  border-color: rgba(120, 170, 210, 0.5);
  background: linear-gradient(160deg, #b7e1f5, #9bc9ee);
}

.cup.on::after {
  content: "";
  position: absolute;
  inset: 6px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
}

.two-col {
  display: flex;
  gap: 10px;
}

.numin {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 16px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.numin span {
  flex: none;
  font-size: 11.5px;
  color: var(--gray);
  letter-spacing: 0.3px;
}

.numin input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  font-family: "Didot", "Georgia", serif;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}

.numin em {
  flex: none;
  font-style: normal;
  font-size: 10.5px;
  color: var(--gray2);
}

.note {
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink2);
  font-size: 12.5px;
  line-height: 1.8;
  letter-spacing: 0.2px;
  resize: vertical;
  outline: none;
  box-shadow: var(--shadow);
}

.note::placeholder {
  color: #8f7a86;
}

input::placeholder {
  color: #8f7a86;
}

.char-count {
  margin-top: 6px;
  text-align: right;
  font-size: 10.5px;
  color: var(--gray2);
}

.save-state {
  margin-top: 8px;
  text-align: center;
  font-size: 11.5px;
  color: var(--gray);
  min-height: 1.4em;
}

/* ---------- 按钮 ---------- */
.btn {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.solid {
  color: #fff;
  background: linear-gradient(135deg, #e5678f, #b77acb);
  box-shadow: 0 12px 24px -14px rgba(226, 103, 143, 0.9);
}

.btn.solid.danger {
  background: linear-gradient(135deg, #c94a5f, #a83d54);
}

.btn.ghost {
  color: var(--rose-d);
  border: 1px solid rgba(229, 103, 143, 0.38);
  background: rgba(255, 255, 255, 0.62);
}

.btn.big {
  width: 100%;
  min-height: 50px;
  font-size: 14px;
}

.btn.small {
  min-height: 40px;
  font-size: 12.5px;
}

.btn:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.danger-text {
  color: #b13c50 !important;
}

.textlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--rose-d);
  font-size: 12px;
  letter-spacing: 0.2px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201, 74, 114, 0.35);
}

.textlink.muted {
  color: var(--gray);
  text-decoration-color: rgba(116, 96, 108, 0.28);
}

.textlink.center {
  display: flex;
  margin: 10px auto 0;
}

.textlink.danger {
  color: #b13c50;
}

/* ---------- 洞察 ---------- */
.inscard {
  margin: 16px 22px 0;
  padding: 18px;
  border-radius: 22px;
  border: 0.8px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.insgrid {
  display: flex;
  text-align: center;
}

.insgrid .c {
  flex: 1;
  position: relative;
}

.insgrid .c + .c::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  height: 76%;
  width: 0.7px;
  background: var(--hair);
}

.insgrid .v {
  font-family: "Didot", "Georgia", serif;
  font-size: 22px;
  color: var(--ink);
}

.insgrid .v small {
  margin-left: 2px;
  font-family: inherit;
  font-size: 10.5px;
  color: var(--gray);
}

.insgrid .k {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--gray);
}

.chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 158px;
  padding: 4px 2px 0;
}

.chart-empty {
  width: 100%;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 0.8px dashed rgba(229, 103, 143, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1.9;
  color: var(--gray);
}

.bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.bar .bv {
  font-family: "Didot", "Georgia", serif;
  font-size: 11px;
  color: var(--rose-d);
}

.bar .b {
  width: 100%;
  max-width: 30px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #f7a7c4, #b77acb);
  min-height: 12px;
  transition: height 0.4s ease;
}

.bar .bl {
  font-size: 11px;
  color: var(--gray2);
  white-space: nowrap;
}

.chart-note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--gray);
}

.cycles {
  display: flex;
  flex-direction: column;
}

.cycle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 0.7px solid var(--hair);
  font-size: 12px;
}

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

.cr-date {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 5px;
  align-items: baseline;
  color: var(--ink2);
}

.cr-date b {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.cr-date span {
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
}

.cr-period {
  flex: none;
  font-size: 11px;
  color: var(--gray);
}

.cr-len {
  width: 58px;
  flex: none;
  text-align: right;
  font-family: "Didot", "Georgia", serif;
  font-size: 13px;
  color: var(--rose-d);
  font-variant-numeric: tabular-nums;
}

.rank {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.rk {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rk .n {
  width: 62px;
  flex: none;
  font-size: 12px;
  color: var(--ink2);
}

.rk .track {
  flex: 1;
  height: 8px;
  border-radius: 8px;
  background: rgba(122, 100, 114, 0.12);
  overflow: hidden;
}

.rk .track i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #f7a7c4, #b77acb);
}

.rk .p {
  width: 40px;
  flex: none;
  text-align: right;
  font-family: "Didot", "Georgia", serif;
  font-size: 11px;
  color: var(--gray);
}

.inscard.summary {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(248, 225, 240, 0.82));
}

.summary-text {
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--ink2);
}

/* ---------- 我的 ---------- */
.mecard {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 22px 0;
  padding: 22px;
  border-radius: 24px;
  border: 0.8px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 232, 244, 0.82));
  box-shadow: var(--shadow);
}

.mecard .av {
  width: 58px;
  height: 58px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(140deg, #f9a8c4, #c99be8 70%, #a9c7f0);
  box-shadow: 0 10px 22px -10px rgba(196, 132, 168, 0.8);
}

.mecard .info b {
  font-size: 16px;
  letter-spacing: 0.4px;
}

.mecard .info p {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--gray);
  letter-spacing: 0.2px;
}

.setlist {
  margin: 16px 22px 0;
  border-radius: 22px;
  border: 0.8px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.setrow {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 18px;
  border-bottom: 0.7px solid var(--hair);
  border-radius: 0;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: none;
}

.setrow:last-child {
  border-bottom: 0;
}

.setrow.static {
  cursor: default;
}

.setrow:hover:not(.static) {
  background: rgba(255, 255, 255, 0.45);
}

.setrow .ic {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(249, 168, 196, 0.3), rgba(217, 182, 240, 0.26));
}

.setrow .ic svg {
  width: 16px;
  height: 16px;
  stroke: var(--rose-d);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setrow .k {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.8px;
  color: var(--ink);
  letter-spacing: 0.2px;
}

.setrow .k small {
  font-size: 11px;
  line-height: 1.45;
  color: var(--gray);
  letter-spacing: 0.1px;
}

.setrow .v {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}

.switch {
  width: 44px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: rgba(122, 100, 114, 0.26);
  position: relative;
  transition: background 0.25s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: left 0.25s ease;
}

.switch.on {
  background: linear-gradient(135deg, #e5678f, #b77acb);
}

.switch.on::after {
  left: 21px;
}

.me-note {
  margin: 22px 26px 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--gray);
  text-align: center;
}

.app-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 20px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: var(--gray2);
}

.app-foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.app-foot a:hover {
  border-bottom-color: var(--gray2);
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  height: 66px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  border-radius: 26px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  box-shadow: 0 20px 36px -20px rgba(104, 63, 84, 0.5);
}

.tab {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--gray2);
  font-size: 11px;
  letter-spacing: 0.15px;
}

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

.tab.on {
  color: var(--rose-d);
  font-weight: 600;
}

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

.tab.on::after {
  content: "";
  width: 14px;
  height: 2.5px;
  margin-top: 1px;
  border-radius: 99px;
  background: var(--rose-d);
  animation: tabIn 0.3s cubic-bezier(0.22, 0.85, 0.3, 1) both;
}

@keyframes tabIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 14px;
    opacity: 1;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 40px);
  padding: 11px 20px;
  border-radius: 16px;
  background: rgba(63, 48, 56, 0.95);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.6);
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast-action {
  flex: none;
  padding: 4px 2px;
  color: #ffc4d8;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 弹层 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  visibility: hidden;
  pointer-events: none;
}

.overlay.on {
  visibility: visible;
  pointer-events: auto;
}

.overlay .mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 40, 52, 0.34);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.on .mask {
  opacity: 1;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-height: 86%;
  overflow-y: auto;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg, #fffbf9, #fdf3f7);
  box-shadow: 0 -20px 44px -24px rgba(104, 63, 84, 0.6);
  transform: translateY(102%);
  transition: transform 0.34s cubic-bezier(0.22, 0.85, 0.3, 1);
  scrollbar-width: none;
}

.sheet::-webkit-scrollbar {
  display: none;
}

.overlay.on .sheet {
  transform: translateY(0);
}

.sheet .handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 4px;
  background: rgba(122, 100, 114, 0.28);
}

.sheet h2 {
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.4px;
}

.sh-sub {
  margin: 5px 0 16px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--gray);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sheet-actions.column {
  flex-direction: column;
}

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

.form-note {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--gray);
}

.form-note.warn {
  color: #9a5b2c;
}

.field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.field > span {
  flex: none;
  font-size: 12px;
  color: var(--gray);
}

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 15px;
  letter-spacing: 2px;
  outline: none;
}

.field em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--gray2);
}

.range-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 4px 0 16px;
}

.range-step {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink2);
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow);
}

.range-val {
  min-width: 96px;
  text-align: center;
  font-family: "Didot", "Georgia", serif;
  font-size: 34px;
  color: var(--rose-d);
  font-variant-numeric: tabular-nums;
}

.range-val small {
  margin-left: 3px;
  font-family: inherit;
  font-size: 12px;
  color: var(--gray);
}

input[type="range"] {
  width: 100%;
  height: 32px;
  accent-color: var(--rose-d);
}

.export-summary {
  display: flex;
  gap: 10px;
  margin: 4px 0 2px;
}

.export-summary div {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 0.8px solid var(--line);
}

.export-summary b {
  display: block;
  font-family: "Didot", "Georgia", serif;
  font-size: 22px;
  color: var(--ink);
}

.export-summary span {
  font-size: 10.5px;
  color: var(--gray);
}

.steps {
  margin: 8px 0 0 18px;
  font-size: 12.5px;
  line-height: 2;
  color: var(--ink2);
}

/* ---------- 确认框 ---------- */
.dialog {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 50%;
  z-index: 22;
  padding: 22px;
  border-radius: 22px;
  background: var(--card-solid);
  box-shadow: 0 30px 60px -24px rgba(63, 48, 56, 0.5);
  transform: translateY(-46%) scale(0.97);
  opacity: 0;
  transition: 0.24s ease;
}

.overlay.on .dialog {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

.dialog h2 {
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0.3px;
}

.dialog p {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--gray);
}

.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.dlg-actions .btn {
  min-width: 84px;
}

/* ---------- 启动页 ---------- */
.splash {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #fff6f3, #fbebf3 45%, #f3e9fc);
  transition: opacity 0.6s ease, visibility 0.6s;
}

.splash.out {
  opacity: 0;
  visibility: hidden;
}

.splash-mark {
  width: 108px;
  height: 108px;
  margin-bottom: 24px;
}

.splash-mark svg {
  width: 100%;
  height: 100%;
}

.splash-name {
  padding-left: 12px;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 14px;
  color: #3f3038;
}

.splash-en {
  margin-top: 12px;
  padding-left: 6px;
  font-size: 9px;
  letter-spacing: 6px;
  color: #8f7585;
}

.splash-bar {
  position: absolute;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: 148px;
  height: 2.5px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(226, 103, 143, 0.13);
}

.splash-bar i {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(247, 144, 180, 0), #f790b4 32%, #b98ae8 72%, rgba(185, 138, 232, 0));
  animation: barSweep 1.45s cubic-bezier(0.55, 0.05, 0.45, 0.95) infinite;
}

@keyframes barSweep {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* ---------- 锁屏 ---------- */
.lockscreen {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 26px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: linear-gradient(168deg, #fff9f6, #fdf0f5 46%, #f7effc);
}

.lock-inner {
  width: 100%;
  text-align: center;
}

.lock-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
}

.lock-mark svg {
  width: 100%;
  height: 100%;
}

.lock-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 3px;
}

.lock-title:focus {
  outline: none;
}

.lock-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 26px 0 4px;
}

.pin-dots i {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(201, 74, 114, 0.45);
  border-radius: 50%;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.pin-dots i.filled {
  background: var(--rose-d);
  border-color: var(--rose-d);
}

.pin-dots.err {
  animation: shake 0.36s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 20px auto 0;
}

.pinpad button {
  height: 56px;
  border-radius: 18px;
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-family: "Didot", "Georgia", serif;
  font-size: 22px;
  box-shadow: var(--shadow);
  transition: background 0.16s ease, transform 0.12s ease;
}

.pinpad button:active {
  background: #fff;
  transform: scale(0.96);
}

.pinpad span {
  display: block;
}

.lockscreen .textlink {
  margin-top: 14px;
}

/* ---------- 新手引导 ---------- */
.onboarding {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top)) 26px calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(168deg, #fff9f6, #fdf0f5 46%, #f7effc);
  scrollbar-width: none;
}

.onboarding::-webkit-scrollbar {
  display: none;
}

.ob-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.ob-dots {
  display: flex;
  gap: 6px;
}

.ob-dots i {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(122, 100, 114, 0.22);
  transition: width 0.25s ease, background 0.25s ease;
}

.ob-dots i.on {
  width: 18px;
  background: var(--rose);
}

.ob-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 30px;
}

.ob-step[data-ob-step="0"] {
  justify-content: center;
  padding-bottom: 6vh;
}

.ob-logo {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
}

.ob-logo svg {
  width: 100%;
  height: 100%;
}

.ob-title {
  text-align: center;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 10px;
  padding-left: 10px;
}

.ob-step h1:focus,
.ob-step h2:focus {
  outline: none;
}

.ob-slogan {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gray);
}

.ob-points {
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.ob-points li {
  padding: 13px 0 13px 18px;
  border-top: 0.7px solid var(--hair);
  position: relative;
}

.ob-points li:last-child {
  border-bottom: 0.7px solid var(--hair);
}

.ob-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
  opacity: 0.7;
}

.ob-points b {
  display: block;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.ob-points span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--gray);
}

.ob-step .btn.big {
  margin-top: 28px;
}

.ob-h2 {
  margin-top: 24px;
  font-size: 23px;
  line-height: 1.4;
  letter-spacing: 0.4px;
}

.ob-step[data-ob-step="1"] .ob-h2 {
  margin-top: 10px;
}

.ob-h2.spaced {
  margin-top: 30px;
}

.ob-lead {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink2);
}

.ob-legal {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ob-legal li {
  padding: 11px 0;
  border-top: 0.7px solid var(--hair);
}

.ob-legal li:last-child {
  border-bottom: 0.7px solid var(--hair);
}

.ob-legal b {
  display: block;
  font-size: 12.5px;
}

.ob-legal span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--gray);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 14px;
  border-radius: 16px;
  border: 0.8px solid rgba(229, 103, 143, 0.3);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink2);
}

.check input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  accent-color: var(--rose-d);
}

.check a {
  color: var(--rose-d);
  text-underline-offset: 3px;
}

.ob-fine {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--gray);
}

.ob-fine a {
  color: var(--rose-d);
}

.onboarding .chips {
  margin-top: 14px;
}

.onboarding .date-input {
  margin-top: 16px;
}

.onboarding .textlink {
  margin-top: 10px;
}

/* ---------- 无 JS ---------- */
.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #fff9f6;
  color: #3f3038;
  font-size: 15px;
  text-align: center;
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .splash-bar i {
    width: 100%;
    opacity: 0.6;
  }
}

/* ---------- 小屏微调 ---------- */
@media (max-width: 370px) {
  .hd {
    padding-left: 22px;
    padding-right: 22px;
  }
  .quick {
    padding-left: 22px;
    padding-right: 22px;
  }
  .qitem {
    width: 60px;
  }
  .qbtn {
    width: 52px;
    height: 52px;
  }
  .stats,
  .tip,
  .action-card,
  .daycard,
  .inscard,
  .setlist,
  .mecard {
    margin-left: 18px;
    margin-right: 18px;
  }
  .days,
  .week {
    margin-left: 18px;
    margin-right: 18px;
  }
  .tabbar {
    left: 14px;
    right: 14px;
  }
  .bigday {
    font-size: 62px;
  }
}
