/* 全局样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏 */

.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.navbar-brand h1 {
    font-size: 18px;
    color: #667eea;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.navbar-menu a {
    text-decoration: none;
    color: #666;
    font-size: 13px;
    transition: color 0.2s;
}

.navbar-menu a:hover {
    color: #667eea;

/* 移动设备响应式 */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 10px;
        height: 50px;
    }
    
    .navbar-brand h1 {
        font-size: 16px;
    }
    
    .navbar-menu {
        gap: 15px;
    }
    
    .navbar-menu a {
        font-size: 11px;
    }
}
}

/* 主内容 */

.main-content {
    min-height: calc(100vh - 120px);
    padding-bottom: 60px;
}

/* 页脚 */

.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
}

/* 响应式 */

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .navbar-menu {
        gap: 15px;
    }
    
    .navbar-menu a {
        font-size: 12px;
    }
}

/* 公用按钮 */

button, a.btn {
    font-family: inherit;
}

/* 公用样式 */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 卡片样式 */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* 输入框 */

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-family: inherit;
}

/* 滚动条美化 */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 合并消息计数标记 */
.merged-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #667eea;
    color: white;
    font-size: 11px;
    border-radius: 10px;
    font-weight: 500;
}

/* 消息内容保留换行 */
.message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 附件容器 */
.message-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 图片缩略图 */
.attachment-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #e0e0e0;
    display: block;
}

.attachment-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

/* 附件链接 */
.attachment-link {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.attachment-link:hover {
    background: #667eea;
    color: white;
}

/* 图片查看弹窗 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 弹窗关闭按钮 */
.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
}

/* 弹窗图片 */
.image-modal-content {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}

/* 图片说明 */
.image-modal-caption {
    margin-top: 15px;
    text-align: center;
    color: #ccc;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    max-width: 80%;
    word-wrap: break-word;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .attachment-thumbnail {
        width: 100px;
        height: 100px;
    }
    
    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .image-modal-content {
        max-width: 95%;
        max-height: 80vh;
    }
}
.attachment-link:hover {
    background: #667eea;
    color: white;
}

/* 图片查看弹窗 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 弹窗关闭按钮 */
.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
}

/* 弹窗图片 */
.image-modal-content {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}

/* 图片说明 */
.image-modal-caption {
    margin-top: 15px;
    text-align: center;
    color: #ccc;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    max-width: 80%;
    word-wrap: break-word;
}
