/* 留言板专用样式 - 独立文件避免主样式缓存未更新 */
.message-form { margin-bottom: 32px; }

.message-login-prompt {
    text-align: center;
    padding: 32px 20px;
}

.message-login-prompt p {
    margin-bottom: 16px;
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

.message-board {
    padding: 20px;
}

.message-board__empty {
    color: #64748b;
    text-align: center;
    padding: 28px 20px;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.message-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.message-card.is-expanded {
    border-color: #a5b4fc;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
}

.message-card__toggle {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    box-sizing: border-box;
    outline: none;
}

.message-card__toggle:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
}

.message-card__toggle:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.message-card__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.message-card__summary {
    flex: 1;
    min-width: 0;
    display: block;
}

.message-card__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.message-card__author {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.message-card__count {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.message-card__count--muted {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.message-card__time {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.message-card__preview {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card__latest {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card__chevron {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 8px;
    border-radius: 999px;
    background: #f1f5f9;
    position: relative;
    transition: transform 0.2s, background 0.2s;
}

.message-card__chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translate(-60%, -70%) rotate(-45deg);
}

.message-card.is-expanded .message-card__chevron {
    transform: rotate(180deg);
    background: rgba(99, 102, 241, 0.12);
}

.message-card.is-expanded .message-card__chevron::before {
    border-color: #6366f1;
}

.message-card__detail {
    padding: 0 20px 20px;
    border-top: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.message-card__detail[hidden] {
    display: none !important;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
}

.message-thread__entry {
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.message-thread__entry--user {
    border-left: 4px solid #0ea5e9;
    background: #f8fafc;
}

.message-thread__entry--admin {
    border-left: 4px solid #6366f1;
    background: #f5f3ff;
}

.message-thread__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.message-thread__author {
    font-weight: 600;
    color: #334155;
}

.message-thread__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
}

.message-thread__time {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
}

.message-thread__content {
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    word-break: break-word;
}

.message-followup-form {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #fff;
}

.message-followup-form .form-group:last-of-type {
    margin-bottom: 12px;
}

.message-followup-form textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.message-followup-form textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.message-followup-form .captcha-group input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.message-list--admin {
    margin-top: 8px;
}

.message-thread__badge--user {
    color: #0369a1;
    background: rgba(14, 165, 233, 0.12);
}

.message-admin-reply-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #fff;
}

.message-admin-reply-form textarea {
    flex: 1;
    min-width: 0;
    min-height: 72px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.message-admin-reply-form textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.message-admin-reply-form .btn {
    flex-shrink: 0;
    align-self: flex-end;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .message-admin-reply-form {
        flex-direction: column;
    }

    .message-admin-reply-form .btn {
        width: 100%;
        align-self: stretch;
    }
}

.message-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.message-admin-actions__form {
    margin: 0;
}

.message-admin-actions__delete {
    color: #dc2626 !important;
    border-color: #fecaca !important;
}

.message-admin-actions__delete:hover {
    color: #fff !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}
