/**
 * 留言板「朋友圈」样式
 * 微信朋友圈风格，直接展示所有内容，无需展开
 */

/* ==================== 留言列表容器 ==================== */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 0;
}

/* ==================== 留言卡片（朋友圈风格） ==================== */
.envelope-card {
    position: relative;
    background: #fff;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 0;
    border-bottom: 1px solid #f0f0f0;
    animation: fadeInUp 0.4s ease backwards;
}

.envelope-card:nth-child(1) { animation-delay: 0.05s; }
.envelope-card:nth-child(2) { animation-delay: 0.08s; }
.envelope-card:nth-child(3) { animation-delay: 0.11s; }
.envelope-card:nth-child(4) { animation-delay: 0.14s; }
.envelope-card:nth-child(5) { animation-delay: 0.17s; }
.envelope-card:nth-child(6) { animation-delay: 0.2s; }
.envelope-card:nth-child(n+7) { animation-delay: 0.23s; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 移除所有信封装饰 */
.envelope-flap,
.wax-seal,
.postmark,
.expand-hint {
    display: none !important;
}

/* 移除信封背景 */
.envelope-body {
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}
.envelope-body::before {
    display: none !important;
}

/* ==================== 头部（头像+昵称+时间） ==================== */
.letter-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
}

.letter-avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    border: none;
    object-fit: cover;
    background: #e0e0e0;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1.2rem;
    color: #666;
}

.letter-info {
    margin-left: 0;
    flex: 1;
    min-width: 0;
}

.letter-nickname {
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    font-size: 1rem;
    font-weight: 500;
    color: #4c6b8a;
}

.letter-time {
    font-size: 0.75rem;
    color: #b0b0b0;
    margin-top: 2px;
}

/* ==================== 留言内容 ==================== */
.letter-content {
    position: relative;
    background: none;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    transform-origin: none;
    transition: none;
    max-height: none;
    overflow: visible;
}
.letter-content::before {
    display: none;
}

.letter-text {
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.7;
    padding: 0;
    margin-bottom: 12px;
    word-break: break-word;
}
.letter-text::before,
.letter-text::after {
    display: none;
}

/* ==================== 签名 ==================== */
.letter-signature {
    text-align: right;
    font-family: 'ZCOOL XiaoWei', cursive;
    font-size: 0.85rem;
    color: #b0b0b0;
    margin-top: 10px;
    margin-bottom: 0;
}
.letter-signature::before {
    content: '—— ';
}

/* ==================== 留言图片 ==================== */
.letter-image {
    margin: 12px 0;
    padding: 0;
    background: none;
    border-radius: 6px;
    overflow: hidden;
}
.letter-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: block;
}
.letter-image img:hover {
    opacity: 0.9;
    transform: none;
}

/* ==================== 互动按钮 ==================== */
.letter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: none;
}

.letter-like-btn,
.letter-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #888;
    transition: all 0.2s ease;
}

.letter-like-btn:hover,
.letter-comment-btn:hover {
    background: rgba(0,0,0,0.04);
}

.letter-like-btn.liked {
    color: #e74c3c;
}
.letter-like-btn.liked .like-icon {
    color: #e74c3c;
}

/* ==================== 点赞列表 ==================== */
.letter-likes-list {
    background: #f7f7f7;
    padding: 6px 10px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}
.letter-likes-list span {
    color: #4c6b8a;
    font-weight: 500;
}

/* ==================== 评论区 ==================== */
.letter-comments {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}

.comments-list {
    background: #f7f7f7;
    padding: 8px 10px;
    border-radius: 4px;
}

.comment-item {
    display: block;
    gap: 0;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    line-height: 1.5;
}
.comment-item:last-child {
    border-bottom: none;
}

.comment-nickname {
    color: #4c6b8a;
    font-weight: 500;
}

.comment-content {
    color: #333;
}

.comment-time {
    font-size: 0.7rem;
    color: #b0b0b0;
    margin-top: 2px;
    display: block;
}

.comment-input-area {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: env(safe-area-inset-bottom, 10px);
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    min-width: 0;
    background: #fafafa;
}
.comment-input:focus {
    outline: none;
    border-color: #4c6b8a;
    background: #fff;
}

.comment-submit-btn {
    padding: 8px 16px;
    background: #4c6b8a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.comment-submit-btn:hover {
    background: #3d5a73;
}

/* ==================== 语音留言播放器 ==================== */
.voice-message-player {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f2f5;
    padding: 8px 14px;
    border-radius: 6px;
    margin: 10px 0;
    cursor: pointer;
    transition: background 0.2s;
}
.voice-message-player:hover {
    background: #e8eaed;
}
.voice-message-player .voice-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
}
.voice-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 16px;
}
.voice-wave span {
    display: block;
    width: 3px;
    background: #4c6b8a;
    border-radius: 2px;
    animation: none;
}
.voice-message-player.playing .voice-wave span {
    animation: voiceWave 0.6s ease-in-out infinite alternate;
}
.voice-wave span:nth-child(1) { height: 6px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 14px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 6px; animation-delay: 0.4s; }

@keyframes voiceWave {
    0% { height: 4px; }
    100% { height: 16px; }
}

.voice-duration {
    font-size: 0.8rem;
    color: #888;
}

/* ==================== 删除按钮 ==================== */
.delete-msg-btn {
    display: none !important;
    background: none !important;
    border: none !important;
    color: #ccc !important;
    cursor: pointer;
    font-size: 0.8rem !important;
    padding: 4px !important;
}
.delete-msg-btn:hover {
    color: #e74c3c !important;
}

/* ==================== 留言输入框（朋友圈风格） ==================== */
.msg-compose-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.msg-compose-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.msg-compose-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #4c6b8a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.msg-compose-textarea {
    flex: 1;
    border: none;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    min-height: 60px;
    padding: 8px 0;
}
.msg-compose-textarea:focus {
    outline: none;
}
.msg-compose-textarea::placeholder {
    color: #b0b0b0;
}

.msg-compose-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.msg-compose-tools {
    display: flex;
    gap: 8px;
}

.msg-tool-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.msg-tool-btn:hover {
    background: rgba(0,0,0,0.04);
}

.msg-compose-count {
    font-size: 0.75rem;
    color: #b0b0b0;
}

.msg-compose-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    margin-top: 10px;
    object-fit: cover;
}

.msg-submit-btn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: #4c6b8a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}
.msg-submit-btn:hover {
    background: #3d5a73;
}

/* AI 生成卡片 */
.ai-gen-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.ai-gen-header {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f7f7f7;
}
.ai-gen-content {
    padding: 14px;
}
.ai-gen-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: none;
    min-height: 50px;
}
.ai-gen-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}
.ai-gen-upload {
    background: #f0f2f5;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.ai-gen-upload input {
    display: none;
}
.ai-gen-ref-preview {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
    object-fit: cover;
}
.ai-gen-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fafafa;
    margin-left: auto;
}
.ai-gen-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.ai-gen-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}
.ai-gen-actions button:first-child {
    background: #4c6b8a;
    color: #fff;
}
.ai-gen-actions button:last-child {
    background: #f0f2f5;
    color: #666;
}

/* ==================== 未登录遮罩 ==================== */
.lyb-login-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}
.lyb-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 300px;
}
.lyb-login-card h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #333;
}
.lyb-login-card p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.lyb-login-btn {
    padding: 10px 24px;
    background: #4c6b8a;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* ==================== 语音留言输入框 ==================== */
.voice-message-box {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.voice-back-bar {
    margin-bottom: 12px;
}
.voice-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4c6b8a;
    padding: 4px 0;
}
.voice-record-area {
    text-align: center;
}
.voice-record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4c6b8a;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 0.1s;
}
.voice-record-btn:active {
    transform: scale(0.95);
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 600px) {
    .envelope-card {
        padding: 12px;
        margin-bottom: 8px;
    }
    .letter-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .letter-nickname {
        font-size: 0.9rem;
    }
    .letter-text {
        font-size: 0.9rem;
    }
    .comment-input-area {
        gap: 6px;
    }
    .comment-input {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .comment-submit-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .letter-comments {
        padding-bottom: 70px;
    }
    .msg-compose-avatar {
        width: 32px;
        height: 32px;
    }
}

/* ==================== 页面标题区域 ==================== */
.page-header {
    margin-bottom: 16px;
}
.page-title {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 4px;
}
.page-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
}

/* ==================== 空状态 ==================== */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #b0b0b0;
    font-size: 0.95rem;
}
