:root {
  /* 白色系：干净、留白多 */
  --bg: #ffffff;
  --bg-deep: #f7f7f8;        /* 抬头的极浅灰 */
  --paper: #ffffff;
  --paper-soft: rgba(255, 255, 255, 0.86);
  --ink: #1f1f22;            /* 近黑文字 */
  --ink-mid: #55555c;
  --ink-soft: #9a9aa2;
  --rose: #e9a2a2;           /* 只做点缀的淡粉 */
  --rose-deep: #d97f7f;
  --rose-wash: rgba(233, 162, 162, 0.12);
  --blue: #9fb6c4;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 18px;
  --radius-sm: 12px;
  /* 经期配色 */
  --pd-period: #e88fa0;
  --pd-predicted: #dfe6f5;
  --pd-spot: #f5d98a;
  --pd-mucus: #a8d5c2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101013;
    --bg-deep: #16161a;
    --paper: #1a1a1f;
    --paper-soft: rgba(26, 26, 31, 0.86);
    --ink: #f2f2f4;
    --ink-mid: #b6b6bd;
    --ink-soft: #7c7c85;
    --rose: #e9a2a2;
    --rose-deep: #f0b3b3;
    --rose-wash: rgba(233, 162, 162, 0.14);
    --blue: #9fb6c4;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --pd-period: #e88fa0;
    --pd-predicted: #2f3648;
    --pd-spot: #6b5a2a;
    --pd-mucus: #2f4a40;
  }
}

/* ============ 基础 ============ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  /* 关键：所有元素都禁掉双击缩放 */
  touch-action: manipulation;
}

button, a, input, textarea, label {
  touch-action: manipulation;
}

.hidden { display: none !important; }

/* 隐藏滚动条，但保留滚动能力 */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                /* Chrome / Safari / iOS */
}

html {
  scrollbar-width: none;        /* Firefox：隐藏滚动条 */
  -ms-overflow-style: none;     /* 旧版 Edge/IE */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* manipulation = 允许滚动和轻点，但禁掉双击缩放 */
  touch-action: manipulation;
  /* 万一有元素超宽，也不让页面横向滚动 */
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  /* 只允许上下滑，杜绝横向滚动导致的视觉错位 */
  overflow-x: hidden;
  max-width: 100vw;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ============ 按钮与输入 ============ */
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: var(--rose-deep);
  color: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  transition: transform .15s ease, background .2s ease, opacity .2s;
}
button:hover { background: var(--rose); }
button:active { transform: scale(.975); }
button:disabled { opacity: .5; cursor: default; }

.icon-btn {
  background: transparent;
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.icon-btn:hover { background: var(--rose-wash); color: var(--rose-deep); }

input, textarea {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
}
textarea { resize: none; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); }

/* ============ 登录 ============ */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(900px 500px at 50% -10%, var(--bg-deep), transparent 65%),
    var(--bg);
  /* 已登录时 boot() 会把它隐藏掉；这段淡出让切换不突兀 */
  transition: opacity .18s ease;
}
.login.hidden { opacity: 0; }
.login-inner { width: min(360px, 100%); text-align: center; }
.seal {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--rose-deep);
  background: var(--rose-wash);
  border: 1px solid var(--line);
  animation: beat 2.6s ease-in-out infinite;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.1); }
  24% { transform: scale(1); }
  36% { transform: scale(1.05); }
}
.login-inner h1 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 3px;
  margin: 0 0 6px;
}
.login-inner .sub {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 1px;
  margin: 0 0 34px;
}
.login-inner form { display: grid; gap: 14px; }
.identity-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.identity-picker label { cursor: pointer; }
.identity-picker input { position: absolute; opacity: 0; pointer-events: none; }
.identity-picker span {
  display: block;
  padding: 11px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-mid);
  background: var(--paper);
}
.identity-picker input:checked + span {
  border-color: var(--rose-deep);
  color: var(--rose-deep);
  background: var(--rose-wash);
}
.login-inner input {
  text-align: center;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
  letter-spacing: 4px;
  font-size: 16px;
}
.login-inner input:focus { border-color: var(--rose); }
.login-inner button { padding: 13px; font-size: 15px; letter-spacing: 2px; }
.err { color: #c0565f; font-size: 13px; min-height: 20px; margin: 0; }
.foot { color: var(--ink-soft); font-size: 12px; margin-top: 34px; letter-spacing: 1px; }

/* ============ 抬头 ============ */
.app {
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  padding: max(18px, env(safe-area-inset-top)) 16px 12px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 62%);
}
.hero-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 164, 143, 0.26), transparent 70%);
  pointer-events: none;
}
.hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 12px; letter-spacing: 4px; color: var(--ink-soft); }
.hero-actions { display: flex; align-items: center; gap: 8px; }

.anniv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(150, 100, 95, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.anniv-heart { font-size: 11px; color: var(--rose); animation: beat 2.6s ease-in-out infinite; }
.anniv-body { display: inline-flex; align-items: baseline; gap: 2px; }
.anniv-days {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .5px;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.anniv-unit { font-size: 10px; color: var(--ink-soft); letter-spacing: .5px; }
.anniv-sub {
  position: relative;
  margin-top: 9px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .5px;
  opacity: .9;
  display: flex;
  align-items: center;
  gap: 7px;
}
.anniv-sub::before { content: ""; width: 16px; height: 1px; background: var(--line-strong); flex: 0 0 auto; }

.hero-date {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 12px;
}
.hero-day {
  font-size: 52px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.hero-meta { display: flex; flex-direction: column; line-height: 1.4; }
.hero-meta > span:first-child { font-size: 15px; color: var(--ink-mid); letter-spacing: 1px; }
.hero-weekday { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }
.hero-together {
  position: relative;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .5px;
}
.hero-together b { color: var(--rose-deep); font-weight: 500; }

.wrap { display: grid; gap: 14px; padding: 0 16px; }

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--ink-mid);
}
.panel-hint { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }

/* 旧的猫图样式已由文件末尾的「四只猫」替换，这里留空 */

/* ============ 心情 ============ */
.mood-pair { display: flex; align-items: stretch; gap: 14px; }
.mood-slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
}
.mood-divider { width: 1px; background: var(--line); margin: 4px 0; }
.slot-label {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-emoji { font-size: 30px; line-height: 1.35; }
.slot-note {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  word-break: break-word;
  line-height: 1.5;
  min-height: 18px;
}

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 14px 0 10px;
  justify-content: center;
}
.picker button {
  flex: 0 0 auto;
  width: calc((100% - 18px) / 10);
  min-width: 0;
  font-size: 19px;
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 0;
  border-radius: 10px;
  line-height: 1;
  filter: grayscale(0.55);
  opacity: .72;
  transition: all .18s ease;
}
.picker button:hover { opacity: 1; transform: translateY(-1px); }
.picker button.on {
  border-color: var(--rose);
  background: var(--rose-wash);
  filter: none;
  opacity: 1;
  transform: translateY(-1px);
}
.mood-note {
  text-align: center;
  font-size: 16px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
}

/* ============ 写作框 ============ */
.composer {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 14px;
}
.composer textarea { min-height: 56px; font-size: 16px; line-height: 1.7; }
.composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.attach {
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.attach:hover { background: var(--rose-wash); color: var(--rose-deep); }
.composer-hint { font-size: 12px; color: var(--ink-soft); }
.composer-bar button { margin-left: auto; padding: 8px 22px; font-size: 14px; }

.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-preview:empty { display: none; }
.upload-preview .thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 已选照片的移除键 */
.thumb-del {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  background: rgba(48, 36, 28, 0.62);
  -webkit-tap-highlight-color: transparent;
}
.thumb-del:active { background: #c0565f; }

/* ============ 今天 ============ */
.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
}
.today-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--ink-mid);
}
.tabs { display: flex; gap: 2px; }
.tab {
  background: transparent;
  color: var(--ink-soft);
  padding: 4px 12px;
  font-size: 12px;
  letter-spacing: 1px;
  border-radius: 999px;
}
.tab.active { color: var(--rose-deep); background: var(--rose-wash); }

.timeline { display: grid; gap: 10px; }

.item {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 15px 17px;
  animation: rise .3s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.item-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  background: var(--rose);
  flex: 0 0 auto;
}
.avatar.her { background: var(--blue); }
.item-head .who { color: var(--ink-mid); font-size: 13px; }
.item-head .time { margin-left: auto; font-size: 11px; }

.edited {
  font-size: 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 4px;
  line-height: 1.6;
}
.item-head .del + .del { margin-left: 4px; }

.item-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.75;
}
.item-body.mood-line { display: flex; align-items: baseline; gap: 8px; }
.item-body.mood-line .big { font-size: 22px; }
.item-body.mood-line .txt { font-size: 14px; color: var(--ink-mid); }

.item-photo img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  cursor: zoom-in;
  margin-top: 2px;
}
.caption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.6; }

.empty { text-align: center; padding: 44px 0 36px; color: var(--ink-soft); }
.empty-heart { display: block; font-size: 20px; color: var(--rose); opacity: .5; margin-bottom: 10px; }
.empty p { margin: 0 0 2px; font-size: 14px; }
.empty-sub { font-size: 12px; opacity: .8; }

/* ============ 评论 ============ */
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.comment-toggle {
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 3px 0;
  letter-spacing: .5px;
}
.comment-toggle:hover { color: var(--rose-deep); background: transparent; }
.comment-body { margin-top: 6px; display: grid; gap: 10px; }
.comment { padding-left: 10px; border-left: 1px solid var(--line); }
.comment.reply { border-left-color: var(--rose-wash); }
.comment-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-soft);
}
.comment-who { color: var(--ink-mid); font-size: 12px; }
.comment-who.me { color: var(--rose-deep); }
.comment-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 1px;
  line-height: 1.65;
}
.comment-acts { display: flex; gap: 12px; margin-top: 2px; }
button.link {
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  padding: 0;
  letter-spacing: .5px;
}
button.link:hover { color: var(--rose-deep); background: transparent; }
button.link.danger:hover { color: #c0565f; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }
.comment-form textarea {
  font-size: 16px;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
}
.comment-form textarea:focus { border-color: var(--rose); }
.comment-form button { flex: 0 0 auto; padding: 7px 18px; font-size: 13px; }
.comment-none { font-size: 12px; color: var(--ink-soft); opacity: .8; }
.reply-form { margin-top: 6px; }

/* ============ 编辑 ============ */
.edit-box { margin-top: 12px; }
.edit-box textarea {
  font-size: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rose);
  background: transparent;
  margin-bottom: 10px;
}
.row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
button.small { padding: 7px 18px; font-size: 13px; }
button.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); }
button.ghost:hover { background: var(--rose-wash); color: var(--rose-deep); }

/* ============ 问答 ============ */
.qa-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 18px 18px;
}
.qa-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.qa-label { font-size: 11px; letter-spacing: 2px; color: var(--ink-soft); }
.qa-tag {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--rose-deep);
  background: var(--rose-wash);
  border-radius: 999px;
  padding: 2px 10px;
}
.qa-tag:empty { display: none; }
.qa-question {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: .5px;
}
.qa-meta { font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; margin-bottom: 16px; }
.qa-answer textarea {
  font-size: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  line-height: 1.7;
}
.qa-answer textarea:focus { border-color: var(--rose); }
.qa-answer-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.qa-hint { font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.qa-answer-bar button { margin-left: auto; flex: 0 0 auto; }

.qa-bubble { border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.qa-bubble.mine { background: var(--rose-wash); }
.qa-bubble.theirs { background: rgba(139, 167, 176, 0.10); }
.qa-who {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.qa-bubble.mine .qa-who { color: var(--rose-deep); }
.qa-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.qa-locked {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}
.qa-locked p { margin: 0; }
.lock-icon { font-size: 16px; flex: 0 0 auto; }

.qa-history { display: grid; gap: 4px; }
.qa-hist { border-bottom: 1px solid var(--line); padding: 9px 4px; }
.qa-hist:last-child { border-bottom: 0; }
.qa-hist summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.qa-hist summary::-webkit-details-marker { display: none; }
.qa-hist-day {
  flex: 0 0 auto;
  color: var(--rose-deep);
  font-size: 11px;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.qa-hist-q {
  color: var(--ink-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qa-hist-body { padding: 6px 0 2px; }
.qa-none { font-size: 12px; color: var(--ink-soft); padding: 8px 4px; }

/* ============ 记忆漩涡 ============ */
.memory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 4px 0;
}
.memory-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--ink-mid);
}

.seg {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg-btn {
  flex: 1 1 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 6px 0;
  border-radius: 999px;
  letter-spacing: 1px;
}
.seg-btn:hover { background: transparent; color: var(--ink-mid); }
.seg-btn.active {
  background: var(--paper);
  color: var(--rose-deep);
  box-shadow: 0 1px 3px rgba(150, 100, 95, 0.10);
}

.memory-list { display: grid; gap: 6px; }
.mem-group-head {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 2px;
  padding: 14px 6px 4px;
}
.mem-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 13px 16px;
  text-align: left;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .2s;
}
.mem-card:hover {
  background: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 3px 14px rgba(150, 100, 95, 0.10);
}
.mem-card.accent { background: linear-gradient(135deg, var(--paper) 40%, var(--rose-wash) 100%); }
.mem-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mem-title { font-size: 15px; letter-spacing: .5px; }
.mem-sub { font-size: 11px; color: var(--ink-soft); letter-spacing: .3px; }
.mem-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mem-total {
  font-size: 12px;
  color: var(--rose-deep);
  background: var(--rose-wash);
  border-radius: 999px;
  padding: 1px 9px;
  font-variant-numeric: tabular-nums;
}
.mem-arrow { color: var(--ink-soft); font-size: 16px; opacity: .6; }
.mem-loading { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 30px 0; }

/* ============ 抽屉 ============ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(60, 40, 38, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-body {
  position: relative;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  animation: slideUp .3s cubic-bezier(.22, .8, .28, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 16px;
}
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: 1px; }
.sheet-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: .5px; }
.sheet-actions:empty { display: none; }

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 12, 13, 0.94);
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox img {
  max-width: 94vw;
  max-height: 82vh;
  border-radius: 8px;
  object-fit: contain;
  transition: transform .25s ease;
  transform: scale(1);
}
/* 点一下再放大一档 */
.lightbox img.zoom-2 { transform: scale(1.9); cursor: zoom-out; }
.lightbox img { cursor: zoom-in; }
.lb-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 20px;
  padding: 0;
  display: grid;
  place-items: center;
}
#lb-cap {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  margin: 12px 0 0;
  text-align: center;
  max-width: 80vw;
}

/* ============ 底部导航 ============ */
.tabbar-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(124px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 30%, var(--bg) 100%);
  pointer-events: none;
  z-index: 100;
}
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(120, 80, 78, 0.16), 0 1px 3px rgba(120, 80, 78, 0.08);
  z-index: 101;
}
.tabbtn {
  flex: 1 1 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 14px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  position: relative;
}
.tabbtn:hover { background: transparent; }
.tabbtn.active { color: var(--rose-deep); background: var(--rose-wash); }
.tb-icon { font-size: 15px; line-height: 1.3; }
.tb-label { font-size: 10px; letter-spacing: .5px; }
.tb-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
}

/* ============ toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(110px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  max-width: 82vw;
  text-align: center;
}
.toast.on { opacity: .92; transform: translate(-50%, 0); }

@media (max-width: 390px) {
  .hero-day { font-size: 46px; }
  .picker button { font-size: 17px; }
  .qa-question { font-size: 16px; }
}

/* ============ 图片专栏 ============ */
.seg-badge {
  display: inline-block;
  margin-left: 3px;
  font-size: 9px;
  color: var(--rose-deep);
  opacity: .75;
  font-variant-numeric: tabular-nums;
}
.seg-badge:empty { display: none; }

.photo-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.photo-filter::-webkit-scrollbar { display: none; }
.pf-chip {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: .5px;
}
.pf-chip:hover { background: var(--rose-wash); color: var(--rose-deep); }
.pf-chip.active {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: #fff;
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.pw-cell {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: var(--bg-deep);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
  animation: rise .3s ease both;
}
.pw-cell:hover { background: var(--bg-deep); }
.pw-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.pw-cell:active img { transform: scale(1.04); }

.pw-date {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: #fff;
  background: rgba(48, 36, 28, 0.5);
  padding: 0 5px;
  border-radius: 5px;
  letter-spacing: .2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pw-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 6px 6px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(to top, rgba(40, 30, 24, 0.6), transparent);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .2s;
}
.pw-cell:hover .pw-cap { opacity: 1; }

/* 图片墙：长按某张照片后才露出的删除角标 */
.pw-del {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  font-size: 0;
  color: #fff;
  background: rgba(30, 22, 24, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pw-del::after {
  content: '删除';
  display: inline-block;
  padding: 5px 14px;
  border-radius: 14px;
  background: #c0565f;
  box-shadow: 0 4px 14px rgba(120, 50, 55, 0.35);
  font-size: 12px;
  letter-spacing: 2px;
}
/* 长按后这张照片缩一点，表示选中了 */
.pw-cell[data-armed="1"] img { transform: scale(0.94); }
.pw-cell[data-armed="1"] .pw-del { opacity: 1; pointer-events: auto; }
.pw-cell[data-armed="1"] .pw-cap,
.pw-cell[data-armed="1"] .pw-date { opacity: 0; }

.photo-more { display: flex; justify-content: center; padding: 14px 0 4px; }

/* 灯箱翻页 */
.lightbox { grid-template-rows: 1fr auto; }
.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 62;
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, 0.26); }
.lb-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#lb-nav {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
#lb-nav:empty { display: none; }

/* 大图里的删除键：右上角，紧挨着关闭 */
.lb-del {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 64px;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
}
.lb-del:hover { background: rgba(192, 86, 95, 0.7); }

/* 删除确认弹层 */
.cfm {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(30, 22, 24, 0.42);
  display: grid;
  place-items: center;
  padding: 32px;
  animation: fade .18s ease;
}
.cfm-card {
  width: min(300px, 100%);
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(60, 40, 40, 0.22);
  padding: 22px 20px 16px;
  text-align: center;
  animation: rise .2s ease both;
}
.cfm-card p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-mid);
}
.cfm-row { display: flex; gap: 10px; }
.cfm-row button { flex: 1 1 0; padding: 10px; font-size: 14px; }
.danger-solid { background: #c0565f; color: #fff; }
.danger-solid:hover { background: #b04b54; }

@media (max-width: 390px) {
  .photo-wall { gap: 3px; }
}

/* ============ 四只猫（区切换） ============ */
.catnav {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 6px;
}
.catface {
  position: relative;
  background: transparent;
  padding: 0;
  border: 0;
  width: 100%;
  max-width: 240px;
  min-height: 112px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  justify-items: center;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.catface:hover { background: transparent; }
.catface:active { transform: scale(.95); }

.catface-halo {
  position: absolute;
  inset: 12% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.028) 0%, transparent 66%);
  pointer-events: none;
}

.cat-img {
  position: relative;
  transition: filter .3s ease, opacity .32s ease, transform .38s cubic-bezier(.34, 1.56, .64, 1);
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  grid-area: 1 / 1;
  place-self: center;
  opacity: 0;
  transform: translateY(8px) scale(.94);
  pointer-events: none;
  -webkit-user-drag: none;
}

/* 深色模式：黑线反相成浅色，透明底不受影响 */
@media (prefers-color-scheme: dark) {
  .cat-img { filter: invert(1) hue-rotate(180deg) brightness(1.05); }
}
.catnav[data-zone="chat"]   .cat-duty,
.catnav[data-zone="qa"]     .cat-sing,
.catnav[data-zone="memory"] .cat-light,
.catnav[data-zone="period"] .cat-happy {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 微动态：每只猫各自的小动作 */
.catnav[data-zone="chat"] .cat-duty { animation: catBreathUp 3.4s ease-in-out infinite; }
@keyframes catBreathUp {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.01); }
}
.catnav[data-zone="qa"] .cat-sing { animation: catSing 2.4s ease-in-out infinite; }
@keyframes catSing {
  0%, 100% { transform: rotate(-2.5deg) scale(1); }
  50% { transform: rotate(2.5deg) scale(1.02); }
}
.catnav[data-zone="memory"] .cat-light { animation: catGlow 4.2s ease-in-out infinite; }
@keyframes catGlow {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.03); opacity: 1; }
}
.catnav[data-zone="period"] .cat-happy { animation: catHop 3s ease-in-out infinite; }
@keyframes catHop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-5px) rotate(-1.5deg); }
  70% { transform: translateY(-2px) rotate(1.5deg); }
}

.cat-dot {
  position: absolute;
  top: 14px;
  right: 42px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose-deep);
  box-shadow: 0 0 0 2px var(--bg);
  animation: dotPulse 1.8s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: .7; }
}

/* ============ 经期（按模板重做） ============ */
.pd {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 22px 16px 20px;
  /* 关键：任何内容都不许撑破卡片 */
  max-width: 100%;
  overflow: hidden;
}

.pd-title {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
}
.pd-sub {
  margin: 6px 0 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

/* 四个数字 */
.pd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.pd-stat {
  background: var(--bg-deep);
  border-radius: 12px;
  padding: 11px 3px 9px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
.pd-stat b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pd-stat span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-sum {
  margin: 16px 0 14px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-mid);
}
.pd-sum b { color: var(--ink); font-weight: 700; }

/* 月份切换 */
.pd-calhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.pd-arrow {
  flex: 0 0 auto;
  width: 42px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  background: var(--bg-deep);
  color: var(--ink-mid);
  font-size: 11px;
  display: grid;
  place-items: center;
}
.pd-arrow:hover { background: var(--line); color: var(--ink); }
.pd-month {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 8px;
  white-space: nowrap;
}
.pd-month:hover { background: var(--bg-deep); }
.pd-month::after {
  content: "▾";
  font-size: 10px;
  margin-left: 4px;
  opacity: .45;
}

.pd-monthpick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--bg-deep);
  border-radius: 12px;
}
.pd-mp {
  background: transparent;
  color: var(--ink-mid);
  font-size: 12px;
  padding: 8px 0;
  border-radius: 8px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.pd-mp:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.pd-mp.on { background: var(--ink); color: #fff; }
/* 「回到本月」占满一行 */
.pd-mp.back {
  grid-column: 1 / -1;
  background: var(--pd-period);
  color: #fff;
  font-weight: 600;
  margin-bottom: 2px;
}
.pd-mp.back:hover { background: #e07f92; color: #fff; }

/* 未来月份：淡一点，表示只能看不能记 */
.pd-mp.fut { color: var(--ink-soft); opacity: .75; }

/* 预测区间的日子：浅蓝底 + 虚线圈 */
.pd-day.predicted {
  background: var(--pd-predicted);
  color: var(--ink-mid);
}
.pd-mp.on:hover { background: var(--ink); color: #fff; }

/* 星期与日期 */
.pd-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 2px;
}
.pd-week span {
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 4px 0;
}

.pd-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.pd-day {
  aspect-ratio: 1 / 1;
  min-width: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
  font-variant-numeric: tabular-nums;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  transition: background .15s;
}
.pd-day:hover { background: var(--bg-deep); }
.pd-day.empty { pointer-events: none; }

/* 未来的日子：置灰、不可点 */
.pd-day.future {
  color: var(--ink-soft);
  opacity: .35;
  pointer-events: none;
  cursor: default;
}
.pd-day.period { background: var(--pd-period); color: #fff; }
.pd-day.spot { background: var(--pd-spot); color: #4a3c14; }
.pd-day.today { border-color: #4b9a6a; }

/* 选中的日子（点选或拖选） */
.pd-day.selected {
  background: rgba(232, 143, 160, 0.28);
  color: #a8505f;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--pd-period);
}
.pd-day.selected.period {
  background: var(--pd-period);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.65);
}
.pd-day.selected.today {
  box-shadow: inset 0 0 0 1.5px var(--pd-period), 0 0 0 2px #4b9a6a;
}

/* 拖动时不要选中文字、不要触发浏览器手势 */
.pd-grid {
  -webkit-user-select: none;
  user-select: none;
  /* 允许竖向滚动（页面上下滑），横向由 JS 处理成选日期 */
  touch-action: pan-y;
}

/* 图例 */
.pd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 14px;
  font-size: 10px;
  color: var(--ink-soft);
}
.pd-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.lg.period { background: var(--pd-period); }
.lg.predicted { background: var(--pd-predicted); }
.lg.spot { background: var(--pd-spot); }
.lg.today { border: 1.5px solid #4b9a6a; background: transparent; }

/* 底部三个按钮 */
.pd-bottom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.pd-btn {
  padding: 11px 0;
  font-size: 14px;
  border-radius: 10px;
  min-width: 0;
}
.pd-btn.cancel {
  background: #fff;
  color: var(--ink-mid);
  border: 1px solid var(--line-strong);
}
.pd-btn.cancel:hover { background: #fff; color: #c0565f; border-color: #c0565f; }
.pd-btn.period {
  background: #2f9e6d;
  color: #fff;
  font-weight: 600;
}
.pd-btn.period:hover { background: #288a5e; }
.pd-btn.spot {
  background: #fff;
  color: #8a6d1e;
  border: 1px solid var(--pd-spot);
}
.pd-btn.spot:hover { background: #fffdf3; }

.pd-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  .pd-btn.cancel { background: #232328; }
  .pd-btn.cancel:hover { background: #232328; }
  .pd-btn.spot { background: #232328; color: #d9c68a; }
  .pd-btn.spot:hover { background: #2a2820; }
  .pd-mp:hover { background: rgba(255,255,255,.08); }
}

/* 小屏再缩一点，保证 7 列不挤 */
@media (max-width: 360px) {
  .pd { padding: 18px 10px 16px; }
  .pd-stat b { font-size: 14px; }
  .pd-stat span { font-size: 9px; }
  .pd-day { font-size: 12px; }
  .pd-week span { font-size: 10px; }
}

/* ============ 上传照片（可选日期） ============ */
.photo-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pw-upload {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--rose-deep);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  padding: 7px 15px;
  border-radius: 999px;
}
.pw-upload:hover { background: var(--rose-wash); border-color: var(--rose); }
.pw-upload-hint { font-size: 11px; color: var(--ink-soft); }

.pw-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.pw-sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(60, 40, 38, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.pw-sheet-body {
  position: relative;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(120px + env(safe-area-inset-bottom));
  animation: slideUp .28s cubic-bezier(.22,.8,.28,1);
  max-height: 86vh;
  overflow-y: auto;
}
.pw-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pw-sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; }

.pw-label { margin: 0 0 8px; font-size: 13px; color: var(--ink-mid); }
.pw-dateinput {
  width: 100%;
  font-size: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 12px;
  -webkit-appearance: none;
  appearance: none;
}
.pw-dateinput:focus { border-color: var(--rose); outline: none; }

.pw-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pw-chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
}
.pw-chip:hover { background: var(--rose-wash); color: var(--rose-deep); }
.pw-chip.on { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }

.pw-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  max-height: 220px;
  overflow-y: auto;
}
.pw-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-deep);
}
.pw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pw-actions { display: flex; gap: 10px; }
.pw-actions .ghost { flex: 0 0 auto; }
.pw-submit {
  flex: 1 1 auto;
  padding: 12px;
  font-size: 15px;
  background: var(--rose-deep);
}
.pw-submit:hover { background: var(--rose); }
