/* ===== 基础变量 ===== */
:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --text: #4A3F35;
  --text-soft: #9A8D7E;
  --text-faint: #C4B8A8;

  --green: #7BC47F;
  --green-deep: #5BA85F;
  --green-soft: #E3F4E4;

  --orange: #FFB08A;
  --orange-deep: #F09060;
  --orange-soft: #FFE8DA;

  --purple: #B39DDB;
  --purple-deep: #9575CD;
  --purple-soft: #EFE6F9;

  --shadow: 0 6px 20px rgba(180, 150, 110, 0.10);
  --shadow-hover: 0 12px 32px rgba(180, 150, 110, 0.16);
  --radius: 24px;
  --radius-sm: 16px;
}

/* ===== 深色模式变量（跟随系统亮暗） ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #221E1A;
    --card: #2C2722;
    --text: #F0E6D8;
    --text-soft: #B0A598;
    --text-faint: #8A7F72;
    --green-soft: #2A3D2B;
    --orange-soft: #3D2E25;
    --purple-soft: #2E2835;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

/* ===== 深色模式变量（JS 切换 body.theme-dark，与系统暗色一致） ===== */
body.theme-dark {
  --green-soft: #2A3D2B;
  --orange-soft: #3D2E25;
  --purple-soft: #2E2835;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.45);
}


* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 12%, rgba(255, 176, 138, 0.12) 0%, transparent 38%),
    radial-gradient(circle at 88% 70%, rgba(123, 196, 127, 0.12) 0%, transparent 38%),
    radial-gradient(circle at 50% 95%, rgba(179, 157, 219, 0.10) 0%, transparent 42%);
  background-attachment: fixed;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Hero 顶部区 ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 64px 20px 48px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(44px);
  opacity: 0.55;
}
.blob-1 {
  width: 210px; height: 210px;
  background: var(--green-soft);
  top: -40px; left: 8%;
  animation: float 9s ease-in-out infinite;
}
.blob-2 {
  width: 190px; height: 190px;
  background: var(--orange-soft);
  top: 10px; right: 10%;
  animation: float 11s ease-in-out infinite reverse;
}
.blob-3 {
  width: 170px; height: 170px;
  background: var(--purple-soft);
  bottom: -30px; left: 44%;
  animation: float 13s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -16px) scale(1.06); }
}

.hero-content { position: relative; z-index: 1; }

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }
.dot-purple { background: var(--purple); }

.hero-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--green-deep), var(--orange-deep), var(--purple-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 6px;
}

.hero-tag {
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 1px;
}

/* ===== 模块导航条（sticky）===== */
.modnav {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -20px 32px;
  padding: 12px 20px;
  background: rgba(255, 248, 240, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 18px rgba(180, 150, 110, 0.06);
  border-bottom: 1px dashed rgba(180, 150, 110, 0.14);
}

.modnav-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
.modnav-inner::-webkit-scrollbar { display: none; }

.modnav-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  background: var(--card);
  border-radius: 100px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.modnav-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--text);
}
.modnav-chip:active { transform: translateY(0); }

.chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.chip-green { background: var(--green); }
.chip-orange { background: var(--orange); }
.chip-purple { background: var(--purple); }

/* ===== Main 主体 ===== */
.main { padding-bottom: 40px; }

.section { margin-bottom: 48px; scroll-margin-top: 76px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.section-tag {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--card);
  padding: 4px 12px;
  border-radius: 100px;
  box-shadow: var(--shadow);
}

/* ===== 动态卡片 ===== */
.dynamics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 720px) {
  .dynamics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dyn-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.dyn-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.dyn-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: var(--author-color, var(--green));
  opacity: 0.7;
  border-radius: var(--radius) var(--radius) 0 0;
}

.dyn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: 4px;
}

.author-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--author-color, #ccc);
  box-shadow: 0 0 0 3px var(--author-soft, #f5f5f5);
}

.author-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.dyn-time {
  font-size: 12px;
  color: var(--text-faint);
}

.link-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, var(--author-soft, #fafafa), #ffffff 60%);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: transform 0.2s;
  position: relative;
}
.link-card:hover { transform: scale(1.015); }

.link-card::after {
  content: "🔗";
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 18px;
  opacity: 0.45;
}

.link-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.45;
  padding-right: 28px;
}

.link-url {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
  word-break: break-all;
}

.link-summary {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.65;
}

.chat-bubble {
  background: var(--author-soft, #f5f5f5);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
}

.quote-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  padding: 16px 20px 10px;
  line-height: 1.85;
  position: relative;
}
.quote-text::before {
  content: "\201C";
  font-size: 44px;
  color: var(--author-color, #ccc);
  opacity: 0.35;
  position: absolute;
  top: 0;
  left: 8px;
  font-family: Georgia, serif;
  line-height: 1;
}
.quote-text::after {
  content: "\201D";
  font-size: 44px;
  color: var(--author-color, #ccc);
  opacity: 0.35;
  position: absolute;
  bottom: -12px;
  right: 10px;
  font-family: Georgia, serif;
  line-height: 1;
}

/* ===== 纪念日 ===== */
.anni-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.anni-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.anni-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.anni-upcoming {
  background: linear-gradient(135deg, #FFF8F0, #FFFFFF 45%, var(--green-soft));
}

.anni-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  background: linear-gradient(135deg, var(--green), var(--orange));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 100px;
  box-shadow: 0 3px 10px rgba(123, 196, 127, 0.35);
  letter-spacing: 0.5px;
}

.anni-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
}

.anni-info {
  flex: 1;
  min-width: 0;
}

.anni-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.anni-date {
  font-size: 13px;
  color: var(--text-soft);
}

.anni-note {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
}

.anni-countdown {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
  padding: 7px 15px;
  background: var(--bg);
  border-radius: 100px;
  flex-shrink: 0;
}

.countdown-active {
  background: linear-gradient(135deg, var(--green), var(--orange));
  color: #fff;
  box-shadow: 0 3px 12px rgba(123, 196, 127, 0.3);
}

/* ===== 留言墙 ===== */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.msg-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 5px;
  height: 100%;
  background: var(--author-color, var(--green));
  opacity: 0.75;
  border-radius: var(--radius) 0 0 var(--radius);
}
.msg-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.msg-emoji {
  font-size: 22px;
  margin-right: 6px;
  vertical-align: middle;
}

.msg-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background: var(--author-soft, #f8f5f0);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 18px;
}

/* ===== 共同目标 ===== */
.goals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  .goals-grid { grid-template-columns: repeat(2, 1fr); }
}

.goal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.goal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.goal-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.goal-emoji {
  font-size: 22px;
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
  flex-shrink: 0;
}

.goal-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.goal-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}

.goal-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.goal-bar {
  flex: 1;
  height: 10px;
  background: #F3EBDE;
  border-radius: 100px;
  overflow: hidden;
}
.goal-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--green), var(--orange) 60%, var(--purple));
  transition: width 0.6s ease;
}

.goal-percent {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 38px;
  text-align: right;
}

.goal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-faint);
}

.goal-members {
  display: flex;
  align-items: center;
  gap: 6px;
}
.goal-member-dots {
  display: inline-flex;
  margin-left: 4px;
}
.goal-member-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-left: -4px;
  border: 2px solid #fff;
}

.goal-deadline {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}

/* ===== 打卡 / 习惯 ===== */
.checkins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) {
  .checkins-grid { grid-template-columns: repeat(3, 1fr); }
}

.checkin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px 52px; /* 底部留空间给通栏打卡按钮 */
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.checkin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.checkin-emoji {
  font-size: 26px;
  margin-bottom: 6px;
}

.checkin-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.checkin-days {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--green-deep), var(--orange-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}
.checkin-days-label {
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.checkin-last {
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.checkin-members {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.checkin-member-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
}

/* ===== 相册 / 照片墙 ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 820px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  background: var(--card);
}
.gallery-item:hover {
  transform: translateY(-3px) rotate(-0.6deg);
  box-shadow: var(--shadow-hover);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
}

.gallery-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px 20px;
  background: rgba(40, 30, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: lockFadeIn 0.25s ease both;
}
.lightbox.show { display: flex; }

.lightbox-stage {
  max-width: 80vw;
  max-height: 72vh;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img {
  max-width: 80vw;
  max-height: 72vh;
  display: block;
}
.lightbox-stage .lb-placeholder {
  width: min(78vw, 560px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 140px;
}

.lightbox-caption {
  margin-top: 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
  max-width: 80vw;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}
.lightbox-close:hover {
  transform: rotate(90deg);
  background: #fff;
}

/* ===== 共享歌单 ===== */
.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.song-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.song-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--author-color, var(--green));
  opacity: 0.7;
}
.song-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.song-card.is-link { cursor: pointer; }
.song-card.is-link::after {
  content: "🎵";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 16px;
  opacity: 0.4;
}

.song-emoji {
  font-size: 26px;
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--author-soft, #f8f5f0);
  border-radius: 14px;
  flex-shrink: 0;
}

.song-info {
  flex: 1;
  min-width: 0;
  padding-right: 24px;
}

.song-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.song-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.song-artist {
  font-size: 12px;
  color: var(--text-faint);
}

.song-note {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}

.song-by {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.song-by .author-dot {
  width: 7px; height: 7px;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 28px 20px 48px;
  color: var(--text-soft);
  font-size: 13px;
  border-top: 1px dashed rgba(180, 150, 110, 0.18);
  margin-top: 12px;
}
.footer-main { font-weight: 600; }
.footer-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-faint);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .hero-title { font-size: 40px; letter-spacing: 2px; }
  .hero { padding: 48px 20px 36px; }
  .dyn-card { padding: 18px; }
  .anni-card {
    padding: 16px 18px;
    flex-wrap: wrap;
  }
  .anni-countdown {
    width: 100%;
    text-align: center;
  }
  .section-title { font-size: 20px; }
  .checkins-grid { gap: 10px; }
  .checkin-card { padding: 14px 12px; }
  .checkin-days { font-size: 26px; }
  .gallery-grid { gap: 10px; }
  .lightbox-stage .lb-placeholder { font-size: 96px; }
}

/* ===== 密码门（奶泡纸感风格）===== */
body.locked { overflow: hidden; }

.lock-mask {
  position: fixed; inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lockFadeIn .3s ease both;
}
.lock-mask.hidden { display: none; }

.lock-dialog {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(180, 150, 110, 0.22);
  padding: 36px 28px 28px;
  text-align: center;
  animation: lockPopIn .35s ease both;
}

.lock-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: inline-block;
  animation: lockBounce 2s ease infinite;
}

.lock-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.lock-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 22px;
}

.lock-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 18px;
  letter-spacing: 3px;
  text-align: center;
  color: var(--text);
  background: #FFFDF9;
  border: 2px solid #F0E6D8;
  border-radius: 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.lock-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}
.lock-input.err {
  border-color: #F87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
  animation: lockShake .3s ease;
}

.lock-err {
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  color: #F87171;
  opacity: 0;
  transition: opacity .2s ease;
}
.lock-err.show { opacity: 1; }

.lock-remember {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.lock-remember input { accent-color: var(--green); }

.lock-btn {
  margin-top: 20px;
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--green), var(--orange));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 8px 20px rgba(123, 196, 127, 0.30);
}
.lock-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(123, 196, 127, 0.40); }
.lock-btn:active { transform: translateY(0); }

@keyframes lockFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lockPopIn {
  from { transform: scale(0.92) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes lockBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
/* ===== 留言墙补充（GLM 生成） ===== */
.msg-bubble {
  display: inline-flex;
  gap: 6px;
  background: var(--author-soft);
  padding: 12px 16px;
  border-radius: 16px;
  margin-left: 8px;
  font-size: 15px;
  line-height: 1.8;
}

.msg-emoji {
  font-size: 18px;
}

/* ===== v0.3 管理 UI 样式（追加到 style.css 末尾）===== */

/* ---------- 悬浮齿轮按钮 ---------- */
#adminFab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FFFCF7;
  border: none;
  box-shadow: 0 6px 20px rgba(123, 196, 127, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  transition: transform 0.45s cubic-bezier(.4, 1.4, .6, 1), background 0.3s, box-shadow 0.3s, color 0.3s;
  color: #7BC47F;
}
#adminFab:hover {
  transform: rotate(90deg) scale(1.06);
  box-shadow: 0 10px 28px rgba(123, 196, 127, 0.28), 0 4px 12px rgba(0, 0, 0, 0.08);
}
#adminFab.in-admin {
  background: linear-gradient(135deg, #7BC47F, #5fae62);
  color: #fff;
  box-shadow: 0 6px 22px rgba(123, 196, 127, 0.45);
}
#adminFab.in-admin::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFB08A;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 176, 138, 0.3);
}

/* ---------- 管理提示条 ---------- */
.admin-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 20px;
  background: rgba(255, 252, 247, 0.85);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(123, 196, 127, 0.18);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
  font-size: 13px;
  color: #5a5650;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(.4, 1.2, .6, 1);
}
.admin-bar.show {
  transform: translateY(0);
}
.admin-bar-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.admin-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7BC47F;
  box-shadow: 0 0 0 3px rgba(123, 196, 127, 0.22);
  animation: adminPulse 1.6s ease-in-out infinite;
}
@keyframes adminPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.admin-bar-accent {
  color: #B39DDB;
  font-weight: 600;
}
.admin-exit-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(179, 157, 219, 0.4);
  background: #fff;
  color: #B39DDB;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-exit-btn:hover {
  background: #EFE6F9;
  color: #8e6fc0;
  border-color: #B39DDB;
  transform: translateY(-1px);
}

/* ---------- 操作按钮（添加/编辑/删除） ---------- */
.admin-add,
.admin-edit,
.admin-del {
  position: relative;
  z-index: 1001; /* 高于 sticky 模块导航条，避免被遮挡点不到 */
}
.admin-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(123, 196, 127, 0.35);
  background: #fff;
  color: #5a8a5d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(123, 196, 127, 0.08);
  white-space: nowrap;
}
.admin-add:hover {
  background: #E3F4E4;
  border-color: #7BC47F;
  color: #4a7a4d;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(123, 196, 127, 0.2);
}

.admin-edit,
.admin-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  opacity: 0.9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.admin-edit:hover {
  background: #EFE6F9;
  border-color: #B39DDB;
  color: #8e6fc0;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(179, 157, 219, 0.22);
}
.admin-del:hover {
  background: #FFE8DA;
  border-color: #FFB08A;
  color: #d97a4a;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(255, 176, 138, 0.25);
}

.admin-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
  z-index: 5;
}

/* 卡片内操作按钮：嵌在卡片右上角内部（不悬浮在卡片外） */
.dyn-card,
.anni-card,
.msg-card,
.goal-card,
.checkin-card,
.gallery-item,
.song-card {
  position: relative;
}
.card-admin-btns {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
}
.card-admin-btns .admin-edit {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: #9a958c;
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
  transition: all 0.2s;
}
.card-admin-btns .admin-edit:hover {
  background: #EFE6F9;
  border-color: #B39DDB;
  color: #8e6fc0;
  opacity: 1;
  transform: scale(1.08);
}
body.admin-mode .admin-actions {
  opacity: 1;
}

/* 管理模式下卡片定位适配 */
body.admin-mode .dyn-card,
body.admin-mode .anni-card,
body.admin-mode .msg-card,
body.admin-mode .goal-card,
body.admin-mode .checkin-card,
body.admin-mode .gallery-item,
body.admin-mode .song-card {
  position: relative;
}
body.admin-mode .section-head {
  position: relative;
  padding-right: 92px;
}
body.admin-mode .section-head .admin-add {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- 通用 modal 遮罩 ---------- */
.admin-mask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(90, 86, 80, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.admin-mask.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- 管理密码 modal ---------- */
#adminMask .admin-dialog {
  width: 100%;
  max-width: 360px;
  background: #FFFCF7;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(123, 196, 127, 0.12);
  text-align: center;
  transform: translateY(14px) scale(0.95);
  transition: transform 0.32s cubic-bezier(.4, 1.4, .6, 1);
}
#adminMask.show .admin-dialog {
  transform: translateY(0) scale(1);
}
.admin-dialog-icon {
  font-size: 40px;
  margin-bottom: 6px;
  line-height: 1;
}
.admin-dialog-title {
  font-size: 22px;
  font-weight: 700;
  color: #3a3833;
  margin: 0 0 6px;
}
.admin-dialog-sub {
  font-size: 13px;
  color: #9a958c;
  margin: 0 0 20px;
}
#adminInput {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  font-size: 15px;
  color: #3a3833;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  text-align: center;
  letter-spacing: 2px;
}
#adminInput:focus {
  border-color: #7BC47F;
  box-shadow: 0 0 0 3px rgba(123, 196, 127, 0.15);
}
#adminInput.err {
  border-color: #e8826a;
  animation: adminShake 0.42s;
}
@keyframes adminShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
#adminErr {
  font-size: 12px;
  color: #e8826a;
  margin-top: 10px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
#adminErr.show {
  opacity: 1;
}
#adminBtn {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7BC47F, #5fae62);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  letter-spacing: 1px;
}
#adminBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(123, 196, 127, 0.4);
}
#adminBtn:active {
  transform: translateY(0);
}

/* ---------- 编辑表单 modal ---------- */
#editModal .edit-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #FFFCF7;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(179, 157, 219, 0.12);
  transform: translateY(14px) scale(0.95);
  transition: transform 0.32s cubic-bezier(.4, 1.4, .6, 1);
  overflow: hidden;
}
/* 表单区在弹窗内滚动，底部取消/保存按钮固定可见（修复长表单按钮被挤出弹窗点不到） */
#editModal .edit-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 26px 8px;
}
#editModal.show .edit-dialog {
  transform: translateY(0) scale(1);
}
.edit-head {
  padding: 22px 26px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}
.edit-title {
  font-size: 20px;
  font-weight: 700;
  color: #3a3833;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.edit-title-emoji {
  font-size: 22px;
}
.edit-sub {
  font-size: 12px;
  color: #9a958c;
  margin-top: 4px;
}
.edit-body {
  padding: 18px 26px 4px;
  overflow-y: auto;
  flex: 1;
}
.edit-foot {
  padding: 14px 26px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

/* ---------- 表单字段 ---------- */
.form-field {
  margin-bottom: 16px;
}
.form-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5a5650;
  margin-bottom: 6px;
}
.form-field-label .req {
  color: #e8826a;
  margin-left: 2px;
}
.form-field input[type="text"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field input[type="datetime-local"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  font-size: 14px;
  color: #3a3833;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}
.form-field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #B39DDB;
  box-shadow: 0 0 0 3px rgba(179, 157, 219, 0.15);
}
.form-field input[type="date"]:focus,
.form-field input[type="datetime-local"]:focus {
  border-color: #FFB08A;
  box-shadow: 0 0 0 3px rgba(255, 176, 138, 0.15);
}
.form-field input[type="number"]:focus {
  border-color: #7BC47F;
  box-shadow: 0 0 0 3px rgba(123, 196, 127, 0.15);
}
.form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%239a958c' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-hint {
  font-size: 11px;
  color: #b5b0a6;
  margin-top: 4px;
}

/* ---------- checkbox 组（成员选择） ---------- */
.form-checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #5a5650;
  transition: all 0.2s;
  user-select: none;
}
.form-checkbox input {
  display: none;
}
.form-checkbox .checkbox-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ccc;
  transition: all 0.2s;
  flex-shrink: 0;
}
.form-checkbox[data-author="刘一凯"] input:checked + .checkbox-dot {
  border-color: #7BC47F;
  background: #7BC47F;
  box-shadow: 0 0 0 3px rgba(123, 196, 127, 0.2);
}
.form-checkbox[data-author="王欣雨"] input:checked + .checkbox-dot {
  border-color: #FFB08A;
  background: #FFB08A;
  box-shadow: 0 0 0 3px rgba(255, 176, 138, 0.2);
}
.form-checkbox[data-author="林元辉"] input:checked + .checkbox-dot {
  border-color: #B39DDB;
  background: #B39DDB;
  box-shadow: 0 0 0 3px rgba(179, 157, 219, 0.2);
}
.form-checkbox[data-author="刘一凯"]:has(input:checked) {
  background: #E3F4E4;
  border-color: #7BC47F;
  color: #4a7a4d;
}
.form-checkbox[data-author="王欣雨"]:has(input:checked) {
  background: #FFE8DA;
  border-color: #FFB08A;
  color: #d97a4a;
}
.form-checkbox[data-author="林元辉"]:has(input:checked) {
  background: #EFE6F9;
  border-color: #B39DDB;
  color: #8e6fc0;
}

/* 渐变选择预览块（相册 bg） */
.form-gradient-preview {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  margin-top: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  transition: background 0.3s;
}

/* ---------- 表单底部按钮 ---------- */
.btn-cancel,
.btn-save {
  padding: 10px 22px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-cancel {
  background: #f5f1ea;
  color: #6a655c;
}
.btn-cancel:hover {
  background: #ece6db;
  transform: translateY(-1px);
}
.btn-save {
  background: linear-gradient(135deg, #7BC47F, #5fae62);
  color: #fff;
  box-shadow: 0 4px 12px rgba(123, 196, 127, 0.28);
}
.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(123, 196, 127, 0.38);
}
.btn-save:active {
  transform: translateY(0);
}
.btn-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- 删除确认 modal ---------- */
#confirmModal .confirm-dialog {
  width: 100%;
  max-width: 340px;
  background: #FFFCF7;
  border-radius: 24px;
  padding: 28px 26px 22px;
  box-shadow: 0 20px 60px rgba(232, 130, 106, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
  transform: translateY(14px) scale(0.95);
  transition: transform 0.32s cubic-bezier(.4, 1.4, .6, 1);
}
#confirmModal.show .confirm-dialog {
  transform: translateY(0) scale(1);
}
.confirm-icon {
  font-size: 38px;
  margin-bottom: 8px;
  line-height: 1;
}
.confirm-text {
  font-size: 16px;
  color: #3a3833;
  margin: 0 0 6px;
  font-weight: 700;
}
.confirm-sub {
  font-size: 13px;
  color: #9a958c;
  margin: 0 0 22px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-actions .btn-cancel {
  flex: 1;
  padding: 10px;
}
.btn-confirm-del {
  flex: 1;
  padding: 10px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ff9a7b, #e8694a);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(232, 105, 74, 0.28);
  font-family: inherit;
}
.btn-confirm-del:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 105, 74, 0.4);
}
.btn-confirm-del:active {
  transform: translateY(0);
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  #adminFab {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
  .admin-bar {
    padding: 8px 12px;
    font-size: 12px;
    gap: 8px;
  }
  .admin-bar-text {
    flex: 1;
  }
  .admin-exit-btn {
    padding: 5px 12px;
    font-size: 11px;
  }
  #editModal .edit-dialog,
  #adminMask .admin-dialog,
  #confirmModal .confirm-dialog {
    max-width: 100%;
  }
  #editModal .edit-dialog {
    max-height: 92vh;
  }
  .edit-head,
  .edit-body,
  .edit-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-checkbox-group {
    gap: 8px;
  }
  .form-checkbox {
    padding: 6px 12px;
    font-size: 12px;
  }
  body.admin-mode .section-head {
    padding-right: 80px;
  }
  .admin-actions {
    right: 8px;
    bottom: 8px;
  }
}
/* ===== C3 移动端打磨 ===== */
html {
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 640px) {
  /* 1. 心情墙卡片 */
  .mood-member {
    min-width: 100% !important;
    padding: 12px !important;
    border-radius: 12px !important;
  }
  .mood-member .mood-emoji {
    font-size: 30px !important;
  }

  /* 2. AI 面板 */
  #aiPanel {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 70vh !important;
    max-height: 70vh !important;
    border-radius: 20px 20px 0 0 !important;
  }
  #aiPanel .ai-input-area,
  #aiPanel .input-area,
  #aiPanel > div:last-child {
    padding: 14px !important;
  }
  #aiInput {
    min-height: 44px !important;
  }
  #aiSendBtn {
    min-height: 44px !important;
    min-width: 64px !important;
  }
  #aiMessages {
    overscroll-behavior: contain !important;
  }

  /* 3. AI 悬浮按钮 & 主FAB — 三个按钮水平排开 */
  #aiFab {
    right: calc(18px + 56px + 12px + 54px + 12px) !important;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    width: 52px !important;
    height: 52px !important;
  }
  #fabAdd {
    right: calc(18px + 54px + 12px) !important;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #adminFab {
    right: calc(18px + 54px + 12px) !important;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 4. 年度回顾弹窗 */
  #annualOverlay {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  #annualOverlay .confirm-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
  }
  #annualOverlay .annual-num {
    font-size: 34px !important;
  }

  /* 5. FAB 菜单 */
  #fabMenu {
    max-height: 60vh !important;
    overflow-y: auto !important;
  }
  #fabMenu .fab-item {
    padding: 12px 14px !important;
    font-size: 15px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  /* 6. 全局移动端细节 */
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
  button,
  .fab-item,
  .comment-btn,
  input,
  select,
  textarea {
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  .edit-dialog label {
    font-size: 13px !important;
  }
  .edit-dialog .form-input,
  .edit-dialog textarea {
    min-height: 44px !important;
  }

  /* 心情选择弹层 */
  #moodPicker {
    width: 92vw !important;
    max-width: 92vw !important;
    gap: 8px !important;
  }
  #moodPicker .mood-pick {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 26px !important;
  }
}


/* ============================================================
 * 三小只门户 · 聊天记录模块样式（追加到 style.css 末尾）
 * 奶泡纸感：奶油底、大圆角、柔阴影、作者色点缀
 * ============================================================ */

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* loading / empty / error */
.chat-loading,
.chat-empty,
.chat-error {
  padding: 36px 16px;
  text-align: center;
  font-size: 14px;
  color: #a89c84;
  background: #fffdf6;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(120, 110, 90, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.03);
}
.chat-error { color: #d97757; }

/* 一天的分组容器 */
.chat-day {
  position: relative;
  background: #fffdf6;
  border-radius: 22px;
  padding: 14px 16px 16px;
  box-shadow: 0 8px 22px rgba(120, 110, 90, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

/* 日期分组头 */
.chat-day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(120, 110, 90, 0.18);
}

.chat-day-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f6c177;
  box-shadow: 0 0 0 3px rgba(246, 193, 119, 0.22);
  flex: 0 0 auto;
}

.chat-day-label {
  font-size: 15px;
  font-weight: 700;
  color: #6b5b3e;
  letter-spacing: 0.4px;
}

.chat-day-count {
  margin-left: auto;
  font-size: 12px;
  color: #b3a585;
  background: rgba(246, 193, 119, 0.16);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
}

/* 消息网格：桌面两列 */
.chat-day-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* 单条消息卡片 */
.chat-card {
  --chat-author-color: #8a7f6a;
  --chat-author-bg: #f3efe6;
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 12px 11px;
  border: 1px solid rgba(0, 0, 0, 0.035);
  border-left: 3px solid var(--chat-author-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.chat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(120, 110, 90, 0.1);
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 复用全局 .author-badge；若全局未给样式，这里兜底 */
.chat-meta .author-badge {
  font-size: 12px;
  line-height: 1.6;
  padding: 1px 9px;
  border-radius: 999px;
  font-weight: 700;
  background: var(--chat-author-bg);
  color: var(--chat-author-color);
  white-space: nowrap;
}

.chat-time {
  font-size: 11px;
  color: #b0a890;
  white-space: nowrap;
}

.chat-body {
  font-size: 14px;
  line-height: 1.6;
  color: #3d3526;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* 加载更多按钮 */
.chat-loadmore {
  align-self: center;
  margin: 4px auto 0;
  padding: 11px 30px;
  font-size: 14px;
  font-weight: 700;
  color: #6b5b3e;
  background: #fffdf6;
  border: 1px solid rgba(246, 193, 119, 0.45);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(120, 110, 90, 0.07);
  transition: all 0.18s ease;
  letter-spacing: 0.5px;
}

.chat-loadmore:hover {
  background: #f6c177;
  color: #fff;
  border-color: #f6c177;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(246, 193, 119, 0.4);
}

.chat-loadmore:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(246, 193, 119, 0.35);
}

/* 结束标记 */
.chat-end {
  text-align: center;
  font-size: 12px;
  color: #c2b89e;
  padding: 14px 0 4px;
  letter-spacing: 1.5px;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .chat-list { gap: 14px; }

  .chat-day {
    padding: 12px 12px 14px;
    border-radius: 18px;
  }

  .chat-day-head {
    padding: 2px 2px 10px;
    margin-bottom: 10px;
  }

  .chat-day-label { font-size: 14px; }

  /* 窄屏单列，保证可读性 */
  .chat-day-items {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chat-card {
    padding: 9px 11px 10px;
    border-radius: 12px;
  }

  .chat-body {
    font-size: 13.5px;
    line-height: 1.55;
  }

  .chat-loadmore {
    width: 100%;
    padding: 12px 16px;
  }
}

/* 极小屏：日期头紧凑 */
@media (max-width: 360px) {
  .chat-day-count { font-size: 11px; padding: 2px 7px; }
  .chat-time { font-size: 10.5px; }
}

/* ============ 聊天模块：收起 / 展开 ============ */
.chat-list.collapsed {
  display: none;
}

/* ============ 聊天模块：搜索 ============ */
/* 结果计数 */
.chat-search-count {
  margin: 8px 0 0;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 6px;
  display: inline-block;
}
.chat-search-count[hidden] { display: none; }

/* 搜索结果容器：独立于 #chatList，避免破坏原分页 DOM 与事件 */
.chat-search-results { margin-top: 12px; }
.chat-search-results[hidden] { display: none; }

/* 空结果 */
.chat-search-results .chat-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* 关键词高亮 */
mark.chat-highlight {
  background: #fef08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, .35);
}

/* 搜索模式下原列表隐藏（兜底，配合 [hidden]） */
.chat-list.searching { display: none; }

/* 搜索框聚焦态 */
#chatSearch {
  transition: border-color .2s, box-shadow .2s;
}
#chatSearch:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .2);
}

/* ============ 聊天模块：工具区（搜索框 + 收起按钮） ============ */
.chat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.chat-search {
  width: 200px;
  padding: 6px 12px;
  font-size: 13px;
  color: #4a3f36;
  background: #fffdf6;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 999px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, width .2s;
}
.chat-search:focus {
  width: 260px;
  border-color: #f6c177;
  box-shadow: 0 0 0 3px rgba(246,193,119,.2);
}
.chat-toggle {
  cursor: pointer;
  background: #fff8f0;
  border: 1px solid #ecdcc6;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  color: #8a6d4f;
  transition: all .2s;
  white-space: nowrap;
}
.chat-toggle:hover {
  background: #ffefd9;
  border-color: #d9c4a3;
}
@media (max-width: 640px) {
  .chat-tools { flex-wrap: wrap; }
  .chat-search { width: 100%; }
  .chat-search:focus { width: 100%; }
}

/* ===== v3.0 新增模块样式 ===== */

/* ---------- 话题广场 ---------- */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topic-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.topic-question {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.topic-question::before {
  content: "💬";
  font-size: 20px;
  flex-shrink: 0;
}

.topic-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.topic-answer {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

.topic-answer-form {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.topic-answer-form textarea {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  border: 1.5px solid #F0E6D8;
  border-radius: 14px;
  background: #FFFDF9;
  color: var(--text);
  outline: none;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.topic-answer-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.topic-answer-form button {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  align-self: flex-start;
}
.topic-answer-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 196, 127, 0.3);
}

/* ---------- 投票模块 ---------- */
.vote-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 720px) {
  .vote-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vote-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.vote-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.vote-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vote-title::before {
  content: "📊";
  font-size: 20px;
}

.vote-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vote-option {
  position: relative;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}
.vote-option:hover {
  border-color: var(--orange);
  transform: translateY(-1px);
}
.vote-option.voted {
  border-color: var(--green);
  background: var(--card);
  cursor: default;
}
.vote-option.voted:hover {
  transform: none;
}

.vote-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green-soft), var(--orange-soft));
  z-index: -1;
  transition: width 0.6s ease;
  border-radius: var(--radius-sm);
}

.vote-count {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--card);
  padding: 2px 8px;
  border-radius: 100px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ---------- 心愿单 ---------- */
.wish-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .wish-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.wish-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.wish-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.wish-check {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  background: var(--bg);
}
.wish-check:hover {
  border-color: var(--green);
}
.wish-check.checked {
  background: var(--green);
  border-color: var(--green);
}
.wish-check.checked::after {
  content: "✓";
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}

.wish-content {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.wish-card.wish-done .wish-content {
  text-decoration: line-through;
  color: var(--text-faint);
}
.wish-card.wish-done .wish-check {
  background: var(--green-soft);
  border-color: var(--green-soft);
}
.wish-card.wish-done .wish-check::after {
  color: var(--green-deep);
}

/* ---------- 回忆 / 那年今日 ---------- */
.memories-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.on-this-day {
  background: linear-gradient(135deg, var(--purple-soft), var(--card) 60%);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed var(--purple);
}
.on-this-day-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.on-this-day-text {
  font-size: 14px;
  color: var(--purple-deep);
  font-weight: 600;
  line-height: 1.6;
}

.memory-timeline {
  position: relative;
  padding-left: 28px;
}
.memory-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--orange), var(--purple));
  opacity: 0.3;
  border-radius: 2px;
}

.memory-item {
  position: relative;
  margin-bottom: 20px;
}
.memory-item:last-child {
  margin-bottom: 0;
}
.memory-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.memory-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.memory-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}
.memory-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-deep);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.memory-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

/* ---------- 全局搜索 ---------- */
.search-wrap {
  margin-bottom: 32px;
  position: sticky;
  top: 72px;
  z-index: 40;
}

.global-search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 15px;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: 100px;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239A8D7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'></circle><line x1='21' y1='21' x2='16.65' y2='16.65'></line></svg>");
  background-repeat: no-repeat;
  background-position: 18px center;
  box-sizing: border-box;
}
.global-search-input::placeholder {
  color: var(--text-faint);
}
.global-search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft), var(--shadow);
}

.global-search-results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.18s, box-shadow 0.18s;
  border-left: 4px solid transparent;
}
.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-left-color: var(--orange);
}
.search-result-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}
.search-result-content {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-content em {
  font-style: normal;
  color: var(--orange-deep);
  background: var(--orange-soft);
  padding: 0 4px;
  border-radius: 4px;
}

.search-hint {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-faint);
  font-size: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- admin-add-slot 适配 ---------- */
.section-head .admin-add-slot {
  margin-left: auto;
}
body.admin-mode .section-head .admin-add-slot {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
body.admin-mode .section-head {
  position: relative;
  padding-right: 92px;
}

/* ---------- 移动端自适应 ---------- */
@media (max-width: 640px) {
  .topic-card,
  .vote-card,
  .wish-card,
  .memory-card {
    padding: 16px 18px;
  }
  
  .topic-answer-form {
    flex-direction: column;
  }
  .topic-answer-form button {
    width: 100%;
  }

  .search-wrap {
    position: relative;
    top: 0;
  }

  .memory-timeline {
    padding-left: 24px;
  }
  .memory-item::before {
    left: -24px;
    width: 14px;
    height: 14px;
  }
}
/* ===== v3.0 新增模块样式 ===== */

/* ---------- 话题广场 ---------- */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topic-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.topic-question {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.topic-question::before {
  content: "💬";
  font-size: 20px;
  flex-shrink: 0;
}

.topic-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.topic-answer {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

.topic-answer-form {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.topic-answer-form textarea {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  border: 1.5px solid #F0E6D8;
  border-radius: 14px;
  background: #FFFDF9;
  color: var(--text);
  outline: none;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.topic-answer-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.topic-answer-form button {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  align-self: flex-start;
}
.topic-answer-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 196, 127, 0.3);
}

/* ---------- 投票模块 ---------- */
.vote-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 720px) {
  .vote-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vote-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.vote-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.vote-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vote-title::before {
  content: "📊";
  font-size: 20px;
}

.vote-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vote-option {
  position: relative;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}
.vote-option:hover {
  border-color: var(--orange);
  transform: translateY(-1px);
}
.vote-option.voted {
  border-color: var(--green);
  background: var(--card);
  cursor: default;
}
.vote-option.voted:hover {
  transform: none;
}

.vote-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green-soft), var(--orange-soft));
  z-index: -1;
  transition: width 0.6s ease;
  border-radius: var(--radius-sm);
}

.vote-count {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--card);
  padding: 2px 8px;
  border-radius: 100px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ---------- 心愿单 ---------- */
.wish-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .wish-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.wish-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.wish-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.wish-check {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  background: var(--bg);
}
.wish-check:hover {
  border-color: var(--green);
}
.wish-check.checked {
  background: var(--green);
  border-color: var(--green);
}
.wish-check.checked::after {
  content: "✓";
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}

.wish-content {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.wish-card.wish-done .wish-content {
  text-decoration: line-through;
  color: var(--text-faint);
}
.wish-card.wish-done .wish-check {
  background: var(--green-soft);
  border-color: var(--green-soft);
}
.wish-card.wish-done .wish-check::after {
  color: var(--green-deep);
}

/* ---------- 回忆 / 那年今日 ---------- */
.memories-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.on-this-day {
  background: linear-gradient(135deg, var(--purple-soft), var(--card) 60%);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed var(--purple);
}
.on-this-day-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.on-this-day-text {
  font-size: 14px;
  color: var(--purple-deep);
  font-weight: 600;
  line-height: 1.6;
}

.memory-timeline {
  position: relative;
  padding-left: 28px;
}
.memory-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--orange), var(--purple));
  opacity: 0.3;
  border-radius: 2px;
}

.memory-item {
  position: relative;
  margin-bottom: 20px;
}
.memory-item:last-child {
  margin-bottom: 0;
}
.memory-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.memory-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.memory-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}
.memory-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-deep);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.memory-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

/* ---------- 全局搜索 ---------- */
.search-wrap {
  margin-bottom: 32px;
  position: sticky;
  top: 72px;
  z-index: 40;
}

.global-search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 15px;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: 100px;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239A8D7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'></circle><line x1='21' y1='21' x2='16.65' y2='16.65'></line></svg>");
  background-repeat: no-repeat;
  background-position: 18px center;
  box-sizing: border-box;
}
.global-search-input::placeholder {
  color: var(--text-faint);
}
.global-search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft), var(--shadow);
}

.global-search-results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.18s, box-shadow 0.18s;
  border-left: 4px solid transparent;
}
.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-left-color: var(--orange);
}
.search-result-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}
.search-result-content {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-content em {
  font-style: normal;
  color: var(--orange-deep);
  background: var(--orange-soft);
  padding: 0 4px;
  border-radius: 4px;
}

.search-hint {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-faint);
  font-size: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- admin-add-slot 适配 ---------- */
.section-head .admin-add-slot {
  margin-left: auto;
}
body.admin-mode .section-head .admin-add-slot {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
body.admin-mode .section-head {
  position: relative;
  padding-right: 92px;
}

/* ---------- 移动端自适应 ---------- */
@media (max-width: 640px) {
  .topic-card,
  .vote-card,
  .wish-card,
  .memory-card {
    padding: 16px 18px;
  }
  
  .topic-answer-form {
    flex-direction: column;
  }
  .topic-answer-form button {
    width: 100%;
  }

  .search-wrap {
    position: relative;
    top: 0;
  }

  .memory-timeline {
    padding-left: 24px;
  }
  .memory-item::before {
    left: -24px;
    width: 14px;
    height: 14px;
  }
}
/* ============================================================
   侧边悬浮导航 v3.1（追加段）
   - 桌面端右侧胶囊竖排
   - 移动端右下汉堡 + 右侧抽屉
   - 全部使用 CSS 变量，自动跟随亮暗模式
   ============================================================ */

/* 平滑滚动（锚点跳转） */
html {
  scroll-behavior: smooth;
}

/* 隐藏原顶部 chips 导航（保留结构，不影响其他功能） */
.modnav {
  display: none !important;
}

/* ---------- 彩色圆点（共用） ---------- */
.side-nav-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.side-nav-dot-green  { background: var(--green); }
.side-nav-dot-orange { background: var(--orange); }
.side-nav-dot-purple { background: var(--purple); }

/* ============================================================
   桌面端：右侧悬浮侧边栏（≥768px）
   ============================================================ */
.side-nav {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 10px;
  min-width: 128px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow-hover), 0 0 0 1px rgba(196, 184, 168, 0.08) inset;
  border: 1px solid rgba(196, 184, 168, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  animation: sideNavFadeIn 0.5s ease 0.2s forwards;
}

/* 顶部三色渐变装饰条 */
.side-nav::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--purple));
  opacity: 0.85;
}

@keyframes sideNavFadeIn {
  to { opacity: 1; }
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 14px 8px 12px;
  border-radius: 13px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: background 0.22s ease, color 0.22s ease,
              transform 0.22s ease, box-shadow 0.22s ease;
}

.side-nav-item:hover {
  background: var(--green-soft);
  color: var(--text);
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(123, 196, 127, 0.16);
}

/* hover：圆点亮起 */
.side-nav-item:hover .side-nav-dot-green  { box-shadow: 0 0 10px var(--green); }
.side-nav-item:hover .side-nav-dot-orange { box-shadow: 0 0 10px var(--orange); }
.side-nav-item:hover .side-nav-dot-purple { box-shadow: 0 0 10px var(--purple); }

.side-nav-item:active {
  transform: translateX(-2px) scale(0.96);
}

.side-nav-item.is-active {
  background: linear-gradient(135deg, var(--green-soft), rgba(123, 196, 127, 0.06));
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(123, 196, 127, 0.14);
}

.side-nav-item.is-active .side-nav-dot {
  transform: scale(1.5);
}

.side-nav-item.is-active .side-nav-dot-green  { box-shadow: 0 0 0 4px rgba(123, 196, 127, 0.18); }
.side-nav-item.is-active .side-nav-dot-orange { box-shadow: 0 0 0 4px rgba(255, 176, 138, 0.18); }
.side-nav-item.is-active .side-nav-dot-purple { box-shadow: 0 0 0 4px rgba(179, 157, 219, 0.18); }

/* ---------- 移动端组件默认隐藏（桌面端不显示） ---------- */
.side-nav-burger,
.side-nav-drawer,
.side-nav-drawer-mask {
  display: none;
}

/* ============================================================
   移动端：汉堡按钮 + 抽屉（<768px）
   ============================================================ */
@media (max-width: 767px) {
  /* 隐藏桌面侧边栏 */
  .side-nav {
    display: none;
  }

  /* 汉堡按钮 */
  .side-nav-burger {
    display: flex;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  }

  .side-nav-burger:hover {
    transform: scale(1.06);
    background: var(--green-deep);
  }

  .side-nav-burger:active {
    transform: scale(0.96);
  }

  .side-nav-burger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.25s ease;
  }

  .side-nav-burger.is-open .side-nav-burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .side-nav-burger.is-open .side-nav-burger-line:nth-child(2) {
    opacity: 0;
  }
  .side-nav-burger.is-open .side-nav-burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* 遮罩（毛玻璃） */
  .side-nav-drawer-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(34, 30, 26, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .side-nav-drawer-mask.is-show {
    opacity: 1;
    visibility: visible;
  }

  /* 抽屉 */
  .side-nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    width: 80%;
    max-width: 320px;
    background: var(--card);
    box-shadow: var(--shadow-hover);
    border-left: 1px solid rgba(196, 184, 168, 0.22);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  .side-nav-drawer.is-open {
    transform: translateX(0);
  }

  /* 抽屉头部 */
  .side-nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(196, 184, 168, 0.2);
    flex-shrink: 0;
  }

  .side-nav-drawer-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.5px;
  }

  .side-nav-drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  }

  .side-nav-drawer-close:hover {
    background: var(--green-soft);
    color: var(--text);
    transform: rotate(90deg);
  }

  /* 抽屉菜单列表 */
  .side-nav-drawer-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .side-nav-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-soft);
    font-size: 15px;
  font-weight: 500;
  transition: background 0.22s ease, color 0.22s ease;
}

.side-nav-drawer-item:hover {
  background: var(--green-soft);
  color: var(--text);
}

.side-nav-drawer-item.is-active {
  background: var(--green-soft);
  color: var(--text);
  font-weight: 600;
}

.side-nav-drawer-item.is-active .side-nav-dot {
  transform: scale(1.45);
  box-shadow: 0 0 0 4px rgba(123, 196, 127, 0.18);
}

}
