/* ============================================================
   见字如面 v1.2.0 — 文艺书信风视觉系统
   设计：复古书信 × 暖色毛玻璃 × 仪式感动效
   ============================================================ */

/* ============ 变量 ============ */
.zlb-root, #zlb-mailbox {
    --zlb-theme: #c0392b;
    --zlb-theme-soft: rgba(192, 57, 43, 0.12);
    --zlb-envelope: #8b5a3c;
    --zlb-envelope-dark: #6b4423;
    --zlb-paper: #f4e8d0;
    --zlb-paper-line: rgba(180, 150, 100, 0.35);
    --zlb-ink: #4a3a2a;
    --zlb-bg: rgba(28, 20, 14, 0.92);
    --zlb-gold: #d4af37;
    --zlb-gold-soft: rgba(212, 175, 55, 0.5);
}

/* ============ 浮动信封按钮 ============ */
.zlb-float-btn {
    position: fixed;
    right: 26px;
    bottom: 86px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--zlb-theme, #c0392b) 0%, #a93226 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99998;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(192, 57, 43, 0.4), 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s;
    animation: zlb-float-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               zlb-breath 3.5s ease-in-out 0.7s infinite;
}
.zlb-float-btn:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 12px 32px rgba(192, 57, 43, 0.5), 0 5px 12px rgba(0, 0, 0, 0.35);
}
.zlb-float-btn .zlb-envelope-icon {
    width: 30px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

/* 光环（用于新信脉冲） */
.zlb-float-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--zlb-gold, #d4af37);
    opacity: 0;
    pointer-events: none;
}

/* 默认呼吸光晕 */
@keyframes zlb-breath {
    0%, 100% { box-shadow: 0 8px 24px rgba(192, 57, 43, 0.4), 0 3px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 175, 55, 0); }
    50%      { box-shadow: 0 8px 24px rgba(192, 57, 43, 0.45), 0 3px 8px rgba(0, 0, 0, 0.3), 0 0 12px 2px rgba(212, 175, 55, 0.35); }
}
@keyframes zlb-float-in {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* === 新信闪动状态（has-new）=== */
.zlb-float-btn.has-new {
    animation: zlb-float-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               zlb-new-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s,
               zlb-new-glow 1.8s ease-in-out 1.3s infinite;
}
.zlb-float-btn.has-new .zlb-envelope-icon {
    animation: zlb-new-shake 1.6s ease-in-out 1.3s infinite;
    transform-origin: 50% 80%;
}
.zlb-float-btn.has-new .zlb-float-ring {
    animation: zlb-new-ring 1.8s ease-out 1.3s infinite;
}
.zlb-float-btn.has-new .zlb-float-ring:nth-child(2) {
    animation-delay: 2.2s;
}

/* 信封左右轻晃 */
@keyframes zlb-new-shake {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(-10deg); }
    30%      { transform: rotate(9deg); }
    45%      { transform: rotate(-7deg); }
    60%      { transform: rotate(5deg); }
    75%      { transform: rotate(-3deg); }
}
/* 按钮整体弹跳一次 */
@keyframes zlb-new-bounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.18) translateY(-6px); }
    60%  { transform: scale(0.95) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
}
/* 持续微闪 */
@keyframes zlb-new-glow {
    0%, 100% { box-shadow: 0 8px 24px rgba(192, 57, 43, 0.5), 0 0 16px 3px rgba(212, 175, 55, 0.55); }
    50%      { box-shadow: 0 8px 24px rgba(192, 57, 43, 0.4), 0 0 6px 1px rgba(212, 175, 55, 0.2); }
}
/* 金色光环脉冲扩散 */
@keyframes zlb-new-ring {
    0%   { transform: scale(1); opacity: 0.8; border-width: 3px; }
    100% { transform: scale(1.8); opacity: 0; border-width: 1px; }
}

/* 未读红点 */
.zlb-float-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee0a3f);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 8px rgba(238, 10, 63, 0.6);
    border: 2px solid #fff;
    animation: zlb-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes zlb-badge-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ============ 信箱面板模态 ============ */
.zlb-modal {
    position: fixed;
    inset: 0;
    background: var(--zlb-bg);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    overflow-y: auto;
    pointer-events: auto;
}
/* 暖色光斑装饰背景 */
.zlb-modal::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.zlb-modal::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 55%;
    height: 55%;
    background: radial-gradient(circle, rgba(192, 57, 43, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.zlb-modal.open {
    opacity: 1;
    visibility: visible;
}

/* 面板主体：信纸摊开质感 */
.zlb-modal-stage {
    position: relative;
    width: 100%;
    max-width: 540px;
    margin: auto;
    background:
        linear-gradient(135deg, #faf3e0 0%, #f0e4c8 100%);
    border-radius: 16px;
    padding: 0;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.25);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    display: flex;
    flex-direction: column;
}
.zlb-modal.open .zlb-modal-stage {
    transform: scale(1) translateY(0);
    opacity: 1;
}
/* 信纸边缘纹理 */
.zlb-modal-stage::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        repeating-linear-gradient(0deg, transparent 0, transparent 28px, rgba(180, 150, 100, 0.08) 28px, rgba(180, 150, 100, 0.08) 29px);
    pointer-events: none;
    z-index: 0;
}

/* 面板头部：书法标题 */
.zlb-mailbox-header {
    position: relative;
    text-align: center;
    padding: 26px 24px 16px;
    border-bottom: 1px solid rgba(139, 90, 60, 0.2);
    z-index: 1;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent);
}
.zlb-mailbox-title {
    font-family: 'STKaiti', 'KaiTi', '楷体', 'Ma Shan Zheng', 'Georgia', serif;
    font-size: 26px;
    font-weight: 700;
    color: #3a2a1a;
    letter-spacing: 6px;
    margin: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.zlb-mailbox-sub {
    font-size: 12px;
    color: #9a8a6a;
    margin-top: 4px;
    letter-spacing: 2px;
    font-family: 'Georgia', serif;
}
/* 装饰小印章 */
.zlb-mailbox-seal {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e74c3c 0%, #c0392b 60%, #8b0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'STKaiti', 'KaiTi', serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    transform: rotate(-8deg);
}
.zlb-mailbox-seal::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.35);
}

/* 关闭按钮 */
.zlb-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(58, 42, 26, 0.1);
    color: #5a4a3a;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}
.zlb-close:hover {
    background: rgba(58, 42, 26, 0.2);
    transform: rotate(90deg);
}

/* ============ 书签式 Tab ============ */
.zlb-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    margin: 0;
    border-bottom: none;
    position: relative;
    z-index: 1;
    background: rgba(139, 90, 60, 0.06);
}
.zlb-tab {
    flex: 1;
    text-align: center;
    padding: 12px 8px 11px;
    cursor: pointer;
    color: #8b6f5a;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.25s;
    position: relative;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 1px;
}
.zlb-tab:hover {
    color: #5a4a3a;
    background: rgba(139, 90, 60, 0.06);
}
.zlb-tab.active {
    color: var(--zlb-theme, #c0392b);
    border-bottom-color: var(--zlb-theme, #c0392b);
    background: rgba(255, 253, 248, 0.6);
}
.zlb-tab.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--zlb-theme, #c0392b);
}

/* tab 内容区 */
.zlb-tab-content {
    display: none;
    padding: 24px 26px 28px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    flex: 1;
}
.zlb-tab-content.active {
    display: block;
    animation: zlb-page-flip 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes zlb-page-flip {
    from { opacity: 0; transform: translateX(20px) rotateY(8deg); }
    to   { opacity: 1; transform: translateX(0) rotateY(0); }
}

/* ============ 写信区 ============ */
.zlb-write-title {
    font-size: 19px;
    font-weight: 700;
    color: #3a2a1a;
    margin-bottom: 4px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
}
.zlb-write-sub {
    font-size: 13px;
    color: #9a8a6a;
    margin-bottom: 20px;
    font-family: 'Georgia', serif;
}
.zlb-field {
    margin-bottom: 16px;
}
.zlb-field label {
    display: block;
    font-size: 13px;
    color: #7a6a5a;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.zlb-field input[type="text"],
.zlb-field textarea,
.zlb-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(139, 90, 60, 0.25);
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 14px;
    background: rgba(255, 253, 248, 0.7);
    color: #3a2a1a;
    font-family: 'STKaiti', 'KaiTi', '楷体', 'Georgia', serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    line-height: 1.7;
}
.zlb-field input[type="text"]:focus,
.zlb-field textarea:focus,
.zlb-field select:focus {
    border-color: var(--zlb-theme, #c0392b);
    box-shadow: 0 0 0 3px var(--zlb-theme-soft, rgba(192, 57, 43, 0.12));
    background: #fffdf8;
}
.zlb-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 30px;
    background-image: repeating-linear-gradient(0deg, transparent 0, transparent 29px, rgba(180, 150, 100, 0.15) 29px, rgba(180, 150, 100, 0.15) 30px);
    background-attachment: local;
}

/* 心情/主题 chips */
.zlb-mood-row, .zlb-topic-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.zlb-chip {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    background: rgba(139, 90, 60, 0.08);
    color: #7a6a5a;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    user-select: none;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
}
.zlb-chip:hover {
    background: rgba(139, 90, 60, 0.16);
    transform: translateY(-1px);
}
.zlb-chip.active {
    background: var(--zlb-theme, #c0392b);
    color: #fff;
    box-shadow: 0 3px 8px rgba(192, 57, 43, 0.3);
}
.zlb-char-count {
    font-size: 12px;
    color: #b0a090;
    margin-top: 4px;
    text-align: right;
    font-family: 'Georgia', serif;
}
.zlb-form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

/* ============ 按钮 ============ */
.zlb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 26px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}
.zlb-btn-primary {
    background: linear-gradient(135deg, var(--zlb-theme, #c0392b), #a93226);
    color: #fff;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
}
.zlb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(192, 57, 43, 0.45);
    filter: brightness(1.08);
}
.zlb-btn-gold {
    background: linear-gradient(135deg, var(--zlb-gold, #d4af37), #b8941f);
    color: #3a2a1a;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}
.zlb-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(212, 175, 55, 0.55);
    filter: brightness(1.08);
}
.zlb-btn-ghost {
    background: transparent;
    color: #7a6a5a;
    border: 1px solid rgba(139, 90, 60, 0.3);
}
.zlb-btn-ghost:hover {
    background: rgba(139, 90, 60, 0.08);
    border-color: var(--zlb-theme, #c0392b);
    color: var(--zlb-theme, #c0392b);
}
.zlb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============ 收信区空状态（立体信封按钮 + 飘落）============ */
.zlb-read-placeholder,
.zlb-mine-placeholder {
    text-align: center;
    padding: 30px 10px;
    color: #8a7a6a;
    position: relative;
}
.zlb-empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
    display: inline-block;
    animation: zlb-float-envelope 3s ease-in-out infinite;
}
@keyframes zlb-float-envelope {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-8px) rotate(3deg); }
}
.zlb-empty-state {
    text-align: center;
    padding: 30px 10px;
    color: #8a7a6a;
}
.zlb-empty-state .zlb-empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

/* ============ 信封（纯 CSS 绘制，用于收信动画）============ */
.zlb-envelope {
    position: relative;
    width: 280px;
    height: 190px;
    margin: 20px auto;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(60px) scale(0.6) rotate(-12deg);
}
.zlb-envelope.fly-in {
    animation: zlb-env-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes zlb-env-in {
    0%   { opacity: 0; transform: translateY(80px) scale(0.5) rotate(-15deg); }
    60%  { opacity: 1; transform: translateY(-10px) scale(1.04) rotate(3deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
.zlb-env-body {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--zlb-envelope, #8b5a3c) 0%, var(--zlb-envelope-dark, #6b4423) 100%);
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}
.zlb-env-front {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--zlb-envelope-dark, #6b4423) 0%, var(--zlb-envelope, #8b5a3c) 100%);
    clip-path: polygon(0 30%, 50% 100%, 100% 30%, 100% 100%, 0 100%);
    border-radius: 6px;
    z-index: 3;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}
.zlb-env-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(180deg, var(--zlb-envelope, #8b5a3c) 0%, var(--zlb-envelope-dark, #6b4423) 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53);
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.zlb-envelope.opening .zlb-env-flap {
    transform: rotateX(-180deg);
    z-index: 1;
}
.zlb-seal {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e74c3c 0%, var(--zlb-theme, #c0392b) 60%, #8b0000 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 -3px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'STKaiti', 'KaiTi', serif;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s, transform 0.4s;
}
.zlb-seal::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}
.zlb-envelope.opening .zlb-seal {
    animation: zlb-seal-break 0.5s ease-out forwards;
}
@keyframes zlb-seal-break {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
    40%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3) rotate(15deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(45deg); }
}

/* ============ 信纸（收信展示）============ */
.zlb-letter-paper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background:
        linear-gradient(90deg, transparent 0, transparent 44px, rgba(192, 57, 43, 0.15) 44px, rgba(192, 57, 43, 0.15) 45px, transparent 45px),
        repeating-linear-gradient(0deg, transparent 0, transparent 29px, var(--zlb-paper-line, rgba(180, 150, 100, 0.35)) 29px, var(--zlb-paper-line, rgba(180, 150, 100, 0.35)) 30px),
        linear-gradient(135deg, var(--zlb-paper, #f4e8d0) 0%, #ede0c4 100%);
    border-radius: 6px;
    padding: 28px 24px 24px 56px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    color: var(--zlb-ink, #4a3a2a);
    font-family: 'STKaiti', 'KaiTi', '楷体', 'Georgia', serif;
    line-height: 30px;
    font-size: 15px;
    opacity: 0;
    transform: scaleY(0) translateY(-20px);
    transform-origin: top center;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease;
}
.zlb-letter-paper.expanding {
    animation: zlb-paper-expand 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    max-height: 80vh;
    overflow-y: auto;
}
@keyframes zlb-paper-expand {
    0%   { opacity: 0; transform: scaleY(0) translateY(-20px); max-height: 0; }
    50%  { opacity: 0.6; transform: scaleY(0.3) translateY(-10px); }
    100% { opacity: 1; transform: scaleY(1) translateY(0); max-height: 80vh; }
}
.zlb-paper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--zlb-paper-line, rgba(180, 150, 100, 0.35));
    flex-wrap: wrap;
    gap: 8px;
}
.zlb-paper-meta {
    font-size: 12px;
    color: #8b6914;
    font-family: 'Georgia', serif;
    line-height: 1.6;
}
.zlb-paper-meta .zlb-from { font-weight: bold; color: var(--zlb-theme, #c0392b); }
.zlb-paper-mood,
.zlb-paper-topic {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 4px;
}
.zlb-paper-mood  { background: var(--zlb-theme-soft, rgba(192, 57, 43, 0.12)); color: var(--zlb-theme, #c0392b); }
.zlb-paper-topic { background: rgba(139, 105, 20, 0.12); color: #8b6914; }
.zlb-paper-content {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 100px;
    font-size: 15px;
    line-height: 30px;
    color: var(--zlb-ink, #4a3a2a);
}
.zlb-paper-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--zlb-paper-line, rgba(180, 150, 100, 0.35));
    flex-wrap: wrap;
}

/* ============ 回信展示 ============ */
.zlb-replies {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--zlb-paper-line, rgba(180, 150, 100, 0.35));
}
.zlb-replies-title {
    font-size: 13px;
    color: #8b6914;
    margin-bottom: 10px;
    font-family: 'Georgia', serif;
}
.zlb-reply-item {
    background: rgba(255, 248, 225, 0.6);
    border-left: 3px solid var(--zlb-theme, #c0392b);
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 28px;
}
.zlb-reply-meta {
    font-size: 12px;
    color: #8b6914;
    margin-bottom: 4px;
}

/* ============ 我的信件列表 ============ */
.zlb-my-list {
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 2px;
}
.zlb-my-letter {
    background: linear-gradient(135deg, var(--zlb-paper, #f4e8d0), #ede0c4);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    color: var(--zlb-ink, #4a3a2a);
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    position: relative;
    border-left: 3px solid var(--zlb-theme, #c0392b);
    animation: zlb-card-in 0.4s ease both;
}
@keyframes zlb-card-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.zlb-my-letter-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
}
.zlb-my-letter-status.pending  { background: rgba(214, 54, 56, 0.15); color: #d63638; }
.zlb-my-letter-status.approved { background: rgba(70, 180, 80, 0.15); color: #46b450; }
.zlb-my-letter-preview {
    font-size: 14px;
    line-height: 26px;
    margin: 8px 0;
    max-height: 72px;
    overflow: hidden;
    position: relative;
}
.zlb-my-letter-preview::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 24px;
    background: linear-gradient(transparent, var(--zlb-paper, #f4e8d0));
}
.zlb-my-letter-foot {
    font-size: 12px;
    color: #8b6914;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* ============ 投递成功 ============ */
.zlb-deliver-ok {
    text-align: center;
    padding: 24px 10px;
    animation: zlb-fade-in 0.5s ease;
}
.zlb-ok-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #46b450, #2d8a35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(70, 180, 80, 0.45);
    animation: zlb-ok-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.zlb-ok-icon svg { width: 34px; height: 34px; }
@keyframes zlb-ok-pop {
    0%   { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0); }
}
.zlb-deliver-ok h3 {
    font-size: 20px;
    color: #3a2a1a;
    margin-bottom: 8px;
    font-family: 'STKaiti', 'KaiTi', serif;
}
.zlb-deliver-ok p {
    font-size: 14px;
    color: #8a7a6a;
    line-height: 1.8;
}

/* ============ 写信/回信表单（回信用）============ */
.zlb-write-form {
    width: 100%;
    background: linear-gradient(135deg, var(--zlb-paper, #f4e8d0), #ede0c4);
    border-radius: 6px;
    padding: 24px 22px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    color: var(--zlb-ink, #4a3a2a);
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.4s, transform 0.4s;
}
.zlb-write-form.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============ Toast ============ */
.zlb-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: rgba(28, 20, 14, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.35s, transform 0.35s;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
}
.zlb-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.zlb-toast.success { border-left: 3px solid #46b450; }
.zlb-toast.error   { border-left: 3px solid #d63638; }
.zlb-toast.warning { border-left: 3px solid #ffb900; }

/* ============ 加载动画 ============ */
.zlb-spin {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: zlb-spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes zlb-spin { to { transform: rotate(360deg); } }

.zlb-loading-dots {
    text-align: center;
    color: #9a8a6a;
    padding: 36px 20px;
}
.zlb-loading-dots .zlb-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--zlb-gold, #d4af37);
    margin: 0 4px;
    animation: zlb-bounce 1.2s infinite ease-in-out;
}
.zlb-loading-dots .zlb-dot:nth-child(2) { animation-delay: 0.15s; }
.zlb-loading-dots .zlb-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes zlb-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40%           { transform: scale(1); opacity: 1; }
}

@keyframes zlb-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ 响应式 ============ */
@media (max-width: 600px) {
    .zlb-float-btn { right: 18px; bottom: 74px; width: 52px; height: 52px; }
    .zlb-float-btn .zlb-envelope-icon { width: 26px; height: 19px; }
    .zlb-modal { padding: 10px; }
    .zlb-modal-stage { max-width: 100%; max-height: 92vh; }
    .zlb-mailbox-header { padding: 20px 18px 12px; }
    .zlb-mailbox-title { font-size: 22px; letter-spacing: 4px; }
    .zlb-mailbox-seal { width: 28px; height: 28px; font-size: 14px; top: 14px; right: 16px; }
    .zlb-tabs { padding: 0 12px; }
    .zlb-tab { font-size: 13px; padding: 10px 4px 9px; }
    .zlb-tab-content { padding: 18px 16px 22px; }
    .zlb-envelope { width: 220px; height: 150px; }
    .zlb-seal { width: 44px; height: 44px; font-size: 17px; }
    .zlb-letter-paper { padding: 20px 16px 18px 40px; font-size: 14px; line-height: 28px; }
    .zlb-letter-paper.expanding { max-height: 75vh; }
    .zlb-write-form { padding: 18px 14px; }
    .zlb-field textarea { min-height: 110px; }
}

/* 暗色主题适配 */
body.dark-theme .zlb-modal-stage {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 175, 55, 0.3);
}
