:root {
  --bg-mist: #DBEBEE;
  --bg-mint: #CCEAE3;
  --bg-paper: #F9F7F1;
  --card-bg: #FFFFFF;
  --card-warm: #FFFCF7;
  --ink: #474A4D;
  --ink-deep: #2E3133;
  --muted: #8A9199;
  --muted-light: #ACB3BA;
  --orange: #EF6418;
  --coral: #F2A37B;
  --coral-deep: #E57A44;
  --teal: #57A69A;
  --teal-soft: #E6F4F1;
  --blue-topic: #4987C6;
  --line: rgba(71, 74, 77, 0.08);
  --shadow-sm: 0 4px 16px rgba(62, 92, 102, 0.06);
  --shadow-md: 0 10px 28px rgba(62, 92, 102, 0.10);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: linear-gradient(180deg, #DBEBEE 0%, #E8F2F2 45%, #F7F6F2 100%);
  background-attachment: fixed;
}

button, input, textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

img {
  max-width: 100%;
  -webkit-user-drag: none;
}

.hidden {
  display: none !important;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* 通用按钮与小组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.12s, opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #F39B6D 0%, #EF6418 100%);
  box-shadow: 0 6px 16px rgba(239, 100, 24, 0.25);
}
.btn-export-primary {
  white-space: nowrap;
}
.btn-teal {
  color: #fff;
  background: linear-gradient(135deg, #6EC1B6 0%, #4D9E93 100%);
  box-shadow: 0 6px 16px rgba(77, 158, 147, 0.22);
}
.btn-soft {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(71, 74, 77, 0.12);
}
.btn-block {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

.lv-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  background: #FFF0E6;
  border: 1px solid rgba(239, 100, 24, 0.18);
  line-height: 1.5;
}
.vip-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #B87333;
  background: #FFF6E0;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: rgba(46, 49, 51, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-width: 88vw;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: var(--muted);
}
.empty-state img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin: 0 auto 12px;
  opacity: 0.85;
}

/* ==================== 1. 登录首屏（原版 activity_app_login 风格） ==================== */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-mist);
  background-image: url('../assets/ic_login_top_bg.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: min(100%, 760px) auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-container {
  width: min(460px, 100%);
  margin: auto;
}

.login-hero {
  text-align: center;
  padding: 18px 10px 14px;
}
.login-hero-mascots {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.login-hero-mascots .logo-main {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(87, 136, 150, 0.25));
}
.login-hero-mascots .baobao-char {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(87, 136, 150, 0.2));
}
.login-hero h1 {
  margin: 4px 0 6px;
  font-size: 24px;
  color: var(--ink-deep);
  letter-spacing: 1px;
}
.login-hero p {
  margin: 0;
  color: #64787D;
  font-size: 13px;
  line-height: 1.6;
}

/* 首屏紧凑安全承诺条 */
.safe-pill-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid rgba(87, 166, 154, 0.25);
  border-radius: 16px;
  padding: 11px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.safe-pill-bar img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: none;
}
.safe-pill-bar .safe-text {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
  color: #556669;
}
.safe-pill-bar .safe-text strong {
  display: block;
  color: var(--ink-deep);
  font-size: 13px;
  margin-bottom: 1px;
}
.safe-pill-bar .safe-link {
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.seg-tabs {
  display: flex;
  background: #EEF4F4;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.seg-tabs button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.seg-tabs button.active {
  background: #fff;
  color: var(--ink-deep);
  box-shadow: 0 2px 8px rgba(71, 74, 77, 0.08);
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.input-row input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #DCE5E7;
  background: #FAFCFC;
  color: var(--ink-deep);
  outline: none;
  font-size: 14px;
}
.input-row input:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(87, 166, 154, 0.14);
}

.form-msg {
  min-height: 18px;
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--orange);
  line-height: 1.5;
}

.resume-box {
  background: #FFF8EB;
  border: 1px solid #F0DFC0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #6E583B;
  line-height: 1.55;
}
.resume-actions {
  display: flex;
  gap: 8px;
  margin-top: 7px;
}
.resume-actions button {
  padding: 5px 11px;
  border-radius: 8px;
  background: #F2DEC0;
  color: #544127;
  font-size: 12px;
  font-weight: 600;
}

.quick-entries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.quick-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 13px;
  background: #F6F9F9;
  border: 1px solid #E3ECEC;
  text-align: left;
}
.quick-entry img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: none;
}
.quick-entry strong {
  display: block;
  font-size: 12px;
  color: var(--ink-deep);
}
.quick-entry span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.login-footer {
  text-align: center;
  margin-top: 14px;
  font-size: 11px;
  color: #778A8E;
}

/* ==================== 2. 原版岁岁 App 主壳与顶部备份胶囊条 ==================== */
.suisui-app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

/* 顶部唯一备份导出栏 */
.backup-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 252, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(71, 74, 77, 0.08);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
}
.backup-topbar-inner {
  max-width: 680px;
  margin: 0 auto;
}
.backup-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.backup-status-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.backup-status-left img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: none;
}
.backup-status-text {
  min-width: 0;
  flex: 1;
}
.backup-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.backup-status-sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
}
.backup-status-sub > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backup-detail-toggle {
  color: var(--teal);
  font-size: 11px;
  padding: 0;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.backup-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.backup-progress-line {
  height: 4px;
  background: #E5EFEF;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 7px;
}
.backup-progress-line i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6EC1B6 0%, #EF6418 100%);
  transition: width 0.25s;
}

/* iOS / 手机端保存文件兜底条 */
.ready-save-bar {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #EEF8F6;
  border: 1px solid #C5E4DE;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #3D6B64;
}
.ready-save-actions {
  display: flex;
  gap: 6px;
  flex: none;
  flex-wrap: wrap;
  max-width: 100%;
}

/* 可折叠的模块同步明细抽屉 */
.backup-drawer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  max-height: 45vh;
  overflow-y: auto;
}
.drawer-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.drawer-mod-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  background: #F6F9F9;
  font-size: 11px;
}
.drawer-mod-chip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: none;
}
.drawer-mod-chip b {
  display: block;
  color: var(--ink-deep);
  font-weight: 600;
}
.drawer-mod-chip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.drawer-foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.drawer-foot-bar button {
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
}

/* ==================== 3. 原版岁岁视图容器（居中手机 App 比例或适度双栏） ==================== */
.suisui-stage {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 12px 12px 24px;
  flex: 1;
}

/* 原版底部 5-Tab 导航栏 (activity_home_layout.xml) */
.suisui-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(71, 74, 77, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.suisui-bottom-nav-inner {
  max-width: 680px;
  margin: 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
}
.nav-tab-btn {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8A9199;
  font-size: 11px;
  font-weight: 500;
}
.nav-tab-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.nav-tab-btn.active {
  color: var(--ink-deep);
  font-weight: 700;
}

/* ==================== Tab 1：树洞 (fragment_tree + item_tree_common_layout) ==================== */
.tree-planet-banner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #23334A 0%, #324B68 55%, #486B8A 100%);
  padding: 18px 18px 15px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.tree-planet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tree-planet-top h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #FFFFFF;
}
.tree-planet-top p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}
.tree-planet-top .planet-main-img {
  width: 78px;
  height: 60px;
  object-fit: contain;
}
.tree-planets-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.tree-planets-strip .planet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}
.tree-planets-strip .planet-item img {
  width: 48px;
  height: 38px;
  object-fit: contain;
}

/* 原版树洞卡片 */
.tree-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tree-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.tree-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tree-avatar-wrap {
  position: relative;
  flex: none;
}
.tree-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #EEF3F4;
}
.tree-user-meta {
  flex: 1;
  min-width: 0;
}
.tree-user-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tree-nickname {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-time-loc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.tree-topic-tag {
  display: inline-block;
  color: var(--blue-topic);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tree-content-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-deep);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 树洞配图网格 */
.tree-img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.tree-img-grid.single {
  grid-template-columns: minmax(0, 220px);
}
.tree-img-grid.double {
  grid-template-columns: repeat(2, minmax(0, 180px));
}
.tree-img-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: #EFF4F5;
  cursor: zoom-in;
}
.tree-img-grid.single img {
  aspect-ratio: auto;
  max-height: 260px;
}

/* 原版树洞语音播放胶囊 */
.tree-voice-bar {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(90deg, #E2F4F0 0%, #F1F9F7 100%);
  border: 1px solid #C8E7E0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tree-voice-bar img.voice-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: none;
}
.tree-voice-bar .voice-dur {
  font-size: 12px;
  font-weight: 700;
  color: #3D847A;
  white-space: nowrap;
}
.tree-voice-bar { cursor: pointer; }
.tree-voice-bar.playing { animation: voice-pulse 1.1s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(87,166,154,.18); }
@keyframes voice-pulse { 50% { background: #D7F3EE; } }
.load-more-records,.new-tree-notice,.saved-account button { border: 0; border-radius: 999px; background: #E8F4F2; color: #357C72; padding: 9px 14px; font-weight: 700; }
.new-tree-notice { margin-top: 10px; }
.saved-account { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; text-align: left; }
.saved-account img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.saved-account div { flex: 1; min-width: 0; }
.saved-account small { display: block; color: #6B7B80; font-size: 11px; }
.tree-voice-bar audio {
  flex: 1;
  height: 32px;
  min-width: 0;
}

/* 树洞底部抱抱与评论操作栏 */
.tree-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tree-action-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.tree-action-item img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ==================== 原版树洞评论区 (item_dynamic_detail_comment_layout) ==================== */
.tree-comments-section {
  margin-top: 10px;
  padding: 12px 12px 6px;
  background: #F8F9FA;
  border-radius: 14px;
}
.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(71, 74, 77, 0.06);
}
.comment-item:last-child {
  border-bottom: 0;
}
.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #E8EEF0;
  border: 1px solid #fff;
}
.comment-main {
  flex: 1;
  min-width: 0;
}
.comment-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.comment-user-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.comment-nick {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comment-like {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  flex: none;
}
.comment-like img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.comment-meta-row {
  font-size: 11px;
  color: var(--muted-light);
  margin-top: 1px;
}
.comment-body-text {
  font-size: 13px;
  color: var(--ink-deep);
  line-height: 1.65;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-pic {
  margin-top: 6px;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  object-fit: cover;
  cursor: zoom-in;
}

/* 楼中楼子评论 (item_tree_sub_comment_layout) */
.sub-comments-list {
  margin-top: 6px;
  padding-left: 8px;
  border-left: 2px solid #E3E8EC;
}
.sub-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
}
.sub-comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #E8EEF0;
}
.sub-comment-main {
  flex: 1;
  min-width: 0;
}
.sub-reply-target {
  color: var(--teal);
  font-weight: 600;
}

.comments-more-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-topic);
}

/* ==================== Tab 2：解忧馆与不晚邮局 (fragment_sorrow_home_layout) ==================== */
.sorrow-scene-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  min-height: 210px;
  background-color: var(--bg-mint);
  background-image: linear-gradient(180deg, rgba(204, 234, 227, 0.25) 0%, rgba(30, 48, 62, 0.55) 100%), url('../assets/ic_sorrow_home.png');
  background-size: cover;
  background-position: center bottom;
  padding: 18px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.sorrow-top-pills {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sorrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-deep);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.sorrow-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.sorrow-house-title {
  margin-top: 64px;
}
.sorrow-house-title h2 {
  margin: 0 0 4px;
  font-size: 20px;
  color: #FFF3D2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.sorrow-house-title p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 243, 210, 0.9);
}

.sub-pill-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.sub-pill-nav button {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sub-pill-nav button.active {
  background: var(--teal);
  color: #fff;
}

.letter-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.letter-envelope-card {
  position: relative;
  background: var(--card-warm);
  border: 1px dashed #DFCBB5;
  border-radius: 16px;
  padding: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.letter-envelope-card .env-icon {
  width: 44px;
  height: 32px;
  object-fit: contain;
}
.letter-envelope-card .stamp-icon {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 38px;
  height: 26px;
  object-fit: contain;
}
.letter-envelope-card strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: #5C4B3B;
}
.letter-envelope-card p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #7D6E60;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.letter-envelope-card small {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #A39384;
}

/* ==================== Tab 3：心情与碎碎念日记 (fragment_mood_home) ==================== */
.mood-banner-card {
  background-color: #F9F7F6;
  background-image: url('../assets/mood/ic_mood_sign_top_bg.png');
  background-size: cover;
  background-position: center top;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.mood-banner-card img.mood-main-face {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex: none;
}
.mood-banner-info h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--ink-deep);
}
.mood-banner-info p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.mood-record-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.mood-record-card > img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: none;
}
.mood-record-body {
  flex: 1;
  min-width: 0;
}
.mood-record-body strong {
  font-size: 14px;
  color: var(--ink-deep);
}
.mood-record-body small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.mood-record-body p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
}

/* ==================== Tab 4：互动 / FM 与心愿 ==================== */
.fm-banner-card {
  background: linear-gradient(135deg, #E3F2F0 0%, #FFF7EC 100%);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.fm-banner-card img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.fm-track-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.fm-track-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: none;
}
.fm-track-info {
  flex: 1;
  min-width: 0;
}
.fm-track-info strong {
  display: block;
  font-size: 14px;
}
.fm-track-info small {
  color: var(--muted);
  font-size: 11px;
}

.starlight-wall-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
}
.starlight-wall-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.starlight-input-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}
.starlight-input-row input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #DCE5E7;
  font-size: 13px;
  outline: none;
}
.starlight-note-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #F7FAF9;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
}
.starlight-note-item span {
  color: var(--muted);
  font-size: 11px;
  margin-left: 6px;
}

/* ==================== Tab 5：我的个人主页 (fragment_user_home_layout) ==================== */
.mine-profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  max-width: 100%;
}
.mine-header-bg {
  height: 148px;
  background-color: #E7F3F1;
  /* 默认原版插画背景兜底：有自定义封面时由 style.backgroundImage 覆盖，缺失或离线失败时自动回退 */
  background-image: url('../assets/mine/app_user_home_background.png'), url('../assets/ic_mine_home_top_bg.png');
  background-size: cover;
  background-position: center top;
  position: relative;
}
.mine-join-stamp {
  position: absolute;
  right: 14px;
  top: 12px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 6px 11px;
  text-align: center;
  color: #5C4B3B;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.mine-join-stamp b {
  display: block;
  font-size: 14px;
  color: var(--orange);
}
.mine-profile-body {
  padding: 0 18px 18px;
  text-align: center;
  margin-top: -42px;
  position: relative;
  max-width: 100%;
  overflow: hidden;
}
.mine-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  background: #EEF3F4;
}
.mine-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.mine-name-row h2 {
  margin: 0;
  font-size: 19px;
  color: var(--ink-deep);
}
.mine-sign {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.mine-sub-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 8px;
  font-size: 11px;
  color: #6B7B80;
}
.mine-sub-tags span {
  white-space: nowrap;
}
.mine-sub-tags .mine-sub-tag + .mine-sub-tag::before {
  content: '·';
  margin-right: 8px;
  color: #A9B7BC;
}

.mine-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.mine-stat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
}
.mine-stat-btn.active {
  background: var(--teal-soft);
}
.mine-stat-btn b {
  font-size: 16px;
  color: var(--ink-deep);
}
.mine-stat-btn span {
  font-size: 11px;
  color: var(--muted);
}

/* 原版个人中心功能图标九宫格 */
.mine-shortcuts-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 14px 10px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.mine-shortcut-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 2px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink);
  min-width: 0;
}
.mine-shortcut-item span {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mine-shortcut-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.mine-people-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.mine-people-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.person-item-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.person-item-row:last-child {
  border-bottom: 0;
}
.person-item-row > img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #EEF3F4;
}
.person-item-info {
  flex: 1;
  min-width: 0;
}
.person-item-info strong {
  font-size: 13px;
  color: var(--ink-deep);
}
.person-item-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== 弹窗：隐私须知、展信阅读、大图预览 ==================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(34, 42, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-card {
  width: min(520px, 100%);
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  background: var(--card-warm);
  border-radius: 22px;
  padding: 22px 20px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}
.modal-card .close-btn,
.letter-paper-modal .close-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F0EAE1;
  color: #5C4B3B;
  font-size: 18px;
}
.modal-card h2 {
  margin: 0 36px 10px 0;
  font-size: 18px;
  color: var(--ink-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-card h2 img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.modal-card h4 {
  margin: 14px 0 4px;
  font-size: 14px;
  color: #3D6B64;
}
.modal-card p, .modal-card li {
  font-size: 13px;
  line-height: 1.75;
  color: #5B6366;
  margin: 4px 0;
}

.letter-paper-modal {
  width: min(520px, 100%);
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  background-color: #FDF9F1;
  background-image: url('../assets/sorrow/letter_open_big.png');
  background-size: cover;
  background-position: center top;
  border-radius: 20px;
  padding: 26px 22px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.letter-paper-modal .stamp {
  position: absolute;
  right: 54px;
  top: 16px;
  width: 48px;
}
.letter-paper-modal h3 {
  margin: 0 80px 6px 0;
  font-size: 18px;
  color: #4A3B2C;
}
.letter-paper-modal .meta {
  font-size: 12px;
  color: #8C7A68;
}
.letter-paper-modal .body {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.9;
  color: #4A3B2C;
  white-space: pre-wrap;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(20, 24, 26, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox img {
  max-width: 96vw;
  max-height: 88vh;
  max-height: 88dvh;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox button {
  position: absolute;
  right: 16px;
  top: calc(14px + env(safe-area-inset-top, 0px));
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 24px;
}

@media (max-width: 520px) {
  .backup-row-main {
    flex-wrap: wrap;
  }
  .backup-actions-right {
    width: 100%;
  }
  .backup-actions-right .btn-primary {
    flex: 1;
  }
  .drawer-modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .letter-cards-grid {
    grid-template-columns: 1fr;
  }
  .ready-save-bar {
    flex-wrap: wrap;
  }
}

/* v7：主页音乐、性格标签、情绪报告、信件与岁友徽标 */
.apk-entry {
  grid-column: 1 / -1;
}
.native-import-btn {
  margin-top: 4px;
  min-height: 52px;
}
.native-import-sub {
  margin: 10px 4px 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #64787D;
}
.native-import-line {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: #E7F0F0;
  overflow: hidden;
}
.native-import-line i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6EC1B6, #EF6418);
}
.mine-bgm-btn {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.92);
  color: #5C4B3B;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.mine-bgm-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.mine-bgm-btn.playing {
  background: #FFF3E8;
  color: #C56A32;
}
.mine-avatar-wrap {
  position: relative;
  display: inline-block;
}
.mine-avatar-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 108px;
  height: 108px;
  transform: translate(-50%, -52%);
  object-fit: contain;
  pointer-events: none;
}
.mine-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  max-width: 100%;
  overflow: hidden;
}
.label-pill,
.guardian-badge,
.pin-badge,
.museum-badge,
.mutual-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.label-pill {
  background: #F3EFE6;
  color: #6E583B;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guardian-badge {
  background: #FFF0E6;
  color: #EF6418;
}
.mine-better {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6B7B80;
}
.pin-badge {
  margin-left: auto;
  background: #FFF1E4;
  color: #E08A45;
}
.vip-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: none;
}
.sex-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: none;
}
.person-name-line,
.tree-user-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.person-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.mutual-badge {
  background: #E7F6F2;
  color: #3D847A;
}
.tree-card.has-paper {
  position: relative;
  overflow: hidden;
  background-color: #fff;
  background-size: cover;
  background-position: center;
}
.tree-card.has-paper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.84);
  pointer-events: none;
}
.tree-card.has-paper > * {
  position: relative;
  z-index: 1;
}
.sign-report-card {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 214, 186, 0.55), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(186, 224, 216, 0.7), transparent 46%),
    #fffdf8;
  box-shadow: var(--shadow-sm);
}
.sign-report-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.sign-report-card p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.sign-bar-row {
  display: grid;
  grid-template-columns: 52px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 12px;
  color: #5C675F;
}
.sign-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}
.sign-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #F3C7A4, #7EBEB2);
}
.diary-bottom-art,
.sorrow-page-wave {
  display: block;
  width: 100%;
  margin-top: 8px;
  border-radius: 16px;
}
.sorrow-scene-card {
  background-image: none;
  background-color: #8EBFB4;
  padding: 0;
  min-height: 280px;
}
.sorrow-top-banner {
  min-height: 280px;
}
.sorrow-banner-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.sorrow-scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(204, 234, 227, 0.2) 0%, rgba(30, 48, 62, 0.5) 100%);
}
.sorrow-scene-card .sorrow-top-pills,
.sorrow-scene-card .sorrow-house-title {
  position: relative;
  z-index: 2;
  margin-left: 18px;
  margin-right: 18px;
}
.sorrow-scene-card .sorrow-top-pills {
  margin-top: 18px;
}
.sorrow-scene-card .sorrow-house-title {
  margin-top: 72px;
  margin-bottom: 28px;
}
.sorrow-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
  height: 46px;
  object-fit: cover;
  object-position: center bottom;
}
.letter-call {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8A5A3A;
  font-weight: 600;
}
.letter-open-day {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #FFF4E4;
  color: #B86A32;
  font-size: 12px;
  font-weight: 700;
}
.museum-badge {
  background: rgba(255, 248, 236, 0.92);
  color: #8A6230;
}
.museum-badge img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.letter-attach {
  margin-top: 12px;
}
.letter-attach video,
.letter-attach audio {
  width: 100%;
  margin-top: 8px;
}
.interact-friends-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.interact-friends-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.drawer-apk-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
