/* ============================================================
 * 留言板
 * 文件：css/message.css
 * ============================================================ */

/* 留言板 */
.message-board {
    margin-top: 20px;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

/* 留言时不填昵称了，这里显示当前登录身份 */
.message-identity {
    font-size: 0.92rem;
    color: #6b7684;
    background-color: #f4f7fb;
    border: 1px dashed #d7e0ea;
    border-radius: 8px;
    padding: 10px 14px;
}

.message-identity.online {
    color: #1e7a3c;
    background-color: #eaf6ee;
    border-color: #bfe3cb;
    border-style: solid;
}

.message-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
}

.message-form textarea:focus {
    outline: none;
    border-color: #989898;
    box-shadow: 0 0 5px rgba(152, 152, 152, 0.3);
}

.message-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    font-size: 1rem;
}

/* 占位文字统一成浅灰，深色模式下也看得清 */
.message-form input::placeholder,
.message-form textarea::placeholder {
    color: #999;
}

.message-form input:focus {
    outline: none;
    border-color: #989898;
    box-shadow: 0 0 5px rgba(152, 152, 152, 0.3);
}

.send-btn {
    width: 150px;
    padding: 12px;
    background-color: #2f2f2f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

.send-btn:hover {
    background-color: #989898;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.messages-list {
    margin-top: 20px;
}

.message-item {
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;   /* 给右上角的删除按钮定位用 */
}

/* 自己发的留言右上角会出现「删除」 */
.message-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.8rem;
    color: #b3261e;
    background-color: #fdeaea;
    border: 1px solid #f7cfcf;
    border-radius: 6px;
    padding: 3px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.message-delete:hover {
    background-color: #f9d7d7;
}

.message-author {
    font-weight: bold;
    color: #2f2f2f;
    margin-bottom: 8px;
}

.message-content {
    color: #555;
    line-height: 1.6;
}

.message-time {
    font-size: 0.85rem;
    color: #999;
    margin-top: 10px;
    text-align: right;
}
/* 留言内容太长时自动换行，避免撑破卡片 */
.message-content {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
