/* ==========================================================================
   佩佩风格 · 日常生活提醒
   配色：粉 + 白，柔和、圆润、可爱
   ========================================================================== */

:root {
  /* 主色 */
  --pink-50:  #FFF5F9;
  --pink-100: #FFE8F2;
  --pink-200: #FFD3E5;
  --pink-300: #FFB6D5;
  --pink-400: #FF97C4;
  --pink-500: #FF7AB3;
  --pink-600: #F2649E;

  /* 辅助 */
  --cream:  #FFFBF4;
  --yellow: #FFE9A8;
  --mint:   #D8F3E8;
  --lav:    #EDE4FF;

  /* 中性 */
  --text:   #5A4650;
  --text-2: #967E8B;
  --line:   #FFDCEB;
  --white:  #FFFFFF;

  --shadow-sm: 0 2px 8px rgba(255, 122, 179, .12);
  --shadow:    0 6px 20px rgba(255, 122, 179, .18);
  --shadow-lg: 0 12px 36px rgba(255, 122, 179, .24);
  --radius:    22px;
  --radius-sm: 14px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #FFEAF4 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, #FFF1F8 0%, transparent 55%),
    linear-gradient(180deg, #FFF9FC 0%, #FFF3F8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

/* ---------------- 背景漂浮装饰 ---------------- */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.deco {
  position: absolute;
  font-size: 22px;
  opacity: .28;
  animation: floaty 9s ease-in-out infinite;
  filter: saturate(1.1);
}
.d1 { top: 8%;  left: 6%;  animation-delay: 0s;   font-size: 26px; }
.d2 { top: 22%; right: 8%; animation-delay: 1.2s; font-size: 20px; }
.d3 { top: 46%; left: 4%;  animation-delay: 2.4s; font-size: 18px; }
.d4 { top: 64%; right: 6%; animation-delay: .6s;  font-size: 24px; }
.d5 { top: 80%; left: 10%; animation-delay: 3s;   font-size: 18px; }
.d6 { top: 34%; right: 3%; animation-delay: 1.8s; font-size: 20px; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-18px) rotate(8deg); }
}

/* ---------------- 布局 ---------------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ---------------- Hero ---------------- */
.hero { text-align: center; padding: 14px 0 6px; }

.hero-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.icon-btn {
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 18px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: grid; place-items: center;
}
.icon-btn:active { transform: scale(.92); }

.melody { margin: 4px auto 2px; width: 132px; }
.melody-svg { width: 100%; height: auto; display: block; animation: bob 4s ease-in-out infinite; }
.melody-img {
  width: 100%; height: auto; display: block;
  border-radius: 50%;
  animation: bob 4s ease-in-out infinite;
  filter: drop-shadow(0 6px 16px rgba(255,122,179,.25));
}
[hidden] { display: none !important; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

.hero-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--pink-600);
  margin-top: 2px;
}
.hero-title span { color: var(--pink-500); }

.hero-date { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }

/* 进度环 */
.hero-progress { margin-top: 14px; display: flex; flex-direction: column; align-items: center; }
.progress-ring-wrap { position: relative; width: 116px; height: 116px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--pink-100); stroke-width: 11; }
.ring-fg {
  fill: none;
  stroke: url(#g) var(--pink-400);
  stroke: var(--pink-400);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .8s cubic-bezier(.34,1.4,.64,1);
  filter: drop-shadow(0 2px 6px rgba(255,122,179,.35));
}
.ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 1px;
  font-size: 26px; font-weight: 800; color: var(--pink-600);
  line-height: 1;
}
.ring-label small {
  font-size: 13px; color: var(--text-2); font-weight: 700;
  line-height: 1;
  transform: translateY(3px);
}
.progress-text { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }

/* ---------------- 卡片 ---------------- */
.card {
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h2 { font-size: 16.5px; font-weight: 800; color: var(--text); }

.mini-btn {
  border: none;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255,122,179,.35);
  transition: transform .16s, box-shadow .16s;
  font-family: inherit;
}
.mini-btn:active { transform: scale(.94); box-shadow: 0 1px 5px rgba(255,122,179,.3); }
.mini-btn.ghost {
  background: var(--white);
  color: var(--pink-600);
  border: 1.5px solid var(--pink-200);
  box-shadow: none;
}

/* ---------------- 提醒列表 ---------------- */
.reminder-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.reminder {
  display: flex; align-items: center; gap: 11px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: transform .18s, box-shadow .18s, background .3s, border-color .3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.reminder::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--pink-300);
  opacity: .7;
}
.reminder:active { transform: scale(.985); }

.reminder.is-done {
  background: linear-gradient(135deg, #FFF8FC, #FFF1F8);
  border-color: var(--pink-200);
}
.reminder.is-done .r-title { text-decoration: line-through; color: var(--text-2); }
.reminder.is-done::before { background: var(--pink-500); }

.reminder.is-now {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px var(--pink-100), var(--shadow-sm);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px var(--pink-100), var(--shadow-sm); }
  50%     { box-shadow: 0 0 0 6px rgba(255,182,213,.45), var(--shadow-sm); }
}

.r-emoji {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--pink-50);
  border-radius: 12px;
  font-size: 19px;
}
.r-body { flex: 1; min-width: 0; }
.r-title {
  font-size: 14.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.r-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-2); margin-top: 1px;
}
.r-time { font-weight: 700; color: var(--pink-500); }
.r-badge {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--pink-100); color: var(--pink-600); font-weight: 700;
}
.r-note { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

.r-check {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%;
  border: 2.5px solid var(--pink-200);
  background: var(--white);
  display: grid; place-items: center;
  color: transparent;
  font-size: 14px; font-weight: 900;
  transition: all .22s cubic-bezier(.34,1.5,.64,1);
}
.reminder.is-done .r-check {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  border-color: var(--pink-500);
  color: #fff;
  transform: scale(1.06);
}

.empty-tip { text-align: center; color: var(--text-2); font-size: 13px; padding: 18px 0; }

/* ---------------- 趋势柱 ---------------- */
.trend {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 8px; height: 108px; padding: 4px 2px 0;
}
.trend-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.trend-bar {
  width: 100%; max-width: 32px;
  background: linear-gradient(180deg, var(--pink-300), var(--pink-400));
  border-radius: 8px 8px 4px 4px;
  min-height: 5px;
  transition: height .7s cubic-bezier(.34,1.3,.64,1);
  position: relative;
}
.trend-item.today .trend-bar {
  background: linear-gradient(180deg, var(--pink-500), var(--pink-600));
  box-shadow: 0 0 0 3px var(--pink-100);
}
.trend-num { font-size: 11px; font-weight: 800; color: var(--pink-600); }
.trend-day { font-size: 10.5px; color: var(--text-2); font-weight: 600; }

/* ---------------- 心情 ---------------- */
.mood-row { display: flex; gap: 9px; }
.mood {
  flex: 1;
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px 4px 8px;
  font-size: 21px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform .16s, border-color .2s, background .2s;
  font-family: inherit;
}
.mood span { font-size: 11px; color: var(--text-2); font-weight: 600; }
.mood:active { transform: scale(.94); }
.mood.active {
  border-color: var(--pink-400);
  background: var(--pink-50);
  box-shadow: 0 0 0 3px var(--pink-100);
}
.mood.active span { color: var(--pink-600); }

/* ---------------- 管理列表 ---------------- */
.manage-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.manage-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.manage-item.off { opacity: .45; }
.m-emoji { font-size: 17px; }
.m-info { flex: 1; min-width: 0; }
.m-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sub { font-size: 11.5px; color: var(--text-2); }
.m-actions { display: flex; gap: 5px; }
.m-btn {
  width: 30px; height: 30px;
  border: none; border-radius: 9px;
  background: var(--pink-50);
  color: var(--pink-600);
  font-size: 13px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s, background .2s;
}
.m-btn:active { transform: scale(.9); }
.m-btn.danger { background: #FFEFF4; color: #E8557F; }

/* ---------------- 留言 ---------------- */
.notes-card { background: linear-gradient(160deg, #FFF9FC 0%, #FFF3F9 100%); }

.note-display {
  background: var(--white);
  border: 1.5px solid var(--pink-200);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.note-display::before {
  content: '❝';
  position: absolute; top: 4px; left: 12px;
  font-size: 30px; color: var(--pink-200); font-family: Georgia, serif;
}
.note-text {
  font-size: 15px; font-weight: 600; color: var(--pink-600);
  line-height: 1.75;
  min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
}

.note-list { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; max-height: 190px; overflow-y: auto; }
.note-item {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13px;
}
.note-item p { flex: 1; line-height: 1.55; }
.note-item .n-author { display: block; font-size: 11px; color: var(--text-2); margin-top: 2px; }
.note-del {
  border: none; background: transparent;
  color: #E8557F; font-size: 14px; cursor: pointer;
  padding: 0 2px; line-height: 1;
  opacity: .55;
}
.note-del:active { opacity: 1; }

.note-editor { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.note-editor input {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.note-editor input:focus { border-color: var(--pink-300); box-shadow: 0 0 0 3px var(--pink-100); }
.note-editor .mini-btn { align-self: flex-end; }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; }
.modal[hidden] { display: none !important; }
.modal-mask { position: absolute; inset: 0; background: rgba(90,70,80,.32); backdrop-filter: blur(3px); animation: fade .22s; }
@keyframes fade { from { opacity: 0 } }

.modal-box {
  position: relative;
  width: 100%; max-width: 520px;
  background: var(--white);
  border-radius: 26px 26px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(255,122,179,.25);
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
  max-height: 90vh; overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%) } }

.modal-box h3 { font-size: 18px; font-weight: 800; color: var(--pink-600); margin-bottom: 16px; text-align: center; }
.modal-box label {
  display: block;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  margin-bottom: 11px;
}
.modal-box input, .modal-box select {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--pink-50);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.modal-box input:focus, .modal-box select:focus {
  border-color: var(--pink-300); box-shadow: 0 0 0 3px var(--pink-100); background: var(--white);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .mini-btn { flex: 1; padding: 12px; font-size: 14.5px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%; top: 22px;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: #fff;
  font-size: 13.5px; font-weight: 700;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 84vw; text-align: center;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 页脚 ---------------- */
.foot {
  text-align: center;
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-2);
  opacity: .8;
}

/* ---------------- 滚动条 ---------------- */
.note-list::-webkit-scrollbar { width: 5px; }
.note-list::-webkit-scrollbar-thumb { background: var(--pink-200); border-radius: 999px; }

/* ---------------- 大屏微调 ---------------- */
@media (min-width: 560px) {
  body { font-size: 15.5px; }
  .app { padding-top: 8px; }
  .modal { place-items: center; }
  .modal-box { border-radius: 26px; animation: pop .28s cubic-bezier(.34,1.3,.64,1); }
  @keyframes pop { from { transform: scale(.94); opacity: 0 } }
}

/* ---------------- 减少动效 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
