* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 10px; }
::selection { color: #fff; background-color: #a855f7; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #050810 0%, #0a1128 100%); color: #e2e8f0; min-height: 100vh; display: flex; flex-direction: column; }

.header { background: rgba(8, 12, 21, 0.9); backdrop-filter: blur(12px); border-bottom: none; position: sticky; top: 0; z-index: 100; }
.nav { display: flex; justify-content: space-between; align-items: center; max-width: 120rem; margin: 0 auto; padding: 1.5rem 3rem; gap: 2rem; }
.logo { font-size: 2.4rem; font-weight: 700; background: linear-gradient(90deg, #a855f7, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; flex-shrink: 0; }
.nav-list { display: flex; list-style: none; gap: 0.5rem; }
.nav-list li { display: flex; align-items: center; }
.nav-list a { text-decoration: none; color: #94a3b8; font-size: 1.6rem; padding: 0.5rem 1rem; transition: all 0.3s ease; border-radius: 0.8rem; white-space: nowrap; }
.nav-list a:hover, .nav-list a.active { color: #a855f7; background: rgba(168, 85, 247, 0.1); }

.nav-avatar { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 1rem; border-radius: 2rem; text-decoration: none; transition: all 0.3s ease; flex-shrink: 0; }
.nav-avatar:hover { background: rgba(168, 85, 247, 0.1); }
.nav-avatar img { width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168, 85, 247, 0.4); }
.nav-avatar:hover img { border-color: #a855f7; }
.nav-avatar-name { font-size: 1.4rem; color: #e2e8f0; font-weight: 500; white-space: nowrap; }

.nav-search { position: relative; flex-shrink: 0; }
.nav-search input { height: 3.6rem; width: 20rem; padding: 0 1rem 0 3.2rem; font-size: 1.4rem; border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 2rem; outline: none; background: rgba(255, 255, 255, 0.04); color: #e2e8f0; transition: all 0.3s; }
.nav-search input::placeholder { color: #475569; }
.nav-search input:focus { border-color: #a855f7; width: 26rem; }
.nav-search::before { content: '🔍'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; pointer-events: none; }

/* 私信按钮 */
.nav-icon-btn { display: none; align-items: center; justify-content: center; width: 4rem; height: 4rem; font-size: 1.8rem; text-decoration: none; color: #94a3b8; transition: all 0.3s; border-radius: 0.8rem; position: relative; flex-shrink: 0; }
.nav-icon-btn:hover { color: #a855f7; background: rgba(168, 85, 247, 0.1); }
#message-badge { position: absolute; top: -0.3rem; right: -0.3rem; min-width: 1.8rem; height: 1.8rem; background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-size: 1rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* 移动端汉堡菜单 */
.nav-hamburger { display: none; position: relative; flex-direction: column; gap: 0.5rem; background: none; border: none; cursor: pointer; padding: 0.5rem; z-index: 300; }
.nav-hamburger span { display: block; width: 2.4rem; height: 0.2rem; background: #e2e8f0; border-radius: 0.1rem; transition: all 0.3s; }
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(0.5rem, 0.5rem); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(0.5rem, -0.5rem); }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 50; backdrop-filter: blur(4px); }
.mobile-overlay.show { display: block; }
body.no-scroll { overflow: hidden; }

.account-dropdown { display: none; position: absolute; top: calc(100% + 0.8rem); right: 0; min-width: 22rem; background: rgba(15, 23, 42, 0.98); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 1rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); z-index: 200; overflow: hidden; backdrop-filter: blur(20px); }
.account-dropdown.show { display: block; animation: dropIn 0.2s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-0.5rem); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; cursor: pointer; transition: background 0.2s ease; }
.dropdown-item:hover { background: rgba(168, 85, 247, 0.1); }
.dropdown-item img { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; border: 1px solid rgba(168, 85, 247, 0.2); }
.dropdown-item span { flex: 1; font-size: 1.4rem; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-header { padding: 1rem 1.5rem; font-size: 1.2rem; color: #64748b; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.dropdown-empty { padding: 1.5rem; text-align: center; font-size: 1.3rem; color: #475569; }
.dropdown-remove { background: none; border: none; color: #475569; cursor: pointer; font-size: 1.2rem; padding: 0.3rem; border-radius: 0.3rem; transition: all 0.2s; }
.dropdown-remove:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.dropdown-footer { padding: 0.8rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.dropdown-footer a { font-size: 1.3rem; color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.dropdown-footer a:hover { color: #a855f7; }

.main { max-width: 60rem; margin: 0 auto; padding: 3rem 2rem; flex: 1; width: 100%; }

.messages-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(168, 85, 247, 0.2); }
.messages-header h2 { font-size: 2.4rem; background: linear-gradient(90deg, #a855f7, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }

.conversations-list { display: flex; flex-direction: column; gap: 1rem; }
.conversation-item { display: flex; align-items: center; gap: 1.2rem; padding: 1.5rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(168, 85, 247, 0.15); border-radius: 1.2rem; cursor: pointer; transition: all 0.3s; }
.conversation-item:hover { background: rgba(168, 85, 247, 0.08); border-color: rgba(168, 85, 247, 0.4); transform: translateX(0.5rem); }
.conversation-item.unread { border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.06); }
.conversation-item .avatar { width: 5rem; height: 5rem; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168, 85, 247, 0.3); flex-shrink: 0; }
.conversation-info { flex: 1; min-width: 0; }
.conversation-name { font-size: 1.6rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.5rem; }
.conversation-preview { font-size: 1.3rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.time { font-size: 1.2rem; color: #64748b; }
.unread-badge { min-width: 1.8rem; height: 1.8rem; background: #ef4444; color: #fff; border-radius: 50%; font-size: 1.1rem; display: none; align-items: center; justify-content: center; }
.unread-badge.show { display: flex; }

.login-prompt { display: flex; justify-content: center; align-items: center; padding: 10rem; }
.login-prompt p { font-size: 2rem; color: #94a3b8; }
.login-prompt a { color: #a855f7; text-decoration: none; }
.login-prompt a:hover { color: #ec4899; }

.empty-state { text-align: center; padding: 5rem; color: #64748b; font-size: 1.6rem; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); z-index: 300; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.show { display: flex; }
.modal-box { background: rgba(15, 23, 42, 0.98); border: 1px solid rgba(168, 85, 247, 0.3); border-radius: 1.5rem; padding: 2.5rem; max-width: 50rem; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-box h3 { font-size: 2rem; color: #e2e8f0; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 1.4rem; color: #94a3b8; margin-bottom: 0.8rem; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem 1.2rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(168, 85, 247, 0.3); border-radius: 0.8rem; color: #e2e8f0; font-size: 1.4rem; outline: none; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { border-color: #a855f7; }

/* 自定义用户选择下拉框 */
.form-select {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.8rem;
    color: #e2e8f0;
    font-size: 1.4rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    padding-right: 3.5rem;
    transition: all 0.3s;
}
.form-select:focus { border-color: #a855f7; }
.form-select option { background: #0f172a; color: #e2e8f0; padding: 0.8rem; }
.form-select option:hover { background: rgba(168, 85, 247, 0.2); }

/* 用户选择下拉面板（更美观的替代方案） */
.user-select-wrapper { position: relative; }
.user-select-btn {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.8rem;
    color: #94a3b8;
    font-size: 1.4rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}
.user-select-btn:hover, .user-select-btn.active { border-color: #a855f7; background: rgba(168, 85, 247, 0.08); }
.user-select-btn .placeholder { color: #64748b; }
.user-select-btn .selected-user { display: flex; align-items: center; gap: 0.8rem; color: #e2e8f0; }
.user-select-btn .selected-user img { width: 2.8rem; height: 2.8rem; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168, 85, 247, 0.3); }
.user-select-btn .arrow { font-size: 1.2rem; transition: transform 0.3s; }
.user-select-btn.active .arrow { transform: rotate(180deg); }

.user-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.8rem;
    max-height: 25rem;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.user-select-dropdown.show { display: block; animation: dropIn 0.2s ease; }

.user-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}
.user-option:hover { background: rgba(168, 85, 247, 0.1); }
.user-option img { width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168, 85, 247, 0.2); }
.user-option-info { flex: 1; min-width: 0; }
.user-option-name { font-size: 1.4rem; color: #e2e8f0; font-weight: 500; }
.user-option-role { font-size: 1.2rem; color: #64748b; }
.user-option .check { color: #a855f7; font-size: 1.4rem; }

.user-empty { padding: 2rem; text-align: center; color: #64748b; font-size: 1.3rem; }

.user-search-input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    color: #e2e8f0;
    font-size: 1.3rem;
    outline: none;
}
.user-search-input::placeholder { color: #475569; }
.form-group textarea { min-height: 12rem; resize: vertical; }
.char-count { text-align: right; font-size: 1.2rem; color: #64748b; margin-top: 0.5rem; }
.modal-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 2rem; }
.btn { padding: 1rem 2rem; border-radius: 0.8rem; font-size: 1.4rem; cursor: pointer; transition: all 0.3s; border: none; }
.btn-primary { background: linear-gradient(135deg, #a855f7, #ec4899); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4); }
.btn-outline { background: transparent; border: 1px solid rgba(168, 85, 247, 0.3); color: #94a3b8; }
.btn-outline:hover { border-color: #a855f7; color: #a855f7; }

.chat-box { max-width: 50rem; width: 95%; height: 70vh; display: flex; flex-direction: column; padding: 0; }
.chat-header { display: flex; align-items: center; gap: 1rem; padding: 1.5rem 2rem; border-bottom: 1px solid rgba(168, 85, 247, 0.2); }
.back-btn { background: none; border: none; color: #a855f7; font-size: 1.4rem; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.message { display: flex; align-items: flex-end; gap: 0.8rem; max-width: 80%; }
.message-me { align-self: flex-end; flex-direction: row-reverse; }
.message-other { align-self: flex-start; }
.message .avatar { width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.message-other .avatar { margin-right: 0; }
.message-other .message-content { margin-left: 0; }
.message-me .avatar { margin-left: 0; }
.message-me .message-content { margin-right: 0; }
.message-content { padding: 1rem 1.5rem; border-radius: 1.2rem; font-size: 1.4rem; line-height: 1.5; word-break: break-word; }
.message-me .message-content { background: linear-gradient(135deg, #a855f7, #ec4899); color: #fff; border-bottom-right-radius: 0.3rem; }
.message-other .message-content { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.2); color: #e2e8f0; border-bottom-left-radius: 0.3rem; }
.chat-input-area { display: flex; gap: 1rem; padding: 1.5rem; border-top: 1px solid rgba(168, 85, 247, 0.2); }
.chat-input-area textarea { flex: 1; padding: 1rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(168, 85, 247, 0.3); border-radius: 0.8rem; color: #e2e8f0; font-size: 1.4rem; outline: none; resize: none; min-height: 4rem; max-height: 10rem; font-family: inherit; }
.chat-input-area textarea:focus { border-color: #a855f7; }
.chat-input-area .btn { flex-shrink: 0; }
.chat-box .char-count { padding: 0 1.5rem 1rem; text-align: right; }

.messages-header .btn { padding: 0.8rem 1.5rem; font-size: 1.3rem; }

.footer { background: rgba(8, 12, 21, 0.9); border-top: 1px solid rgba(168, 85, 247, 0.1); text-align: center; padding: 2rem; margin-top: auto; }
.footer p { font-size: 1.4rem; color: #64748b; }

@media (max-width: 768px) {
    .nav-hamburger { display: flex; }
    .nav-search { display: none; }
    .nav-list { display: none; position: fixed; top: 0; left: 0; width: min(28rem, 80vw); height: 100vh; background: rgba(8, 12, 21, 0.98); flex-direction: column; padding: 8rem 2rem 3rem; gap: 0.5rem; z-index: 200; border-right: 1px solid rgba(168, 85, 247, 0.2); overflow-y: auto; backdrop-filter: blur(20px); }
    .nav-list.mobile-open { display: flex; animation: slideIn 0.3s ease; }
    @keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
    .nav-list a { font-size: 1.8rem; padding: 1.2rem 1.5rem; }
    .nav-avatar-name { display: none; }
    .messages-container { padding: 1rem; }
    .modal-box { width: 95%; padding: 1.5rem; }
    .chat-box { width: 98%; height: 85vh; }
    .message { max-width: 90%; }
    .conversation-item .avatar { width: 4rem; height: 4rem; }
    .conversations-list { gap: 0.8rem; }
    .conversation-item { padding: 1.2rem; }
    .messages-header h2 { font-size: 2rem; }
    .user-select-dropdown { max-height: 20rem; }
    .user-option { padding: 0.8rem 1rem; }
    .user-option img { width: 2.8rem; height: 2.8rem; }
    .account-dropdown { min-width: 0; width: 85vw; max-width: 32rem; right: 0; left: auto; transform: none; }
    .dropdown-item { padding: 1.2rem 1.5rem; }
    .dropdown-item img { width: 4rem; height: 4rem; }
    .dropdown-item span { font-size: 1.6rem; }
}
