:root {
  --bg: #140d1d;
  --bg-soft: #1d1428;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4eefb;
  --muted: #a99cbb;
  --pink: #ff7aa8;
  --pink-deep: #ff4d8d;
  --violet: #9b7bff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #ff6b6b;
  --radius: 18px;
  --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; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(1100px 620px at 12% -10%, rgba(255, 122, 168, 0.22), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(155, 123, 255, 0.2), transparent 60%),
    radial-gradient(700px 500px at 50% 108%, rgba(255, 77, 141, 0.12), transparent 60%);
  background-attachment: fixed;
}

input, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
h1, h2 { margin: 0; font-weight: 700; }
.muted { color: var(--muted); font-size: 0.82rem; }
[hidden] { display: none !important; }
/* 双保险：万一有别的规则盖掉 hidden 属性，这两个容器也不会同时出现 */
#gate[hidden], #app[hidden], .page[hidden], .sheet[hidden] { display: none !important; }

/* ------------------------------- 登录页 ------------------------------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px 22px 22px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.brand { text-align: center; margin-bottom: 22px; }
.brand-mark { font-size: 2.6rem; line-height: 1; }
.brand h1 { font-size: 1.6rem; letter-spacing: 0.06em; margin-top: 6px; }
.brand-sub { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

input[type="text"], textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input[type="text"]:focus, textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 122, 168, 0.16);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.65; }

input[type="date"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  outline: none;
  color-scheme: dark;
  font-family: inherit;
}
input[type="date"]:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 122, 168, 0.16);
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-weight: 700;
  text-align: center;
  font-size: 1.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gate-actions { display: grid; gap: 12px; margin-top: 4px; }

.btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  font-weight: 600;
  transition: transform 0.12s, opacity 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; }
.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 55%, var(--violet) 130%);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 77, 141, 0.32);
}
.btn-ghost {
  background: var(--card-strong);
  border: 1px solid var(--line);
}
.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: var(--danger);
  margin-top: 10px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.emoji-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-chip {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.28rem;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid transparent;
  transition: transform 0.12s, border-color 0.18s, background 0.18s;
}
.emoji-chip:active { transform: scale(0.92); }
.emoji-chip.on {
  border-color: var(--pink);
  background: rgba(255, 122, 168, 0.16);
  box-shadow: 0 0 0 3px rgba(255, 122, 168, 0.12);
}

.gate-msg {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.32);
  color: #ffc9c9;
}

/* 登录页也显示版本号，方便对证「我这边跑的是哪一版」 */
.gate-version {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ------------------------------ 主界面容器 ------------------------------ */

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px calc(88px + var(--safe-bottom));
}

.page { animation: fade-in 0.22s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  margin: 0 -16px;
  background: linear-gradient(180deg, rgba(20, 13, 29, 0.96), rgba(20, 13, 29, 0.7) 72%, transparent);
  backdrop-filter: blur(12px);
}

.pair-title { display: flex; align-items: center; gap: 11px; }
.pair-emoji { font-size: 1.5rem; }
.pair-title strong { font-size: 1.06rem; letter-spacing: 0.03em; }
.pair-sub { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--muted); }

.days-chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 122, 168, 0.16);
  border: 1px solid rgba(255, 122, 168, 0.3);
  color: #ffd6e6;
  font-size: 0.68rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px currentColor;
  color: var(--warn);
}
.dot.on { background: var(--ok); color: var(--ok); }
.dot.off { background: var(--danger); color: var(--danger); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 1.2rem;
  line-height: 1;
}
.icon-btn.small { width: 34px; height: 34px; border-radius: 11px; font-size: 1.1rem; }

/* 顶部提醒条 */
.reminder-bar {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 15px;
  background: linear-gradient(140deg, rgba(255, 93, 122, 0.18), rgba(155, 123, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: pop 0.28s ease;
}
.reminder-bar .r-emoji { font-size: 1.3rem; line-height: 1.3; }
.reminder-bar strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.reminder-bar p { margin: 0; font-size: 0.8rem; color: #e3d8f2; line-height: 1.6; }

/* ------------------------------ 底部导航 ------------------------------ */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: rgba(20, 13, 29, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  max-width: 120px;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 5px 2px;
  border-radius: 13px;
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
}
.tab span { font-size: 1.16rem; line-height: 1.2; filter: grayscale(0.55); transition: filter 0.18s; }
.tab small { font-size: 0.64rem; letter-spacing: 0.03em; }
.tab.on { color: var(--text); background: rgba(255, 122, 168, 0.14); }
.tab.on span { filter: none; }

/* --------------------------------- 首页 --------------------------------- */

.daily-card {
  margin: 6px 0 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255, 122, 168, 0.16), rgba(155, 123, 255, 0.13));
  border: 1px solid rgba(255, 255, 255, 0.13);
}
.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  color: #ffd6e6;
  margin-bottom: 8px;
}
.tiny-btn {
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
}
.daily-text { margin: 0; font-size: 1.05rem; line-height: 1.75; }
.daily-foot { margin-top: 8px; font-size: 0.78rem; color: var(--muted); text-align: right; }

.home-anniv { margin-bottom: 18px; display: grid; gap: 8px; }
.home-anniv .anniv-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.86rem;
}
.home-anniv .anniv-chip .n { margin-left: auto; color: #ffd6e6; font-size: 0.8rem; }
.home-anniv .anniv-chip .d { color: var(--muted); font-size: 0.74rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 12px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 0.95rem; letter-spacing: 0.08em; color: #e9dcff; }

/* 时间线 */
.feed { display: grid; gap: 12px; }

.note {
  padding: 14px 15px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  animation: pop 0.28s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.note.mine {
  background: linear-gradient(160deg, rgba(255, 122, 168, 0.13), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 122, 168, 0.26);
}
.note-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  font-size: 0.8rem;
  color: var(--muted);
}
.note-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 1rem;
}
.note-who { color: var(--text); font-weight: 600; font-size: 0.86rem; }
.note-mood { margin-left: auto; font-size: 0.95rem; }
.note-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.note-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.react-btn {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}
.react-btn.mine { border-color: var(--pink); background: rgba(255, 122, 168, 0.18); }
.note-comment {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(155, 123, 255, 0.16);
  border: 1px solid rgba(155, 123, 255, 0.3);
  color: #ded2ff;
}
.note-time { margin-left: auto; font-size: 0.72rem; color: var(--muted); }
.note-del { font-size: 0.72rem; color: rgba(255, 107, 107, 0.75); padding: 2px 4px; }

.btn-more { margin-top: 14px; background: var(--card); border: 1px solid var(--line); }

.empty { text-align: center; color: var(--muted); padding: 44px 0; font-size: 0.9rem; }
.empty-emoji { font-size: 2.4rem; margin-bottom: 10px; }

/* 悬浮按钮 */
.fab {
  position: fixed;
  right: max(18px, calc(50vw - 310px + 18px));
  bottom: calc(84px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border-radius: 20px;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 60%, var(--violet) 140%);
  box-shadow: 0 14px 34px rgba(255, 77, 141, 0.42);
  z-index: 30;
  transition: transform 0.14s;
}
.fab:active { transform: scale(0.94); }

/* ------------------------------ 分段控件 ------------------------------ */

.seg {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.seg-btn {
  flex: 1;
  padding: 9px 8px;
  border-radius: 11px;
  font-size: 0.86rem;
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
}
.seg-btn.on {
  background: linear-gradient(135deg, rgba(255, 122, 168, 0.9), rgba(255, 77, 141, 0.85));
  color: #fff;
  font-weight: 600;
}
.seg.small { margin-bottom: 0; }
.seg.small .seg-btn { padding: 7px 4px; font-size: 0.78rem; }

/* -------------------------------- 经期卡片 ------------------------------- */

.cycle-card {
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255, 93, 122, 0.16), rgba(155, 123, 255, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.13);
}
.cycle-top { display: flex; align-items: center; gap: 12px; }
.cycle-emoji { font-size: 2rem; line-height: 1; }
.cycle-phase { font-size: 1.15rem; font-weight: 700; }
.cycle-day { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.cycle-meta {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.cycle-meta div {
  flex: 1;
  min-width: 88px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.24);
}
.cycle-meta .k { font-size: 0.7rem; color: var(--muted); }
.cycle-meta .v { font-size: 0.95rem; font-weight: 600; margin-top: 2px; }

.cycle-bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
  position: relative;
}
.cycle-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }

.tip-card {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  line-height: 1.75;
  color: #e3d8f2;
}

/* 日历 */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid .dow {
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 4px 0;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid transparent;
  position: relative;
}
.cal-cell.blank { background: transparent; }
.cal-cell.today { border-color: var(--pink); font-weight: 700; }
.cal-cell.period { background: rgba(255, 93, 122, 0.34); color: #ffe3ea; }
.cal-cell.predicted { background: rgba(255, 93, 122, 0.14); border: 1px dashed rgba(255, 93, 122, 0.5); }
.cal-cell.ovulation { background: rgba(255, 179, 71, 0.3); }
.cal-cell.fertile { background: rgba(255, 179, 71, 0.14); }
.cal-cell .dotmark {
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet);
}

/* 记录列表 / 设置列表 */
.record-list, .setting-list { display: grid; gap: 8px; margin-bottom: 12px; }
.record-row, .setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}
.record-row .sub { color: var(--muted); font-size: 0.74rem; margin-top: 2px; }
.record-row .grow, .setting-row .grow { flex: 1; min-width: 0; }
.record-row .del, .setting-row .del { color: rgba(255, 107, 107, 0.8); font-size: 0.76rem; }

.setting-row { flex-wrap: wrap; }
.setting-row .ctl { display: flex; align-items: center; gap: 6px; }
.num-input {
  width: 62px;
  text-align: center;
  padding: 7px 6px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.switch {
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch.on { background: linear-gradient(135deg, var(--pink), var(--pink-deep)); }
.switch.on i { transform: translateX(19px); }

/* --------------------------- 怀孕风险 / 日历事件 --------------------------- */

.risk-card {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.risk-card .risk-top { display: flex; align-items: center; gap: 10px; }
.risk-card .risk-badge {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.risk-card .risk-label { font-size: 0.96rem; font-weight: 600; }
.risk-card .risk-day { margin-left: auto; font-size: 0.72rem; color: var(--muted); }
.risk-card p { margin: 9px 0 0; font-size: 0.82rem; line-height: 1.7; color: #e3d8f2; }
.risk-card .risk-marks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

.risk-card.peak { background: linear-gradient(150deg, rgba(255, 93, 122, 0.22), rgba(255, 255, 255, 0.04)); border-color: rgba(255, 93, 122, 0.5); }
.risk-card.peak .risk-badge { background: var(--danger); color: #fff; }
.risk-card.high { background: linear-gradient(150deg, rgba(255, 179, 71, 0.18), rgba(255, 255, 255, 0.04)); border-color: rgba(255, 179, 71, 0.45); }
.risk-card.high .risk-badge { background: var(--warn); color: #3a2a00; }
.risk-card.mid .risk-badge { background: rgba(155, 123, 255, 0.35); color: #efe8ff; }
.risk-card.low .risk-badge { background: rgba(74, 222, 128, 0.28); color: #d6ffe4; }

/* 事件标签选择 */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--card);
  border: 1px solid var(--line);
  transition: background 0.16s, border-color 0.16s, transform 0.1s;
}
.tag:active { transform: scale(0.95); }
.tag.on { background: rgba(255, 122, 168, 0.22); border-color: var(--pink); color: #fff; }

/* 事件列表 */
.event-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 6px;
}
.event-summary div {
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.event-summary .k { font-size: 0.7rem; color: var(--muted); }
.event-summary .v { font-size: 1.05rem; font-weight: 700; margin-top: 2px; }

.event-list { display: grid; gap: 9px; }
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
}
.event-row .ic { font-size: 1.15rem; line-height: 1.3; }
.event-row .body { flex: 1; min-width: 0; }
.event-row .t { font-size: 0.9rem; }
.event-row .t b { color: #ffd6e6; }
.event-row .m { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }
.event-row .ops { display: flex; flex-direction: column; gap: 5px; flex: none; }
.event-row.intimacy { background: linear-gradient(150deg, rgba(255, 122, 168, 0.14), rgba(255, 255, 255, 0.04)); }
.event-row .lock { font-size: 0.66rem; color: var(--muted); }
.event-row.private-locked .t { color: var(--muted); }

/* 日历上「有记录」的小圆点（紫），与经期记录的圆点（白）区分开 */
.cal-cell .evdot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--violet);
}
.cal-cell.has-intimacy .evdot { background: var(--pink); }

/* ------------------------------- 纪念日 ------------------------------- */

.anniv-list { display: grid; gap: 10px; margin-bottom: 12px; }
.anniv-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.anniv-card .ic { font-size: 1.5rem; }
.anniv-card .body { flex: 1; min-width: 0; }
.anniv-card .t { font-weight: 600; font-size: 0.94rem; }
.anniv-card .m { color: var(--muted); font-size: 0.76rem; margin-top: 3px; }
.anniv-card .cnt { text-align: right; flex: none; }
.anniv-card .cnt b { font-size: 1.25rem; color: var(--pink); }
.anniv-card .cnt span { display: block; font-size: 0.68rem; color: var(--muted); }
.anniv-card.soon { border-color: rgba(255, 122, 168, 0.5); background: linear-gradient(150deg, rgba(255, 122, 168, 0.14), rgba(255, 255, 255, 0.04)); }
.anniv-card .ops { display: flex; flex-direction: column; gap: 6px; margin-left: 4px; }

/* ------------------------------ 心愿单 / 备忘 ----------------------------- */

.add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.add-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  outline: none;
}
.add-row input:focus { border-color: var(--pink); }
.btn.compact { width: auto; padding: 11px 18px; flex: none; }

.wish-list, .memo-list { display: grid; gap: 10px; }
.wish, .memo {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.wish .body, .memo .body { flex: 1; min-width: 0; }
.wish .t, .memo .t { font-size: 0.94rem; word-break: break-word; }
.wish.done .t, .memo.done .t { text-decoration: line-through; color: var(--muted); }
.wish .m, .memo .m { color: var(--muted); font-size: 0.74rem; margin-top: 4px; }
.wish .m a { color: #a9c9ff; text-decoration: none; word-break: break-all; }
.tick {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  transition: background 0.18s, border-color 0.18s;
}
.tick.on { background: linear-gradient(135deg, var(--pink), var(--pink-deep)); border-color: transparent; }
.pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
}
.pill.pin { background: rgba(255, 179, 71, 0.2); border-color: rgba(255, 179, 71, 0.4); color: #ffdca8; }
.pill.due { background: rgba(155, 123, 255, 0.18); border-color: rgba(155, 123, 255, 0.38); color: #ded2ff; }
.memo .ops, .wish .ops { display: flex; flex-direction: column; gap: 6px; flex: none; }
.icon-tiny { font-size: 0.9rem; padding: 2px 4px; opacity: 0.75; }

/* -------------------------------- 我的页 -------------------------------- */

.card-host { display: grid; gap: 10px; }

/* ------------------------------ 头像选择器 ------------------------------ */

.avatar-picker { display: flex; align-items: center; gap: 14px; }
.avatar-preview {
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-actions { display: grid; gap: 7px; justify-items: start; }
.avatar-hint { margin: 0; font-size: 0.7rem; line-height: 1.5; }

/* 有自定义头像时，头像位显示图片而不是 emoji */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.note-avatar, .me-avatar, .comment .av, .member-row .av { overflow: hidden; }

.me-avatar { overflow: hidden; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.me-card {
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255, 122, 168, 0.13), rgba(155, 123, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.me-head { display: flex; align-items: center; gap: 13px; }
.me-avatar {
  width: 56px;
  height: 56px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.1);
}
.me-name { font-size: 1.12rem; font-weight: 700; }
.me-bio { color: var(--muted); font-size: 0.78rem; margin-top: 3px; }
.me-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.me-grid div {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.24);
}
.me-grid .k { font-size: 0.7rem; color: var(--muted); }
.me-grid .v { font-size: 0.92rem; font-weight: 600; margin-top: 2px; }
.me-empty { color: var(--muted); font-size: 0.82rem; margin-top: 12px; line-height: 1.7; }

.me-rows { display: grid; gap: 8px; }
.row-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  text-align: left;
}
.row-btn span { color: var(--muted); }

.id-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #ded2ff;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 7px;
  word-break: break-all;
}

/* -------------------------------- 评论面板 ------------------------------- */

.comment-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: #e3d8f2;
  margin-bottom: 12px;
  max-height: 30vh;
  overflow-y: auto;
}
.comment-note .who { color: var(--muted); font-size: 0.74rem; margin-bottom: 4px; }
.comment-list { display: grid; gap: 9px; max-height: 44vh; overflow-y: auto; }
.comment {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
}
.comment .av { font-size: 1.05rem; }
.comment .body { flex: 1; min-width: 0; }
.comment .who { font-size: 0.78rem; color: var(--muted); }
.comment .who b { color: var(--text); }
.comment .tx { font-size: 0.88rem; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.comment .ops { display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------- 底部抽屉 ------------------------------- */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 14, 0.62);
  backdrop-filter: blur(4px);
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 10px 20px calc(24px + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #241833, #1a1126);
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  animation: slide-up 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 92dvh;
  overflow-y: auto;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 12px;
}
.sheet-title { font-size: 1.05rem; margin-bottom: 14px; }

.mood-row { display: flex; gap: 8px; margin-bottom: 14px; }
.mood-chip {
  flex: 1;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 9px 0;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid transparent;
  font-size: 1.45rem;
  transition: transform 0.12s, border-color 0.18s, background 0.18s;
}
.mood-chip:active { transform: scale(0.93); }
.mood-chip.on {
  border-color: var(--pink);
  background: rgba(255, 122, 168, 0.17);
}
.mood-chip small { font-size: 0.62rem; color: var(--muted); }

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.sheet-foot .btn { width: auto; padding: 11px 26px; }

.invite-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.22);
}
.invite-box code {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--pink);
}

.members { display: grid; gap: 8px; }
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  font-size: 0.88rem;
}
.member-row .me-tag {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--pink);
}

/* 账号区块 */
.section-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 16px;
  color: var(--muted);
  font-size: 0.76rem;
}
.section-sep::before,
.section-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
#s-account-line { white-space: pre-line; }

/* 账号管理列表 */
.admin-list { display: grid; gap: 12px; margin-bottom: 16px; }
.admin-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.admin-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.admin-status {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(120, 200, 150, 0.18);
  color: #2f8f5b;
}
.admin-status.off {
  background: rgba(220, 120, 120, 0.16);
  color: #c05050;
}
.admin-meta {
  margin: 8px 0 10px;
  font-size: 0.74rem;
  line-height: 1.6;
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions .danger { color: #c05050; }

/* 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 13, 29, 0.95);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: pop 0.2s ease;
  max-width: 90vw;
  text-align: center;
}

@media (min-width: 700px) {
  body { font-size: 16.5px; }
  .gate-card { padding: 32px 28px 26px; }
}
