/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #fff;
    color: #333;
    overflow: hidden;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-blue {
    background: #3498db;
    color: white;
}

.btn-blue:hover {
    background: #2980b9;
}

.btn-white {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.btn-white:hover {
    background: #f5f5f5;
}

.btn-gray {
    background: #95a5a6;
    color: white;
}

.btn-gray:hover {
    background: #7f8c8d;
}

.btn-red {
    background: #e74c3c;
    color: white;
}

.btn-red:hover {
    background: #c0392b;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    opacity: 0.7;
}

/* 认证页面 - 极简几何风格 - 黑白灰主题 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

/* 几何背景装饰 */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.geometric-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    transform: rotate(45deg);
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

@keyframes slideInStagger {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* 页面切换动画 - 不同组件不同动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-logo {
    animation: scaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-title {
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.animate-input {
    animation: slideInFromLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-button {
    animation: fadeInUp 0.6s ease-out both;
}

.animate-footer {
    animation: fadeIn 0.6s ease-out both;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

.slide-out {
    animation: slideOut 0.4s ease-in;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* 页面切换动画 - 首页和搜索页面 */
.page-transition {
    animation: pageFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.page-slide-out {
    animation: pageSlideOut 0.4s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes pageSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-40px) scale(0.96);
    }
}

/* 聊天容器组件动画 */
.animate-sidebar {
    animation: slideInFromLeft 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
}

.animate-user-info-sidebar {
    animation: fadeInDown 0.5s ease-out 0.2s both;
}

.chat-container.page-transition .search-bar {
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

.chat-container.page-transition .chat-categories {
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.chat-container.page-transition .chat-main {
    animation: fadeInUp 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

/* 搜索页面组件动画 */
.animate-back-btn {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.animate-search-box {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.animate-user-info {
    animation: slideInFromRight 0.6s ease-out 0.3s both;
}

.animate-tab {
    animation: fadeInDown 0.4s ease-out both;
}

.search-page.page-transition .search-results {
    animation: fadeIn 0.6s ease-out 0.4s both;
}

/* 搜索结果项动画 */
.result-item {
    animation: slideInFromLeft 0.5s ease-out both;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.15s; }
.result-item:nth-child(3) { animation-delay: 0.2s; }
.result-item:nth-child(4) { animation-delay: 0.25s; }
.result-item:nth-child(5) { animation-delay: 0.3s; }
.result-item:nth-child(n+6) { animation-delay: 0.35s; }

/* 消息气泡动画 */
.message-item {
    animation: fadeInUp 0.3s ease-out both;
}

.message-item:nth-last-child(1) { animation-delay: 0s; }
.message-item:nth-last-child(2) { animation-delay: 0.05s; }
.message-item:nth-last-child(3) { animation-delay: 0.1s; }

/* 系统消息动画 */
.system-message {
    animation: fadeInDown 0.4s ease-out both;
}

/* 模态框动画 */
.modal.show {
    animation: fadeIn 0.3s ease-out, scaleIn 0.3s ease-out;
}

/* 侧边栏动画 */
.sidebar-right.show {
    animation: slideInFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 按钮点击动画 */
.btn:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* 输入框聚焦动画 */
.form-group-minimal input:focus + .input-line {
    width: 100%;
    animation: expandLine 0.3s ease-out;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: relative;
    animation: pulse 2s infinite;
    background: rgba(255, 255, 255, 0.05);
}

.logo-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.auth-title {
    text-align: center;
    color: white;
    font-size: 36px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 50px;
    text-transform: uppercase;
}

.auth-form {
    width: 100%;
}

.form-group-minimal {
    margin-bottom: 30px;
    position: relative;
}

.form-group-minimal input {
    width: 100%;
    padding: 15px 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group-minimal input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group-minimal input:focus {
    outline: none;
    border-bottom-color: rgba(255, 255, 255, 0.9);
    color: white;
}

.form-group-minimal input:focus + .input-line {
    width: 100%;
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 0.3s ease;
}

.form-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-bottom: 20px;
    min-height: 20px;
    text-align: center;
    font-weight: 300;
}

.btn-minimal {
    width: 100%;
    padding: 18px 0;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-minimal span {
    position: relative;
    z-index: 1;
}

.btn-minimal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-minimal:hover {
    color: #1a1a1a;
    border-color: rgba(255, 255, 255, 1);
}

.btn-minimal:hover::before {
    left: 0;
}

.btn-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 0.3s ease;
}

.btn-minimal:hover .btn-line {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 40px;
}

.auth-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s ease;
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 0.3s ease;
}

.auth-link:hover {
    color: rgba(255, 255, 255, 0.95);
}

.auth-link:hover::after {
    width: 100%;
}

/* 通用表单样式（用于主界面） */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* 限制群描述和公告输入框宽度 */
#groupDescriptionInput,
#announcementContentInput {
    width: 100% !important;
    max-width: 100% !important;
    resize: vertical !important;
}

/* 创建群聊好友选择列表样式 */
#createGroupFriendsList {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #f9f9f9;
}

#createGroupFriendsList label {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 4px;
    transition: background 0.2s;
    user-select: none;
}

#createGroupFriendsList label:hover {
    background: #f0f0f0;
}

#createGroupFriendsList label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

#createGroupFriendsList .avatar {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    flex-shrink: 0;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* 聊天容器 */
.chat-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    background: #34495e;
    color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-info {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.username {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-id {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-bar {
    padding: 15px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-bar input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
}

.search-results-popup {
    position: absolute;
    top: 180px;
    left: 15px;
    right: 15px;
    max-height: 300px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results-popup.show {
    display: block;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.chat-categories {
    flex: 1;
    overflow-y: auto;
}

.category-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.category-header {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.category-header:hover {
    background: rgba(255,255,255,0.05);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.category-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.category-header:not(.collapsed) + .category-content {
    max-height: 1000px;
}

.contact-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s, transform 0.2s;
    animation: slideInStagger 0.4s ease-out both;
}

.contact-item:hover {
    background: rgba(255,255,255,0.05);
    transform: translateX(5px);
}

.contact-item.active {
    background: rgba(255,255,255,0.1);
}

.contact-item .avatar {
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid #34495e;
}

.online-indicator.offline {
    background: #95a5a6;
}

.contact-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    margin-bottom: 2px;
}

.contact-last-msg {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.system-message-item {
    padding: 10px 15px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.5;
}

.system-message-item .actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.sidebar-footer {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.add-menu {
    position: relative;
    flex: 1;
}

.add-menu-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    min-width: 150px;
    z-index: 100;
}

.add-menu-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

/* 头像 */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.avatar.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.avatar.large {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

/* 主聊天区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}

.chat-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 12px;
    color: #999;
}

.chat-content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* 群功能栏 */
.group-features-sidebar {
    width: 280px;
    border-left: 1px solid #eee;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feature-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.feature-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.announcement-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
}

.announcement-content {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-word;
}

.announcement-content.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-link {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: #2980b9;
}

.members-list {
    max-height: 400px;
    overflow-y: auto;
}

.member-item-sidebar {
    display: flex;
    align-items: center;
    padding: 8px 0;
    gap: 10px;
}

.member-item-sidebar .avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.member-item-sidebar .member-name {
    font-size: 13px;
    color: #333;
    flex: 1;
}

/* 公告列表 */
.announcement-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    position: relative;
}

.announcement-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.announcement-card-info {
    flex: 1;
}

.announcement-card-author {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.announcement-card-time {
    font-size: 11px;
    color: #999;
}

.announcement-card-actions {
    display: flex;
    gap: 8px;
}

.announcement-card-content {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.announcement-card-content.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.announcement-expand-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 0;
    margin-top: 4px;
}

.announcement-expand-btn:hover {
    color: #2980b9;
}

.modal-large {
    max-width: 600px;
    max-height: 80vh;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 头像上传 */
.avatar-upload-container {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.avatar-upload-area {
    flex: 1;
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9f9f9;
}

.avatar-upload-area:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.avatar-upload-area.dragover {
    border-color: #3498db;
    background: #e8f4f8;
}

.upload-hint {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

.message-item {
    display: flex;
    gap: 10px;
    max-width: 70%;
    margin-bottom: 15px;
}

.message-item.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
    font-size: 14px;
}

.message-content-wrapper {
    flex: 1;
    min-width: 0;
}

.message-name {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
    padding: 0 4px;
}

.message-item.own .message-name {
    text-align: right;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 8px;
    word-wrap: break-word;
    position: relative;
    display: inline-block;
}

.message-item:not(.own) .message-bubble {
    background: #f0f0f0;
    color: #333;
}

.message-item.own .message-bubble {
    background: #3498db;
    color: white;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 5px;
}

.typing-indicator {
    padding: 10px 15px;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

.input-area {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.input-area input:focus {
    outline: none;
    border-color: #3498db;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
}

.modal-content form {
    padding: 20px;
}

/* 右侧侧边栏 */
.sidebar-right {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.sidebar-right.show {
    right: 0;
}

.sidebar-right-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-right-header h2 {
    font-size: 20px;
}

.sidebar-right-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.member-item {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.member-actions {
    display: flex;
    gap: 8px;
}

.member-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #3498db;
    color: white;
}

.member-badge.admin {
    background: #e74c3c;
}

/* 胶囊开关 */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* 搜索页面 */
.search-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.search-header {
    padding: 20px;
    background: #34495e;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s;
}

.btn-back:hover {
    background: rgba(255,255,255,0.2);
}

.search-header .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 600px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

.search-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.result-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-item .avatar {
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.result-id {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.result-description {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.result-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #3498db;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: absolute;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-right {
        width: 100%;
        right: -100%;
    }

    .message-item {
        max-width: 85%;
    }

    .search-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 50%;
    }
}

/* 滚动条样式 */
::-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;
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 150px;
    padding: 4px 0;
    display: none;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item.context-menu-danger {
    color: #e74c3c;
}

.context-menu-item.context-menu-danger:hover {
    background: #fee;
}

.context-menu-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

