/* ============================================================
   css/panels/panels-mailbox.css — 信箱样式
   信封卡片 / 信纸 / 邮票 / 状态标签 / 搜索 / 分享预览确认
   全部颜色走主题变量（换主题时信箱随之变色）
   ============================================================ */

/* CSS 变量 → 主题化（--sage/--rose/--surface-solid 等由主题系统注入） */
:root {
    --mailbox-casual: var(--sage, #A8B8A0);
    --mailbox-special: var(--rose, #C9A8A8);
    --mailbox-paper: var(--bg-secondary, var(--surface-solid, #FFFFFF));
    --mailbox-ink: var(--text-primary, #1E1C1A);
    --mailbox-ink-light: var(--text-secondary, #8A8278);
    --mailbox-fold: var(--border, #E8E4DF);
    --mailbox-tint: var(--accent-light, rgba(201,168,168,0.12));
}

/* ===== 信箱面板布局：顶部固定 + 内容区独立滚动 =====
   整页滚动会让右侧滚动条出现/消失 → 顶部栏左右跳（血泪）。
   改成 flex 列：返回条/标签/页头/搜索/筛选固定，只有列表区自己滚动。 */
#nest-sub-mailbox.nest-sub-panel.fullscreen {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* ★ 全面隐藏信箱/日记/时间胶囊列表区的可见滚动条：
   内容多时滚动条会挤占宽度 → 组件左移、不同月份对不齐（血泪）。隐藏后内容始终全宽。 */
#nest-sub-mailbox * { scrollbar-width: none; -ms-overflow-style: none; }
#nest-sub-mailbox ::-webkit-scrollbar { display: none; }
#nest-sub-mailbox .nest-sub-back,
#nest-sub-mailbox .mailbox-tabs,
#nest-sub-mailbox .mailbox-list-header,
#nest-sub-mailbox .mailbox-search,
#nest-sub-mailbox .mailbox-filters {
    flex-shrink: 0;
}
#mailbox-list-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
#mailbox-letter-view,
#mailbox-diary-panel,
#mailbox-capsule-panel,
#mailbox-diary-detail {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
/* ★ iOS 全屏层铁律：信箱/日记/胶囊的内容滚动区底部必须留出安全区 + 键盘高度，
   否则回信输入条（信纸最底部）会被 Home 横条/键盘盖住、顶到可视区外（甲方实锤「回复的条被底部栏盖住」）。
   安卓 --safe-bottom/--kbd-h 恒为 0，此规则零影响。 */
#mailbox-letter-view,
#mailbox-diary-panel,
#mailbox-capsule-panel,
#mailbox-diary-detail {
    padding-bottom: calc(16px + var(--safe-bottom, 0px) + var(--kbd-h, 0px));
}

/* ===== 信件页头（我们的信 + 帮助问号，与日记/时间胶囊同位置同款） ===== */
.mailbox-list-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 6px;
}
.mailbox-list-title {
    font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.mailbox-list-actions { display: flex; align-items: center; gap: 8px; }

/* ===== 搜索框 ===== */
.mailbox-search {
    display: flex; align-items: center; gap: 7px;
    margin: 4px 12px 2px; padding: 8px 12px;
    border-radius: 22px;
    background: var(--surface-solid, #fff);
    border: 1px solid var(--mailbox-fold);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mailbox-search:focus-within {
    border-color: var(--mailbox-special);
    box-shadow: 0 0 0 3px var(--mailbox-tint);
}
.mailbox-search > svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.mailbox-search input {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    font-family: var(--font-body); font-size: 13px; color: var(--text-primary);
}
.mailbox-search input::placeholder { color: var(--text-muted); }
.mailbox-search-clear {
    width: 22px; height: 22px; border: none;
    background: var(--mailbox-tint); color: var(--mailbox-special);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: transform 0.15s ease, opacity 0.2s ease;
}
.mailbox-search-clear svg { width: 11px; height: 11px; }
.mailbox-search-clear:active { transform: scale(0.85); }

/* ===== 信箱筛选栏（类型一行 + 状态一行） ===== */
.mailbox-filters {
    display: flex; flex-direction: column; gap: 6px;
    padding: 6px 12px 8px;
    flex-shrink: 0;
}
.mailbox-filter-row {
    display: flex; align-items: center; gap: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.mailbox-filter-row::-webkit-scrollbar { display: none; }
.mailbox-filter-label {
    font-size: 11px; color: var(--text-muted); flex-shrink: 0; letter-spacing: 0.5px;
}
.mailbox-filter-btn {
    flex-shrink: 0;
    padding: 4px 13px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.mailbox-filter-btn.active {
    background: var(--rose);
    color: #fff;
    border-color: var(--rose);
}
.mailbox-filter-btn:active { transform: scale(0.95); }

/* 日期：内嵌到搜索框右侧（日历图钉 + 标签 + 清除），选中态用玫红浅底 + 文字色，不抢主筛选 */
.mailbox-search-sep {
    width: 1px; height: 18px; flex-shrink: 0;
    background: var(--border); margin: 0 2px;
}
/* ===== 信封列表 =====
   ★ 普通流布局（非 flex column）：根治信件多时信封被 flex 压缩成
   「上下很窄的长条框、内容显示不全」（flex-shrink + overflow:hidden
   会让子项 min-height 自动最小值归零，越压越扁，实锤）。 */
#mailbox-envelopes {
    padding: 10px 12px 16px; overflow-y: auto;
    flex: 1; min-height: 0;
    scrollbar-gutter: stable;
    display: block;
}
.mailbox-envelope { margin-bottom: 14px; }

/* 信封卡片 */
.mailbox-envelope {
    position: relative;
    background: var(--mailbox-paper);
    border: 1px solid var(--mailbox-fold);
    border-radius: 10px;
    padding: 14px 16px 12px;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.mailbox-envelope:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
/* 未读：左上角小蜡封点 + 状态标签更醒目（不用侧条纹，符合设计准则） */
.mailbox-envelope.unread::before {
    content: ''; position: absolute; top: 13px; left: 13px;
    width: 8px; height: 8px; border-radius: 50%;
    /* ★ 2026-10 甲方定：未读标记一律跟主题色走（--rose） */
    background: var(--rose, #C9A8A8);
    box-shadow: 0 0 6px rgba(201,168,168,0.45);
}

/* 邮票 */
.envelope-stamp {
    position: absolute; top: 12px; right: 14px;
    width: 30px; height: 36px; border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25);
}
.envelope-stamp::after {
    content: ''; position: absolute; inset: 3px;
    border: 1px dashed rgba(255,255,255,0.3);
}
.stamp-label {
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic; font-size: 7px; color: rgba(255,255,255,0.9);
    text-align: center; line-height: 1.1; letter-spacing: 0.5px;
    transform: rotate(90deg);
}

/* 顶部行：状态标签 + 类型标签 + 日期 */
.envelope-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin: 2px 54px 6px 0;
}
.envelope-badges { display: flex; align-items: center; gap: 6px; min-width: 0; }
.env-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.env-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.env-status.st-replied { background: var(--sage-light, rgba(168,184,160,0.12)); color: var(--sage, #7da08a); }
.env-status.st-waiting { background: var(--mailbox-tint); color: var(--mailbox-special); }
.env-status.st-todo { background: var(--lavender-light, rgba(184,168,196,0.10)); color: var(--lavender, #9a8ab0); }
.env-type {
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; line-height: 1.5; white-space: nowrap;
    border: 1px solid currentColor; opacity: 0.85;
}
.env-type.tp-casual { color: var(--sage, #7da08a); }
.env-type.tp-special { color: var(--mailbox-special); }
.envelope-date {
    font-size: 11px;
    color: var(--mailbox-ink);
    white-space: nowrap;
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic;
    letter-spacing: 0.2px;
}

/* 窄屏：日期缩一点但保留（日期是信封最重要的区分信息，不能藏） */
@media (max-width: 370px) {
    .envelope-date { font-size: 10px; }
    .envelope-top { margin-right: 40px; }
}

/* 预览文字 */
.envelope-preview {
    margin: 0 54px 6px 0;
    font-size: 13px; color: var(--mailbox-ink); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 底部信息 */
.envelope-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 4px;
}
.envelope-reply-badge {
    font-size: 11px; color: var(--mailbox-ink-light);
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif; font-style: italic;
}
.envelope-fav-icon {
    color: var(--mailbox-special); cursor: pointer; padding: 2px;
    opacity: 0.45; transition: opacity 0.2s ease, transform 0.15s ease;
}
.envelope-fav-icon:hover,
.envelope-fav-icon.filled { opacity: 1; }
.envelope-fav-icon:active { transform: scale(0.88); }

/* ===== 信箱骨架（与真实信封同构：邮票位+标签行+两行预览+底栏，加载无跳变） ===== */
.mailbox-envelope.sk-env { pointer-events: none; }
.sk-line, .sk-chip, .sk-stamp {
    display: block; border-radius: 6px;
    background: linear-gradient(90deg, var(--border, #eae6e1) 25%, rgba(255,255,255,0.65) 50%, var(--border, #eae6e1) 75%);
    background-size: 200% 100%;
    animation: mailboxShimmer 1.4s ease-in-out infinite;
}
.sk-line { height: 13px; margin: 8px 54px 8px 0; }
/* 顶部/底栏里的骨架条贴合真实布局（不叠加外边距） */
.envelope-top .sk-line,
.envelope-footer .sk-line { margin: 0; }
.sk-line.w92 { width: 92%; } .sk-line.w70 { width: 70%; }
.sk-line.w30 { width: 30%; } .sk-line.w40 { width: 40%; }
.sk-line.h10 { height: 10px; } .sk-line.h14 { height: 14px; }
.sk-chip { width: 44px; height: 18px; border-radius: 9px; }
.sk-chip.w36 { width: 36px; }
.sk-stamp { position: absolute; top: 12px; right: 14px; width: 30px; height: 36px; border-radius: 2px; }
@keyframes mailboxShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .sk-line, .sk-chip, .sk-stamp { animation: none; }
}

/* ===== 空状态 ===== */
.mailbox-empty {
    text-align: center; padding: 60px 20px;
}
.mailbox-empty-icon {
    width: 64px; height: 48px; margin: 0 auto 16px;
    color: var(--text-muted); opacity: 0.5;
}
.mailbox-empty-title {
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic; font-size: 22px; color: var(--text-secondary);
    margin-bottom: 8px;
}
.mailbox-empty-sub {
    font-size: 13px; color: var(--text-muted); line-height: 1.7;
}

/* ===== 信件阅读视图 ===== */
#mailbox-letter-view {
    flex: 1; overflow-y: auto; min-height: 0;
}
.mailbox-letter-view-hidden { display: none; }

.letter-paper {
    position: relative; margin: 12px; padding: 32px 24px 28px;
    background: var(--mailbox-paper);
    border-radius: 4px;
    box-shadow:
        0 2px 12px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(0,0,0,0.04);
    /* 信纸横线纹理（中性装饰色，暗色下走深色线） */
    background-image:
        repeating-linear-gradient(
            transparent, transparent 22px,
            rgba(180,170,160,0.15) 22px, rgba(180,170,160,0.15) 23px
        );
    background-position: 0 52px;
}

/* 折叠线 */
.paper-fold {
    position: absolute; pointer-events: none;
}
.paper-fold-h {
    top: 50%; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--mailbox-fold), transparent);
    opacity: 0.5;
}
.paper-fold-v {
    left: 25%; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg, transparent, var(--mailbox-fold), transparent);
    opacity: 0.3;
}

/* 信件头部工具栏 */
.letter-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
}
.letter-back-btn,
.letter-tool-btn {
    width: 32px; height: 32px; border: none; background: none;
    cursor: pointer; padding: 0; display: flex; align-items: center;
    justify-content: center; color: var(--mailbox-ink-light);
    border-radius: 50%; transition: all 0.2s;
}
.letter-back-btn:hover,
.letter-tool-btn:hover {
    background: rgba(0,0,0,0.05); color: var(--mailbox-ink);
}
.letter-tools { display: flex; gap: 2px; }
.letter-tool-btn.filled { color: var(--mailbox-special); }
.letter-tool-btn.danger { color: #b0655a; }
.letter-tool-btn.danger:hover { background: rgba(176,101,90,0.12); color: #a05a50; }

/* 邮票 + 邮戳区 */
.letter-stamp-area {
    display: flex; justify-content: flex-end; align-items: flex-start;
    gap: 10px; margin-bottom: 20px;
}
.letter-stamp {
    width: 40px; height: 48px; border-radius: 1px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25);
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic; font-size: 8px; color: rgba(255,255,255,0.9);
    text-align: center; line-height: 1.2;
}
.letter-stamp span { transform: rotate(90deg); }
.letter-postmark-circle {
    width: 50px; height: 50px; border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 10px; color: var(--mailbox-ink-light);
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    text-align: center; line-height: 1.3; transform: rotate(-8deg);
    opacity: 0.55;
}

/* 称呼 */
.letter-salutation {
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic; font-size: 20px; color: var(--mailbox-ink);
    margin-bottom: 18px; letter-spacing: 0.5px;
}

/* 正文 */
.letter-body {
    font-family: 'Cormorant Garamond', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    /* 长文正文跟着「字号 / 行距」走（乘子默认 1 = 与改前像素一致）；标题/签名/按钮不缩放 */
    font-size: calc(16px * var(--read-fs-scale, 1)); line-height: calc(1.85 * var(--read-lh-scale, 1)); color: var(--mailbox-ink);
    margin-bottom: 22px; white-space: pre-wrap; word-break: break-word;
}

/* 签名 */
.letter-signature {
    text-align: right; font-family: 'Playfair Display', Georgia, serif;
    font-style: italic; font-size: 15px; color: var(--mailbox-ink);
    margin-top: 8px; margin-bottom: 20px;
}
.signature-name {
    font-family: 'Great Vibes', 'Playfair Display', Georgia, 'Noto Serif SC', 'PingFang SC', cursive;
    font-size: 22px; font-style: normal; line-height: 1.8;
}

/* 回复区（主次：正文是「信」的叙事，回信是「来回的小纸条」——整体缩小、变淡、间距更收） */
.letter-replies {
    border-top: 1px dashed var(--mailbox-fold);
    padding-top: 12px; margin-top: 8px;
}
.letter-reply-item {
    margin-bottom: 9px; padding: 8px 11px; border-radius: 10px;
}
.letter-reply-item.reply-ai { background: var(--mailbox-tint); }
.reply-handle {
    font-size: 10.5px; color: var(--mailbox-ink-light);
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic; margin-bottom: 3px; letter-spacing: 0.3px; opacity: 0.85;
}
.reply-content {
    font-family: 'Cormorant Garamond', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-size: 13.5px; line-height: 1.62; color: var(--mailbox-ink);
}

/* 回复输入 */
.letter-reply-input {
    display: flex; gap: 8px; margin-top: 18px;
    padding-top: 14px; border-top: 1px solid var(--mailbox-fold);
    align-items: flex-end;
}
.mailbox-reply-textarea {
    flex: 1; border: 1px solid var(--mailbox-fold);
    border-radius: 8px; padding: 10px 12px;
    font-family: 'Cormorant Garamond', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-size: 15px; font-style: italic; color: var(--mailbox-ink);
    background: var(--surface-solid, rgba(255,255,255,0.6)); resize: none;
    outline: none; transition: border-color 0.2s;
}
.mailbox-reply-textarea:focus { border-color: var(--mailbox-special); }
.mailbox-reply-textarea::placeholder { color: var(--mailbox-ink-light); opacity: 0.5; }

.mailbox-reply-send {
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: var(--mailbox-ink); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.2s;
}
.mailbox-reply-send:hover { background: var(--mailbox-special); transform: scale(1.06); }
.mailbox-reply-send:active { transform: scale(0.94); }
.mailbox-reply-send svg { display: block; }

/* ===== 深色模式（主体颜色已走主题变量，这里只处理中性装饰） ===== */
[data-theme-mode="dark"] .letter-paper {
    background-image:
        repeating-linear-gradient(
            transparent, transparent 22px,
            rgba(255,255,255,0.04) 22px, rgba(255,255,255,0.04) 23px
        );
    background-position: 0 52px;
}
[data-theme-mode="dark"] .letter-postmark-circle { border-color: rgba(255,255,255,0.12); }
[data-theme-mode="dark"] .letter-back-btn:hover,
[data-theme-mode="dark"] .letter-tool-btn:hover { background: rgba(255,255,255,0.08); color: var(--mailbox-ink); }
[data-theme-mode="dark"] .paper-fold-h,
[data-theme-mode="dark"] .paper-fold-v { opacity: 0.2; }
[data-theme-mode="dark"] .sk-line, [data-theme-mode="dark"] .sk-chip, [data-theme-mode="dark"] .sk-stamp {
    background: linear-gradient(90deg, rgba(255,255,255,0.07) 25%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0.07) 75%);
    background-size: 200% 100%;
}

/* ===== 信箱红点 Badge ===== */
.mailbox-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px;
    /* ★ 2026-10 甲方定：角标底色跟主题色走（--rose）；数字用暖褐（与 #pins-badge 同口径）；
       line-height 与高度一致 → 数字正正好居中 */
    background: var(--rose, #C9A8A8);
    color: #3A322B; font-size: 10px; font-weight: 600;
    margin-left: 4px; vertical-align: top;
    line-height: 16px;
}

/* ===== 分享到聊天的信件卡片气泡 ===== */
/* 外层泡泡：消息色底衬（比内层卡片略大一圈，形成「二层」）；内层 .mailbox-share-card 才是纸卡片 */
.bubble.mailbox-share-bubble,
.msg.user .bubble.mailbox-share-bubble,
.msg.assistant .bubble.mailbox-share-bubble {
    padding: 9px 12px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.4);
    width: auto;
}
.msg.user .bubble.mailbox-share-bubble { border-bottom-right-radius: 14px; }
.msg.assistant .bubble.mailbox-share-bubble { border-bottom-left-radius: 14px; }
.msg .bubble.mailbox-share-bubble:hover { transform: none; box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.4); }
.mailbox-share-card {
    background: var(--mailbox-paper);
    border: 1px solid var(--mailbox-fold);
    border-radius: 10px; padding: 16px;
    max-width: 268px; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.mailbox-share-card .ms-icon {
    text-align: center; margin-bottom: 8px;
}
.mailbox-share-card .ms-icon svg {
    width: 28px; height: 22px; color: var(--mailbox-ink-light); opacity: 0.6;
}
.mailbox-share-card .ms-title {
    font-family: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
    font-size: 15.5px; font-weight: 600; color: var(--mailbox-ink);
    text-align: center; line-height: 1.35; margin-bottom: 2px;
}
.mailbox-share-card .ms-author {
    font-family: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
    font-style: italic; font-size: 11px; color: var(--mailbox-ink-light);
    text-align: center; margin-bottom: 8px; opacity: 0.9;
}
.mailbox-share-card .ms-preview {
    font-size: 12.5px; color: var(--mailbox-ink); line-height: 1.6;
    text-align: left; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mailbox-share-card .ms-hint {
    font-size: 11px; color: var(--mailbox-ink-light); text-align: center;
    border-top: 1px dashed var(--mailbox-fold); padding-top: 6px; margin-top: 2px;
}

/* ===== 分享卡点击 → 聊天内临时信纸预览（全屏浮层，挂 #app；隐藏态插入 → rAF 加 .show 防闪） ===== */
.mailbox-share-preview-overlay {
    position: absolute; inset: 0; z-index: 1750;
    display: flex; align-items: center; justify-content: center;
    padding: 22px; box-sizing: border-box;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.mailbox-share-preview-overlay.show {
    opacity: 1;
    transition: none;
    animation: lscFadeIn 0.22s ease;
}
.mailbox-share-preview-overlay.show .mailbox-share-preview { animation: lscCardIn 0.28s cubic-bezier(0.25, 1, 0.35, 1); }
.mailbox-share-preview {
    width: min(340px, 88vw); max-height: 84vh;
    overflow-y: auto;
    background: var(--mailbox-paper);
    border: 1px solid var(--mailbox-fold);
    border-radius: 14px; padding: 20px 18px 16px;
    box-shadow: 0 14px 42px rgba(0,0,0,0.2);
}
.mailbox-share-preview .lsp-header {
    display: flex; align-items: flex-start; gap: 10px;
    border-bottom: 1px dashed var(--mailbox-fold); padding-bottom: 10px; margin-bottom: 10px;
}
.mailbox-share-preview .lsp-title {
    flex: 1; min-width: 0;
    font-family: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
    font-size: 18px; font-weight: 600; color: var(--mailbox-ink); line-height: 1.3;
}
.mailbox-share-preview .lsp-close {
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.05); color: var(--mailbox-ink);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.2s, transform 0.15s;
}
.mailbox-share-preview .lsp-close:hover { background: rgba(0,0,0,0.1); }
.mailbox-share-preview .lsp-close:active { transform: scale(0.92); }
.mailbox-share-preview .lsp-meta {
    font-family: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
    font-size: 12px; font-style: italic; margin-bottom: 14px; opacity: 0.9;
}
.mailbox-share-preview .lsp-body {
    font-family: 'Cormorant Garamond', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    /* 分享预览里的信件正文同上，跟着字号 / 行距走 */
    font-size: calc(15.5px * var(--read-fs-scale, 1)); line-height: calc(1.85 * var(--read-lh-scale, 1)); color: var(--mailbox-ink);
    white-space: pre-wrap; word-break: break-word;
}
.mailbox-share-preview .lsp-sign {
    text-align: right; font-family: 'Playfair Display', Georgia, serif;
    font-style: italic; font-size: 14px; color: var(--mailbox-ink);
    margin-top: 16px;
}
.mailbox-share-preview .lsp-sign .signature-name {
    font-family: 'Great Vibes', 'Playfair Display', Georgia, 'Noto Serif SC', 'PingFang SC', cursive;
    font-size: 20px; font-style: normal; line-height: 1.7;
}

/* ===== 回信进行中 / 温柔状态（延迟回信：落盘调度，不立刻生成） ===== */
.letter-reply-status { margin-top: 14px; }
.reply-warm {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 12px;
    background: var(--rose-light); color: var(--rose);
    font-size: 12.5px; line-height: 1.7; letter-spacing: 0.2px;
}
.reply-warm .reply-warm-icon { flex-shrink: 0; opacity: 0.8; }
.reply-warm.pending::after {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.6; flex-shrink: 0;
    animation: replyWarmPulse 1.6s ease-in-out infinite;
}
@keyframes replyWarmPulse {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 0.8; transform: scale(1.1); }
}
.reply-warm.failed { background: var(--lavender-light); color: var(--lavender); }
.reply-remind-btn {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 8px; margin-left: 4px;
    padding: 5px 14px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text-secondary);
    font-family: var(--font-body); font-size: 12px; cursor: pointer;
    transition: all 0.2s;
}
.reply-remind-btn:hover { border-color: var(--rose); color: var(--rose); }

/* ===== 帮助浮层行样式（信箱/日记/时间胶囊 共用简洁卡片，基础卡片样式在各面板 css） ===== */
.help-row {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 14px 0; text-align: left;
}
.help-ico {
    width: 34px; height: 34px; border-radius: 12px; flex-shrink: 0;
    background: var(--rose-light); color: var(--rose);
    display: flex; align-items: center; justify-content: center;
}
.help-ico svg { width: 17px; height: 17px; }
.help-txt { flex: 1; min-width: 0; }
.help-txt b {
    display: block; font-size: 13.5px; color: var(--text-primary);
    font-weight: 600; margin-bottom: 2px;
}
.help-txt p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* ===== 分享预览确认（隐藏态插入 → rAF 加 .show；open 动画独占、close 过渡独占） ===== */
.letter-share-confirm {
    position: absolute; inset: 0; z-index: 1700;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; box-sizing: border-box;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.18s ease;   /* close 方向 */
}
.letter-share-confirm.show {
    opacity: 1;
    transition: none;                 /* 断开 open 方向双驱动 */
    animation: lscFadeIn 0.22s ease;
}
.letter-share-confirm.show .lsc-card { animation: lscCardIn 0.28s cubic-bezier(0.25, 1, 0.35, 1); }
@keyframes lscFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lscCardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: none; }
}
.lsc-card {
    width: min(320px, 86vw);
    background: var(--surface-solid, #fff);
    border-radius: 18px; padding: 22px 18px 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.lsc-title {
    font-family: 'Playfair Display', Georgia, 'Noto Serif SC', 'STSong', 'PingFang SC', serif;
    font-style: italic; font-size: 19px; color: var(--text-primary);
    text-align: center; margin-bottom: 10px;
}
.lsc-meta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 12px; color: var(--text-secondary); margin-bottom: 10px;
}
.lsc-preview {
    font-size: 13px; line-height: 1.7; color: var(--text-primary);
    background: var(--bg-chat, #FCFAF6);
    border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 10px;
}
.lsc-tip { font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 14px; }
.lsc-btns { display: flex; gap: 10px; }
.lsc-btns button {
    flex: 1; height: 40px; border-radius: 20px; border: none;
    font-family: var(--font-body); font-size: 14px; cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}
.lsc-btns button:active { transform: scale(0.96); }
.lsc-cancel { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.lsc-ok { background: var(--rose); color: #fff; }
.lsc-ok:hover { opacity: 0.9; }
