@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #06b6d4;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: rgba(99, 102, 241, 0.15);
    --bg-chat: #f8fafc;
    --bg-input: #ffffff;
    --bg-bubble-me: linear-gradient(135deg, #6366f1, #8b5cf6);
    --bg-bubble-other: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-sidebar: #e2e8f0;
    --text-sidebar-muted: #94a3b8;
    --text-white: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-chat);
    height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.5); }

/* ============ 登录/注册 ============ */
#auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--bg-dark);
    overflow: hidden;
    position: relative;
}

#auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(6,182,212,0.1) 0%, transparent 50%);
    animation: authBgFloat 20s ease-in-out infinite;
}

@keyframes authBgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

.auth-box {
    position: relative;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-box h1 {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-box .auth-subtitle {
    text-align: center;
    color: var(--text-sidebar-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-box h2 {
    margin-bottom: 24px;
    color: var(--text-white);
    font-size: 20px;
    font-weight: 500;
}

.auth-box input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-white);
    transition: var(--transition);
    font-family: inherit;
}

.auth-box input::placeholder { color: var(--text-sidebar-muted); }

.auth-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.auth-box button {
    width: 100%;
    padding: 14px;
    background: var(--bg-bubble-me);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    margin-top: 4px;
}

.auth-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.auth-box button:active { transform: translateY(0); }

.auth-box .switch {
    text-align: center;
    margin-top: 24px;
    color: var(--text-sidebar-muted);
    font-size: 14px;
}

.auth-box .switch a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-box .switch a:hover { color: var(--accent); }

/* ============ 主应用 ============ */
#main-page { display: flex; height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.user-info {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.user-info .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-bubble-me);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.user-info .user-name {
    font-weight: 500;
    font-size: 15px;
}

.user-info button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-sidebar-muted);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    font-family: inherit;
}

.user-info button:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: var(--danger);
}

.tabs {
    display: flex;
    padding: 4px;
    margin: 16px 16px 0;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-sidebar-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn.active {
    color: var(--text-white);
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.tab-btn:hover:not(.active) { color: var(--text-sidebar); }

.list { flex: 1; overflow-y: auto; padding: 8px; }

/* ============ 搜索 ============ */
.search-box {
    padding: 12px;
    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
    color: var(--text-white);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.search-box input::placeholder { color: var(--text-sidebar-muted); }

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box button {
    background: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover { background: var(--primary-dark); }

/* ============ 列表项 ============ */
.chat-item, .friend-item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    margin-bottom: 2px;
}

.chat-item:hover, .friend-item:hover { background: var(--bg-sidebar-hover); }

.chat-item.active {
    background: var(--bg-sidebar-active);
    border-left: 3px solid var(--primary);
}

.chat-avatar, .friend-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-bubble-me);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

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

.chat-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-sidebar);
}

.chat-preview {
    font-size: 13px;
    color: var(--text-sidebar-muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: var(--text-sidebar-muted);
    white-space: nowrap;
}

.friend-item .remove-btn {
    background: rgba(239,68,68,0.15);
    border: none;
    color: var(--danger);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    font-family: inherit;
}

.friend-item .remove-btn:hover {
    background: rgba(239,68,68,0.3);
}

/* ============ 聊天区域 ============ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
    position: relative;
}

.chat-header {
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

#chat-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-title::before {
    content: '💬';
    font-size: 20px;
}

.chat-header .call-buttons { display: flex; gap: 10px; }

.chat-header .call-buttons button {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.chat-header .call-buttons button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.08);
    transform: translateY(-1px);
}

.chat-header #voice-call-btn:hover {
    border-color: var(--success);
    color: var(--success);
    background: rgba(34,197,94,0.08);
}

/* ============ 消息区域 ============ */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    scroll-behavior: smooth;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.empty-state .empty-icon {
    font-size: 64px;
    opacity: 0.4;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state p { 
    font-size: 16px;
    font-weight: 500;
    color: #94a3b8;
}

/* ============ 消息气泡 ============ */
.message {
    display: flex;
    margin-bottom: 12px;
    animation: msgFadeIn 0.3s ease;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.sent { 
    justify-content: flex-end;
    padding-left: 60px;
}
.message.received { 
    justify-content: flex-start;
    padding-right: 60px;
}

.message-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 20px;
    word-break: break-word;
    line-height: 1.6;
    font-size: 14px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message-content:hover {
    transform: translateY(-2px);
}

.message.sent .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-white);
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.message.sent .message-content:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.message.received .message-content {
    background: #ffffff;
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.message.received .message-content:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.message-time {
    font-size: 11px;
    margin-top: 6px;
    text-align: right;
    opacity: 0.8;
    font-weight: 500;
}

.message.sent .message-time { 
    color: rgba(255,255,255,0.85);
}

.message.received .message-time {
    color: var(--text-secondary);
}

.message img {
    max-width: 240px;
    max-height: 300px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: block;
}

.message img:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }

.message video {
    max-width: 280px;
    border-radius: var(--radius-md);
    display: block;
}

.message audio {
    max-width: 240px;
    border-radius: var(--radius-md);
}

/* ============ 输入区域 ============ */
.input-area {
    border-top: 1px solid var(--border);
    padding: 20px 32px;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    position: relative;
}

.input-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.input-tools button {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    opacity: 0.7;
}

.input-tools button:hover {
    background: rgba(99,102,241,0.1);
    transform: translateY(-2px) scale(1.1);
    opacity: 1;
}

.input-box {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-box textarea {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    resize: none;
    height: 52px;
    max-height: 120px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--text-primary);
    transition: var(--transition);
    background: var(--bg-chat);
}

.input-box textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.input-box textarea::placeholder { color: var(--text-secondary); }

.input-box button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 14px 32px;
    border-radius: 26px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
    height: 52px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.input-box button:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.input-box button:active { 
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* ============ 表情包选择器 ============ */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 24px;
    right: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    padding: 16px;
    margin-bottom: 8px;
    z-index: 100;
    animation: emojiSlideUp 0.3s ease;
}

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

.emoji-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.emoji-categories button {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
}

.emoji-categories button:hover {
    background: #f1f5f9;
    color: #475569;
}

.emoji-categories button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.emoji-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
}

.emoji-item:hover {
    background: #f1f5f9;
    transform: scale(1.2);
}

/* ============ 视频通话弹窗 ============ */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-call-container {
    background: #0f172a;
    width: 90%;
    max-width: 900px;
    height: 85%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.video-header {
    padding: 16px 24px;
    background: rgba(0,0,0,0.4);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#call-status {
    font-size: 15px;
    font-weight: 500;
}

.video-header button {
    background: var(--danger);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-header button:hover { background: #dc2626; transform: scale(1.05); }

.video-wrapper { position: relative; background: #000; }
.video-wrapper.remote { flex: 1; }
.video-wrapper.local {
    position: absolute;
    bottom: 90px;
    right: 24px;
    width: 200px;
    height: 150px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.video-wrapper video { width: 100%; height: 100%; object-fit: cover; }

.video-placeholder {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.5);
    font-size: 15px;
}

/* ============ 语音通话 UI ============ */
.voice-call-ui {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.voice-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    animation: voicePulse 2s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5); }
}

.voice-wave {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 40px;
}

.voice-wave span {
    width: 6px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    animation: voiceWave 1s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { height: 20px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 35px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 50px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 35px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 20px; animation-delay: 0.4s; }

@keyframes voiceWave {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.call-controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 16px;
    background: rgba(0,0,0,0.4);
}

.call-controls button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.call-controls button:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.call-controls button.active {
    background: rgba(239,68,68,0.3);
    border-color: rgba(239,68,68,0.5);
}

/* ============ 来电弹窗 ============ */
.incoming-call {
    background: var(--bg-sidebar);
    padding: 48px;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: incomingPulse 2s ease-in-out infinite;
}

@keyframes incomingPulse {
    0%, 100% { box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 0 rgba(99,102,241,0.2); }
    50% { box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 20px rgba(99,102,241,0); }
}

.incoming-call .call-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: callRing 1.5s ease-in-out infinite;
}

@keyframes callRing {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(0deg); }
}

.incoming-call h2 {
    margin-bottom: 12px;
    color: var(--text-white);
    font-size: 22px;
    font-weight: 600;
}

.incoming-call p {
    font-size: 16px;
    color: var(--text-sidebar-muted);
    margin-bottom: 36px;
}

.incoming-call .call-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.incoming-call .call-buttons button {
    padding: 16px 48px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.incoming-call .call-buttons .accept {
    background: var(--success);
    color: white;
}

.incoming-call .call-buttons .accept:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34,197,94,0.4);
}

.incoming-call .call-buttons .reject {
    background: var(--danger);
    color: white;
}

.incoming-call .call-buttons .reject:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239,68,68,0.4);
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar { width: 280px; min-width: 280px; }
    .auth-box { margin: 20px; padding: 32px 24px; }
    .message-content { max-width: 80%; }
    .video-call-container { width: 95%; height: 90%; }
    .video-wrapper.local { width: 140px; height: 105px; }
}

/* ============ Upload Progress Bar ============ */
.upload-progress-bar {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
}

.upload-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-percent {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.upload-progress-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: 3px;
    transition: width 0.2s ease;
}
