:root {
  --pink: #ff6f91;
  --pink-deep: #e94b74;
  --pink-soft: #ffe9ef;
  --bg: #fff7f9;
  --card: #ffffff;
  --text: #3f2c33;
  --muted: #a08f95;
  --line: #ffe0e8;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(233, 75, 116, 0.1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
button { font-family: inherit; }
.hidden { display: none !important; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* ---------- 顶部封面 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #ffb3c7, #ff6f91 55%, #f86a9a);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  /* 背景图原样显示，不再压暗 */
  opacity: 1;
}
/* 只在底部压一点深色，保证标题看得清，中间不动——照片该是什么色就是什么色 */
.hero-mask {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.34));
}
/* 没背景图时还是原来的粉色调 */
.hero:not(.has-cover) .hero-mask { background: rgba(233, 75, 116, 0.18); }
.hero-inner {
  position: relative;
  padding: calc(30px + env(safe-area-inset-top)) 18px 18px;
  text-align: center;
}
.hero-avatars { display: flex; justify-content: center; align-items: center; }
.hero-avatars .ava > img {
  border: 2px solid #fff; background: #fff; box-sizing: border-box;
}
.hero-avatars .ava + .ava { margin-left: -16px; }
/* 右边那个压在左边那个上面，挂件也跟着这个顺序 */
.hero-avatars .ava:nth-child(2) { z-index: 3; }
.hero h1 { margin: 10px 0 2px; font-size: 21px; font-weight: 600; letter-spacing: 1px; }
.hero p { margin: 0; font-size: 12.5px; opacity: 0.9; }
/* 有背景图时给文字加描边，照片再亮也看得清 */
.hero.has-cover h1, .hero.has-cover p {
  opacity: 1; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5), 0 0 2px rgba(0, 0, 0, 0.3);
}
.days-pill {
  display: inline-block; margin-top: 10px; padding: 4px 14px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.28);
  font-size: 13px; backdrop-filter: blur(4px);
}
.days-pill b { font-size: 15px; }

/* ---------- 时光轴 ---------- */
main { padding: 12px 12px 0; }
.date-sep { text-align: center; margin: 14px 0 8px; }
.date-sep span {
  display: inline-block; padding: 2px 12px; border-radius: 999px;
  background: var(--pink-soft); color: var(--pink-deep); font-size: 12px;
}

.post {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px;
}
.post-head { display: flex; align-items: center; gap: 10px; }
/* 点头像 / 昵称进这个人的主页，只看 TA 发过的 */
.post-author { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.post-author:active { opacity: 0.6; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--pink-soft); flex: none; }
.post-who { flex: 1; min-width: 0; }
.post-who .name { font-weight: 600; font-size: 15px; }
.post-who .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: var(--pink-soft); color: var(--pink-deep); border-radius: 6px; padding: 0 5px; font-size: 11px; }
.tag.edited { background: #eef2ff; color: #5b6ab0; }
.post-text { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; }

.media { display: grid; gap: 4px; margin-top: 9px; }
.media .item { position: relative; padding-top: 100%; overflow: hidden; border-radius: 10px; background: var(--pink-soft); }
.media .item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media.n1 { grid-template-columns: 1fr; }
.media.n1 .item { padding-top: 0; }
.media.n1 .item img { position: relative; width: 100%; max-height: 320px; height: auto; }
.media.n2, .media.n3, .media.n5, .media.n6, .media.n7, .media.n8, .media.n9 { grid-template-columns: repeat(3, 1fr); }
.media.n4 { grid-template-columns: repeat(2, 1fr); max-width: 68%; }
.media .item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.media.n1 .item video { position: relative; max-height: 320px; object-fit: contain; }

.actions { display: flex; align-items: center; gap: 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.actions button { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 0; display: flex; align-items: center; gap: 4px; }
.actions button.liked { color: var(--pink-deep); }
.actions .spacer { flex: 1; }
.heart { transition: transform .18s ease; }
.heart.pop { transform: scale(1.35); }

.likes-line { margin-top: 8px; font-size: 12.5px; color: var(--pink-deep); }
.comments { margin-top: 8px; background: #fff6f8; border-radius: 12px; padding: 8px 11px; }
.comment { font-size: 13px; padding: 3px 0; word-break: break-word; }
.comment b { color: var(--pink-deep); font-weight: 600; margin-right: 4px; }
.comment .del { color: var(--muted); font-size: 12px; margin-left: 6px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; background: #fff; color: var(--text);
  min-width: 0;
}
.comment-form button { border: 0; background: var(--pink); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; }

.loading, .empty { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0; }

/* ---------- 底部导航 / 发布按钮 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
}
.tabbar button {
  flex: 1; border: 0; background: none; color: var(--muted);
  padding: 8px 0 7px; font-size: 11px; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar button .ic { font-size: 19px; line-height: 1; }
.tabbar button.active { color: var(--pink-deep); }
/* 有新消息时「我的」上挂个小红点 */
.tabbar button .dot {
  position: absolute; top: 6px; left: 50%; margin-left: 8px;
  min-width: 8px; height: 8px; border-radius: 999px; background: #ff3b5c;
  border: 1.5px solid #fff; box-sizing: content-box;
}
.tabbar button .dot.hidden { display: none; }

.fab {
  position: fixed; right: 18px; bottom: calc(74px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 50%; border: 0; z-index: 31;
  background: linear-gradient(135deg, #ff92ad, #ff5c85); color: #fff;
  font-size: 28px; line-height: 1; box-shadow: 0 8px 18px rgba(255, 92, 133, 0.42);
}

/* ---------- 发布面板 ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet.show { display: block; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.42); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
  border-radius: 18px 18px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease; max-height: 88vh; overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.sheet-head button { border: 0; background: none; color: var(--muted); font-size: 14px; padding: 4px 2px; }
.sheet-head button.primary { color: var(--pink-deep); font-weight: 600; }
.sheet textarea {
  width: 100%; border: 0; min-height: 90px; margin-top: 8px; resize: none;
  font-size: 15px; font-family: inherit; color: var(--text); outline: none; line-height: 1.6;
}
.sheet .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
.sheet .grid .thumb { position: relative; padding-top: 100%; border-radius: 10px; overflow: hidden; background: #f3f3f3; }
.sheet .grid .thumb img, .sheet .grid .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet .grid .thumb .rm {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 12px; line-height: 1; padding: 0;
}
.sheet-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--pink-deep);
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
/* 拍照按钮：按住时给个反馈，长按会变录像 */
#take-media {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; transition: transform .12s ease, background .12s ease;
}
#take-media.holding {
  transform: scale(0.93); background: var(--pink); border-color: var(--pink); color: #fff;
}
.take-tip {
  position: fixed; z-index: 95; left: 50%; bottom: 34%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(63, 44, 51, 0.93); color: #fff; padding: 8px 14px;
  border-radius: 999px; font-size: 13px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease;
}
.take-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sheet-tools input[type="date"], .sheet-tools input[type="text"] {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px;
  font-family: inherit; color: var(--text); background: #fff;
}
.sheet-tools input[type="text"] { flex: 1; min-width: 110px; }
.progress { height: 4px; border-radius: 4px; background: var(--pink-soft); margin-top: 10px; overflow: hidden; display: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--pink); transition: width .2s; }
.progress.show { display: block; }

/* ---------- 我的 ---------- */
.pad { padding: 14px 12px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.me-top { display: flex; align-items: center; gap: 12px; }
.me-top .who { flex: 1; }
.me-btns { display: flex; gap: 8px; }
.me-btns .btn-line { flex: 1; }
.me-top .who .n { font-size: 16px; font-weight: 600; }
.me-top .who .s { font-size: 12px; color: var(--muted); }
.field { display: flex; gap: 8px; margin-bottom: 8px; }
.field input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.btn-pink {
  width: 100%; border: 0; background: var(--pink); color: #fff;
  border-radius: 12px; padding: 11px; font-size: 14px;
}
.btn-pink:disabled { opacity: .6; }
.btn-line {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--pink-deep);
  border-radius: 12px; padding: 10px; font-size: 14px; margin-top: 8px;
}
.user-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #fff0f4; }
.user-item:last-child { border-bottom: 0; }
.user-item .avatar { width: 34px; height: 34px; }
.user-item .info { flex: 1; min-width: 0; font-size: 13px; }
.user-item .info small { color: var(--muted); display: block; }
.user-item button { border: 0; background: var(--pink-soft); color: var(--pink-deep); border-radius: 999px; padding: 5px 10px; font-size: 12px; }

/* ---------- 图查看 ---------- */
.lightbox { position: fixed; inset: 0; background: #000; z-index: 70; display: none; align-items: center; justify-content: center; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: none; will-change: transform; }
/* 翻页时淡入一下，换图不会硬切 */
.lightbox img.fade { animation: lbFade .2s ease; }
@keyframes lbFade { from { opacity: .35; } to { opacity: 1; } }
.lb-tip { position: absolute; bottom: calc(46px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-size: 12px; opacity: 0; transition: opacity .25s ease; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.lb-tip.show { opacity: .9; }
.lb-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; border: 0; background: rgba(255,255,255,.18); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 17px; }
.lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255,255,255,.18); color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; }
.lb-arrow.prev { left: 12px; }
.lb-arrow.next { right: 12px; }
.lb-count { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; opacity: .85; }

/* ---------- 登录 ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #ffd0dd 0%, #ff9db8 45%, #ff6f91 100%);
  padding: 20px;
}
.login-wrap {
  width: 100%; max-width: 360px; background: rgba(255, 255, 255, 0.94);
  border-radius: 22px; padding: 30px 22px 24px; text-align: center;
  box-shadow: 0 18px 40px rgba(200, 40, 90, 0.22);
}
.login-wrap .love { font-size: 34px; }
.login-wrap h1 { margin: 8px 0 4px; font-size: 20px; color: var(--pink-deep); }
.login-wrap .sub { margin: 0 0 20px; font-size: 12.5px; color: var(--muted); }
.login-wrap input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 15px;
  font-family: inherit; background: #fffafb; color: var(--text);
}
.login-wrap button {
  width: 100%; border: 0; border-radius: 12px; padding: 12px; margin-top: 4px;
  background: linear-gradient(135deg, #ff8fa8, #ff5c85); color: #fff; font-size: 15px;
}
.err { color: var(--pink-deep); font-size: 13px; margin-top: 10px; min-height: 18px; }
.tip { font-size: 12px; color: var(--muted); margin-top: 16px; }

.loc-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--line); }

/* 下拉刷新 */
.ptr { height: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; font-size: 12px; color: #b08393; background: transparent; }
.ptr span { padding-bottom: 6px; opacity: .85; }

.vid-hint { margin: 8px 2px 0; padding: 8px 10px; font-size: 12px; line-height: 1.6; color: #a15c72; background: var(--pink-soft); border-radius: 8px; }

/* ---------- 表情面板 ---------- */
.comment-form .emoji-btn {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.emoji-panel {
  position: fixed; z-index: 80; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); padding: 8px;
}
.emoji-panel.hidden { display: none; }
.emoji-tabs { display: flex; gap: 6px; margin-bottom: 6px; overflow-x: auto; }
.emoji-tabs button {
  flex: none; border: 0; background: #fff5f7; color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: 12px;
}
.emoji-tabs button.active { background: var(--pink); color: #fff; }
.emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  max-height: 172px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.emoji-grid button {
  border: 0; background: none; font-size: 21px; padding: 3px 0; border-radius: 8px;
}
.emoji-grid button:active { background: var(--pink-soft); }

/* ---------- 档案库 ---------- */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 8px; font-size: 13px;
}
.seg button.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.del-info {
  background: #fff1f5; color: var(--pink-deep); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; margin-bottom: 10px;
}
.del-info.ok { background: #f1f9f3; color: #4a8a5c; }
.post-actions { display: flex; gap: 8px; margin-top: 10px; }
.post-actions button { flex: 1; border: 0; border-radius: 12px; padding: 9px; font-size: 13px; }
.post-actions .restore { background: var(--pink-soft); color: var(--pink-deep); }
.post-actions .purge { background: #fff1f3; color: #c9365e; }
.comment.deleted { color: var(--muted); text-decoration: line-through; }
.hint { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
a.btn-pink { display: block; text-align: center; text-decoration: none; color: #fff; }

/* ---------- 页面内提示 / 确认框 ---------- */
.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); z-index: 90;
  transform: translateX(-50%); background: rgba(63, 44, 51, 0.93); color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; max-width: 80%;
  text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal {
  position: fixed; inset: 0; z-index: 95; display: flex;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.42);
}
.modal-box {
  width: 78%; max-width: 320px; background: #fff; border-radius: 16px;
  padding: 18px 16px 12px; text-align: center; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
.modal-box p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; }
.modal-box input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; color: var(--text); margin-bottom: 14px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; border: 0; border-radius: 12px; padding: 10px; font-size: 14px; }
.modal-actions .cancel { background: #fff1f5; color: var(--muted); }
.modal-actions .ok { background: var(--pink); color: #fff; }

/* ---------- 签到 ---------- */
.ck-card {
  background: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(255, 92, 133, 0.08);
}
.ck-card.hidden { display: none; }
.ck-bar {
  background: #fff; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(255, 92, 133, 0.08);
}
.ck-bar.hidden { display: none; }
.ck-btn.wide { width: 100%; padding: 12px; font-size: 15px; }
.ck-top { display: flex; align-items: center; gap: 12px; }
.ck-streak { font-size: 14.5px; color: var(--text); }
.ck-streak b { font-size: 20px; color: var(--pink-deep); margin: 0 2px; }
.ck-sub { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.ck-btn {
  flex: 0 0 auto; border: 0; border-radius: 999px; padding: 10px 18px; font-size: 14px;
  font-family: inherit; color: #fff; background: linear-gradient(135deg, #ff92ad, #ff5c85);
  box-shadow: 0 6px 14px rgba(255, 92, 133, 0.35);
}
.ck-btn[disabled] {
  background: var(--pink-soft); color: var(--pink-deep); box-shadow: none; font-size: 12.5px;
}
.ck-others { margin-top: 10px; font-size: 12px; color: var(--muted); }
.ck-link {
  margin-top: 10px; width: 100%; border: 0; background: none; padding: 4px 0;
  color: var(--pink-deep); font-size: 12.5px; font-family: inherit; text-align: left;
}

/* 有背景图时把封面撑高，文字靠下（跟朋友圈封面一个感觉） */
.hero.has-cover { min-height: 210px; }
.hero.has-cover .hero-inner {
  min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 26px;
}

/* ---------- 更换背景（入口在「我的」里） ---------- */
.bg-page {
  position: fixed; inset: 0; z-index: 63; background: var(--bg);
  display: flex; flex-direction: column;
}
.bg-page.hidden { display: none; }
.bg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.bg-head > span { font-size: 15px; font-weight: 600; color: var(--text); }
.bg-head button { border: 0; background: none; color: var(--pink-deep); font-size: 14px; font-family: inherit; }
.bg-head-right { width: 28px; }
.bg-body {
  flex: 1; overflow-y: auto;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
}
.bg-preview {
  border-radius: var(--radius); overflow: hidden; background: var(--pink-soft);
  aspect-ratio: 390 / 240; background-size: cover; background-position: center;
  box-shadow: 0 2px 10px rgba(255, 92, 133, 0.12);
}
.bg-actions { display: flex; gap: 10px; margin-top: 12px; }
.bg-actions .btn-pink, .bg-actions .btn-line { flex: 1; }
.bg-switch {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 13.5px; color: var(--text);
}
.bg-switch input { width: 18px; height: 18px; accent-color: var(--pink); }
.bg-history { margin-top: 18px; }
.bg-history h4 { margin: 0 0 10px; font-size: 14.5px; }
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bg-tile {
  border: 0; padding: 0; background: none; font-family: inherit; text-align: left;
}
.bg-tile i {
  display: block; width: 100%; aspect-ratio: 390 / 240; border-radius: 10px;
  background-size: cover; background-position: center; background-color: var(--pink-soft);
  border: 2px solid transparent;
}
.bg-tile.on i { border-color: var(--pink); }
.bg-tile span {
  display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 语音条 / 录音 ---------- */
.voice {
  position: relative; display: flex; align-items: center; gap: 9px;
  margin-top: 10px; padding: 9px 15px; width: fit-content; max-width: 78%;
  background: #fff1f6; border: 1px solid #ffd6e4; border-radius: 999px 999px 999px 8px;
  overflow: hidden; user-select: none;
}
.voice .vplay { font-size: 13px; color: var(--pink-deep); line-height: 1; }
.voice.playing .vplay { font-size: 0; }
.voice.playing .vplay::before { content: '⏸'; font-size: 13px; }
.vwaves { display: flex; align-items: center; gap: 2px; height: 15px; }
.vwaves i { display: block; width: 2px; height: 5px; border-radius: 2px; background: #ffb3c9; }
.vwaves i:nth-child(3n) { height: 10px; }
.vwaves i:nth-child(3n + 1) { height: 7px; }
.voice.playing .vwaves i { background: var(--pink); animation: vwave .9s ease-in-out infinite; }
.voice.playing .vwaves i:nth-child(2n) { animation-delay: .12s; }
.voice.playing .vwaves i:nth-child(3n) { animation-delay: .26s; }
@keyframes vwave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(2.1); }
}
.vdur { font-size: 12px; color: var(--muted); flex: none; }
.vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 111, 145, 0.16); }
.vbar .vprog { display: block; width: 0; height: 100%; background: var(--pink); transition: width .1s linear; }

/* 发布框里待发的语音 */
.sheet .grid .thumb.voice {
  padding: 8px 12px; padding-top: 8px; border-radius: 999px; background: #fff1f6;
  border: 1px solid #ffd6e4; display: flex; align-items: center; gap: 7px;
  grid-column: span 3; box-sizing: border-box;
}
.sheet .grid .thumb.voice .rm { position: static; background: none; color: var(--muted); font-size: 13px; }

/* 按住说话时的状态条 */
.rec-panel {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px 14px; border-radius: 14px;
  background: #fff1f6; border: 1px solid #ffd6e4;
}
.rec-panel.cancel { background: #fff0f0; border-color: #ffc9c9; }
.rec-mic { font-size: 20px; }
.rec-main { flex: 1; min-width: 0; }
.rec-time { font-size: 15px; font-weight: 600; color: var(--pink-deep); }
.rec-hint { font-size: 12px; color: var(--muted); }
.rec-panel.cancel .rec-hint { color: #c9365e; }
.rec-wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.rec-wave i {
  display: block; width: 2px; height: 5px; border-radius: 2px; background: var(--pink);
  animation: vwave .8s ease-in-out infinite;
}
.rec-wave i:nth-child(2n) { animation-delay: .1s; }
.rec-wave i:nth-child(3n) { animation-delay: .22s; }
.rec-panel.cancel .rec-wave i { animation: none; background: #ffb3b3; }

.audio-line { margin-top: 10px; }
.audio-line audio { width: 100%; max-width: 320px; height: 34px; }

/* ---------- 小家装修中（总开关关闭） ---------- */
.closed-body {
  margin: 0; min-height: 100vh; font-family: inherit;
  background: linear-gradient(170deg, #ffe9f0 0%, #fff6f9 45%, #ffeef4 100%);
  color: #4a4a52;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}
.closed-wrap { width: 100%; max-width: 360px; text-align: center; }
.closed-house {
  position: relative; width: 132px; height: 132px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 50%; box-shadow: 0 10px 30px rgba(255, 111, 145, 0.18);
  animation: closedFloat 3.6s ease-in-out infinite;
}
.closed-house .house { font-size: 58px; line-height: 1; }
.closed-house .balloon {
  position: absolute; top: 8px; left: 10px; font-size: 26px;
  animation: closedFloat 2.6s ease-in-out infinite;
}
.closed-house .tool {
  position: absolute; right: 6px; bottom: 10px; font-size: 30px;
  transform: rotate(-18deg);
  animation: closedWiggle 1.8s ease-in-out infinite;
}
@keyframes closedFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes closedWiggle {
  0%, 100% { transform: rotate(-18deg); }
  50% { transform: rotate(6deg); }
}
.closed-wrap h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; color: #d94f77; }
.closed-sub { margin: 0 0 18px; font-size: 14px; color: #a97b8a; }
.closed-card {
  background: #fff; border-radius: 16px; padding: 14px 16px; margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(255, 111, 145, 0.12);
}
.closed-card p { margin: 0; font-size: 13.5px; line-height: 1.8; color: #6b6070; }
.closed-wrap .btn-pink { width: 100%; margin-bottom: 10px; }
.closed-wrap .btn-line { width: 100%; background: #fff; }
.closed-tip { margin: 14px 0 0; font-size: 12.5px; color: #a97b8a; min-height: 18px; }

/* ---------- 头像 + 挂件 ---------- */
/* 头像外面这一层用来托挂件：挂件比头像大一圈，可以伸出到头像外面 */
.ava { position: relative; display: inline-block; width: var(--s, 40px); height: var(--s, 40px); flex: none; }
.ava > img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: var(--pink-soft); display: block;
}
.pendant {
  position: absolute; left: 50%; top: 50%; width: 152%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%); pointer-events: none; z-index: 2;
}
.pendant:empty { display: none; }
.pendant svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---------- 头像挂件选择页 ---------- */
.ped-body {
  flex: 1; overflow-y: auto;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
}
.ped-preview { display: flex; justify-content: center; padding: 10px 0 6px; }
.ped-name { margin: 0 0 4px; text-align: center; font-size: 14px; font-weight: 600; color: var(--pink-deep); }
.ped-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.ped-cell {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 9px 2px 6px; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.ped-cell .ped-label { font-size: 11px; color: var(--muted); }
.ped-cell.on {
  border-color: var(--pink); background: #fff5f8;
  box-shadow: 0 0 0 2px rgba(255, 111, 145, 0.18);
}
.ped-cell.on .ped-label { color: var(--pink-deep); font-weight: 600; }

/* ---------- 消息通知 / 我点过赞的 ---------- */
.badge {
  display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 11.5px; line-height: 18px;
  text-align: center; vertical-align: 2px;
}
.badge.gray { background: var(--pink-soft); color: var(--pink-deep); }
.badge.hidden { display: none; }

.mlist {
  flex: 1; overflow-y: auto; padding: 10px 12px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.mlist-empty { padding: 26px 16px; text-align: center; }
.mrow {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: #fff; border-radius: 12px; padding: 10px 12px;
  font-family: inherit; box-shadow: 0 2px 10px rgba(255, 92, 133, 0.08);
}
.mrow.unread { background: #fff5f8; }
.mrow.gone { opacity: 0.6; }
.mrow .who {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--pink-soft);
}
.mrow .main { flex: 1; min-width: 0; }
.mrow .txt { font-size: 13.5px; color: var(--text); line-height: 1.45; }
.mrow .txt b { font-weight: 600; }
.mrow .when { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.mrow .pic {
  width: 44px; height: 44px; border-radius: 8px; flex: none; object-fit: cover;
  background: var(--pink-soft);
}
.mrow .pic-text {
  width: 44px; height: 44px; border-radius: 8px; flex: none; background: var(--pink-soft);
  color: var(--pink-deep); font-size: 11px;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.mrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); flex: none; }

/* ---------- 登录提示：TA 更新了朋友圈 ---------- */
.newpost {
  position: fixed; inset: 0; z-index: 96; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.newpost.hidden { display: none; }
.newpost-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.newpost-box {
  position: relative; width: 100%; max-width: 330px; max-height: 82vh;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #fff; border-radius: 18px; padding: 20px 16px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  animation: npIn .22s ease;
}
@keyframes npIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.newpost-title { margin-top: 9px; font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.45; }
.newpost-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.newpost-list {
  width: 100%; margin-top: 13px; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.newpost-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: var(--pink-soft); border-radius: 12px; padding: 8px 10px;
  font-family: inherit; transition: background .15s;
}
.newpost-item:active { background: var(--line); }
.newpost-item .main { flex: 1; min-width: 0; }
.newpost-item .txt { font-size: 13px; color: var(--text); line-height: 1.4; }
.newpost-item .tag {
  display: inline-block; font-style: normal; font-size: 10.5px; line-height: 1.5;
  color: var(--pink-deep); background: #fff; border-radius: 4px;
  padding: 0 4px; margin-left: 4px; vertical-align: 1px;
}
.newpost-item .when { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.newpost-item .pic {
  width: 44px; height: 44px; border-radius: 8px; flex: none; object-fit: cover;
  background: #fff;
}
.newpost-item .pic-text {
  width: 44px; height: 44px; border-radius: 8px; flex: none; background: #fff;
  color: var(--pink-deep); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.newpost-actions { display: flex; gap: 10px; width: 100%; margin-top: 14px; }
.newpost-actions button {
  flex: 1; border: 0; border-radius: 12px; padding: 11px;
  font-size: 14px; font-family: inherit;
}
#newpost-later { background: var(--pink-soft); color: var(--muted); }
#newpost-go { background: var(--pink); color: #fff; }

/* ---------- 个人主页（只看 TA 发的朋友圈） ---------- */
.profile-body {
  flex: 1; overflow-y: auto;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
}
.profile-top {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 18px 12px 15px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.profile-name { font-size: 17px; font-weight: 600; color: var(--text); }
.profile-stat { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.6; }
.profile-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.profile-list .post { margin-bottom: 0; }

/* 我的页里「TA 的朋友圈」入口 */
.people-list { display: flex; flex-direction: column; gap: 8px; }
.people-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: var(--pink-soft); border-radius: 12px; padding: 9px 12px;
  font-family: inherit; color: var(--text);
}
.people-row .main { flex: 1; min-width: 0; }
.people-row .nm { display: block; font-size: 14px; font-weight: 600; }
.people-row .sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.people-row .go { color: var(--pink-deep); font-size: 13px; }

/* ---------- 裁剪（朋友圈那样拖着选一块） ---------- */
.crop-page {
  position: fixed; inset: 0; z-index: 64; background: #16151a;
  display: flex; flex-direction: column; color: #fff;
}
.crop-page.hidden { display: none; }
.crop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}
.crop-head > span { font-size: 13px; opacity: 0.75; }
.crop-head button { border: 0; background: none; color: #fff; font-size: 14px; font-family: inherit; opacity: 0.85; }
.crop-head button.primary { color: var(--pink); font-weight: 600; opacity: 1; }
/* 高度由 JS 按封面比例算出来（aspect-ratio），不能用 flex 撑开，
   否则裁剪框比封面高，调完显示出来就对不上了 */
.crop-stage {
  width: 100%; margin: auto 0; position: relative; overflow: hidden;
  background: #000; touch-action: none;
}
.crop-stage img { position: absolute; will-change: left, top; user-select: none; -webkit-user-drag: none; }
.crop-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
}
.crop-foot span { font-size: 12px; opacity: 0.7; }
.crop-foot input[type="range"] { flex: 1; accent-color: var(--pink); }
.crop-foot button {
  border: 0; background: rgba(255, 255, 255, 0.16); color: #fff;
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-family: inherit;
}

.ck-page {
  position: fixed; inset: 0; z-index: 62; background: var(--bg);
  display: flex; flex-direction: column;
}
.ck-page.hidden { display: none; }
.ck-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.ck-head > span { font-size: 15px; font-weight: 600; color: var(--text); }
.ck-head button { border: 0; background: none; color: var(--pink-deep); font-size: 14px; font-family: inherit; }
.ck-nav { display: flex; gap: 10px; }
.ck-nav button { font-size: 20px; line-height: 1; padding: 0 6px; }
.ck-summary {
  display: flex; justify-content: space-around; background: #fff; padding: 12px 8px;
  border-bottom: 1px solid var(--line); text-align: center;
}
.ck-summary div b { display: block; font-size: 18px; color: var(--pink-deep); }
.ck-summary div span { font-size: 11.5px; color: var(--muted); }
.ck-week { display: grid; grid-template-columns: repeat(7, 1fr); padding: 10px 8px 4px; }
.ck-week span { text-align: center; font-size: 11.5px; color: var(--muted); }
.ck-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 4px 8px 8px;
}
.ck-cell {
  position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 12px; background: #fff;
  font-family: inherit; font-size: 13px; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.ck-cell.blank { background: none; }
.ck-cell.future { color: #d8ccd1; }
.ck-cell.has { background: var(--pink-soft); color: var(--pink-deep); font-weight: 600; }
.ck-cell.makeup { background: #fff3d6; color: #b8860b; }
.ck-cell.today { box-shadow: inset 0 0 0 2px var(--pink); }
.ck-cell.sel { box-shadow: inset 0 0 0 2px var(--pink-deep); }
.ck-cell .dot { font-size: 9px; line-height: 1; }
.ck-detail {
  margin: 0 8px calc(16px + env(safe-area-inset-bottom)); background: #fff;
  border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--text); line-height: 1.9;
  box-shadow: 0 2px 10px rgba(255, 92, 133, 0.08);
}
.ck-detail.hidden { display: none; }
.ck-detail h4 { margin: 0 0 6px; font-size: 14.5px; }
.ck-detail .row { color: var(--muted); font-size: 13px; }
.ck-detail .row b { color: var(--text); font-weight: 500; }
.ck-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; background: var(--pink-soft); color: var(--pink-deep);
}
.ck-tag.makeup { background: #fff3d6; color: #b8860b; }
.ck-detail .makeup-btn {
  margin-top: 10px; width: 100%; border: 0; border-radius: 12px; padding: 10px;
  font-size: 14px; font-family: inherit; color: #fff; background: var(--pink);
}
.ck-detail .makeup-btn[disabled] { background: #f0e3e7; color: #b9a4ab; }
.ck-detail a { color: var(--pink-deep); }

/* ---------- 搜索 ---------- */
.search-btn {
  position: fixed; z-index: 30; right: 14px; top: calc(10px + env(safe-area-inset-top));
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); font-size: 16px; line-height: 1;
  box-shadow: 0 6px 16px rgba(255, 92, 133, 0.22); backdrop-filter: blur(6px);
}
.search-btn.hidden { display: none; }

.search {
  position: fixed; inset: 0; z-index: 62; background: var(--bg);
  display: flex; flex-direction: column;
}
.search.hidden { display: none; }
.search-head {
  display: flex; align-items: center; gap: 8px; background: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--line);
}
.search-head input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
}
.search-head button {
  border: 0; background: none; color: var(--pink-deep); font-size: 14px; font-family: inherit; padding: 6px 2px;
}
.search-tip {
  padding: 14px 16px 4px; font-size: 12.5px; color: var(--muted); text-align: center;
}
.search-tip.hidden { display: none; }
.search-list {
  flex: 1; overflow-y: auto; padding: 6px 12px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.sres {
  display: flex; gap: 10px; width: 100%; text-align: left; font-family: inherit;
  background: #fff; border: 0; border-radius: 14px; padding: 10px;
  box-shadow: 0 2px 8px rgba(255, 92, 133, 0.08);
}
.sres .thumb {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 10px;
  object-fit: cover; background: var(--pink-soft);
}
.sres .main { flex: 1; min-width: 0; }
.sres .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.sres .txt { font-size: 13.5px; color: var(--text); line-height: 1.5; word-break: break-word; }
.sres mark { background: #ffe08a; color: inherit; border-radius: 3px; padding: 0 1px; }

/* 搜索跳转后，目标卡片闪一下，一眼看到 */
@keyframes flashCard { 0%, 40% { background: var(--pink-soft); } 100% { background: var(--card); } }
.post.flash { animation: flashCard 1.8s ease; }

/* ---------- 顶部年月条（滚动后浮出，点开可快速跳月） ---------- */
.month-pill {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  top: calc(10px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); color: var(--pink-deep);
  box-shadow: 0 6px 16px rgba(255, 92, 133, 0.22);
  backdrop-filter: blur(6px);
  animation: toastIn .18s ease;
}
.month-pill.hidden { display: none; }
.month-pill .pill-main {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 2px 0;
  color: var(--pink-deep); font-family: inherit; font-size: 13.5px; font-weight: 600;
}
.month-pill .caret { font-size: 11px; opacity: .7; }
.month-pill .clear {
  width: 18px; height: 18px; border: 0; border-radius: 50%; padding: 0;
  background: var(--pink-soft); color: var(--pink-deep); font-size: 11px; line-height: 1;
}
.month-pill .clear.hidden { display: none; }

/* ---------- 年月快速选择 ---------- */
.jump { position: fixed; inset: 0; z-index: 60; display: none; }
.jump.show { display: block; }
.jump-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.42); }
.jump-body {
  position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
  border-radius: 18px 18px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease; max-height: 80vh; overflow-y: auto;
}
.jump-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 12px;
}
.jump-head button { border: 0; background: none; font-size: 16px; color: var(--muted); padding: 4px; }
.jump-years { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.jump-years button {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-family: inherit;
}
.jump-years button.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.jump-months {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.jump-months button {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 4px; font-size: 13.5px; font-family: inherit; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.jump-months button .n { font-size: 11px; color: var(--muted); }
.jump-months button.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.jump-months button.active .n { color: #fff; }
.jump-months button.empty { opacity: .38; }
.jump-foot { margin-top: 14px; }
.jump-foot button {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--pink-deep);
  border-radius: 12px; padding: 11px; font-size: 14px; font-family: inherit;
}

@media (min-width: 560px) {
  .tabbar { left: 50%; transform: translateX(-50%); width: 520px; border-radius: 16px 16px 0 0; }
  .fab { right: calc(50% - 242px); }
  .sheet-body { left: 50%; transform: translateX(-50%); width: 520px; }
  .jump-body { left: 50%; transform: translateX(-50%); width: 520px; }
  .search { left: 50%; right: auto; width: 520px; transform: translateX(-50%); box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
}
