/* ============================================================
   css/panels/panels-diary.css — 日记 & 时间胶囊样式（重做）
   暖米纸 + 干燥玫瑰 + 金色细线 + SVG 线条图标（零 emoji）
   层级铁律：编辑器 overlay 1520 > 信箱面板 1500
   ============================================================ */

/* === 信箱 Tab 栏 === */
.mailbox-tabs {
    display: flex; gap: 0; padding: 8px 12px 0;
    border-bottom: 1px solid var(--border);
}
.mailbox-tab {
    flex: 1; padding: 10px 0; text-align: center;
    font-family: var(--font-body); font-size: 14px; color: var(--text-secondary);
    background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: all 0.25s;
}
.mailbox-tab.active {
    color: var(--rose); border-bottom-color: var(--rose); font-weight: 600;
}
.mailbox-tab:hover { color: var(--rose); }

/* ===== 未看红点（页签标头 / 月份名 / 月份左右箭头）=====
   ★ 2026-10 甲方定：小红点一律跟主题色走（--rose），不再用固定未读红 */
.mailbox-tab.has-unread::after,
.dm-month-label.has-unread::after {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--rose, #C9A8A8); margin-left: 5px; vertical-align: 2px;
}
.dm-nav-btn { position: relative; }
.dm-nav-btn.has-unread::after {
    content: ''; position: absolute; top: 1px; right: 1px; width: 6px; height: 6px; border-radius: 50%;
    background: var(--rose, #C9A8A8); pointer-events: none;
    box-shadow: 0 0 0 1.5px var(--surface);
}
.mailbox-help-btn {
    flex: 0 0 auto; width: 30px; height: 30px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
    font-family: var(--font-display); font-size: 14px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.mailbox-help-btn:hover { border-color: var(--rose); color: var(--rose); transform: translateY(-1px); }

/* === 日记列表：头部 === */
/* 顶部留白交给月份吸顶标签，保证 sticky 顶到滚动区上缘 */
.diary-list { padding: 0 12px 12px; }
.diary-list-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 10px;
}
.diary-list-title { font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.diary-list-actions { display: flex; align-items: center; gap: 8px; }
.diary-help-btn {
    width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); font-family: var(--font-display); font-size: 14px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.diary-help-btn:hover { border-color: var(--rose); color: var(--rose); }

/* 页头星标筛选（与时间胶囊同款） */
.diary-filter-btn {
    width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.diary-filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.diary-filter-btn.active { border-color: var(--gold); color: var(--gold); background: var(--gold-light); }

.diary-write-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 18px; border: none; border-radius: 20px;
    background: var(--rose); color: #fff; font-family: var(--font-body); font-size: 13px;
    cursor: pointer; box-shadow: var(--shadow-xs), var(--shadow-sm);
    transition: all 0.2s;
}
.diary-write-btn:hover { background: var(--rose-hover); transform: translateY(-1px); }
.diary-write-btn-lg { padding: 10px 26px; font-size: 14px; margin-top: 14px; }

/* === 按月归纳：月份吸顶标题 === */
.diary-month { margin-bottom: 4px; }
.diary-month-label {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 8px;
    background: var(--bg-primary);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-faint);
}
.diary-month-text {
    font-family: var(--font-body); font-size: 13px; font-weight: 600;
    color: var(--text-secondary); letter-spacing: 0.5px;
}
.diary-month-count {
    font-family: var(--font-display); font-style: italic; font-size: 11px;
    color: var(--gold); margin-left: auto; opacity: 0.8;
}

/* === 日记卡片：标题为主角，其余全部降级变轻 === */
.diary-card {
    background: var(--surface); border-radius: 12px; padding: 15px 18px 14px; margin-bottom: 10px;
    box-shadow: var(--shadow-xs), var(--shadow-sm); cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative; overflow: hidden;
}
.diary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm), var(--shadow-md); }
.diary-card.sealed { opacity: 0.85; }
.diary-card-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.diary-card-date {
    font-family: var(--font-display); font-size: 11px; color: var(--gold);
    font-style: italic; letter-spacing: 0.06em;
}
.diary-card-star {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer; padding: 2px;
    transition: color 0.2s, transform 0.2s;
}
.diary-card-star:hover { color: var(--gold); transform: scale(1.15); }
.diary-card-star.filled { color: var(--gold); }
/* 标题：主角。加粗、留呼吸，最多两行。 */
.diary-card-title {
    font-family: var(--font-body); font-size: 17px; font-weight: 700;
    color: var(--text-primary); margin-bottom: 7px; line-height: 1.42;
    letter-spacing: 0.01em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-word;
}
/* 作者/心情/天气：最轻的一层，只做辅助，别抢标题。 */
.diary-card-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-muted); margin-bottom: 7px;
}
/* 预览：弱化为次级，颜色更淡，让标题一眼被看到。 */
.diary-card-preview {
    font-size: 12px; color: var(--text-muted); line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.diary-card-blur { font-size: 12px; color: var(--text-muted); filter: blur(2px); line-height: 1.7; }

/* 作者 chip / 心情天气 chip */
.diary-author-chip {
    display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 10px;
    font-size: 10.5px; font-weight: 500; white-space: nowrap;
}
.diary-author-chip.ai { background: var(--rose-light); color: var(--rose); }
.diary-author-chip.me { background: var(--sage-light); color: var(--sage); }
.diary-author-chip.co { background: var(--lavender-light); color: var(--lavender); }
.diary-chip {
    display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 10px;
    font-size: 10.5px; color: var(--text-secondary); background: var(--border-faint);
}
.diary-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 10px; font-weight: 500; }
.diary-badge.inviting { background: var(--lavender-light); color: var(--lavender); }
.diary-badge.sealed { background: var(--gold-light); color: var(--gold-dark); }

/* 合并卡（同一天多篇） */
.diary-card-merged { padding-bottom: 10px; }
.diary-merge-part { padding: 4px 0 8px; }
.diary-merge-part:hover { background: var(--border-faint); border-radius: 8px; }
.diary-merge-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-bottom: 4px;
}
.diary-merge-title {
    font-family: var(--font-body); font-size: 14.5px; font-weight: 600;
    color: var(--text-primary); line-height: 1.4; letter-spacing: 0.01em;
}
.diary-merge-author { margin-bottom: 4px; }
.diary-merge-divider {
    height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.35; margin: 8px 0;
}

/* === 日记详情 ===
   ★ 参与面板 flex 列布局（顶部固定栏下方、自己独立滚动）：
   之前 position:absolute + top:0 会把详情盖到返回条/标签下面，顶部按钮被固定栏遮挡（血泪） */
#mailbox-diary-detail {
    background: var(--bg-primary); overflow-y: auto; padding: 16px;
    /* iOS 键盘：详情里的续写框聚焦时，底部留出键盘高度，别把「完成这篇日记」压在键盘下面 */
    padding-bottom: calc(28px + var(--safe-bottom, 0px) + var(--kbd-h, 0px));
}
.diary-detail-paper {
    background: var(--surface); border-radius: 12px; padding: 24px 20px;
    box-shadow: var(--shadow-sm); min-height: 100%;
    border: 1px solid var(--border);
}
.diary-detail-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
@media (min-width: 380px) { .diary-detail-tools { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.diary-detail-tools button {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    padding: 7px 4px; border-radius: 14px; border: 1px solid var(--border);
    background: var(--surface); font-family: var(--font-body); font-size: 11.5px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.diary-detail-tools button svg { width: 12px; height: 12px; flex-shrink: 0; }
/* 固定六格：不适用于这篇日记的按钮留空位（占位但不可见），保证同样按钮永远在同一列 */
.diary-tool-ghost { visibility: hidden; }
.diary-detail-tools button:hover { border-color: var(--rose); color: var(--rose); }
.diary-detail-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.diary-detail-date { font-family: var(--font-display); font-size: 13px; color: var(--gold); font-style: italic; letter-spacing: 0.05em; }
.diary-detail-tag {
    display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-secondary);
    background: var(--rose-light); padding: 2px 10px; border-radius: 10px;
}
/* 详情标题：正文的主角，加粗留白；作者/标签压轻。 */
.diary-detail-title {
    font-family: var(--font-body); font-size: 22px; font-weight: 700;
    color: var(--text-primary); margin: 10px 0 6px; line-height: 1.32; letter-spacing: 0.01em;
}
.diary-detail-author { font-size: 12px; color: var(--text-muted); margin-bottom: 22px; letter-spacing: 0.02em; }
.diary-content { font-family: var(--font-body); font-size: 15px; line-height: 1.9; color: var(--text-primary); white-space: pre-wrap; }
.diary-divider { border: none; border-top: 1px dashed var(--border); margin: 20px 0; width: 40%; }
.diary-divider-full { width: 100%; border-top: 1px solid var(--gold); opacity: 0.3; }
/* ★ 2028-09 合写日记：分成几块「纸」，每块顶上一行小字标是谁写的（名字动态，长名字不撑破窄屏） */
.diary-seg { position: relative; padding: 2px 0 2px 14px; margin-bottom: 18px; }
.diary-seg:last-child { margin-bottom: 0; }
.diary-seg::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px;
    border-radius: 2px; background: var(--lavender-light, var(--rose-light)); opacity: 0.9;
}
.diary-seg-who {
    font-family: var(--font-serif, Georgia, serif); font-style: italic; font-size: 12px; letter-spacing: 0.04em;
    color: var(--text-muted); margin-bottom: 6px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.diary-seg-text { font-family: var(--font-body); font-size: 15px; line-height: 1.9; color: var(--text-primary); }
.diary-seg-text .diary-divider { margin: 14px 0; }
.diary-go-edit { margin-top: 8px; }
.diary-go-edit button {
    border: 1px solid var(--border); background: var(--surface); color: var(--rose);
    border-radius: 14px; padding: 6px 14px; font-family: var(--font-body); font-size: 13px; cursor: pointer;
}
.diary-go-edit button:hover { border-color: var(--rose); }
.diary-section-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.assistant-opening { background: var(--rose-light); padding: 16px; border-radius: 8px; margin-bottom: 16px; }
.diary-continue-area { margin-top: 16px; }
.diary-textarea {
    width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border);
    border-radius: 8px; font-family: var(--font-body); font-size: 15px; line-height: 1.8;
    background: var(--bg-primary); color: var(--text-primary); resize: vertical; box-sizing: border-box;
}
.diary-textarea:focus { border-color: var(--rose); box-shadow: var(--shadow-glow); }
.diary-save-btn {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 8px; padding: 10px 24px; border: none; border-radius: 20px;
    background: var(--rose); color: #fff; font-family: var(--font-body); font-size: 14px;
    cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-xs), var(--shadow-sm);
}
.diary-save-btn:hover { background: var(--rose-hover); }

/* 合并详情块 */
.diary-merge-block { padding: 6px 0; }
.diary-merge-block-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

/* 封印状态 */
.diary-sealed-msg { text-align: center; padding: 40px 20px; }
.seal-icon { color: var(--gold); margin-bottom: 16px; }
.seal-date { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }
.seal-message { font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--gold); margin-top: 12px; }
.diary-capsule-label { text-align: center; font-size: 11px; color: var(--gold); margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* === 日记编辑器（暖纸 + 玫瑰 + 金色细线，与时间胶囊编辑器同一风格） === */
.diary-editor-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 50% -12%, var(--rose-light), transparent 62%),
        var(--bg-primary);
    z-index: 1520; overflow-y: auto;
    /* iOS 键盘：滚动容器底部预留键盘/安全区高度，让"已输的最后几行+光标"能滚出键盘区 */
    padding-bottom: calc(24px + var(--safe-bottom, 0px) + var(--kbd-h, 0px));
}
.diary-editor-panel { padding: calc(14px + var(--safe-top)) 18px 44px; max-width: 480px; margin: 0 auto; }
.diary-editor-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
    position: relative;
}
.diary-editor-header::after {
    content: ''; position: absolute; left: 18px; right: 18px; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.55;
}
.diary-editor-header button {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 16px; border: none; border-radius: 16px;
    font-family: var(--font-body); font-size: 14px; cursor: pointer;
    background: var(--surface); color: var(--text-secondary); transition: all 0.2s;
}
.diary-editor-header button:hover { color: var(--rose); }
.diary-editor-header .diary-save-btn {
    background: var(--rose); color: #fff;
    box-shadow: var(--shadow-xs), var(--shadow-sm);
}
.diary-editor-header .diary-save-btn:hover { background: var(--rose-hover); color: #fff; }
.diary-editor-title-text {
    font-family: var(--font-body); font-size: 16px; font-weight: 600;
    color: var(--text-primary); letter-spacing: 0.3px;
}
.diary-editor-preview {
    background: var(--rose-light); padding: 16px; border-radius: 12px; margin-bottom: 16px;
    border: 1px solid var(--border);
}
.diary-editor-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.3px; }
.diary-editor-preview-content { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* 日期选择行：印章/邮戳样式 */
.diary-editor-date-row { margin-bottom: 16px; }
.diary-date-input {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 12px;
    font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: 0.5px;
    background: var(--surface); color: var(--rose);
    box-sizing: border-box; cursor: pointer; text-align: center;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
}
.diary-date-input:focus, .diary-date-input:hover { border-color: var(--rose); box-shadow: var(--shadow-glow); outline: none; }

/* 草稿提示 */
.diary-draft-banner {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gold-light); border-radius: 10px; padding: 9px 14px; margin-bottom: 16px;
    font-size: 12px; color: var(--gold-dark);
}
.diary-draft-banner button { background: none; border: none; color: var(--rose); font-size: 12px; cursor: pointer; }

/* 标题 / 正文：柔和纸卡，聚焦玫瑰柔光 */
.diary-editor-title {
    width: 100%; padding: 12px 14px; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: 12px;
    font-family: var(--font-body); font-size: 17px; font-weight: 600;
    background: var(--surface); color: var(--text-primary); box-sizing: border-box;
    transition: all 0.2s;
}
.diary-editor-title:focus { border-color: var(--rose); box-shadow: var(--shadow-glow); outline: none; }
.diary-editor-title::placeholder { color: var(--text-muted); }
.diary-editor-textarea {
    width: 100%; min-height: 220px; padding: 14px;
    border: 1px solid var(--border); border-radius: 12px;
    font-family: var(--font-body); font-size: 15px; line-height: 1.9;
    background: var(--surface); color: var(--text-primary); resize: vertical; box-sizing: border-box;
    transition: all 0.2s;
}
.diary-editor-textarea:focus { border-color: var(--rose); box-shadow: var(--shadow-glow); outline: none; }
.diary-editor-textarea::placeholder { color: var(--text-muted); }

/* ★ 日记配图相簿（编辑器 + 详情） */
.diary-album-label { font-size: 13px; color: var(--text-secondary); margin: 16px 0 10px; font-family: var(--font-display); font-style: italic; }
/* 详情/文档内相簿：网格平铺 */
.diary-album { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.diary-album-strip {
    display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px;
    scrollbar-width: thin; touch-action: pan-y;
}
.diary-album-cell {
    position: relative; width: 76px; height: 76px; border-radius: 10px; flex: 0 0 76px;
    overflow: hidden; background: var(--surface); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.diary-album-cell img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-touch-callout: none; }
.diary-album-cell.add {
    border: 1px dashed var(--border); color: var(--text-muted); flex-direction: column; gap: 3px;
    font-size: 12px; background: transparent;
}
.diary-album-cell.add svg { color: var(--rose); }
.diary-album-cell.uploading { border: none; }
.diary-album-spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--border); border-top-color: var(--rose);
    animation: diaryAlbumSpin 0.7s linear infinite;
}
@keyframes diaryAlbumSpin { to { transform: rotate(360deg); } }
.diary-album-cell.error { background: var(--surface); justify-content: center; }
.diary-album-del {
    position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; line-height: 1;
    border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.diary-album-cell.diary-album-dim { opacity: 0.35; }
.diary-album-cell.diary-album-dragging { border-radius: 10px; }


/* 心情/天气 chip 按钮 */
.diary-editor-mood-row, .diary-editor-weather-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.diary-mood-btn, .diary-weather-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 18px;
    background: var(--surface); font-family: var(--font-body); font-size: 12.5px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.diary-mood-btn:hover, .diary-weather-btn:hover { border-color: var(--rose); color: var(--rose); transform: translateY(-1px); }
.diary-mood-btn:active, .diary-weather-btn:active { transform: scale(0.96); }
.diary-mood-btn.active, .diary-weather-btn.active {
    border-color: var(--rose); background: var(--rose-light); color: var(--rose); font-weight: 600;
    box-shadow: var(--shadow-xs);
}
.diary-mood-btn svg, .diary-weather-btn svg, .diary-chip svg, .diary-detail-tag svg { vertical-align: middle; }

/* === 写日记界面：他在这天写过（回忆块） === */
#diary-his-block { margin-bottom: 16px; }
.diary-his-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--gold-dark); font-weight: 600;
    margin-bottom: 8px; letter-spacing: 0.3px;
}
.diary-his-head svg { color: var(--gold); }
.diary-his-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
    box-shadow: var(--shadow-xs);
}
.diary-his-row {
    display: flex; align-items: center; gap: 8px; cursor: pointer; flex-wrap: wrap;
}
.diary-his-title {
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
    color: var(--text-primary); flex-shrink: 0;
}
.diary-his-preview {
    flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diary-his-toggle {
    flex-shrink: 0; font-size: 11.5px; color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px;
    transition: all 0.2s;
}
.diary-his-row:hover .diary-his-toggle { border-color: var(--rose); color: var(--rose); }
.diary-his-full {
    margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border);
    font-size: 13px; color: var(--text-secondary); line-height: 1.8;
    animation: hisFullIn 0.25s ease-out;
}
@keyframes hisFullIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.diary-his-fulltext { white-space: pre-wrap; word-break: break-word; }
.diary-his-note { font-size: 12.5px; color: var(--text-muted); }
.diary-his-item.locked {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: var(--text-muted);
}
.diary-his-item.locked svg { color: var(--gold); flex-shrink: 0; }

/* === 时间胶囊列表 === */
.capsule-list { padding: 12px; }
.capsule-card {
    background: var(--surface); border-radius: 12px; padding: 16px; margin-bottom: 10px;
    box-shadow: var(--shadow-xs), var(--shadow-sm); cursor: pointer; display: flex; gap: 14px; align-items: flex-start;
    transition: transform 0.2s;
}
.capsule-card:hover { transform: translateY(-1px); }
.capsule-card-icon { color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.capsule-card-body { flex: 1; min-width: 0; }
.capsule-card-type { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.capsule-card-title { font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.capsule-card-dates { font-size: 12px; color: var(--text-secondary); }
.capsule-card-message { font-family: var(--font-display); font-style: italic; font-size: 13px; color: var(--gold); margin-top: 4px; }
.capsule-status { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.capsule-status.sealed { background: var(--gold-light); color: var(--gold-dark); }
.capsule-status.opened { background: var(--rose-light); color: var(--rose); }

/* === 空状态（信件/日记/时间胶囊共用：金色圆底 + 大图标） === */
.mailbox-empty { text-align: center; padding: 56px 20px; }
.mailbox-empty-icon {
    width: 76px; height: 76px; margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--gold-light);
    border: 1.5px dashed var(--gold);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    opacity: 1;
    transition: transform 0.25s ease;
}
.mailbox-empty-icon svg { width: 40px; height: 40px; display: block; }
.mailbox-empty-title {
    font-family: var(--font-body); font-size: 16px; font-weight: 600;
    color: var(--text-primary); margin-bottom: 6px;
}
.mailbox-empty-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
[data-theme-mode="dark"] .mailbox-empty-icon {
    background: rgba(196,168,106,0.12);
    border-color: rgba(196,168,106,0.4);
    color: var(--gold);
}

/* 时间胶囊封印表单 */
.diary-seal-form { padding: 20px; }
.diary-seal-form h3 { font-family: var(--font-body); font-size: 18px; color: var(--text-primary); margin-bottom: 16px; }
.diary-seal-form label { display: block; font-size: 13px; color: var(--text-secondary); margin: 10px 0 4px; }
.diary-seal-date {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-family: var(--font-body); font-size: 14px; background: var(--bg-primary); color: var(--text-primary); box-sizing: border-box; cursor: pointer;
}
.diary-seal-message {
    width: 100%; min-height: 60px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-family: var(--font-body); font-size: 14px; background: var(--bg-primary); color: var(--text-primary); resize: vertical; box-sizing: border-box;
}
.diary-seal-btns { display: flex; gap: 10px; margin-top: 16px; }
.diary-seal-btns button {
    flex: 1; padding: 10px; border: none; border-radius: 20px; font-family: var(--font-body); font-size: 14px; cursor: pointer;
}
.diary-seal-btns button:first-child { background: var(--gold); color: #fff; }
.diary-seal-btns button:last-child { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }

/* 帮助浮层 */
.diary-help-overlay,
.mailbox-help-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: 1530; display: flex; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box;
}
.diary-help-card,
.mailbox-help-card {
    background: var(--surface); border-radius: 16px; padding: 24px; max-width: 320px;
    max-height: 82vh; overflow-y: auto;   /* ★ 限高可滚动，防帮助内容超出屏幕 */
    box-shadow: var(--shadow-lg); text-align: center;
}
.diary-help-card h3,
.mailbox-help-card h3 { font-family: var(--font-body); font-size: 18px; color: var(--text-primary); margin-bottom: 12px; }
.diary-help-card p,
.mailbox-help-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 6px 0; text-align: left; }
.diary-help-card button,
.mailbox-help-card button {
    margin-top: 16px; padding: 8px 24px; border: none; border-radius: 20px;
    background: var(--rose); color: #fff; font-family: var(--font-body); font-size: 14px; cursor: pointer;
}

/* === 窄屏适配 === */
@media (max-width: 370px) {
    .diary-card { padding: 12px; }
    .diary-card-title { font-size: 14px; }
    .diary-detail-paper { padding: 16px 14px; }
    .diary-detail-title { font-size: 18px; }
    .diary-mood-btn, .diary-weather-btn { font-size: 11px; padding: 4px 10px; }
}

/* === 删除按钮（危险操作，温柔红） === */
.diary-tool-danger { color: #b0655a !important; border-color: rgba(176,101,90,0.35) !important; }
.diary-tool-danger:hover { background: rgba(176,101,90,0.08) !important; }

/* === 聊天内日记详情浮层（点泡泡卡直接展开） ===
   挂载 #app 内（竖屏约束）；遵循第十五节：基类 opacity:0 + close transition，.show 里 transition:none + animation 独占 */
.chat-diary-overlay {
    position: absolute; inset: 0; z-index: 1560;
    opacity: 0; transition: opacity 0.22s ease;
    pointer-events: none;
}
.chat-diary-overlay.show {
    opacity: 1; transition: none;
    animation: chatDiaryFadeIn 0.26s ease-out;
    pointer-events: auto;
}
@keyframes chatDiaryFadeIn { from { opacity: 0; } to { opacity: 1; } }
.chat-diary-mask {
    position: absolute; inset: 0;
    background: rgba(30,28,26,0.42); backdrop-filter: blur(2px);
}
.chat-diary-sheet {
    position: absolute; left: 14px; right: 14px; top: 52px; bottom: 26px;
    background: var(--bg-primary); border-radius: 16px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
.chat-diary-top {
    flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end;
    padding: 8px 12px 4px;
}
.chat-diary-close {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.2s;
}
.chat-diary-close:hover { border-color: var(--rose); color: var(--rose); transform: rotate(90deg); }
.chat-diary-close:active { transform: rotate(90deg) scale(0.9); }
.chat-diary-body {
    flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 18px;
    scrollbar-gutter: stable;
}
.chat-diary-loading, .chat-diary-missing {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 13px; padding-bottom: 40px;
}
.chat-diary-invite {
    margin-top: 14px; text-align: center;
}
.chat-diary-invite .diary-save-btn {
    border: none; border-radius: 20px; background: var(--rose); color: #fff;
    padding: 10px 22px; font-family: var(--font-body); font-size: 14px; cursor: pointer;
    transition: all 0.2s;
}
.chat-diary-invite .diary-save-btn:active { transform: scale(0.96); }

/* ===== 月度导航（日记 & 信箱共用：默认本月，左右翻月，点月回本月） ===== */
.diary-month-nav, .mailbox-month-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin: 12px 16px 6px; padding: 6px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.diary-month-nav .dm-nav-btn, .mailbox-month-nav .dm-nav-btn {
    width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.diary-month-nav .dm-nav-btn:hover, .mailbox-month-nav .dm-nav-btn:hover { border-color: var(--rose); color: var(--rose); background: var(--rose-light); }
.diary-month-nav .dm-month-label, .mailbox-month-nav .dm-month-label {
    font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--text-primary);
    cursor: pointer; letter-spacing: 0.4px;
}
.diary-month-nav .dm-month-label:hover, .mailbox-month-nav .dm-month-label:hover { color: var(--rose); }
.diary-month-nav .dm-nav-btn svg, .mailbox-month-nav .dm-nav-btn svg { pointer-events: none; }

/* ===== 聊天内写日记编辑器（点泡泡卡直接写，关闭即回聊天） ===== */
.chat-diary-editor-overlay {
    position: absolute; inset: 0; z-index: 1570;
    opacity: 0; transition: opacity 0.22s ease; pointer-events: none;
}
.chat-diary-editor-overlay.show {
    opacity: 1; transition: none; animation: chatDiaryFadeIn 0.26s ease-out; pointer-events: auto;
}
.chat-diary-editor-overlay .diary-editor-panel {
    position: absolute; left: 14px; right: 14px; top: 52px; bottom: 26px;
    background: var(--bg-primary); border-radius: 16px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    padding: 14px 18px calc(44px + var(--safe-bottom, 0px) + var(--kbd-h, 0px));
    max-width: 460px; margin: 0 auto;
    overflow-y: auto; scrollbar-gutter: stable;
}

/* ★ 隐藏日记/信箱帮助浮层及编辑器的可见滚动条（防挤占宽度、组件偏移） */
.diary-editor-overlay *,
.chat-diary-editor-overlay *,
.diary-help-overlay *,
.mailbox-help-overlay * { scrollbar-width: none; -ms-overflow-style: none; }
.diary-editor-overlay ::-webkit-scrollbar,
.chat-diary-editor-overlay ::-webkit-scrollbar,
.diary-help-overlay ::-webkit-scrollbar,
.mailbox-help-overlay ::-webkit-scrollbar { display: none; }
