/**
 * 小手机 — 全局样式
 * 主题：冷调柔雾 · 简约素雅
 * Palette: 低饱和冷蓝为主色，米杏为中性辅助
 */

/* ═══════ CSS 变量 · 冷调柔雾调色盘 ═══════ */

:root {
  /* ─── 核心色系：低饱和浅冷蓝（唯一主色） ─── */
  --monet-blue:        #8FAFBF;   /* 柔雾冷蓝 — 主色 */
  --monet-deepwater:   #6E919F;   /* 深冷蓝 — hover/按下 */
  --monet-lightblue:   #BCCEDA;   /* 浅冷蓝 — 浅色卡片 */
  --monet-paleblue:    #D6E2EA;   /* 极淡冷蓝 — 次要卡片 */
  --monet-ice:         #E8EFF4;   /* 冰霜蓝 — 最淡底色 */

  /* ─── 中性辅助色：米杏色 ─── */
  --cream:             #F5EFE6;   /* 米杏 — 中性辅助 */
  --cream-dark:        #EAE2D6;   /* 深米杏 — 暗区 */

  /* ─── 中性色／表面 ─── */
  --ivory:             #F7F3EE;   /* 暖白基底 — 页面底色 */
  --ink:               #3D4F5C;   /* 主文字 — 深蓝灰 */
  --ink-light:         #7D93A2;   /* 辅助文字 */
  --ink-subtle:        #A0B4C2;   /* placeholder / 最浅文字 */

  --surface-card:      #FFFFFF;   /* 卡片白 */
  --surface-page:      #F5F2EE;   /* 浅暖灰白 */
  --surface-input:     #FFFFFF;   /* 输入框白 */
  --surface-nav:       rgba(255,255,255,0.82);  /* 导航栏半透明毛玻璃 */

  /* ─── 聊天气泡 ─── */
  --bubble-mine:       var(--monet-blue);
  --bubble-other:      #FFFFFF;

  /* ─── 阴影分层(悬浮层级) ─── */
  --shadow-float-lg:   0 8px 32px rgba(100,120,135,0.12);   /* 上层卡片 — 明显柔和 */
  --shadow-float-md:   0 4px 16px rgba(100,120,135,0.08);   /* 中层卡片 */
  --shadow-float-sm:   0 2px 8px rgba(100,120,135,0.05);    /* 下层卡片 — 弱化 */
  --shadow-card:       0 2px 10px rgba(100,120,135,0.06);
  --shadow-card-hover: 0 6px 18px rgba(100,120,135,0.10);
  --shadow-nav:        0 -1px 0 rgba(0,0,0,0.04);

  /* ─── 边框 ─── */
  --border-light:      rgba(0,0,0,0.05);
  --border-separator:  rgba(0,0,0,0.035);

  /* ─── 圆角(大小差异化) ─── */
  --radius-sm:         12px;      /* 小方块卡片 */
  --radius-md:         16px;      /* 中等卡片 */
  --radius-lg:         22px;      /* 大尺寸卡片 */
  --radius-xl:         28px;      /* 特大圆角 */

  /* ─── 字体 ─── */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font: var(--font-family);
  --font-size-base:    14px;
  --font-wt-bold:      600;       /* 标题/时间加重 */
  --font-wt-medium:    400;       /* 卡片标题 */
  --font-wt-regular:   300;       /* 辅助文字 */
  --letter-spacing:    0.5px;

  /* ─── 安全区 ─── */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);

  /* ─── 过渡 ─── */
  --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1.0);

  /* ─── 桌面专用 · 柔白淡蓝调 ─── */
  --desktop-bg:        #F7FBFD;
  --desktop-bg-alt:    #EAF5FA;
  --desktop-bg-warm:   #F4F8FA;
  --desktop-deep-bg:   rgba(255,255,255,0.74);     /* 音乐卡片柔白底 */
  --desktop-card-bg:   rgba(255,255,255,0.56);
  --desktop-text-main: #344854;
  --desktop-text-aux:  #8BA1AD;

  /* ─── 桌面专用字体 · 系统无衬线 ─── */
  --font-desktop: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ═══════ 暗色模式 ═══════ */

html.dark-mode {
  --ivory:             #1a1d24;
  --surface-card:      #242730;
  --surface-page:      #1a1d24;
  --surface-input:     #2c2f3a;
  --surface-nav:       rgba(26,29,36,0.88);
  --ink:               #e4e6ea;
  --ink-light:         #a8adb8;
  --ink-subtle:        #6e7480;
  --border-light:      rgba(255,255,255,0.08);
  --border-separator:  rgba(255,255,255,0.05);
  --shadow-float-lg:   0 8px 32px rgba(0,0,0,0.25);
  --shadow-float-md:   0 4px 16px rgba(0,0,0,0.18);
  --shadow-float-sm:   0 2px 8px rgba(0,0,0,0.12);
  --shadow-card:       0 2px 12px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 6px 20px rgba(0,0,0,0.3);
  --shadow-nav:        0 -1px 0 rgba(255,255,255,0.06);
  --bubble-other:      #2c2f3a;

  /* 桌面变量暗色覆盖 */
  --desktop-bg:        #1a1d24;
  --desktop-bg-alt:    #1f222b;
  --desktop-bg-warm:   #1c1f27;
  --desktop-deep-bg:   #15181f;
  --desktop-card-bg:   rgba(36,39,48,0.56);
  --desktop-text-main: #e4e6ea;
  --desktop-text-aux:  #8a909c;
}

html.dark-mode .desktop-header-card {
  background: rgba(30,33,42,0.6);
  border-color: rgba(255,255,255,0.08);
}
html.dark-mode .desktop-time {
  color: #e4e6ea;
  text-shadow: none;
}
html.dark-mode .wechat-tabs {
  background: rgba(26,29,36,0.78);
  border-top-color: rgba(255,255,255,0.06);
}
html.dark-mode .dock {
  background: rgba(26,29,36,0.78);
  border-color: rgba(255,255,255,0.08);
}
html.dark-mode .dock-icon svg {
  stroke: rgba(255,255,255,0.5);
}
html.dark-mode .chat-list-item,
html.dark-mode .contact-item,
html.dark-mode .me-menu-item,
html.dark-mode .me-profile-card {
  background: var(--surface-card);
  border-bottom-color: var(--border-separator);
}
html.dark-mode .moment-card {
  background: var(--surface-card);
  border-bottom-color: var(--border-separator);
}
html.dark-mode .moment-likes-card {
  background: var(--surface-input);
}
html.dark-mode .moment-comment-input {
  background: var(--surface-input);
}
html.dark-mode .me-menu-title {
  background: var(--surface-page);
}
html.dark-mode .chat-list-section-header {
  background: var(--surface-page);
}
html.dark-mode .moments-list {
  background: var(--surface-page);
}

/* ═══════ 全局重置 ═══════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
  position: fixed;
  width: 100%;
  overscroll-behavior: none;                   /* ← 防 iOS 橡皮筋，不靠 position:fixed 硬扛 */
}

body {
  font-family: var(--font);
  font-size: var(--font-size-base);
  font-weight: var(--font-wt-regular);
  letter-spacing: var(--letter-spacing);
  background: #000;
  color: var(--ink);
  touch-action: auto;
  -webkit-user-select: none;
  user-select: none;
  height: 100vh;                                 /* ← 回退：旧浏览器不认识 dvh */
  height: 100dvh;                              /* ← 新浏览器用 dvh */
  overflow: hidden;
  padding-top: var(--sat);
}

input, textarea, button {
  font-family: inherit;
  font-size: 16px;                             /* ← 防 iOS 缩放 */
  font-weight: var(--font-wt-regular);
  letter-spacing: var(--letter-spacing);
  outline: none;
  border: none;
  background: none;
  color: inherit;
}

/* ═══════ 手机外壳 ═══════ */

.phone {
  width: 100vw;
  height: 100vh;                                 /* ← 回退：旧浏览器不认识 dvh */
  height: 100dvh;                              /* ← dvh */
  background: #8FAFBF;                         /* 冷蓝后备 */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 30px;                           /* 补偿 fixed 状态栏 */
}

/* ═══════ 状态栏 ═══════ */

.status-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 30px;
  min-height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-size: 12px;
  font-weight: var(--font-wt-medium);
  letter-spacing: 0.8px;
  color: var(--ink);                            /* 日间深色文字 */
  z-index: 100;
  background: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.3s, color 0.3s;
}
.status-bar .signal-bar { background: var(--ink-light); }
.status-bar .battery-icon { border-color: var(--ink-light); }
.status-bar .battery-tip { background: var(--ink-light); }
.status-bar .battery-level { background: var(--ink-light); }

/* 夜间模式：状态栏白色 */
html.dark-mode .status-bar {
  color: rgba(255,255,255,0.75);
}
html.dark-mode .status-bar .signal-bar,
html.dark-mode .status-bar .battery-tip,
html.dark-mode .status-bar .battery-level {
  background: rgba(255,255,255,0.5);
}
html.dark-mode .status-bar .battery-icon {
  border-color: rgba(255,255,255,0.5);
}

/* ─── 状态栏 · 页面状态 class ─── */
.status-bar.status-home {
  color: var(--desktop-text-main);
  background: transparent;
}
.status-bar.status-home .signal-bar,
.status-bar.status-home .battery-tip,
.status-bar.status-home .battery-level {
  background: var(--desktop-text-main);
}
.status-bar.status-home .battery-icon {
  border-color: var(--desktop-text-main);
}
/* 暗色模式 status-home 覆盖 */
html.dark-mode .status-bar.status-home {
  color: rgba(255,255,255,0.75);
}
html.dark-mode .status-bar.status-home .signal-bar,
html.dark-mode .status-bar.status-home .battery-tip,
html.dark-mode .status-bar.status-home .battery-level {
  background: rgba(255,255,255,0.5);
}
html.dark-mode .status-bar.status-home .battery-icon {
  border-color: rgba(255,255,255,0.5);
}

.status-bar.status-wechat,
.status-bar.status-chat-detail {
  color: var(--ink);
  background: var(--status-bar-bg, var(--surface-page, rgba(255,255,255,0.6)));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.status-bar.status-wechat .signal-bar,
.status-bar.status-wechat .battery-tip,
.status-bar.status-wechat .battery-level,
.status-bar.status-chat-detail .signal-bar,
.status-bar.status-chat-detail .battery-tip,
.status-bar.status-chat-detail .battery-level {
  background: var(--status-bar-icon, var(--ink-light));
}
.status-bar.status-wechat .battery-icon,
.status-bar.status-chat-detail .battery-icon {
  border-color: var(--status-bar-icon, var(--ink-light));
}

.status-bar.status-immersive {
  color: #fff;
  background: transparent;
}
.status-bar.status-immersive .signal-bar,
.status-bar.status-immersive .battery-tip,
.status-bar.status-immersive .battery-level {
  background: rgba(255,255,255,0.9);
}
.status-bar.status-immersive .battery-icon {
  border-color: rgba(255,255,255,0.9);
}

/* ─── 状态栏 · 自适应透明模式 ─── */
.status-bar.status-translucent {
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
html.dark-mode .status-bar.status-translucent {
  background: rgba(0,0,0,0.3);
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.signal-icon {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
}

.signal-bar {
  width: 3px;
  background: var(--ink);
  border-radius: 1px;
}
.signal-bar:nth-child(1) { height: 3px; }
.signal-bar:nth-child(2) { height: 6px; }
.signal-bar:nth-child(3) { height: 9px; }
.signal-bar:nth-child(4) { height: 12px; }
.signal-bar.inactive { opacity: 0.2; }

.battery-icon {
  width: 22px; height: 11px;
  border-radius: 2px;
  border: 1.5px solid var(--ink);
  position: relative;
  margin-left: 2px;
}
.battery-tip {
  position: absolute;
  width: 1.5px; height: 3px;
  top: 3px; right: -3px;
  border-radius: 0 1px 1px 0;
  background: var(--ink);
}
.battery-level {
  height: 100%;
  background: var(--ink);
  border-radius: 1px;
  margin: 1px;
}

/* ═══════ 屏幕容器 ═══════ */

.screen {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* ═══════ 页面系统 ═══════ */

/* Keep touch handling native. Broad touch-action rules caused WebView/browser taps
   to become too sensitive and interfered with scrolling. */
button, input, textarea, select {
  touch-action: auto;
}

.page {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;                                   /* 始终 flex —— Via 的 WebView 对 display:none 支持有 bug */
  flex-direction: column;
  background: var(--surface-page);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: -1;                                     /* 非活跃页面垫底 */
  opacity: 0;                                      /* 非活跃页面透明 */
  pointer-events: none;                            /* 非活跃页面不可交互 */
}
.page.active {
  z-index: 1;                                      /* 活跃页面置顶 */
  opacity: 1;                                      /* 活跃页面可见 */
  pointer-events: auto;                            /* 活跃页面可交互 */
}

/* ═══════ 导航栏 ═══════ */

.nav-bar {
  position: relative;                          /* 为 .nav-title 的 absolute 居中提供锚点 */
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;              /* ← → 按钮分居两侧，title 绝对居中 */
  padding: 0 12px;
  background: var(--surface-nav);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-light);
  z-index: 50;
}
@supports not (backdrop-filter: blur(1px)) {
  .nav-bar { background: rgba(255,255,255,0.95); }
  html.dark-mode .nav-bar { background: rgba(26,29,36,0.95); }
}

.nav-btn {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  font-size: 18px;
  font-weight: var(--font-wt-regular);
  cursor: pointer;
  flex-shrink: 0;
  background: rgba(0,0,0,0.04);
}
.nav-btn:active { background: rgba(0,0,0,0.08); }
html.dark-mode .nav-btn { background: rgba(255,255,255,0.06); }
html.dark-mode .nav-btn:active { background: rgba(255,255,255,0.12); }

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 16px;
  font-weight: var(--font-wt-medium);
  letter-spacing: 1.5px;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;                        /* 不阻挡左右按钮点击 */
}

.nav-action {
  padding: 5px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 1px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
}
.nav-action:active { background: rgba(0,0,0,0.08); }
html.dark-mode .nav-action { background: rgba(255,255,255,0.06); }
html.dark-mode .nav-action:active { background: rgba(255,255,255,0.12); }

.nav-status { font-size: 14px; }

/* ═══════ 底部 Tab（毛玻璃半透明） ═══════ */

.wechat-tabs {
  height: 49px;
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.3);
  padding-bottom: var(--sab);
  z-index: 30;
}
@supports not (backdrop-filter: blur(1px)) {
  .wechat-tabs { background: rgba(255,255,255,0.92); }
  html.dark-mode .wechat-tabs { background: rgba(26,29,36,0.92); }
}

.wechat-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: var(--ink-subtle);
  font-size: 10px;
  font-weight: var(--font-wt-medium);
  letter-spacing: 1px;
  padding: 3px 10px;                           /* 缩小内部留白 */
  transition: color 0.2s;
}
.wechat-tab.active { color: var(--monet-deepwater); }
.wechat-tab .tab-icon { font-size: 16px; }
.wechat-tab .tab-icon svg {
  stroke: currentColor;
  transition: all 0.2s;
}
.wechat-tab.active .tab-icon svg {
  stroke: var(--monet-blue);
  fill: rgba(143,175,191,0.15);                /* 选中项主色填充高亮 */
  stroke-width: 2;
}

/* ═══════ 头像 ═══════ */

.avatar {
  width: 38px; height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg {
  width: 60px; height: 60px;
  border-radius: 20px;
  font-size: 28px;
}
.avatar.sm {
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: 14px;
}

/* ═══════ 通用组件 ═══════ */

.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(30, 35, 55, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  padding: 9px 22px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.8px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.15);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--ink-subtle);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 14px; opacity: 0.6; }
.empty-state .empty-text { font-size: 14px; font-weight: var(--font-wt-regular); letter-spacing: 1px; }

.loading-spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border-light);
  border-top-color: var(--monet-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════ 模态框 ═══════ */

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-container {
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  background: var(--surface-card);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 16px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  border: 1px solid var(--border-light);
  border-bottom: none;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.1);
}
.modal-overlay.show .modal-container { transform: translateY(0); }

.modal-title {
  font-size: 16px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 1.5px;
  text-align: center;
  margin-bottom: 14px;
  color: var(--ink);
}
.modal-body {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 16px;
}
.modal-buttons { display: flex; gap: 10px; }
.modal-btn {
  flex: 1;
  padding: 11px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 1px;
  cursor: pointer;
  text-align: center;
}
.modal-btn-confirm {
  background: var(--monet-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(123,165,184,0.3);
}
.modal-btn-confirm:active { background: var(--monet-deepwater); }
.modal-btn-cancel {
  background: var(--surface-input);
  color: var(--ink);
  border: 1px solid var(--border-light);
}
.modal-btn-cancel:active { background: var(--surface-page); }
.modal-btn-danger {
  background: #ff3b30;
  color: #fff;
  border: none;
}
.modal-btn-danger:active { background: #d63029; }

/* ═══════ 滚动条 ═══════ */

::-webkit-scrollbar { width: 0; }

/* ═══════ 记忆库 ═══════ */

.memory-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.memory-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-input);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 7px 12px;
  min-width: 0;
}

.memory-search-icon {
  flex-shrink: 0;
  color: var(--ink-subtle);
  opacity: 0.6;
}

.memory-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.5px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.memory-search-input::placeholder {
  color: var(--ink-subtle);
}

.memory-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.memory-filter-select {
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface-input);
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.5px;
  max-width: 100px;
  outline: none;
  cursor: pointer;
}

.memory-filter-select option {
  background: var(--surface-card);
  color: var(--ink);
}

.memory-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface-input);
  color: var(--monet-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.memory-add-btn:active {
  background: rgba(123,165,184,0.12);
}

/* 记忆列表 */

#memoryApp .memory-list-wrap { padding: 6px 14px; }

#memoryApp .memory-item {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 8px 0;
  box-shadow: var(--shadow-card);
  transition: background 0.2s;
  cursor: default;
}

#memoryApp .memory-item:active {
  background: var(--surface-page);
}

#memoryApp .memory-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#memoryApp .memory-item-top .memory-content {
  flex: 1;
  font-size: 14px;
  font-weight: var(--font-wt-regular);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: 0.3px;
  margin-bottom: 0;
}

#memoryApp .memory-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

#memoryApp .memory-item:hover .memory-item-actions,
#memoryApp .memory-item:active .memory-item-actions { opacity: 1; }

#memoryApp .memory-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-input);
  color: var(--ink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#memoryApp .memory-action-btn:active {
  background: var(--surface-page);
}

#memoryApp .memory-action-btn.danger:active {
  background: rgba(255,80,80,0.1);
  color: #ff6b6b;
}

#memoryApp .memory-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-subtle);
  font-weight: var(--font-wt-regular);
  letter-spacing: 1px;
}

#memoryApp .memory-friend-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(123,165,184,0.12);
  color: var(--monet-blue);
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.5px;
}

#memoryApp .memory-importance {
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0.7;
}

#memoryApp .memory-core-badge,
#memoryApp .memory-importance-num {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

#memoryApp .memory-core-badge {
  background: rgba(30,30,30,0.08);
  color: var(--ink);
  border: 0.5px solid rgba(30,30,30,0.1);
}

#memoryApp .memory-importance-num {
  background: rgba(123,165,184,0.1);
  color: var(--monet-blue);
}

#memoryApp .memory-time {
  font-size: 10px;
  color: var(--ink-subtle);
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.5px;
}

#memoryApp .memory-score {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(123,165,184,0.15);
  color: var(--monet-blue);
  font-weight: var(--font-wt-medium);
  letter-spacing: 0.5px;
}

#memoryApp .memory-no-embed {
  font-size: 10px;
  color: rgba(255,180,80,0.7);
  font-weight: var(--font-wt-regular);
  margin-top: 4px;
  display: inline-block;
}

/* 记忆表单（弹窗内） */

.memory-form { display: flex; flex-direction: column; gap: 10px; }

.memory-form-label {
  font-size: 12px;
  color: var(--ink-light);
  font-weight: var(--font-wt-medium);
  letter-spacing: 0.8px;
}

.memory-form-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: var(--surface-input);
  color: var(--ink);
  font-size: 15px;
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.3px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.memory-form-textarea::placeholder {
  color: var(--ink-subtle);
}

.memory-form-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface-input);
  color: var(--ink);
  font-size: 14px;
  font-weight: var(--font-wt-regular);
  outline: none;
  cursor: pointer;
}

.memory-form-select option {
  background: var(--surface-card);
  color: var(--ink);
}

.memory-form-importance {
  display: flex;
  align-items: center;
  gap: 10px;
}

.memory-form-importance input[type="range"] {
  flex: 1;
  accent-color: var(--monet-blue);
  height: 4px;
}

.memory-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.memory-form-actions .form-btn { flex: 1; }

/* ═══════ 表单通用 ═══════ */

.form-group { margin: 12px 0; }
.form-label {
  display: block; font-size: 13px; color: var(--ink-light);
  margin-bottom: 6px; font-weight: var(--font-wt-regular); letter-spacing: 1px;
}
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--surface-input); border: 1px solid var(--border-light);
  border-radius: 14px; font-size: 15px;
  font-weight: var(--font-wt-regular); letter-spacing: 0.6px; color: var(--ink);
}
.form-input:focus { border-color: var(--monet-blue); background: #fff; outline: none; }
.form-input::placeholder { color: var(--ink-subtle); }
textarea.form-input { resize: vertical; min-height: 70px; line-height: 1.5; }
.form-hint {
  font-size: 11px; color: var(--ink-subtle); margin-top: 4px; letter-spacing: 0.8px;
}
.form-btn {
  width: 100%; padding: 12px; background: var(--monet-blue); color: #fff;
  border-radius: 14px; font-size: 12px; font-weight: var(--font-wt-regular);
  letter-spacing: 0.8px; cursor: pointer; text-align: center; padding: 8px;
  box-shadow: 0 2px 10px rgba(123,165,184,0.25);
}
.form-btn:active { background: var(--monet-deepwater); }

/* 朋友圈主动发帖 — 角色选择芯片 */
.proactive-moment-chip {
  display: inline-block;
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; cursor: pointer; letter-spacing: 0.5px;
  border: 1px solid var(--border-light, rgba(0,0,0,0.06));
  background: var(--surface-input, #eee);
  color: var(--ink-light, #888);
  transition: all 0.2s;
  user-select: none;
}
.proactive-moment-chip.selected {
  background: var(--monet-blue, #8FAFBF);
  color: #fff;
  border-color: transparent;
}
.form-btn.secondary {
  background: var(--surface-input); color: var(--ink);
  border: 1px solid var(--border-light); box-shadow: none;
}

/* ═══════ 世界书/记忆卡片 ═══════ */

.worldbook-card, .memory-item {
  padding: 16px 18px;
  background: var(--surface-card);
  cursor: pointer; margin: 0 12px 8px; border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}
.worldbook-card:active, .memory-item:active { background: var(--surface-page); }
.worldbook-name {
  font-size: 15px; font-weight: var(--font-wt-regular); letter-spacing: 1px;
  margin-bottom: 4px; color: var(--ink);
}
.worldbook-preview {
  font-size: 13px; color: var(--ink-light); font-weight: var(--font-wt-regular);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.memory-content {
  font-size: 14px; line-height: 1.5; margin-bottom: 4px;
  color: var(--ink); font-weight: var(--font-wt-regular);
}
.memory-meta {
  font-size: 11px; color: var(--ink-subtle); font-weight: var(--font-wt-regular);
  letter-spacing: 1px; display: flex; gap: 10px;
}

/* ═══════ 左边缘滑动返回指示器 ═══════ */
.swipe-back-indicator {
  position: fixed;
  left: 8px; top: 50%;
  transform: translateY(-50%) translateX(-30px);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.swipe-back-indicator.show {
  opacity: 1;
}

/* ══════════════════════════════════════════════
   桌面 Widgets · 新版小组件流
   ══════════════════════════════════════════════ */

/* ─── .desktop 容器 ─── */
.desktop {
  flex: 1;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-desktop);
  background-image: var(--desktop-wallpaper,
    linear-gradient(135deg,
      #D6E2EA 0%, #BCCEDA 20%, #DCE4E8 40%,
      #E8E6DF 60%, #F2EEE7 80%, #F5EFE6 100%
    ));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #D6E2EA;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* ─── 1. 问候区 ─── */
.greeting-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 8px;
  min-height: 96px;
  flex-shrink: 0;
}
.greeting-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.greeting-time {
  font-size: 40px;
  font-weight: 600;
  color: var(--desktop-text-main);
  letter-spacing: 2px;
  line-height: 1.1;
}
.greeting-text {
  font-size: 18px;
  font-weight: 400;
  color: var(--desktop-text-main);
}
.greeting-signature {
  font-size: 14px;
  opacity: 0.62;
  color: var(--desktop-text-main);
  font-weight: 300;
}
.greeting-avatar {
  width: 60px; height: 60px;
  border-radius: 20px;
  background: rgba(255,255,255,0.64);
  border: 1.5px solid rgba(143,175,191,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.greeting-avatar:active { transform: scale(0.92); }
.greeting-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ─── 2. 相册条 ─── */
.photo-strip-section {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.photo-strip {
  display: flex;
  gap: 8px;
  width: calc(100% - 44px);
  height: 78px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip-item {
  flex: 0 0 calc(33.33% - 6px);
  height: 74px;
  border-radius: 12px;
  background: rgba(255,255,255,0.58);
  cursor: pointer;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(143,175,191,0.12);
  transition: transform 0.2s;
}
.photo-strip-item:active { transform: scale(0.96); }
.photo-strip-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: none;
}
.photo-strip-item .photo-placeholder {
  opacity: 0.35;
  stroke: var(--desktop-text-aux);
}
.photo-strip-title {
  margin-top: 6px;
  font-size: 13px;
  color: var(--desktop-text-aux);
  font-weight: 400;
  letter-spacing: 1px;
}

/* ─── 3. 音乐播放器 — CD 盒 ─── */
/* CD 盒外层容器：flex:1 推底部网格到底 */
.page1-cd-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 4px 0;
}

/* ═══════ 亚克力 CD 盒 (2:1 横长) ═══════ */
.jewelcase {
  width: calc(100% - 38px);
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 2 / 1;
  display: flex;
  flex-shrink: 0;
  min-height: 0;
  max-height: 100%;
  position: relative;
  /* 亚克力半透明壳 */
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  /* 外壳边框 — 凸起塑料边 */
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 5px;
  /* 多层立体光影 */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.05),
    0 3px 18px rgba(0,0,0,0.07),
    0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* ── 左：插页卡片 ── */
.jc-left {
  flex: 0 0 50%;
  position: relative;
  cursor: pointer;
  border-right: 1px solid rgba(0,0,0,0.05);
}

.jc-insert-frame {
  position: absolute;
  inset: 4px;
  border: 1.5px solid rgba(0,0,0,0.07);
  border-radius: 1px;
  overflow: hidden;
  background: rgba(255,255,255,0.3);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
}

.jc-insert-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jc-insert-art img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.jc-insert-art svg {
  stroke: rgba(72,102,116,0.2);
  fill: none;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 插页四角透明卡扣 */
.jc-clip {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 1px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  z-index: 3;
  pointer-events: none;
}
.jc-clip-tl { top: 5px; left: 5px; border-right: none; border-bottom: none; }
.jc-clip-tr { top: 5px; right: 5px; border-left: none; border-bottom: none; }
.jc-clip-bl { bottom: 5px; left: 5px; border-right: none; border-top: none; }
.jc-clip-br { bottom: 5px; right: 5px; border-left: none; border-top: none; }

/* ── 中轴铰链 ── */
.jc-spine {
  flex: 0 0 5px;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.08) 20%,
    rgba(255,255,255,0.18) 40%,
    rgba(255,255,255,0.25) 50%,
    rgba(255,255,255,0.18) 60%,
    rgba(0,0,0,0.08) 80%,
    rgba(0,0,0,0.05)
  );
  box-shadow:
    -1px 0 1px rgba(0,0,0,0.04),
    1px 0 1px rgba(255,255,255,0.25);
}

/* ── 右：CD 托盘 ── */
.jc-right {
  flex: 0 0 calc(50% - 5px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jc-tray-frame {
  position: absolute;
  inset: 4px;
  border-radius: 1px;
  /* 深色托盘底 */
  background: #2a2d32;
  /* 托盘凸起边框 */
  border: 2px solid rgba(0,0,0,0.12);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.08),
    inset 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.jc-tray-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.jc-tray-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.jc-tray-bg svg {
  stroke: rgba(255,255,255,0.08);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 托盘中心凸起 */
.jc-tray-hub {
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin-left: -7%;
  margin-top: -7%;
  z-index: 1;
  background: radial-gradient(circle, #3a3e44 0%, #2a2d32 100%);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.3),
    inset 0 0 0 2px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* ── CD 碟片 ── */
.jc-disc {
  position: absolute;
  width: 98%;
  aspect-ratio: 1;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin-left: -49%;
  margin-top: -49%;
  cursor: pointer;
  z-index: 2;
  box-shadow:
    0 2px 12px rgba(0,0,0,0.3),
    0 0 0 2px rgba(255,255,255,0.04);
  transition: transform 0.15s;
  overflow: hidden;
}
.jc-disc:active { transform: scale(0.97); }
.jc-disc.playing {
  animation: cdSpin 6s linear infinite;
}
@keyframes cdSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* CD 碟面金属底 */
.jc-disc-surface {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(
    circle,
    #f2f2f2 0%, #e0e0e0 12%, #ececec 13%,
    #d4d4d4 28%, #e2e2e2 29%, #ececec 46%,
    #d8d8d8 70%, #c8c8c8 88%, #b8b8b8 100%
  );
}

/* CD 封面图（用户上传 — 铺满整张 CD） */
.jc-disc-art {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.jc-disc-art img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.jc-disc-art svg {
  stroke: rgba(100,100,100,0.25);
  fill: none;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* CD 沟槽纹理覆盖层 */
.jc-disc-art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 7px,
    rgba(255,255,255,0.03) 7px,
    rgba(255,255,255,0.03) 8px,
    transparent 8px,
    transparent 11px,
    rgba(255,255,255,0.02) 11px,
    rgba(255,255,255,0.02) 12px
  );
}

/* CD 中心孔 — 模拟托盘透出，跟播放键一样大 */
.jc-disc-hole {
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin-left: -7%;
  margin-top: -7%;
  z-index: 4;
  background: #2a2d32;
  /* 跟托盘底色一致，像真的透过去 */
  border: 1.5px solid rgba(160,160,160,0.5);
  /* 细环边框 */
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.08),
    inset 0 1px 1px rgba(0,0,0,0.1);
  pointer-events: none;
}

/* CD 表面光泽 */
.jc-disc-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 28% 22%,
    rgba(255,255,255,0.18) 0%,
    transparent 50%
  );
}

/* ═══ 信息+控制条 ═══ */
.jc-bar {
  width: calc(100% - 38px);
  max-width: 420px;
  margin: 5px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 26px;
  padding: 0 2px;
}

.jc-bar-info {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.jc-bar-info .music-title {
  font-size: 12px;
  font-weight: 300;
  font-style: italic;
  color: var(--desktop-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.jc-bar-sep {
  font-size: 9px;
  color: var(--desktop-text-aux);
  opacity: 0.45;
  flex-shrink: 0;
  margin: 0 1px;
}

.jc-bar-info .music-artist {
  font-size: 11px;
  font-weight: 300;
  font-style: italic;
  color: var(--desktop-text-aux);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.jc-bar-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.jc-bar-controls button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--monet-blue);
  transition: background 0.2s;
  padding: 0;
}

.jc-bar-controls button:active {
  background: rgba(143,175,191,0.12);
}

.jc-bar-controls button svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jc-bar-controls #musicPlayBtn {
  width: 26px;
  height: 26px;
  background: var(--monet-blue);
  color: #fff;
  box-shadow: 0 1px 5px rgba(90,138,154,0.25);
  border-radius: 50%;
}

.jc-bar-controls #musicPlayBtn:active {
  transform: scale(0.92);
}

.jc-bar-controls #musicPlayBtn svg {
  fill: currentColor;
  stroke: none;
}

/* 隐藏进度条 + 时间（保持 DOM 给 JS 更新） */
.page1-cd-area .music-progress {
  width: 0; height: 0;
  opacity: 0;
  overflow: hidden;
}
.page1-cd-area .music-progress-fill {
  width: 0%;
  height: 0;
}

/* ─── 音乐标题/歌手名（全局共享兼容老代码） ─── */
.music-title { }
.music-artist { }

/* ─── 音乐悬浮球 ─── */
.music-float-ball {
  position: fixed;
  bottom: calc(128px + var(--sab)); right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px;
  box-shadow: 0 4px 20px rgba(236,65,65,0.12);
  cursor: pointer;
  animation: floatBounceIn 0.3s ease-out;
  touch-action: none;
  user-select: none;
  max-width: min(320px, calc(100vw - 24px));
  border: 1px solid rgba(236,65,65,0.08);
}
@keyframes floatBounceIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.music-float-disc {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4141, #e03a3a);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.music-float-disc svg { fill: rgba(255,255,255,0.9); }
.music-float-disc.playing { animation: spin 3s linear infinite; }
.music-float-info { min-width: 0; flex: 1; }
.music-float-title {
  font-size: 12px; font-weight: 500;
  color: #333;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 220px;
}
.music-float-lyric {
  font-size: 11px; font-weight: 300;
  color: #888;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 250px;
  margin-top: 2px;
  transition: all 0.3s;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
}
.music-float-ball.lyric-expanded {
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 220px;
}
.music-float-ball.lyric-expanded .music-float-disc {
  margin-bottom: 6px;
}
.music-float-ball.lyric-expanded .music-float-title {
  max-width: 200px;
}
.music-float-ball.lyric-expanded .music-float-lyric {
  max-width: 200px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.music-float-ball.compact {
  width: 48px;
  height: 48px;
  padding: 6px;
  gap: 0;
  border-radius: 50%;
  justify-content: center;
}
.music-float-ball.compact .music-float-info {
  display: none;
}
.music-float-ball.compact .music-float-compact-btn {
  bottom: auto;
  top: -4px;
  right: -4px;
}
.music-float-ball.compact .music-float-disc {
  width: 36px;
  height: 36px;
}
.music-float-ball.compact.lyric-expanded {
  flex-direction: row;
  align-items: center;
}
.music-float-close {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 50%; background: #ec4141; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer; border: none;
}
.music-float-compact-btn {
  position: absolute; bottom: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 50%; background: #ec4141; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; cursor: pointer; border: none;
}

/* ─── 音乐全页 App ─── */
.music-app-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(236,65,65,0.06), transparent 36%),
    linear-gradient(180deg, #fefefe 0%, #fff8f8 52%, #fff5f5 100%);
  color: #333;
}
.music-hero {
  flex-shrink: 0;
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  color: #333;
}
.music-disc {
  width: min(55vw, 200px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, #2a2a2a 0 13%, #1a1a1a 14% 28%, #111 29% 44%, #222 45% 52%, #1a1a1a 53% 60%, #252525 61% 100%);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.music-disc.playing { animation: spin 8s linear infinite; }
.music-disc img {
  width: 56%;
  height: 56%;
  border-radius: 50%;
  object-fit: cover;
}
.music-now-title {
  width: 100%;
  margin-top: 14px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
  color: #333;
}
.music-now-artist {
  width: 100%;
  margin-top: 4px;
  font-size: 12px;
  text-align: center;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}
.music-transport {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.music-transport button,
.music-mini-btn {
  height: 34px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  color: #666;
  cursor: pointer;
}
.music-transport button {
  width: 38px;
  padding: 0;
}
.music-transport button.main {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4141, #e03a3a);
  border-color: #ec4141;
  color: #fff;
}
.music-transport svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
}
.music-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.music-auth-row,
.music-search-row,
.music-now-playing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #eee;
}
.music-auth-row {
  justify-content: space-between;
  font-size: 12px;
  color: #999;
}
.music-search-row {
  position: sticky;
  top: 0;
  z-index: 2;
}
.music-search-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 20px;
  padding: 0 14px;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e8e8e8;
  font-size: 13px; outline: none;
}
.music-search-input::placeholder { color: #ccc; }
.music-primary-btn,
.music-secondary-btn {
  min-height: 34px;
  border-radius: 17px;
  padding: 0 13px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.music-primary-btn {
  background: linear-gradient(135deg, #ec4141, #e03a3a);
  color: #fff;
}
.music-secondary-btn {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #e8e8e8;
}
.music-section-title {
  padding: 6px 2px 0;
  font-size: 12px;
  color: #999;
  font-weight: 600;
}
.music-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.music-list-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  cursor: pointer; transition: background 0.15s;
}
.music-list-item:active { background: #fef0f0; }
.music-list-item svg {
  flex-shrink: 0;
  fill: #ec4141; stroke: none;
}
.music-list-title {
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}
.music-list-sub,
.music-empty-line {
  font-size: 11px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}
.music-empty-line {
  padding: 16px 10px;
  text-align: center;
  background: #fafafa;
  border-radius: 8px;
}
.music-now-mini-disc {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4141, #c62828);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.music-now-mini-info {
  flex: 1;
  min-width: 0;
}
.music-mini-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
  color: #666;
  border-color: #e8e8e8;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  cursor: pointer;
}
.music-mini-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #ec4141, #e03a3a);
  border-color: #ec4141;
}
.music-login-card {
  width: min(88%, 360px);
  margin: auto;
  padding: 24px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.music-login-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  letter-spacing: 0;
}
.music-qr-box {
  width: 204px;
  height: 204px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #999;
  word-break: break-word;
}
.music-login-status {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.5;
  color: #999;
  text-align: center;
  word-break: break-word;
}
.music-manual-cookie {
  width: 100%;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.5;
  color: #999;
}

/* ─── 4. App 图标区 ─── */
.app-icons-section {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.app-icons-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--desktop-text-main);
  letter-spacing: 1.5px;
}
.app-icons-body {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.app-icons-grid {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  grid-template-rows: repeat(2, 64px);
  gap: 18px 22px;
}
.app-icon-item {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: rgba(143,175,191,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.2s;
}
.app-icon-item:active { transform: scale(0.92); }
.app-icon-item .app-icon-img {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-icon-item .app-icon-img svg {
  width: 22px; height: 22px;
  stroke: var(--desktop-text-main);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-icon-item .app-icon-label {
  font-size: 11px;
  color: var(--desktop-text-aux);
  font-weight: 400;
  letter-spacing: 0.8px;
}
.app-polaroid-card {
  width: 118px; height: 142px;
  background: rgba(255,255,255,0.68);
  border-radius: 12px;
  border: 1px solid rgba(143,175,191,0.15);
  box-shadow: 0 4px 16px rgba(100,120,135,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 8px 10px;
  cursor: pointer;
  transition: transform 0.2s;
}
.app-polaroid-card:active { transform: scale(0.96); }
.polaroid-image {
  flex: 1;
  width: 100%;
  border-radius: 8px;
  background: rgba(143,175,191,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.polaroid-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.polaroid-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--desktop-text-aux);
  font-weight: 400;
  letter-spacing: 1px;
}

/* ─── 5. 底部网格：小鲸鱼(左2x2) + 搜索(右上) + App(右下) ─── */
.desktop-bottom-grid {
  margin: 18px auto 0;
  width: calc(100% - 38px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 74px 74px;
  gap: 12px;
  flex-shrink: 0;
}

/* 小鲸鱼 v2 — 左侧 2x2 */
.whale-card-v2 {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 10px rgba(100,120,135,0.05);
  padding: 16px 10px;
}
.whale-card-v2:active { transform: scale(0.96); }
.whale-v2-avatar {
  width: 56px; height: 56px;
  animation: whaleFloat 3s ease-in-out infinite;
}
.whale-v2-avatar svg {
  width: 100%; height: 100%;
  stroke: var(--monet-deepwater);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.whale-v2-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--desktop-text-main);
  letter-spacing: 1px;
}
.whale-v2-hint {
  font-size: 11px;
  color: var(--desktop-text-aux);
  transition: opacity 0.3s;
}

/* 搜索 v2 — 右上 1x2 */
.search-card-v2 {
  grid-column: 3 / 5;
  grid-row: 1;
  background: rgba(143,175,191,0.18);
  border: 1px solid rgba(143,175,191,0.14);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 0.2s;
  min-height: 0;
  box-shadow: 0 4px 12px rgba(100,120,135,0.06);
}
.search-card-v2:active { transform: scale(0.96); }
.search-card-v2 svg {
  width: 16px; height: 16px;
  stroke: var(--desktop-text-aux);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-card-v2 span {
  font-size: 14px;
  color: var(--desktop-text-aux);
  font-weight: 400;
}

/* App mini — 右列下（世界书 / 记忆库），参考第二页卡片配色 */
.desktop-app-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s;
  min-height: 0;
  box-shadow: 0 4px 12px rgba(100,120,135,0.06);
}
.desktop-app-mini.app-mini-blue {
  grid-column: 3;
  grid-row: 2;
}
.desktop-app-mini.app-mini-deep {
  grid-column: 4;
  grid-row: 2;
}
.desktop-app-mini:active { transform: scale(0.92); }
.app-mini-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-mini-icon svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-mini-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.8px;
  color: var(--desktop-text-aux);
}

/* 浅蓝 — 世界书 */
.desktop-app-mini.app-mini-blue {
  background: rgba(143,175,191,0.24);
  border: 1px solid rgba(143,175,191,0.14);
}
.desktop-app-mini.app-mini-blue .app-mini-icon { color: #5A8494; }

/* 深蓝 — 记忆库 */
.desktop-app-mini.app-mini-deep {
  background: rgba(110,145,159,0.24);
  border: 1px solid rgba(110,145,159,0.14);
}
.desktop-app-mini.app-mini-deep .app-mini-icon { color: #4A6E7A; }

@keyframes whaleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ─── 6. 旧搜索胶囊（保留样式兼容，被 v2 替代） ─── */
.search-capsule {
  width: 86px; height: 34px;
  background: rgba(255,255,255,0.82);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 14px auto 0;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid rgba(143,175,191,0.12);
  box-shadow: 0 1px 6px rgba(100,120,135,0.04);
  flex-shrink: 0;
}
.search-capsule:active { transform: scale(0.95); }
.search-capsule svg {
  width: 14px; height: 14px;
  stroke: var(--desktop-text-aux);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-capsule span {
  font-size: 13px;
  color: var(--desktop-text-aux);
  font-weight: 400;
}

/* ─── Dock（新版） ─── */
.dock {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(14px + var(--sab));
  margin: 0;
  padding: 10px 18px;
  height: 76px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 5px 20px rgba(100,120,135,0.10);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  flex-shrink: 0;
}
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  padding: 4px 10px;
  transition: transform 0.2s;
}
.dock-item:active { transform: scale(0.88); }
.dock-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dock-icon svg {
  width: 22px; height: 22px;
  stroke: var(--ink-light);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s;
}
.dock-item:active .dock-icon svg { stroke: var(--monet-blue); }
.dock-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.dock-label {
  font-size: 9px;
  color: var(--ink-subtle);
  font-weight: 400;
  letter-spacing: 0.8px;
  opacity: 0.7;
}

/* ─── 暗色模式 · Widget 覆盖 ─── */
html.dark-mode .jewelcase {
  background: rgba(24,28,34,0.35);
  border-color: rgba(255,255,255,0.15);
}
html.dark-mode .jc-insert-frame {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.06);
}
html.dark-mode .jc-tray-frame {
  background: #1a1c21;
  border-color: rgba(0,0,0,0.25);
}
html.dark-mode .jc-disc-hole {
  background: #1a1c21;
  border-color: rgba(140,140,140,0.4);
}
html.dark-mode .jc-spine {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.2) 20%,
    rgba(255,255,255,0.06) 40%,
    rgba(255,255,255,0.1) 50%,
    rgba(255,255,255,0.06) 60%,
    rgba(0,0,0,0.2) 80%,
    rgba(0,0,0,0.15)
  );
}
html.dark-mode .jc-bar .music-title { color: #e4e6ea; }
html.dark-mode .jc-bar .music-artist { color: rgba(255,255,255,0.5); }
html.dark-mode .whale-card-v2 {
  background: rgba(30,33,42,0.58);
  border-color: rgba(255,255,255,0.08);
}
html.dark-mode .whale-v2-name { color: #e4e6ea; }
html.dark-mode .whale-v2-hint { color: rgba(255,255,255,0.45); }
html.dark-mode .search-card-v2 {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.06);
}
html.dark-mode .search-card-v2 svg,
html.dark-mode .search-card-v2 span {
  stroke: rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.45);
}
html.dark-mode .desktop-app-mini.app-mini-blue {
  background: rgba(143,175,191,0.16);
  border-color: rgba(255,255,255,0.06);
}
html.dark-mode .desktop-app-mini.app-mini-blue .app-mini-icon { color: #92C1D4; }
html.dark-mode .desktop-app-mini.app-mini-deep {
  background: rgba(110,145,159,0.18);
  border-color: rgba(255,255,255,0.06);
}
html.dark-mode .desktop-app-mini.app-mini-deep .app-mini-icon { color: #8BB4C0; }
html.dark-mode .search-capsule {
  background: rgba(38,45,55,0.65);
}
html.dark-mode .app-polaroid-card {
  background: rgba(30,33,42,0.68);
}
html.dark-mode .app-icon-item {
  background: rgba(255,255,255,0.06);
}
html.dark-mode .app-icon-item .app-icon-img svg {
  stroke: rgba(255,255,255,0.7);
}
html.dark-mode .app-icon-item .app-icon-label {
  color: rgba(255,255,255,0.45);
}
html.dark-mode .dock {
  background: rgba(36,42,52,0.72);
  border-color: rgba(255,255,255,0.08);
}
html.dark-mode .dock-icon svg {
  stroke: rgba(255,255,255,0.55);
}
html.dark-mode .dock-label {
  color: rgba(255,255,255,0.4);
}
html.dark-mode .greeting-time,
html.dark-mode .greeting-text,
html.dark-mode .greeting-signature {
  color: #e4e6ea;
}
html.dark-mode .app-icons-title {
  color: #e4e6ea;
}
html.dark-mode .photo-strip-item {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.06);
}
html.dark-mode .search-capsule svg,
html.dark-mode .search-capsule span {
  color: rgba(255,255,255,0.45);
  stroke: rgba(255,255,255,0.45);
}
html.dark-mode .photo-strip-title {
  color: rgba(255,255,255,0.45);
}

/* ══════════════════════════════════════════════
   桌面三页滑动系统 + 第二/三页 Widgets
   ══════════════════════════════════════════════ */

/* ─── 桌面容器 ─── */
.desktop {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── 滑动容器 ─── */
.desktop-swiper {
  flex: 1;
  display: flex;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  transition: transform 0.35s cubic-bezier(0.25,0.1,0.25,1.0);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  will-change: transform;
  min-height: 0;
  height: calc(100% - 112px - var(--sab));
  max-height: calc(100% - 112px - var(--sab));
  flex-basis: calc(100% - 112px - var(--sab));
}
.desktop-swiper.dragging {
  cursor: grabbing;
}

/* ─── 每一页 ─── */
.desktop-page {
  width: 100%;
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  padding-bottom: 0;
  flex-shrink: 0;
}

/* ─── 翻页指示点 ─── */
.desktop-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(98px + var(--sab));
  padding: 0;
  flex-shrink: 0;
  z-index: 5;
}
.desktop-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(143,175,191,0.35);
  transition: all 0.3s;
}
.desktop-dot.active {
  width: 18px;
  border-radius: 999px;
  background: rgba(143,175,191,0.75);
}

/* ═══════ 第二页：拍立得叠放 + 功能按钮 ═══════ */

.page2-title {
  display: none;
}

/* ─── 页面布局容器 ─── */
.page2-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 6px 16px 14px;
  min-height: 0;
  height: 100%;
}

/* ═══════ 拍立得叠放组件 (2×3) ═══════ */

.polaroid-widget {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  max-height: calc(100% - 82px);
  padding: 4px 0 8px;
}

.polaroid-stack-v2 {
  position: relative;
  width: min(330px, 86vw);
  height: min(360px, 50vh);
  min-height: 292px;
}

/* ─── 拍立得卡片基础 ─── */
.polaroid-card-v2 {
  position: absolute;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  background: #FDFAF7;
  /* 暖白相纸，不是纯白冷冰冰 */
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 3px 8px rgba(0,0,0,0.05),
    0 6px 18px rgba(0,0,0,0.04);
  border-radius: 3px;
  padding: 7px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.polaroid-card-v2:active {
  transform: scale(0.96) !important;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.03),
    0 2px 5px rgba(0,0,0,0.04) !important;
}

.polaroid-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
}

/* 细纹纸质感 */
.polaroid-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(180,165,145,0.03) 2px,
    rgba(180,165,145,0.03) 3px
  );
  border-radius: 2px;
}

/* ─── 照片区域 ─── */
.polaroid-photo-frame {
  flex: 1 1 auto;
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #FDFAF7;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border-radius: 1px;
  position: relative;
}

.polaroid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 彩色照片！去掉黑白灰度 */
}

.polaroid-photo-frame .photo-placeholder {
  opacity: 0.18;
  stroke: #8BA1AD;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── 拍立得底部留白 — 隐藏，纯白框无字 ─── */
.polaroid-bottom {
  display: none;
}

.polaroid-caption {
  display: none;
}

/* ═══════ 三张拍立得定位 & 旋转 ═══════ */

/* 主照片：大图锚点，拍立得白框 + 英文小字，向右微倾 */
.polaroid-main {
  width: 78%;
  z-index: 1;
  top: 50%;
  left: 40%;
  transform: translate(-50%, -50%) rotate(3deg);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 14px rgba(0,0,0,0.07),
    0 10px 30px rgba(0,0,0,0.05);
  padding: 8px 8px 24px 8px;
  aspect-ratio: auto;
  /* 经典拍立得比例：竖长照片 + 宽白底 */
}
/* 主图的相纸底部显示英文小字 */
.polaroid-main .polaroid-photo-frame {
  aspect-ratio: 3 / 4;
}
.polaroid-main .polaroid-bottom {
  display: flex;
  position: static;
  flex-shrink: 0;
  height: 28px;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}
.polaroid-main .polaroid-caption {
  display: inline;
  font-size: 12px;
  font-family: 'Georgia', 'Times New Roman', var(--font-desktop), serif;
  font-style: italic;
  color: #2c2c2c;
  letter-spacing: 0.6px;
}

/* 右上小照片：纯方框无拍立得边框，左倾叠在大图右上方 */
.polaroid-tr {
  width: 35%;
  z-index: 4;
  top: 1%;
  right: 1%;
  transform: rotate(-5deg);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.08),
    0 4px 16px rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 0;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 3px solid #fff;
}
.polaroid-tr .polaroid-bottom { display: none; }
.polaroid-tr .polaroid-inner::before { display: none; }
.polaroid-tr .polaroid-photo-frame { border-radius: 2px; }

/* 右下小照片：纯方框无拍立得边框，右倾叠在大图右下方 */
.polaroid-br {
  width: 35%;
  z-index: 3;
  bottom: 0%;
  right: -1%;
  transform: rotate(6deg);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.08),
    0 4px 16px rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 0;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 3px solid #fff;
}
.polaroid-br .polaroid-bottom { display: none; }
.polaroid-br .polaroid-inner::before { display: none; }
.polaroid-br .polaroid-photo-frame { border-radius: 2px; }

/* ═══════ 中间区：4个功能按钮 ═══════ */

.page2-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  padding: 0 10px;
  flex-shrink: 0;
  min-height: 68px;
}

.action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 4px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(143,175,191,0.10);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  font-family: var(--font-desktop);
  min-width: 0;
}

.action-btn:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.72);
}

.action-btn svg {
  width: 22px; height: 22px;
  stroke: rgba(72,102,116,0.68); fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.action-btn span {
  font-size: 11px;
  color: var(--desktop-text-aux);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* 按钮色调微调 */
.action-drift { background: rgba(143,175,191,0.18); }
.action-drift svg { stroke: #5A8494; }
.action-mall { background: rgba(110,145,159,0.16); }
.action-mall svg { stroke: #4A6E7A; }
.action-fantasy { background: rgba(143,175,191,0.18); }
.action-fantasy svg { stroke: #5A8494; }
.action-activate { background: rgba(110,145,159,0.16); }
.action-activate svg { stroke: #4A6E7A; }
/* 第三页统一色调 */
.action-music { background: rgba(143,175,191,0.18); }
.action-music svg { stroke: #5A8494; }
.action-watch { background: rgba(110,145,159,0.16); }
.action-watch svg { stroke: #4A6E7A; }
.action-pomodoro { background: rgba(143,175,191,0.18); }
.action-pomodoro svg { stroke: #5A8494; }
.action-forum { background: rgba(110,145,159,0.16); }
.action-forum svg { stroke: #4A6E7A; }

/* ═══════ 暗色模式适配 ═══════ */

html.dark-mode .polaroid-card-v2 {
  background: #FCFAF8;
  /* 暗色模式下拍立得仍然保持暖白底 */
  box-shadow:
    0 1px 2px rgba(0,0,0,0.12),
    0 4px 12px rgba(0,0,0,0.14),
    0 8px 22px rgba(0,0,0,0.10);
}

html.dark-mode .polaroid-main {
  box-shadow:
    0 1px 2px rgba(0,0,0,0.14),
    0 4px 14px rgba(0,0,0,0.18),
    0 10px 28px rgba(0,0,0,0.12);
}

html.dark-mode .polaroid-tr,
html.dark-mode .polaroid-br {
  box-shadow:
    0 2px 8px rgba(0,0,0,0.22),
    0 6px 20px rgba(0,0,0,0.18);
  background: #f8f6f4;
  border-color: #f8f6f4;
}

html.dark-mode .polaroid-photo-frame {
  background: #F0EDE8;
}

html.dark-mode .polaroid-caption {
  color: #9a9088;
}

html.dark-mode .polaroid-inner::before {
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(180,165,145,0.05) 2px,
    rgba(180,165,145,0.05) 3px
  );
}

html.dark-mode .action-btn {
  background: rgba(36,39,48,0.65);
  border-color: rgba(255,255,255,0.06);
}

/* ═══════ 隐藏旧版拍立得元素（兼容） ═══════ */
.polaroid-app-area { display: none; }
.polaroid-stack { display: none; }
.polaroid-apps { display: none; }
.polaroid-app-item { display: none; }
.page2-grid { display: none; }
.album-area { display: none; }
.album-photo-cell { display: none; }
.apps-row { display: none; }
.app-card { display: none; }

/* ═══════ 第三页：天气 + 开发中 ═══════ */

.page3-title {
  display: none;
}

/* ─── 第三页：天气条 ─── */
.weather-strip {
  width: calc(100% - 44px);
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(143,175,191,0.12);
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--desktop-text-main);
}
.weather-strip svg {
  stroke: var(--desktop-text-aux);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.weather-addr-v3 {
  margin-left: auto;
  font-size: 11px;
  color: var(--desktop-text-aux);
  opacity: 0.6;
}

/* ─── 第三页：功能按钮（同第二页横向排布）─── */
.page3-actions {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  padding: 0 10px 0;
  flex-shrink: 0;
  min-height: 68px;
  margin: 0 auto;
}

/* 暗色模式 */
html.dark-mode .weather-strip {
  background: rgba(255,255,255,0.05);
  color: #e4e6ea;
}

/* ─── 暗色模式：第二页网格 ─── */
html.dark-mode .album-area {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.05);
}
html.dark-mode .album-photo-cell {
  background: rgba(255,255,255,0.04);
}
html.dark-mode .album-photo-cell.featured {
  background: rgba(255,255,255,0.02);
}
html.dark-mode .app-card {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.05);
}
html.dark-mode .app-card-icon {
  background: rgba(143,175,191,0.10);
  border-color: rgba(255,255,255,0.06);
  color: rgba(228,232,235,0.7);
}
html.dark-mode .app-card-label {
  color: rgba(255,255,255,0.4);
}
html.dark-mode .page2-title,
html.dark-mode .page3-title {
  color: rgba(255,255,255,0.7);
}
html.dark-mode .desktop-dot {
  background: rgba(255,255,255,0.2);
}
html.dark-mode .desktop-dot.active {
  background: rgba(255,255,255,0.45);
}

/* ═══════ 语音消息气泡 · 微信风格 ═══════ */

.voice-message-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  min-height: 40px;
}

/* 收到的语音（左侧 · 浅灰底） */
.voice-message-bar.voice-other {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  flex-direction: row;
}

/* 发出的语音（右侧 · 冷蓝底） */
.voice-message-bar.voice-mine {
  background: var(--monet-blue);
  color: #fff;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* 尚未生成语音的占位状态 */
.voice-message-bar.voice-pending {
  opacity: 0.55;
  cursor: default;
  border-style: dashed;
}

.voice-message-bar:active:not(.voice-pending) {
  filter: brightness(0.92);
}

.voice-play-icon-svg {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}

.voice-message-bar.voice-other .voice-play-icon-svg {
  background: rgba(143,175,191,0.15);
  color: var(--monet-deepwater);
}

.voice-message-bar.voice-mine .voice-play-icon-svg {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.voice-play-icon-svg.playing {
  animation: voicePulse 0.8s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.voice-duration {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  min-width: 24px;
  text-align: center;
}

.voice-transcript {
  display: none;
  max-width: min(260px, 74vw);
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(143,175,191,0.12);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.voice-transcript.show {
  display: block;
}

.message-row.mine .voice-transcript {
  margin-left: auto;
  background: rgba(143,175,191,0.18);
  color: var(--ink);
}

/* 暗色模式语音消息 */
html.dark-mode .voice-message-bar.voice-other {
  background: #2c2f3a;
  border-color: rgba(255,255,255,0.08);
  color: #e4e6ea;
}

html.dark-mode .voice-message-bar.voice-other .voice-play-icon-svg {
  background: rgba(143,175,191,0.12);
  color: var(--monet-blue);
}

html.dark-mode .voice-transcript {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
}

/* ═══════════════ 新手引导弹窗 ═══════════════ */

.guide-overlay {
  position: fixed; inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  animation: guideFadeIn 0.25s ease-out;
}
@keyframes guideFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-card {
  background: #fff;
  border-radius: 22px;
  width: 100%;
  max-width: 360px;
  max-height: 82vh;
  overflow-y: auto;
  padding: 28px 22px 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.16);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.guide-card.show {
  opacity: 1;
  transform: translateY(0);
}

.guide-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(143,175,191,0.1), rgba(143,175,191,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.guide-title {
  font-size: 19px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

.guide-body {
  font-size: 13px;
  line-height: 1.7;
  color: #222;
  text-align: left;
  width: 100%;
}
.guide-body p { margin: 0 0 6px; }
.guide-body p:last-child { margin-bottom: 0; }

.guide-dots {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
}
.guide-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #DDD;
  cursor: pointer;
  transition: all 0.25s;
}
.guide-dot.active {
  width: 20px;
  border-radius: 7px;
  background: #5A8A9A;
}

.guide-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.guide-btn {
  padding: 10px 18px;
  border-radius: 20px;
  border: 0.5px solid #DDD;
  background: #f5f5f5;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: all 0.2s;
}
.guide-btn:active { background: #e8e8e8; }
.guide-btn.primary {
  background: #5A8A9A;
  color: #fff;
  border-color: transparent;
  font-weight: 500;
}
.guide-btn.primary:active { opacity: 0.85; }
.guide-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: #888;
  font-size: 12px;
  padding: 10px 12px;
}

.guide-swipe-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 10px;
  color: #999;
  letter-spacing: 0.5px;
  opacity: 0.7;
}
