/* styles.css — "没事儿 · 家庭轻聊" 设计系统
 * 参考 elder-companion-web：暖色护眼背景、老人友好大字号大触控区、高对比。
 * 定位：家庭私有朋友圈，异步、无压力的分享，而非实时聊天。
 */

/* ===== 基础 ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: #ECE3D8; /* 手机外壳外的底色（桌面预览时可见） */
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: #3A2E25;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.phone {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(180deg, #FFF8F0 0%, #FCEFE1 100%);
  box-shadow: 0 0 40px rgba(58,46,37,0.12);
  overflow-x: hidden;
}
.statusbar { height: env(safe-area-inset-top, 0px); }
.app { min-height: 100vh; }
.app ::-webkit-scrollbar { width: 0; height: 0; }
.hidden { display: none !important; }

.card {
  background: #FFFFFF; border-radius: 14px; padding: 18px;
  box-shadow: 0 4px 12px rgba(58,46,37,0.05); border: 1px solid rgba(58,46,37,0.04);
}
.tip, .empty { text-align: center; color: #8A7B6E; font-size: 20px; margin: 60px 0; }
.empty-emoji { font-size: 64px; }
.empty-text { margin-top: 12px; line-height: 1.8; white-space: pre-line; }
.loading { text-align: center; color: #8A7B6E; font-size: 18px; padding: 40px 0; }

/* ===== 顶部导航条 ===== */
.navbar { display: flex; align-items: center; padding: 10px 14px; background: linear-gradient(135deg, #FFF3E6, #FFE6D2); position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 8px rgba(232,116,59,0.08); }
.navbar .nav-back { font-size: 26px; color: #E8743B; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 22px; }
.navbar .nav-back:active { background: #FFE9D6; }
.navbar .nav-title { flex: 1; text-align: center; font-size: 20px; font-weight: 700; color: #3A2E25; }
.navbar .nav-right { width: 44px; text-align: right; font-size: 22px; color: #E8743B; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: flex-end; }

/* ===== 角色选择页 ===== */
.role-page { padding: 40px 24px; min-height: 100vh; box-sizing: border-box; }
.role-page .title { font-size: 30px; font-weight: 800; color: #3A2E25; text-align: center; margin-top: 20px; }
.role-page .subtitle { font-size: 20px; color: #8A7B6E; text-align: center; margin: 10px 0 40px; }
.role-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 32px 20px; margin-bottom: 24px; border-radius: 16px;
  border: 2px solid #FFE0C7; background: linear-gradient(135deg, #FFF6EC, #FFE9D6);
  box-shadow: 0 5px 15px rgba(232,116,59,0.14); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.role-card:active { transform: scale(.97); box-shadow: 0 3px 9px rgba(58,46,37,0.12); }
.role-card.parent { border-color: #FFD2AD; background: linear-gradient(135deg, #FFF6EC, #FFE6CE); }
.role-card.child  { border-color: #CFE0F5; background: linear-gradient(135deg, #F4F9FF, #E2EEFB); }
.role-go {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 36px; font-weight: 700; color: #E8B48C; line-height: 1;
}
.role-card.child .role-go { color: #A9C6E8; }
.role-avatar {
  width: 150px; height: 106px; border-radius: 18px; border: 3px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(58,46,37,0.12); background: #F2E9DF;
  object-fit: cover; display: block;
}
.role-name { font-size: 28px; font-weight: 800; color: #E8743B; margin-top: 12px; }
.role-card.child .role-name { color: #3B7DD8; }
.role-desc { font-size: 19px; color: #8A7B6E; margin-top: 6px; text-align: center; }
.role-tip { text-align: center; font-size: 17px; color: #B5531E; margin-top: 16px; line-height: 1.7; }

/* ===== 家庭圈首页（时间线） ===== */
.home { min-height: 100vh; box-sizing: border-box; padding: 14px 14px calc(120px + env(safe-area-inset-bottom)); background: linear-gradient(160deg, #FFF8F0 0%, #FFF1E6 55%, #FFE9DA 100%); }
.home-head { margin: 4px 4px 14px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #FFF3E6, #FFE1CC); box-shadow: 0 3px 9px rgba(232,116,59,0.10); position: relative; }
.home-title { font-size: 26px; font-weight: 800; color: #C2410C; }
.home-sub { font-size: 17px; color: #B5531E; margin-top: 4px; line-height: 1.6; }
.home-set { position: absolute; right: 14px; top: 14px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 21px; background: rgba(255,255,255,0.75); font-size: 21px; cursor: pointer; box-shadow: 0 2px 6px rgba(58,46,37,0.08); }
.home-set:active { transform: scale(.92); }

.feed-tip { text-align: center; font-size: 16px; color: #B0A296; margin: 0 4px 12px; }

/* 动态卡片 */
.post { margin-bottom: 16px; padding: 16px; }
.post-head { display: flex; align-items: center; margin-bottom: 10px; }
.post-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: #FFE9D6;
  border: 2px solid #FFF3E6; font-size: 26px; margin-right: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.p-home.parent .post-avatar { width: 56px; height: 56px; font-size: 30px; }
.post-who { flex: 1; min-width: 0; }
.post-name { font-size: 20px; font-weight: 700; color: #E8743B; }
.post-name[data-role="2"] { color: #3B7DD8; }
.p-home.parent .post-name { font-size: 23px; }
.post-time { font-size: 15px; color: #B0A296; margin-top: 1px; }
.p-home.parent .post-time { font-size: 17px; }
.post-img { width: 100%; border-radius: 12px; background: #F2E9DF; box-shadow: 0 2px 8px rgba(58,46,37,0.08); display: block; cursor: pointer; }
.post-text { font-size: 21px; color: #3A2E25; margin-top: 10px; line-height: 1.7; word-break: break-word; }
.p-home.parent .post-text { font-size: 24px; margin-bottom: 12px; }
.post-text .speak-btn { margin-left: 8px; }
.speak-btn {
  display: inline-block; font-size: 14px; color: #B5531E; background: #FFE9D6;
  border-radius: 999px; padding: 2px 10px; cursor: pointer; user-select: none; white-space: nowrap;
}
.p-home.parent .speak-btn { font-size: 21px; padding: 9px 20px; font-weight: 700; margin-left: 10px; }
.speak-btn.on { background: #E8743B; color: #fff; }
.post-voice { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; background: #FFE9D6; color: #C2410C; font-size: 19px; font-weight: 700; border-radius: 999px; padding: 9px 18px; cursor: pointer; user-select: none; }
.post-voice.on { background: #E8743B; color: #fff; }

/* 反应区（异步、无压力） */
.react-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #F5EDE3; }
.react-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 18px; font-weight: 700; color: #B5531E; background: #FFF3E6;
  border: 1px solid #FFE0C7; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  transition: transform .08s ease; user-select: none;
}
.p-home.parent .react-btn { font-size: 21px; padding: 11px 18px; }
.react-btn:active { transform: scale(.95); }
.react-btn.on { background: linear-gradient(135deg, #FF9A56, #E8743B); color: #fff; border-color: transparent; }
.react-btn .num { font-size: 16px; opacity: .85; }
.react-cm {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 18px; font-weight: 700; color: #6B5B4E; background: #F7F1EA;
  border-radius: 999px; padding: 9px 14px; cursor: pointer; min-width: 0;
}
.p-home.parent .react-cm { font-size: 21px; padding: 11px 16px; }
.react-cm .num { font-size: 16px; opacity: .75; }
.post-reacted { margin-top: 10px; font-size: 16px; color: #2E7D32; background: #EAF7EC; border-radius: 10px; padding: 8px 12px; }

/* 底部发布按钮（悬浮） */
.fab {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 30px;
  border-radius: 32px; background: linear-gradient(135deg, #FF9A56, #E8743B);
  color: #fff; font-size: 23px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(232,116,59,0.42); cursor: pointer; z-index: 30;
  transition: transform .08s ease, opacity .08s ease; white-space: nowrap;
}
.fab:active { opacity: .88; transform: translateX(-50%) scale(.97); }

/* ===== 父母端首页 ===== */
.p-home { display: flex; flex-direction: column; height: 100vh; box-sizing: border-box; padding: 12px; background: linear-gradient(180deg, #FFF8F0 0%, #FCEFE1 100%); }
.status-bar {
  flex-shrink: 0; margin-bottom: 10px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, #FFF3E6, #FFE6D2); color: #B5531E;
  font-size: 23px; font-weight: 700; box-shadow: 0 3px 9px rgba(232,116,59,0.10);
  display: flex; align-items: center; cursor: pointer;
}
.status-bar:active { background: linear-gradient(135deg, #FFE6D2, #FFD9BE); }
.status-bar .edit-ico { margin-left: 6px; font-size: 19px; opacity: .85; }
.board { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-head { margin: 4px 4px 10px; }
.board-title { font-size: 26px; font-weight: 800; color: #3A2E25; }
.board-sub { font-size: 17px; color: #B0A296; margin-top: 2px; }
.moment-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.p-home .empty { margin: 30px 0; font-size: 21px; }
.dual-row { display: flex; gap: 10px; margin: 4px 0 2px; flex-shrink: 0; }
.dual-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  white-space: nowrap; font-size: 22px; font-weight: 700; border-radius: 14px;
  padding: 20px 4px; cursor: pointer; transition: transform .1s ease; user-select: none;
}
.dual-btn:active { opacity: .85; transform: scale(.97); }
.post-entry { color: #fff; background: linear-gradient(135deg, #5BD96A, #34C759); box-shadow: 0 4px 11px rgba(52,199,89,0.38); }
.cal-entry { color: #fff; background: linear-gradient(135deg, #FFB347, #FF8A1F); box-shadow: 0 4px 11px rgba(255,138,31,0.34); }
.guide-entry { text-align: center; font-size: 19px; color: #B0A296; margin-top: 9px; padding: 8px; flex-shrink: 0; cursor: pointer; }

/* ===== 精彩瞬间相册 ===== */
/* 首页入口按钮：父母端大金色按钮，子女端小胶囊 */
.album-entry {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 8px 0 4px; padding: 16px 10px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #FFC94D, #FF9F1C); color: #fff;
  font-size: 24px; font-weight: 800; box-shadow: 0 4px 12px rgba(255,159,28,0.36);
  user-select: none; transition: transform .1s ease; flex-shrink: 0;
}
.album-entry:active { opacity: .88; transform: scale(.98); }
.album-entry-sub { font-size: 15px; font-weight: 500; opacity: .92; margin-top: 3px; }
.album-entry.small {
  flex-direction: row; margin: 0 16px 10px; padding: 11px 10px; border-radius: 12px;
  font-size: 15px; font-weight: 700; box-shadow: 0 3px 8px rgba(255,159,28,0.28);
}

/* 相册页 */
.album { padding: 14px 16px 30px; background: linear-gradient(180deg,#FFF8F0,#FCEFE1); min-height: calc(100vh - 52px); box-sizing: border-box; }
.album-head { text-align: center; margin: 6px 0 14px; }
.album-title { font-size: 24px; font-weight: 800; color: #3A2E25; }
.album-sub { font-size: 14px; color: #A0917F; margin-top: 5px; }
.album-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.album-loading, .album-empty {
  grid-column: 1 / -1; text-align: center; color: #A0917F;
  font-size: 18px; line-height: 1.8; padding: 60px 10px;
}
.album-card {
  background: #fff; border-radius: 14px; overflow: hidden; cursor: pointer;
  box-shadow: 0 3px 10px rgba(90,60,30,0.10); transition: transform .1s ease;
}
.album-card:active { transform: scale(.97); }
.album-img-wrap { position: relative; width: 100%; padding-top: 100%; }
.album-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.album-date {
  position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 10px;
  background: rgba(40,28,18,0.55); color: #fff; font-size: 12px; font-weight: 600;
}
.album-who { display: flex; align-items: center; gap: 6px; padding: 8px 10px 2px; font-size: 14px; font-weight: 700; color: #3A2E25; }
.album-avatar { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #FFE9D6; font-size: 13px; flex-shrink: 0; overflow: hidden; }
img.album-avatar-img { object-fit: cover; }
.album-text {
  padding: 2px 10px 10px; font-size: 13px; color: #6E6055; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.album-foot { margin-top: 18px; text-align: center; }
.album-shuffle {
  display: inline-block; padding: 13px 34px; border-radius: 24px; cursor: pointer;
  background: linear-gradient(135deg, #FFB347, #FF8A1F); color: #fff;
  font-size: 18px; font-weight: 700; box-shadow: 0 4px 11px rgba(255,138,31,0.34);
  user-select: none;
}
.album-shuffle:active { opacity: .85; transform: scale(.97); }
.album-tip { font-size: 13px; color: #B0A296; margin-top: 10px; }

/* 父母端适老化：字更大、卡片间距更宽 */
.album.parent .album-title { font-size: 28px; }
.album.parent .album-sub { font-size: 17px; }
.album.parent .album-loading, .album.parent .album-empty { font-size: 22px; }
.album.parent .album-who { font-size: 18px; padding: 10px 12px 2px; }
.album.parent .album-avatar { width: 30px; height: 30px; font-size: 17px; }
.album.parent .album-text { font-size: 16px; padding: 3px 12px 12px; }
.album.parent .album-date { font-size: 15px; padding: 4px 11px; }
.album.parent .album-shuffle { font-size: 22px; padding: 16px 44px; }
.album.parent .album-tip { font-size: 16px; }

/* 成员列表头像 */
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #FFE9D6; color: #E8743B; font-size: 20px; overflow: hidden; flex-shrink: 0;
}
.member-avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 电子挂历（父母端） ===== */
.cal { padding: 16px; background: linear-gradient(180deg,#FFF8F0,#FCEFE1); min-height: 100vh; box-sizing: border-box; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-arrow {
  width: 52px; height: 52px; line-height: 52px; text-align: center; font-size: 34px; color: #E8743B;
  background: #FFFFFF; border-radius: 50%; box-shadow: 0 2px 7px rgba(232,116,59,0.16); cursor: pointer;
  transition: transform .1s ease; user-select: none;
}
.cal-arrow:active { transform: scale(.92); background: #FFE9D6; }
.cal-month { font-size: 26px; font-weight: 800; color: #3A2E25; }
.cal-week { display: flex; margin-bottom: 6px; }
.cal-wd { flex: 1; text-align: center; font-size: 18px; color: #B0A296; }
.cal-grid { display: flex; flex-wrap: wrap; background: #FFFFFF; border-radius: 14px; padding: 4px; box-shadow: 0 4px 12px rgba(58,46,37,0.05); }
.cal-cell { width: 14.28%; box-sizing: border-box; height: 104px; padding: 2px; display: flex; flex-direction: column; align-items: center; border-radius: 10px; }
.cal-cell.empty { visibility: hidden; }
.cal-day { font-size: 22px; line-height: 1.2; color: #3A2E25; }
.cal-cell.has { cursor: pointer; }
.cal-cell.has .cal-day { color: #E8743B; font-weight: 800; }
.cal-cell.sel { background: #FFE9D6; }
.cal-cover { width: 100%; height: 62px; flex-shrink: 0; border-radius: 8px; margin-top: 2px; object-fit: cover; box-shadow: 0 2px 5px rgba(58,46,37,0.12); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; background: #E8743B; margin-top: 30px; }
.cal-hint { text-align: center; color: #B0A296; font-size: 17px; margin-top: 12px; line-height: 1.6; }
.cal-detail { margin-top: 16px; }
.cal-detail-title { font-size: 23px; font-weight: 800; color: #3A2E25; margin-bottom: 10px; }

/* ===== 发布页 ===== */
.post-page { padding: 20px 24px 40px; min-height: 100vh; box-sizing: border-box; background: linear-gradient(180deg, #FFF8F0, #FCEFE1); }
.p-hint { font-size: 23px; font-weight: 700; color: #3A2E25; text-align: center; margin: 20px 0 10px; }
.p-hint-sub { font-size: 18px; color: #8A7B6E; text-align: center; margin-bottom: 18px; line-height: 1.6; }
.big-camera { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 210px; border-radius: 20px; background: #FFF1E4; color: #E8743B; font-size: 70px; margin: 24px 0 12px; cursor: pointer; border: 2px dashed #FFD9BE; }
.big-camera:active { background: #FFE9D6; }
.big-camera-label { font-size: 26px; font-weight: 800; margin-top: 8px; }
.preview { width: 100%; border-radius: 14px; margin-bottom: 12px; display: block; }
.hold-talk {
  display: flex; align-items: center; justify-content: center; height: 76px; border-radius: 16px;
  background: #FFE9D6; color: #E8743B; font-size: 22px; font-weight: 700; margin: 12px 0; white-space: nowrap;
  cursor: pointer; user-select: none; transition: background .1s ease;
}
.hold-talk.recording { background: #E8743B; color: #fff; animation: holdpulse 1.2s infinite; }
@keyframes holdpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,116,59,0.4); } 50% { box-shadow: 0 0 0 8px rgba(232,116,59,0); } }
.audio-done { display: flex; align-items: center; justify-content: space-between; background: #E8F6EC; color: #2E7D32; font-size: 20px; font-weight: 700; border-radius: 14px; padding: 14px 16px; margin: 12px 0; }
.audio-redo { color: #E8743B; cursor: pointer; font-size: 18px; }
.c-text { width: 100%; box-sizing: border-box; min-height: 110px; padding: 14px; border-radius: 12px; background: #fff; font-size: 20px; color: #3A2E25; border: 1px solid #F0E6DA; resize: vertical; font-family: inherit; outline: none; }
.c-text:focus { border-color: #FFD9BE; }
.p-text { min-height: 120px; font-size: 22px; line-height: 1.6; }
.btn-big {
  display: flex; align-items: center; justify-content: center;
  height: 70px; border-radius: 14px; margin-top: 16px;
  font-size: 24px; font-weight: 700; color: #FFFFFF;
  background: linear-gradient(135deg, #FF9A56, #E8743B);
  box-shadow: 0 4px 12px rgba(232,116,59,0.30);
  letter-spacing: 1px; cursor: pointer; user-select: none;
  transition: transform .08s ease, opacity .08s ease;
}
.btn-big:active { opacity: .85; transform: scale(.98); }
.btn-big.ghost { background: #FFFFFF; color: #E8743B; border: 2px solid #FFD9BE; box-shadow: none; }

/* ===== 动态详情 ===== */
.m-detail { min-height: 100vh; background: linear-gradient(160deg, #FFF8F0 0%, #FFF1E6 55%, #FFE9DA 100%); padding: 14px 14px 30px; box-sizing: border-box; }
.m-card { margin-bottom: 12px; }
.m-head { display: flex; align-items: center; margin-bottom: 12px; }
.m-avatar { width: 52px; height: 52px; border-radius: 50%; background: #FFE9D6; border: 2px solid #FFF3E6; font-size: 28px; display: flex; align-items: center; justify-content: center; margin-right: 12px; }
.m-name { font-size: 22px; font-weight: 700; color: #E8743B; }
.m-name[data-role="2"] { color: #3B7DD8; }
.m-time { font-size: 15px; color: #B0A296; margin-top: 2px; }
.m-img { width: 100%; border-radius: 10px; margin-bottom: 10px; display: block; cursor: pointer; }
.m-text { font-size: 21px; line-height: 1.7; color: #3A2E25; margin-bottom: 10px; word-break: break-word; }
.m-detail.parent .m-text { font-size: 24px; }
.m-detail .post-voice { margin-top: 0; }

/* 回应区（详情内，大按钮） */
.m-react { margin-bottom: 12px; padding: 16px 14px 18px; }
.m-react-tip { text-align: center; font-size: 19px; color: #B5531E; font-weight: 600; margin-bottom: 12px; }
.m-react-row { display: flex; justify-content: space-between; gap: 10px; }
.m-react-big {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100px; border-radius: 14px; background: linear-gradient(135deg, #FFF3E6, #FFE3CC);
  box-shadow: 0 3px 8px rgba(232,116,59,0.12); border: 1px solid #FFD9BE; cursor: pointer;
  transition: transform .08s ease; user-select: none;
}
.m-react-big:active { transform: scale(.96); background: linear-gradient(135deg, #FFE3CC, #FFD0AE); }
.m-react-big.on { background: linear-gradient(135deg, #FF9A56, #E8743B); border-color: transparent; }
.m-react-big.on .m-react-label { color: #fff; }
.m-react-emoji { font-size: 38px; line-height: 1; }
.m-react-label { font-size: 18px; margin-top: 7px; color: #C2410C; font-weight: 700; white-space: nowrap; }

/* 谁回应了 */
.m-reacted-list { margin-bottom: 12px; padding: 13px 16px; font-size: 18px; color: #2E7D32; background: #EAF7EC; border: 1px solid #D5EDD9; line-height: 1.8; }

/* 留言区 */
.m-comments { padding: 16px; margin-bottom: 12px; }
.cm-title { font-size: 21px; font-weight: 700; color: #3A2E25; margin-bottom: 8px; }
.cm-empty { font-size: 18px; color: #B0A296; padding: 8px 0; line-height: 1.7; }
.cm-item { display: flex; padding: 11px 0; border-top: 1px solid #F2E8DE; }
.cm-avatar { width: 40px; height: 40px; border-radius: 50%; background: #FFE9D6; font-size: 20px; display: flex; align-items: center; justify-content: center; margin-right: 10px; flex-shrink: 0; }
.cm-main { flex: 1; min-width: 0; }
.cm-name { font-size: 17px; font-weight: 700; color: #E8743B; }
.cm-name[data-role="2"] { color: #3B7DD8; }
.cm-content { font-size: 20px; line-height: 1.6; color: #3A2E25; margin-top: 2px; word-break: break-word; }
.m-detail.parent .cm-content { font-size: 22px; }
.cm-audio { display: inline-flex; align-items: center; gap: 5px; background: #E8F6EC; color: #2E7D32; border-radius: 999px; padding: 7px 14px; font-size: 18px; margin-top: 4px; font-weight: 700; cursor: pointer; user-select: none; }
.cm-audio.on { background: #C9E8D1; }
.cm-time { font-size: 14px; color: #C0B3A6; margin-top: 3px; }

/* 详情底部留言条（固定） */
.m-input-bar {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #FFFFFF; box-shadow: 0 -2px 10px rgba(58,46,37,0.08); z-index: 20;
}
.m-input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; background: #F7F1EA; border-radius: 24px; font-size: 19px; color: #3A2E25; border: none; font-family: inherit; outline: none; }
.m-input:focus { background: #FFF3E6; box-shadow: 0 0 0 2px #FFD9BE inset; }
.m-btn { flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #FFF1E4; color: #E8743B; font-size: 23px; cursor: pointer; }
.m-btn:active { transform: scale(.94); background: #FFE3CC; }
.m-send { flex-shrink: 0; height: 48px; padding: 0 20px; display: flex; align-items: center; justify-content: center; border-radius: 24px; background: linear-gradient(135deg, #FF9A56, #E8743B); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; }
.m-send:active { opacity: .85; transform: scale(.97); }
.rec-indicator { flex: 1; display: flex; align-items: center; font-size: 18px; color: #E5484D; font-weight: 700; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #E5484D; margin-right: 7px; animation: recpulse 1s infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.rec-cancel { flex-shrink: 0; font-size: 17px; color: #B0A296; padding: 0 11px; cursor: pointer; }
.rec-stop { flex-shrink: 0; height: 48px; padding: 0 18px; display: flex; align-items: center; justify-content: center; border-radius: 24px; background: linear-gradient(135deg, #5BD96A, #34C759); color: #fff; font-size: 19px; font-weight: 700; cursor: pointer; }

/* ===== 弹窗 / 面板 / 轻提示 ===== */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
  background: rgba(58,46,37,0.9); color: #fff; font-size: 17px;
  padding: 12px 20px; border-radius: 12px; z-index: 100; opacity: 0;
  pointer-events: none; transition: opacity .2s ease; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }

.modal-mask, .sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask.hidden, .sheet-mask.hidden { display: none; }
.modal { width: 84%; max-width: 380px; background: #FFF8F0; border-radius: 16px; padding: 22px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.dialog-title { font-size: 22px; font-weight: 800; color: #3A2E25; }
.dialog-sub { font-size: 17px; color: #8A7B6E; margin: 8px 0 16px; line-height: 1.6; }
.dialog-input {
  width: 100%; box-sizing: border-box; height: 50px; padding: 0 14px;
  border-radius: 12px; border: 1px solid #FFD9BE; background: #fff;
  font-size: 19px; color: #3A2E25; font-family: inherit; outline: none;
}
.dialog-btns { display: flex; gap: 12px; margin-top: 18px; }
.db-cancel, .db-ok {
  flex: 1; height: 50px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 19px; font-weight: 700; cursor: pointer;
}
.db-cancel { background: #F2E8DE; color: #8A7B6E; }
.db-ok { background: linear-gradient(135deg, #FF9A56, #E8743B); color: #fff; }

/* ===== 头像选择弹窗 ===== */
.av-cur { display: flex; justify-content: center; margin: 2px 0 14px; }
.av-preview { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid #FFE9D6; box-shadow: 0 4px 10px rgba(58,46,37,0.12); }
.av-preview-emoji { display: flex; align-items: center; justify-content: center; font-size: 46px; background: #FFE9D6; }
.av-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.av-item {
  height: 50px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: #FAF3EB; border-radius: 12px; cursor: pointer;
  border: 2px solid transparent;
}
.av-item:active { background: #FFE9D6; }
.av-item.sel { border-color: #E8743B; background: #FFE9D6; }
.av-upload {
  height: 52px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FF9A56, #E8743B); color: #fff;
  border-radius: 12px; font-size: 19px; font-weight: 700; cursor: pointer;
}
.av-upload:active { opacity: .88; }

/* ===== 身份/关系选择弹窗 ===== */
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.rel-item {
  height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; color: #5A4A3C; background: #FAF3EB;
  border-radius: 12px; cursor: pointer; border: 2px solid transparent;
}
.rel-item:active { background: #FFE9D6; }
.rel-item.sel { border-color: #E8743B; background: #FFE9D6; color: #B5531E; }

/* 状态栏上的身份小标签 */
.status-rel {
  margin-left: 8px; padding: 2px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.7); font-size: 16px; font-weight: 700; color: #B5531E;
}

/* 备案信息：小灰字，沉在页面最底下 */
.icp {
  position: fixed; left: 0; right: 0; bottom: 4px; z-index: 1;
  text-align: center; font-size: 12px; color: #C9BDB1; pointer-events: none;
}

/* 家庭码弹窗：数字要大大的，老人一眼看清 */
.family-code {
  font-size: 46px; font-weight: 800; letter-spacing: 10px; text-align: center;
  color: #E8743B; margin: 8px 0 18px; padding-left: 10px;
}

/* 邀请话术框：虚线框突出可复制，长按也能选中 */
.invite-text {
  background: #FFF7EF; border: 2px dashed #E8B894; border-radius: 14px;
  padding: 14px; font-size: 18px; line-height: 1.7; color: #7A4A21;
  user-select: text; -webkit-user-select: text; margin-bottom: 14px; word-break: break-all;
}

/* ===== 照片头像（各处尺寸的 img 版本） ===== */
.post-avatar-img, .m-avatar-img, .cm-avatar-img, .status-avatar-img, .home-avatar-img { object-fit: cover; }
.status-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #FFF;
  border: 2px solid #FFF; font-size: 22px; margin-right: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.home-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #FFE9D6;
  font-size: 15px; margin-right: 6px; display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;
}
.sheet {
  position: absolute; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #FFF8F0; border-radius: 16px 16px 0 0; padding: 10px;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
}
.sheet-item { padding: 16px; text-align: center; font-size: 20px; color: #3A2E25; border-bottom: 1px solid #F0E6DA; cursor: pointer; }
.sheet-item:last-child { border-bottom: none; }
.sheet-cancel { margin-top: 8px; padding: 16px; text-align: center; font-size: 20px; font-weight: 700; color: #E8743B; background: #fff; border-radius: 12px; cursor: pointer; }

/* ===== 全屏查看原图：黑底沉浸、可缩放、长按可保存 ===== */
.lightbox-card {
  width: 100%; max-width: 100%; height: 100%; box-sizing: border-box;
  background: rgba(20, 16, 12, 0.96); border-radius: 0; padding: 0;
  box-shadow: none; display: flex; flex-direction: column;
}
.lb-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb-img {
  max-width: 100%; max-height: 100%; display: block;
  touch-action: none; user-select: auto; -webkit-touch-callout: default;
}
.lb-hint { color: rgba(255, 255, 255, 0.7); font-size: 16px; text-align: center; padding: 12px 16px 4px; }
.lb-close {
  margin: 10px auto 22px; padding: 12px 44px; border-radius: 26px;
  background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer;
}
