/* ============================================================
   doi神仙 · 黑粉主题 · 双人心动小本本
   黑色打底 × 粉(大大怪)·蓝(小小怪安卓)双色心跳 · Mobile-first
   ============================================================ */

:root {
  --bg: #100c12;            /* 页面底色 */
  --bg-2: #171219;
  --card: #1d1620;          /* 卡片底 */
  --card-hi: #251c29;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.15);
  --ink: #f7edf2;           /* 正文（暖白） */
  --ink-soft: #d5c3cd;
  --ink-faint: #8f7c88;
  --pink: #ff4d88;          /* 大大怪 · 主粉 */
  --pink-soft: #ffb3cd;
  --pink-deep: #e0276a;
  --pink-tint: rgba(255,77,136,.12);
  --blue: #3f8cff;         /* 小小怪 · 安卓蓝 */
  --blue-soft: #a9c7ff;
  --blue-tint: rgba(63,140,255,.14);
  --grad-heart: linear-gradient(135deg, #ff7aa6 0%, #ff3d78 55%, #f7186a 100%);
  --radius: 22px;
  --shadow: 0 2px 0 rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.35);
  --glow-pink: 0 8px 26px rgba(255,61,120,.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  background: #0a070c;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(180deg, #140d16 0%, var(--bg) 120px);
}

/* ---------------- 全屏层（锁 / 引导） ---------------- */
.full-screen {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,77,136,.16), transparent 55%),
    linear-gradient(180deg, #171019 0%, #0c080f 100%);
  padding: 30px 22px;
  overflow-y: auto;
}
.lock-card, .boot-inner {
  width: 100%; max-width: 380px; margin: auto;
  text-align: center;
}

/* 密码锁 */
.lock-logo, .boot-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  background: var(--grad-heart);
  border-radius: 22px;
  box-shadow: var(--glow-pink), inset 0 2px 6px rgba(255,255,255,.35);
  animation: heartBeat 2.2s ease-in-out infinite;
}
.lock-title, .boot-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.lock-sub, .boot-sub { font-size: 13px; color: var(--ink-faint); margin: 6px 0 22px; line-height: 1.6; }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 18px 0 4px; }
.pin-dots i {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: transparent;
  transition: all .15s;
}
.pin-dots i.fill { background: var(--pink); border-color: var(--pink); box-shadow: 0 0 10px rgba(255,77,136,.6); }
.pin-msg { font-size: 12px; color: var(--ink-faint); min-height: 18px; margin-bottom: 10px; }
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 290px; margin: 0 auto 14px;
}
.pin-key {
  aspect-ratio: 1; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line-strong);
  color: var(--ink); font-size: 23px; font-weight: 700; font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.pin-key:active { background: var(--card-hi); transform: scale(.94); }
.pin-key.fake { color: transparent; }

/* 引导 */
.boot-step h2 { font-size: 17px; font-weight: 800; margin: 6px 0 16px; }
.who-row { display: flex; gap: 12px; }
.who-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px;
  padding: 18px 8px 14px; color: var(--ink); font-family: inherit; cursor: pointer;
}
.who-card:active { transform: scale(.97); background: var(--card-hi); }
.who-card b { font-size: 15px; }
.who-card small { font-size: 11px; color: var(--ink-faint); line-height: 1.5; }
.who-card[data-who="big"] { border-color: rgba(255,77,136,.35); }
.who-card[data-who="small"] { border-color: rgba(167,139,250,.35); }

.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.av-big { background: var(--grad-heart); box-shadow: 0 4px 14px rgba(255,61,120,.35); }
.av-small { background: linear-gradient(135deg, #7ab6ff, #3a7df0); box-shadow: 0 4px 14px rgba(58,125,240,.35); }

.big-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 800; letter-spacing: 4px;
  background: var(--card); border: 1px dashed var(--line-strong);
  border-radius: 16px; padding: 16px 10px; margin: 14px auto;
  color: var(--pink-soft);
}
.big-code.small { font-size: 18px; letter-spacing: 2.5px; margin: 4px 0; padding: 11px 10px; }
.code-input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--card); color: var(--ink);
  padding: 13px 14px; font-size: 17px; letter-spacing: 3px; text-align: center;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
  margin: 6px 0 4px; text-transform: uppercase;
}
.code-input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }

/* ---------------- 顶栏 ---------------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(14px + var(--safe-top)) 20px 10px;
  background: rgba(16,12,18,.86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.logo-mark { color: var(--pink); font-size: 15px; text-shadow: 0 0 12px rgba(255,77,136,.8); }
.brand-sub { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 2.2px; text-transform: uppercase; margin-top: 3px; }
.sync-badge {
  margin-left: auto; font-size: 12px; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--ink-faint); background: var(--card);
  border: 1px solid var(--line);
}
.sync-badge.busy { color: var(--pink); animation: spin 1s linear infinite; }
.sync-badge.ok { color: #7bd88f; }
.sync-badge.off { color: #b98a2f; }
.sync-badge.err { color: #e05757; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 内容 ---------------- */
#content { flex: 1; overflow-y: auto; padding-bottom: calc(96px + var(--safe-bottom)); }
.view { display: none; padding: 18px 20px 30px; animation: viewIn .24s ease both; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-title { font-size: 22px; font-weight: 800; margin: 4px 0 2px; letter-spacing: .5px; }
.view-sub { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 14px; }
.sub-title { font-size: 13px; font-weight: 700; color: var(--ink-faint); margin: 22px 0 10px; letter-spacing: 1px; }

/* ---------------- 打卡页 ---------------- */
.date-line { font-size: 13px; color: var(--ink-soft); font-weight: 600; margin: 6px 2px 4px; }
.date-line .today-big { font-weight: 800; color: var(--ink); }

.ring-wrap { position: relative; width: min(64vw, 276px); aspect-ratio: 1; margin: 16px auto 12px; }
.progress-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 7; }
.ring-fg {
  fill: none; stroke: var(--pink); stroke-width: 7; stroke-linecap: round;
  opacity: .9; filter: drop-shadow(0 0 6px rgba(255,77,136,.55));
  stroke-dasharray: 1 12; transition: stroke-dashoffset .5s cubic-bezier(.3,.9,.3,1);
}
.check-circle {
  position: absolute; inset: 8.5%; border-radius: 50%; border: none;
  background: radial-gradient(circle at 32% 26%, #ff9dbd, var(--pink) 60%, #e02466);
  box-shadow: var(--glow-pink), inset 0 -8px 20px rgba(120,0,50,.35), inset 0 6px 14px rgba(255,255,255,.4);
  color: #fff;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-family: inherit; -webkit-user-select: none; user-select: none;
  transition: transform .12s ease;
}
.check-circle:active { transform: scale(.955); }
.check-circle.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(1);} 40% { transform: scale(1.05);} 100% { transform: scale(1);} }
.check-heart { font-size: clamp(16px, 4.6vw, 22px); line-height: 1; text-shadow: 0 2px 8px rgba(120,0,50,.4); }
.check-num { font-size: clamp(46px, 14.5vw, 64px); font-weight: 800; line-height: 1; letter-spacing: -1px; text-shadow: 0 3px 12px rgba(120,0,50,.35); }
.check-unit { font-size: 11.5px; font-weight: 800; letter-spacing: 2.5px; opacity: .92; margin-top: 3px; }
.check-hint { font-size: 10.5px; opacity: .72; font-weight: 600; margin-top: 2px; }

.home-msg { text-align: center; font-size: 14px; color: var(--ink-soft); font-weight: 600; margin: 2px 10px 4px; min-height: 20px; }
.undo-row { text-align: center; min-height: 32px; }
.undo-btn {
  border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-faint);
  border-radius: 999px; font-size: 12px; padding: 7px 15px; font-family: inherit;
}
.undo-btn:active { background: var(--card); }

.partner-card {
  border-color: rgba(63,140,255,.3); background: linear-gradient(135deg, rgba(167,139,250,.10), rgba(255,77,136,.06));
}
.partner-card .photo-head { color: var(--blue-soft); font-weight: 800; font-size: 14px; }
.partner-card .photo-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; margin: 5px 0 0; }
.partner-card.pinkish { border-color: rgba(255,77,136,.3); background: linear-gradient(135deg, rgba(255,77,136,.10), rgba(167,139,250,.05)); }
.partner-card.pinkish .photo-head { color: var(--pink-soft); }

/* 统计 */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px 4px; text-align: center;
}
.stat b { display: block; font-size: 19px; font-weight: 800; color: var(--pink-soft); }
.stat b.v { color: var(--blue-soft); }
.stat span { display: block; font-size: 10px; color: var(--ink-faint); margin-top: 3px; letter-spacing: .5px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 12px 0;
  box-shadow: var(--shadow);
}
.card-title { font-weight: 800; font-size: 14.5px; margin-bottom: 8px; }
.card-sub { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.tiny-note { font-size: 11.5px; color: var(--ink-faint); line-height: 1.6; margin-top: 8px; }
.disclaimer { background: linear-gradient(160deg, var(--card-hi), var(--card)); border-color: rgba(255,77,136,.25); }
.disclaimer b { display: block; margin-bottom: 4px; color: var(--pink-soft); }

/* 按钮 */
.btn {
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink);
  font-size: 13.5px; font-weight: 700; font-family: inherit;
  padding: 11px 18px; flex: 1; cursor: pointer; transition: transform .1s ease;
}
.btn:active { transform: scale(.96); }
.btn.pink { background: var(--grad-heart); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(255,61,120,.3); }
.btn.pink:active { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; border-color: rgba(255,77,136,.4); color: #ff8fae; }
.btn.blue { background: linear-gradient(135deg, #7ab6ff, #3a7df0); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(58,125,240,.3); }
.btn-row { display: flex; gap: 10px; margin: 8px 0; }
.btn-row .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }

/* ---------------- 日历 ---------------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; }
.cal-nav {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--pink-soft); font-size: 21px; line-height: 1;
  font-family: inherit; cursor: pointer; flex-shrink: 0;
}
.cal-nav:active { background: var(--card-hi); }
.cal-title { flex: 1; text-align: center; font-weight: 800; font-size: 16.5px; letter-spacing: 1px; }
.cal-today {
  border: 1px solid rgba(255,77,136,.4); background: var(--pink-tint); color: var(--pink-soft);
  border-radius: 999px; font-size: 11.5px; font-weight: 700; font-family: inherit;
  padding: 7px 13px; cursor: pointer; flex-shrink: 0;
}
.cal-today:active { background: rgba(255,77,136,.22); }

.cal-legend { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--ink-faint); margin: 0 2px 10px; }
.cal-legend i { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.lg-heart { color: var(--pink); font-style: normal; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.14); }
.cal-legend-hint { margin-left: auto; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dow { font-size: 10.5px; font-weight: 700; color: var(--ink-faint); text-align: center; padding: 6px 0 2px; letter-spacing: 1px; }
.dow.we { color: rgba(255,77,136,.75); }
.cal-cell {
  position: relative; aspect-ratio: 1; border-radius: 15px; border: none;
  background: transparent; color: var(--ink-soft); font-family: inherit;
  font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.cal-cell.other { color: rgba(255,255,255,.18); }
.cal-cell.has {
  background: linear-gradient(160deg, rgba(255,61,120,.32), rgba(255,61,120,.12));
  box-shadow: inset 0 0 0 1px rgba(255,77,136,.5), 0 2px 10px rgba(255,61,120,.25);
  color: #fff;
}
.cal-cell.has .day-heart { color: var(--pink-soft); font-size: 12px; line-height: 1; text-shadow: 0 0 8px rgba(255,77,136,.9); }
.cal-cell:not(.has) .day-heart { visibility: hidden; height: 12px; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--pink); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px #fff; }
.cal-cell.sel.has { box-shadow: inset 0 0 0 2px #fff, 0 2px 12px rgba(255,61,120,.45); }
.cal-cell:active { transform: scale(.92); }
.day-cnt { position: absolute; top: 2px; right: 3px; font-size: 8px; font-weight: 800; color: var(--ink); background: #ffd3e2; border-radius: 999px; padding: 1px 3px; min-width: 12px; }

.cal-day-title { font-weight: 800; font-size: 14.5px; margin: 16px 0 2px; }

/* ---------------- 记录列表 ---------------- */
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-day {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--card);
}
.log-day-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(255,255,255,.03);
  font-size: 13px; font-weight: 800;
  border-bottom: 1px solid var(--line);
}
.log-day-head .n { color: var(--ink-faint); font-weight: 600; font-size: 11px; }

.rec-list { padding: 6px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.rec {
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 7px;
}
.rec-top { display: flex; align-items: center; gap: 8px; }
.rec-time { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.rec-time .am { font-size: 10px; color: var(--ink-faint); font-weight: 600; margin-right: 4px; }
.rec-pills { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: var(--pink-tint); color: var(--pink-soft); border: 1px solid rgba(255,77,136,.25);
  white-space: nowrap;
}
.pill.blue { background: var(--blue-tint); color: var(--blue-soft); border-color: rgba(63,140,255,.3); }
.pill.mood { background: rgba(255,255,255,.05); color: var(--ink-soft); border-color: var(--line); }
.pill .who-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rec-note {
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.65;
  border-left: 2px solid rgba(255,77,136,.5); padding-left: 9px; white-space: pre-wrap; word-break: break-word;
}
.rec-note.blue { border-left-color: rgba(63,140,255,.6); }
.rec-ops { display: flex; justify-content: flex-end; gap: 8px; }
.op-btn {
  border: none; background: transparent; color: var(--ink-faint); font-family: inherit;
  font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 8px;
}
.op-btn:active { background: rgba(255,255,255,.07); }
.op-btn.del { color: #ff8fae; }
.log-empty { text-align: center; color: var(--ink-faint); font-size: 13.5px; padding: 40px 10px; line-height: 2; }
.log-empty .big { font-size: 30px; display: block; }

/* ---------------- 设置 ---------------- */
.room-row { display: flex; align-items: center; gap: 12px; }
.room-row .btn { flex: 0 0 auto; }
.who-mini { display: flex; gap: 10px; }
.who-chip {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 9px 6px; font-family: inherit; font-size: 13.5px; font-weight: 800; color: var(--ink-soft);
}
.who-chip.on[data-who="big"] { border-color: var(--pink); color: var(--pink-soft); background: var(--pink-tint); }
.who-chip.on[data-who="small"] { border-color: var(--blue); color: var(--blue-soft); background: var(--blue-tint); }
.who-chip .avatar { width: 30px; height: 30px; font-size: 13px; }
.who-chip small { font-size: 10px; }

.faq { border-top: 1px solid var(--line); padding: 9px 0; }
.faq summary { font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.faq summary::before { content: "＋"; color: var(--pink); font-weight: 800; font-size: 14px; }
.faq[open] summary::before { content: "－"; }
.faq summary::-webkit-details-marker { display: none; }
.faq-body { font-size: 12px; color: var(--ink-faint); line-height: 1.75; padding: 8px 0 4px 22px; }

/* ---------------- 弹层 / 编辑卡片 ---------------- */
#modalLayer {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6,3,7,.7);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease both;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, #221827, #180f1c);
  border: 1px solid var(--line-strong);
  border-radius: 28px 28px 22px 22px; padding: 22px 20px calc(18px + var(--safe-bottom));
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -12px 50px rgba(0,0,0,.55);
  animation: modalIn .3s cubic-bezier(.2,1.3,.4,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(60px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; text-align: center; letter-spacing: .5px; }
.modal-emoji { text-align: center; font-size: 34px; margin-bottom: 6px; }
.modal-sub { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin: 0 0 14px; }
.modal-text { font-size: 14px; color: var(--ink-soft); line-height: 1.8; margin: 8px 0 16px; }
.modal .btn-row { margin-top: 6px; }
.modal .f-row { margin: 12px 0; }
.modal .f-label { font-size: 12px; font-weight: 800; color: var(--ink-soft); letter-spacing: 1px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.modal .f-label em { font-style: normal; color: var(--ink-faint); font-weight: 600; }

.time-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
input[type="date"], input[type="time"], input[type="number"], textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 13px;
  background: var(--bg-2); color: var(--ink); font-size: 14.5px; font-family: inherit;
  padding: 11px 12px;
}
input[type="date"]:focus, input[type="time"]:focus, input[type="number"]:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
textarea { resize: none; min-height: 76px; line-height: 1.6; }
.modal .count-hint { text-align: right; font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line-strong); background: var(--bg-2); color: var(--ink-soft);
  border-radius: 999px; font-size: 12.5px; font-weight: 700; font-family: inherit;
  padding: 8px 13px; cursor: pointer; transition: all .12s;
}
.chip:active { transform: scale(.95); }
.chip.on { border-color: var(--pink); background: var(--pink-tint); color: var(--pink-soft); box-shadow: 0 0 0 1px var(--pink); }

.mood-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood {
  border: 1.5px solid var(--line-strong); background: var(--bg-2); border-radius: 13px;
  padding: 8px 2px; font-family: inherit; cursor: pointer; color: var(--ink-faint);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.mood b { font-size: 19px; line-height: 1.1; font-weight: 400; }
.mood span { font-size: 9px; font-weight: 700; }
.mood.on { border-color: var(--pink); background: var(--pink-tint); color: var(--pink-soft); box-shadow: 0 0 0 1px var(--pink); }

/* ---------------- Toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: calc(112px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 60; background: #241825; color: #ffd9e5; border: 1px solid rgba(255,77,136,.4);
  border-radius: 999px; padding: 11px 20px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--glow-pink);
  animation: toastIn .25s ease both;
  max-width: 86vw; overflow: hidden; text-overflow: ellipsis;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------- 心动特效 ---------------- */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx { position: absolute; animation: floatHeart 1.1s ease-out forwards; text-shadow: 0 0 12px rgba(255,77,136,.7); }
@keyframes floatHeart {
  0% { opacity: 0; transform: translate(0, 10px) scale(.5) rotate(-8deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -140px) scale(1.2) rotate(calc(var(--rot) + 14deg)); }
}

@media (min-width: 521px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .modal { border-radius: 28px; margin-bottom: 20px; }
}

/* 轻心跳（logo / 大圆环上方） */
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.08); }
  24% { transform: scale(1); }
  36% { transform: scale(1.05); }
  48% { transform: scale(1); }
}

/* ============================================================
   明亮主题（黑字 × 粉♥大大怪 / 蓝♥小小怪）· 覆盖上面的暗色
   ============================================================ */
:root {
  --bg: #fff6fa;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-hi: #fff0f6;
  --line: rgba(120, 40, 80, .10);
  --line-strong: rgba(120, 40, 80, .18);
  --ink: #35121f;
  --ink-soft: #7d5366;
  --ink-faint: #b58a9c;
  --pink: #ff3d78;
  --pink-soft: #e0286b;
  --pink-deep: #b90f55;
  --pink-tint: rgba(255, 61, 120, .09);
  --blue: #3b82f6;
  --blue-soft: #1d5bd8;
  --blue-tint: rgba(59, 130, 246, .10);
  --grad-heart: linear-gradient(135deg, #ff85ad 0%, #ff4d88 52%, #f0236e 100%);
  --shadow: 0 1px 2px rgba(200, 70, 120, .06), 0 10px 26px rgba(210, 90, 140, .12);
  --glow-pink: 0 8px 22px rgba(255, 61, 120, .32);
  color-scheme: light;
}

body { background: #ffeef5; color: var(--ink); }
#app { background: linear-gradient(180deg, #fff0f7 0%, #fffafc 300px); }

.full-screen {
  background:
    radial-gradient(130% 95% at 50% -12%, rgba(255, 77, 136, .16), transparent 55%),
    linear-gradient(180deg, #fff1f7 0%, #ffe4ef 100%);
}
.lock-logo, .boot-logo { box-shadow: var(--glow-pink), inset 0 2px 6px rgba(255,255,255,.5); }

#topbar { background: rgba(255,255,255,.9); border-bottom-color: var(--line); }
.sync-badge { background: #fff; border-color: var(--line-strong); color: var(--ink-faint); }
.sync-badge.ok { color: #12a85c; }
.sync-badge.off { color: #d9822b; }
.sync-badge.err { color: #e5484d; }
.sync-badge.busy { color: var(--pink); }

.ring-bg { stroke: #f9dbe6; }
.check-circle {
  background: radial-gradient(circle at 32% 26%, #ff9dbe, var(--pink) 60%, #e0246a);
  box-shadow: var(--glow-pink), inset 0 -8px 20px rgba(160,0,60,.25), inset 0 6px 14px rgba(255,255,255,.45);
  color: #fff;
}
.check-heart, .check-num { text-shadow: 0 2px 10px rgba(150,0,55,.30); }

.home-msg { color: #a06a80; }
.home-tools { display: flex; justify-content: center; gap: 10px; margin: 2px 0 4px; }
.tool-btn {
  border: 1px dashed rgba(255, 61, 120, .5); background: rgba(255,255,255,.85); color: #d6336c;
  border-radius: 999px; font-size: 12.5px; font-weight: 700; font-family: inherit;
  padding: 9px 16px; cursor: pointer; transition: transform .1s;
}
.tool-btn:active { transform: scale(.96); background: #ffeaf2; }
.undo-btn { border-color: rgba(255,61,120,.35); background: rgba(255,255,255,.8); color: #c05a7e; }

.card { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.disclaimer { background: linear-gradient(160deg, #fff3f8, #fffbfd); border-color: rgba(255,61,120,.22); }
.disclaimer b { color: #d6336c; }
.card-title { color: var(--ink); }

.partner-card { border-color: #cfe0ff; background: linear-gradient(135deg, #f3f8ff, #fbf6ff); }
.partner-card .photo-head { color: #1d5bd8; }
.partner-card .photo-text { color: #8a6a97; }
.partner-card.pinkish { border-color: #ffc9dd; background: linear-gradient(135deg, #fff0f5, #fff9f3); }
.partner-card.pinkish .photo-head { color: #d6336c; }

.stat { background: #fff; border-color: var(--line); }
.stat b { color: #d6336c; }
.stat b.v { color: #1d5bd8; }
.stat span { color: var(--ink-faint); }

.btn { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn.pink { background: var(--grad-heart); border-color: transparent; color: #fff; }
.btn.blue { background: linear-gradient(135deg, #5f9bff, #2f62e0); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(59,130,246,.3); }
.btn.danger-ghost { color: #e5484d; border-color: rgba(229,72,77,.45); }

.cal-nav { background: #fff; color: #d6336c; border-color: var(--line); }
.cal-nav:active { background: #fff0f6; }
.cal-title { color: var(--ink); }
.cal-today { background: #ffe9f1; color: #d6336c; border-color: rgba(255,61,120,.45); }
.cal-today:active { background: #ffdce8; }
.cal-legend { color: #a48090; }
.lg-dot { background: #e8cfdb; }
.dow { color: #c08fa0; }
.dow.we { color: #f23d79; }

.cal-cell { color: #77495b; }
.cal-cell.other { color: rgba(140, 60, 100, .30); }
.cal-cell.has {
  background: linear-gradient(160deg, #ffdce9, #fff0f6);
  box-shadow: inset 0 0 0 1px rgba(255,61,120,.45), 0 2px 8px rgba(255,61,120,.18);
  color: #b3124f;
}
.cal-cell.has .day-heart { color: #f23d79; text-shadow: 0 0 8px rgba(255,61,120,.45); }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--pink); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px #35121f; }
.cal-cell.sel.has { box-shadow: inset 0 0 0 2px #35121f, 0 2px 10px rgba(255,61,120,.3); }
.day-cnt { color: #7a1039; background: #ffc6dc; }

.log-day { background: #fff; border-color: var(--line); }
.log-day-head { background: #fff3f8; color: var(--ink); border-bottom-color: var(--line); }
.log-day-head .n { color: #c68ba1; }
.rec { background: #fdf6f9; border-color: var(--line); }
.rec-time { color: var(--ink); }
.pill { background: #ffe9f2; color: #d1265f; border-color: rgba(255,61,120,.30); }
.pill.blue { background: #eaf2ff; color: #1d5bd8; border-color: rgba(59,130,246,.32); }
.pill.mood { background: #f7edf2; color: #8a5a6d; border-color: var(--line); }
.rec-note { color: var(--ink-soft); border-left-color: rgba(255,61,120,.55); }
.rec-note.blue { border-left-color: rgba(59,130,246,.7); }
.op-btn { color: #c08fa0; }
.op-btn.del { color: #e5484d; }
.op-btn:active { background: rgba(120,40,80,.07); }
.log-empty { color: #c39aab; }
.log-empty .big { color: #ff8fb5; }
.cal-day-title { color: var(--ink); }

.room-row .big-code, .big-code { background: #fff0f6; color: #d1265f; border-color: rgba(255,61,120,.4); }
.code-input { background: #fff; color: #d6336c; border-color: var(--line-strong); }
.code-input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }

.who-card { background: #fff; border-color: var(--line-strong); }
.who-card:active { background: #fff0f6; }
.who-card b { color: var(--ink); }
.who-chip { background: #fff; color: #7d5366; border-color: var(--line-strong); }
.who-chip.on[data-who="big"] { background: #ffeaf2; color: #d1265f; border-color: var(--pink); }
.who-chip.on[data-who="small"] { background: #eaf2ff; color: #1d5bd8; border-color: var(--blue); }

.faq summary { color: #6e4555; }
.faq-body { color: #a58794; }
.pin-dots i { border-color: #e5bccd; }
.pin-dots i.fill { background: var(--pink); border-color: var(--pink); box-shadow: 0 0 8px rgba(255,61,120,.5); }
.pin-key { background: #fff; border-color: var(--line-strong); color: var(--ink); box-shadow: 0 4px 10px rgba(200,90,140,.15); }
.pin-key:active { background: #ffeaf2; transform: scale(.94); }

#modalLayer { background: rgba(150, 40, 90, .28); }
.modal {
  background: linear-gradient(180deg, #fff9fc, #ffffff);
  border-color: var(--line-strong);
  box-shadow: 0 14px 50px rgba(190,60,120,.28);
}
input[type="date"], input[type="time"], input[type="number"], textarea {
  background: #fff; color: var(--ink); border-color: var(--line-strong);
}
textarea { color: var(--ink); }
.chip { background: #fff; color: #7d5366; border-color: var(--line-strong); }
.chip.on { border-color: var(--pink); background: #ffeaf2; color: #d1265f; box-shadow: none; }
.mood { background: #fff; border-color: var(--line-strong); color: #c4a4b1; }
.mood.on { border-color: var(--pink); background: #ffeaf2; color: #d1265f; box-shadow: none; }

#toast { background: linear-gradient(90deg, #ff5c92, #f0236e); color: #fff; border: none; box-shadow: 0 10px 26px rgba(255,61,120,.35); }

/* 底部导航（补全） */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(8px + var(--safe-bottom));
}
.tab {
  border: none; background: none; color: #c48fa0; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0; font-size: 10.5px; font-weight: 700; cursor: pointer;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--ink); }
.tab.active svg { color: #f23d79; }

@media (min-width: 521px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: 0 0 40px rgba(210,90,140,.10); }
  .modal { margin-bottom: 20px; }
}

/* ============================================================
   底部导航 · 米诺同款（铺满底部，四格等分）
   ============================================================ */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(120, 40, 80, .10);
  box-shadow: 0 -8px 24px rgba(210, 90, 140, .08);
  padding: 6px 6px calc(8px + var(--safe-bottom));
}
.tab {
  border: none; background: none; -webkit-appearance: none; appearance: none;
  color: #c48fa0; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px 2px; margin: 0;
  font-size: 10.5px; font-weight: 700; cursor: pointer;
  min-height: 54px; border-radius: 16px;
  transition: color .15s, background .15s, transform .08s;
}
.tab:active { background: rgba(255, 61, 120, .07); transform: scale(.96); }
.tab svg { width: 24px; height: 24px; display: block; }
.tab span { line-height: 1.2; }
.tab.active { color: #35121f; }
.tab.active svg { color: #f23d79; filter: drop-shadow(0 0 5px rgba(255,61,120,.35)); }
.tab.active::before { display: none; }
@media (min-width: 521px) {
  #tabbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
