/* ============================================================
   pages2.css — 子页面统一设计系统
   ------------------------------------------------------------
   和小屋卡片同一套视觉：暖奶油底、圆角卡片、木色描边。
   所有子页面共用这一份，保证风格一致。

   依赖：<html data-theme="day|dusk|night">
   ============================================================ */

:root {
  --cream:      #f4ece0;
  --card:       #fffdf8;
  --card-alt:   #fbf3e6;
  --line:       #ece0cf;
  --line-soft:  #f2e8da;
  --ink:        #5a4a3c;
  --ink-2:      #7d6b58;
  --ink-3:      #a8988a;
  --ink-4:      #c0b0a0;
  --rose:       #e0808f;
  --rose-soft:  #f7c2cb;
  --rose-bg:    #ffe9ec;
  --rose-deep:  #c2606e;
  --mint:       #7fb8ac;
  --mint-bg:    #e2f2ee;
  --gold:       #d9a94e;
  --shadow:     rgba(180, 150, 120, 0.16);
  --shadow-2:   rgba(160, 120, 90, 0.22);
}

html[data-theme="night"] {
  --cream:      #2b2540;
  --card:       #453e60;
  --card-alt:   #4a4368;
  --line:       #5d5580;
  --line-soft:  #524a70;
  --ink:        #ece4f6;
  --ink-2:      #ded4ee;
  --ink-3:      #a397bd;
  --ink-4:      #8d80a6;
  --rose:       #f0a3b4;
  --rose-soft:  #75638c;
  --rose-bg:    #5a4a6e;
  --rose-deep:  #f4b8c6;
  --mint:       #8fd0c0;
  --mint-bg:    #3f4f5c;
  --gold:       #f0c674;
  --shadow:     rgba(0, 0, 0, 0.28);
  --shadow-2:   rgba(0, 0, 0, 0.4);
}

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

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background: var(--cream);
  color: var(--ink);
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  transition: background .5s ease, color .5s ease;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  transition: background .5s ease;
}

/* ---------- 页面转场 ---------- */
.page { animation: pIn .3s ease both; }
@keyframes pIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.fade-out { animation: pOut .17s ease both; }
@keyframes pOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* ============================================================
   顶栏
   ============================================================ */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--line-soft);
  transition: background .5s ease, border-color .5s ease;
}
.top .back {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: transform .12s, background .5s, border-color .5s;
  box-shadow: 0 2px 0 var(--shadow);
}
.top .back:active { transform: translateY(2px); box-shadow: none; }
.top .tt { flex: 1; min-width: 0; }
.top .tt h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top .tt .sub {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top .act {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--shadow);
  transition: transform .12s;
}
.top .act:active { transform: translateY(2px); box-shadow: none; }

/* ============================================================
   内容区
   ============================================================ */
.body { padding: 16px 16px calc(30px + env(safe-area-inset-bottom)); }

.sec-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 4px 2px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sec-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 3px 0 var(--shadow);
  transition: background .5s, border-color .5s;
}

/* ============================================================
   统计条（地图页 / 日历页共用）
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 8px 11px;
  text-align: center;
  box-shadow: 0 3px 0 var(--shadow);
}
.stat .n {
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  color: var(--rose);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.stat .n small { font-size: 11px; font-weight: 700; margin-left: 2px; letter-spacing: 0; }
.stat .c {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 6px;
  letter-spacing: .3px;
}

/* ============================================================
   地图页
   ============================================================ */
.map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.02;
  border-radius: 13px;
  overflow: hidden;
  border: 4px solid #c99a6c;
  box-shadow: 0 0 0 2px #a87c54, 0 6px 14px var(--shadow-2);
  background: #cfe6f2;
  margin-bottom: 16px;
}
html[data-theme="night"] .map-frame {
  border-color: #6a6288;
  box-shadow: 0 0 0 2px #4e4870, 0 6px 16px rgba(0,0,0,.5);
}
.map-frame svg { display: block; width: 100%; height: 100%; }

/* 地图上的点 */
.map-dot { cursor: pointer; }
.map-dot circle.pulse {
  animation: pinPulse 2.4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes pinPulse {
  0%, 100% { opacity: .30; r: 9; }
  50%      { opacity: .08; r: 14; }
}
/* 夜晚的地图压暗放在 map.html 里单独控制，这里不重复处理 */

/* 地图角落的小说明 */
.map-hint {
  position: absolute;
  left: 10px; bottom: 10px;
  font-size: 9.5px;
  color: #4a6b7a;
  background: rgba(255,255,255,.86);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ---------- 下一个计划 ---------- */
.next-plan {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rose-bg), var(--card-alt));
  border: 1.5px dashed var(--rose-soft);
  margin-bottom: 16px;
}
.next-plan .ico { font-size: 19px; flex: 0 0 auto; }
.next-plan .tx { flex: 1; min-width: 0; }
.next-plan .tx .a {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--rose-deep);
}
.next-plan .tx .b {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* ---------- 地点列表 ---------- */
.places { display: flex; flex-direction: column; gap: 13px; }
.place {
  overflow: hidden;
  border-radius: 13px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--shadow);
  cursor: pointer;
  transition: transform .12s;
}
.place:active { transform: scale(.985); }
.place .ph {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--card-alt);
  overflow: hidden;
}
.place .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place .ph .badge {
  position: absolute;
  top: 9px; left: 9px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,253,248,.92);
  color: var(--ink-2);
  border: 1.5px solid var(--line);
  backdrop-filter: blur(4px);
}
.place .ph .badge.plan {
  background: rgba(255,233,236,.94);
  color: var(--rose-deep);
  border-color: var(--rose-soft);
}
.place .meta { padding: 12px 14px 13px; }
.place .meta .row1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.place .meta .nm {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.place .meta .dt {
  font-size: 10.5px;
  color: var(--ink-3);
  flex: 0 0 auto;
}
.place .meta .ds {
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.place .meta .tags {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.tag-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--mint-bg);
  color: #3f7a6e;
  border: 1px solid color-mix(in srgb, var(--mint) 40%, transparent);
}
html[data-theme="night"] .tag-pill { color: var(--mint); }

/* ============================================================
   留言页
   ============================================================ */
.msg-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
}
.msg-tab {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 6px;
  border-radius: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s;
}
.msg-tab.on {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
  box-shadow: 0 3px 0 var(--rose-deep);
}
html[data-theme="night"] .msg-tab.on { color: #2b2540; }

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

.msg {
  max-width: 84%;
  padding: 11px 14px 9px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  position: relative;
  word-break: break-word;
  white-space: pre-wrap;
}
/* 他发的（左） */
.msg.him {
  align-self: flex-start;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 0 var(--shadow);
}
/* 她发的（右） */
.msg.her {
  align-self: flex-end;
  background: var(--rose-bg);
  border: 1.5px solid var(--rose-soft);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 0 rgba(214,130,144,.16);
}
html[data-theme="night"] .msg.her {
  background: var(--rose-bg);
  border-color: var(--rose-soft);
}
.msg .mt {
  font-size: 9.5px;
  color: var(--ink-4);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg.her .mt { justify-content: flex-end; }
.msg .del {
  font-size: 9.5px;
  color: var(--ink-4);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.msg.locked {
  background: var(--card-alt);
  border-style: dashed;
  color: var(--ink-3);
  font-style: italic;
  text-align: center;
  align-self: center;
  max-width: 100%;
}

/* 写信输入区 */
.composer {
  position: sticky;
  bottom: 0;
  margin-top: 18px;
  padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--cream) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1.5px solid var(--line-soft);
}
.composer textarea {
  width: 100%;
  min-height: 74px;
  max-height: 150px;
  resize: none;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.6;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  outline: none;
  transition: border-color .15s;
}
.composer textarea:focus { border-color: var(--rose-soft); }
.composer textarea::placeholder { color: var(--ink-4); }
.composer .row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}
.composer .who {
  flex: 1;
  font-size: 11px;
  color: var(--ink-3);
}
.composer .send {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--rose);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--rose-deep);
  transition: transform .12s;
}
.composer .send:active { transform: translateY(3px); box-shadow: none; }

/* ============================================================
   日历页
   ============================================================ */
.cal-hero {
  text-align: center;
  padding: 22px 16px 20px;
  border-radius: 13px;
  background: linear-gradient(160deg, var(--card), var(--card-alt));
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--shadow);
  margin-bottom: 16px;
}
.cal-hero .big {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--rose);
  font-variant-numeric: tabular-nums;
  letter-spacing: -3px;
}
.cal-hero .unit { font-size: 12.5px; color: var(--ink-3); margin-top: 9px; letter-spacing: .5px; }
.cal-hero .since { font-size: 10.5px; color: var(--ink-4); margin-top: 5px; }

/* 月份分组 */
.month-group { margin-bottom: 16px; }
.month-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 2px 9px;
}
.month-head .m {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  letter-spacing: .5px;
}
.month-head .line { flex: 1; height: 1px; background: var(--line-soft); }
.month-head .cnt { font-size: 10px; color: var(--ink-4); }

/* 时间轴 */
.tl { display: flex; flex-direction: column; }
.tl-item {
  display: flex;
  gap: 11px;
  position: relative;
  padding-bottom: 11px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 19px; top: 30px; bottom: -2px;
  width: 1.5px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-item .d {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--rose);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  z-index: 1;
}
.tl-item .d small { font-size: 7.5px; font-weight: 600; color: var(--ink-4); margin-top: 2px; }
.tl-item.past .d { background: var(--rose-bg); border-color: var(--rose-soft); }
.tl-item.next .d {
  background: var(--gold);
  border-color: #c99a45;
  color: #fff;
  animation: pop 1.9s ease-in-out infinite;
}
@keyframes pop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); } }
.tl-item .bx {
  flex: 1;
  padding: 10px 13px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 2px 0 var(--shadow);
  margin-top: 1px;
}
.tl-item .bx .t { font-size: 13px; font-weight: 700; color: var(--ink); }
.tl-item .bx .s { font-size: 10px; color: var(--ink-3); margin-top: 4px; }
.tl-item .bx .q {
  font-size: 10.5px;
  color: var(--rose-deep);
  margin-top: 5px;
  font-weight: 600;
}

/* ============================================================
   回忆馆
   ============================================================ */
.filters {
  display: flex;
  gap: 7px;
  padding: 12px 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s;
}
.chip.on {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
  box-shadow: 0 2px 0 var(--rose-deep);
}
html[data-theme="night"] .chip.on { color: #2b2540; }

.mem-grid { display: flex; flex-direction: column; gap: 14px; }
.mem {
  overflow: hidden;
  border-radius: 13px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--shadow);
  cursor: pointer;
  transition: transform .12s;
}
.mem:active { transform: scale(.985); }
.mem .ph {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--card-alt);
  overflow: hidden;
}
.mem .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mem .ph .tag {
  position: absolute;
  top: 9px; left: 9px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,253,248,.92);
  color: var(--ink-2);
  border: 1.5px solid var(--line);
  backdrop-filter: blur(4px);
}
.mem .meta { padding: 12px 14px 13px; }
.mem .meta .dt { font-size: 10.5px; color: var(--ink-3); margin-bottom: 4px; }
.mem .meta .tt { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.mem .meta .ex {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   弹层
   ============================================================ */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(60, 45, 32, .48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.sheet-mask.on { opacity: 1; visibility: visible; }
.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.22,1,.36,1);
  border-top: 3px solid var(--rose);
  color: var(--ink);
}
.sheet-mask.on .sheet { transform: translateY(0); }
.sheet h2 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.sheet .sd { font-size: 11px; color: var(--ink-3); margin-bottom: 15px; }
.sheet p {
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
  margin: 0 0 13px;
  color: var(--ink-2);
}
.sheet .ph-wide {
  width: calc(100% + 40px);
  margin: -22px -20px 18px;
  max-height: 48vh;
  overflow: hidden;
  background: var(--card-alt);
}
.sheet .ph-wide img { width: 100%; display: block; object-fit: cover; }
.sheet .btn-full {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--rose);
  border: none;
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--rose-deep);
  cursor: pointer;
}
.sheet .btn-full:active { transform: translateY(3px); box-shadow: none; }
html[data-theme="night"] .sheet .btn-full { color: #2b2540; }

/* ============================================================
   表单（新增地点等）
   ============================================================ */
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 13px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card-alt);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s;
}
.field textarea { min-height: 78px; resize: none; line-height: 1.6; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--rose-soft); }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-4); }

.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; }

/* ============================================================
   空状态 / 小提示
   ============================================================ */
.empty {
  text-align: center;
  padding: 44px 26px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.9;
}
.empty .ic { font-size: 30px; display: block; margin-bottom: 12px; opacity: .6; }

/* 浮动按钮 */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--rose);
  border: none;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--rose-deep), 0 6px 18px rgba(200,120,140,.35);
  cursor: pointer;
}
.fab:active { transform: translateY(4px); box-shadow: 0 0 0 var(--rose-deep); }
html[data-theme="night"] .fab { color: #2b2540; }

/* 小提示气泡 */
#toast {
  position: fixed;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 13px;
  z-index: 10000;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
  line-height: 1.5;
}

/* 像素颗粒质感 */
body.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .04;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
html[data-theme="night"] body.grain::after { mix-blend-mode: screen; opacity: .028; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* ============================================================
   柔和淡入 + 像素加载（所有子页面共用）
   ============================================================ */
@keyframes softIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes softInUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* 页面整体淡入 */
#app { animation: softIn .5s cubic-bezier(.22,1,.36,1) both; }

/* 卡片依次淡入，不突兀 */
.card, .stat, .mem, .place, .tl-item, .msg, .mine-item,
.check-card, .coll-pill, .next-plan {
  animation: softIn .5s cubic-bezier(.22,1,.36,1) both;
}
.card:nth-child(1), .stat:nth-child(1), .mem:nth-child(1) { animation-delay: .02s; }
.card:nth-child(2), .stat:nth-child(2), .mem:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3), .stat:nth-child(3), .mem:nth-child(3) { animation-delay: .10s; }
.card:nth-child(4), .stat:nth-child(4), .mem:nth-child(4) { animation-delay: .14s; }
.card:nth-child(5), .mem:nth-child(5) { animation-delay: .18s; }
.card:nth-child(6), .mem:nth-child(6) { animation-delay: .22s; }

/* 按钮：按下去有回弹感 */
.back, .act, .fab, .chip, .btn-full, .edit-dot, .ybtn, .lk-tab, .lk-opt {
  transition: transform .18s cubic-bezier(.34,1.4,.64,1),
              box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.back:active, .act:active, .chip:active, .btn-full:active,
.edit-dot:active, .ybtn:active { transform: scale(.95); }
.fab:active { transform: scale(.92) translateY(2px); }

/* 弹层柔和弹出 */
.sheet-mask { transition: opacity .3s ease, visibility .3s; }
.sheet-mask .sheet { transition: transform .38s cubic-bezier(.22,1,.36,1); }
.sheet-mask .sheet > * { animation: softInUp .45s cubic-bezier(.22,1,.36,1) both; }
.sheet-mask .sheet > *:nth-child(2) { animation-delay: .04s; }
.sheet-mask .sheet > *:nth-child(3) { animation-delay: .08s; }
.sheet-mask .sheet > *:nth-child(4) { animation-delay: .12s; }
.sheet-mask .sheet > *:nth-child(5) { animation-delay: .16s; }
.sheet-mask .sheet > *:nth-child(6) { animation-delay: .20s; }

/* 图片加载完慢慢显出来，不要"啪"地跳出来 */
.mem .ph img, .place .ph img, .msg img, .ph-wide img {
  animation: softIn .55s ease both;
}

/* 尊重系统的"减少动态效果" */
@media (prefers-reduced-motion: reduce) {
  #app, .card, .stat, .mem, .place, .tl-item, .msg, .mine-item,
  .sheet-mask .sheet > * { animation: none !important; }
}

/* ============================================================
   像素加载动画（子页面共用）
   ------------------------------------------------------------
   在 <body> 之后立刻渲染，所以不会出现白屏。
   ============================================================ */
.px-load {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: linear-gradient(170deg, #f6eee2, #ecdfcc);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity .55s ease, visibility .55s;
}
html[data-theme="night"] .px-load { background: linear-gradient(170deg, #3a3352, #2b2540); }
.px-load.done { opacity: 0; visibility: hidden; pointer-events: none; }

.px-load .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.px-load .grid i {
  width: 13px; height: 13px;
  border-radius: 2px;
  background: #e4d6c2;
  animation: pxPop 1.5s ease-in-out infinite;
}
@keyframes pxPop {
  0%, 70%, 100% { background: #e4d6c2; transform: scale(1); }
  35%           { background: #f0a3b4; transform: scale(1.22); }
}
@keyframes pxPopNight {
  0%, 70%, 100% { background: #4a4268; transform: scale(1); }
  35%           { background: #f0a3b4; transform: scale(1.22); }
}
html[data-theme="night"] .px-load .grid i { animation-name: pxPopNight; }
.px-load .grid i:nth-child(1)  { animation-delay: 0s;    }
.px-load .grid i:nth-child(2)  { animation-delay: .07s;  }
.px-load .grid i:nth-child(3)  { animation-delay: .14s;  }
.px-load .grid i:nth-child(4)  { animation-delay: .21s;  }
.px-load .grid i:nth-child(5)  { animation-delay: .28s;  }
.px-load .grid i:nth-child(6)  { animation-delay: .35s;  }
.px-load .grid i:nth-child(7)  { animation-delay: .42s;  }
.px-load .grid i:nth-child(8)  { animation-delay: .49s;  }
.px-load .grid i:nth-child(9)  { animation-delay: .56s;  }
.px-load .grid i:nth-child(10) { animation-delay: .63s;  }
.px-load .grid i:nth-child(11) { animation-delay: .70s;  }
.px-load .grid i:nth-child(12) { animation-delay: .77s;  }
.px-load .grid i:nth-child(13) { animation-delay: .84s;  }
.px-load .grid i:nth-child(14) { animation-delay: .91s;  }
.px-load .grid i:nth-child(15) { animation-delay: .98s;  }
.px-load .grid i:nth-child(16) { animation-delay: 1.05s; }
.px-load .msg {
  font-size: 12px;
  letter-spacing: 2px;
  color: #a8988a;
}
html[data-theme="night"] .px-load .msg { color: #b0a4c8; }
