/* ===============================
   1. 全局与基础样式
   =============================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

/* 现代优雅滚动条 (微信/macOS 风格) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.14);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.32);
}

::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.48);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* 针对侧边栏列表、聊天窗口等常用滚动区域定制 */
.user-list,
.chat-window,
.detail-panel,
.request-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.14) transparent;
}

.user-list::-webkit-scrollbar,
.chat-window::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar,
.request-panel::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.user-list::-webkit-scrollbar-track,
.chat-window::-webkit-scrollbar-track,
.detail-panel::-webkit-scrollbar-track,
.request-panel::-webkit-scrollbar-track {
    background: transparent;
}

.user-list::-webkit-scrollbar-thumb,
.chat-window::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb,
.request-panel::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 6px;
}

.user-list:hover::-webkit-scrollbar-thumb,
.chat-window:hover::-webkit-scrollbar-thumb,
.detail-panel:hover::-webkit-scrollbar-thumb,
.request-panel:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.22);
}

.user-list::-webkit-scrollbar-thumb:hover,
.chat-window::-webkit-scrollbar-thumb:hover,
.detail-panel::-webkit-scrollbar-thumb:hover,
.request-panel::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.38);
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hidden { display: none !important; }

/* ===============================
   2. 提示框 & 弹窗
   =============================== */
#toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    background: white; padding: 12px 24px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-size: 14px; font-weight: 500;
    display: flex; align-items: center; animation: slideDown 0.3s ease-out forwards;
}
.toast.success { border-left: 4px solid #00c853; color: #00c853; }
.toast.error { border-left: 4px solid #ff3d00; color: #ff3d00; }
.toast.info { border-left: 4px solid #2979ff; color: #2979ff; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 模态框 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px);
    z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 1; transition: opacity 0.3s;
}
.modal-box {
    background: white; width: 380px; padding: 24px; border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-align: left; animation: scaleUp 0.2s ease-out;
}
@keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box h3 { text-align: left; font-size: 17px; font-weight: 600; color: #191919; margin-bottom: 8px; }
.modal-desc { text-align: left; font-size: 14px; color: #808080; margin-bottom: 20px; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 16px; margin-top: 24px; }
.modal-buttons button {
    flex: none; min-width: 90px; padding: 8px 20px; border-radius: 4px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: background-color 0.2s;
}
.btn-cancel { background: #f2f2f2; color: #191919; }
.btn-cancel:hover { background: #e5e5e5; }
.btn-confirm { background: #07c160; color: white; }
.btn-confirm:hover { background-color: #06ad53; }
.btn-confirm-delete { background: #ff4d4f; color: white; }
.btn-confirm-delete:hover { background-color: #ff7875; }


/* ===============================
   3. 登录/注册
   =============================== */
#auth-wrapper { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.auth-card {
    background: #ffffff; padding: 40px; border-radius: 4px; border: 1px solid #d7dbe0;
    box-shadow: 0 12px 40px rgba(40, 48, 60, 0.12); text-align: center; width: 380px;
    transition: all 0.4s ease; animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.avatar-container img { width: 80px; height: 80px; border-radius: 6px; border: 1px solid #e1e4e8; background: #f5f5f5; padding: 5px; margin-bottom: 15px; }
.auth-card h2 { color: #1f2329; margin-bottom: 5px; }
.auth-card .subtitle { color: #777f89; margin-bottom: 15px; }
.input-group { position: relative; margin-bottom: 20px; text-align: left;}
.input-group input { width: 100%; padding: 12px 15px; border: 1px solid #d7dbe0; border-radius: 4px; background: #ffffff; font-size: 15px; transition: 0.3s; }
.input-group input:focus { border-color: #07c160; background: white; }
.input-group label { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; pointer-events: none; transition: 0.3s; font-size: 14px; background: transparent; padding: 0 5px; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label { top: 0; font-size: 12px; color: #07c160; background: white; }
.btn-primary { width: 100%; padding: 12px; background: #07c160; color: white; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; font-weight: bold; transition: 0.3s; margin-top: 10px; }
.btn-primary:hover { background: #06ad53; }
.switch-link { margin-top: 20px; font-size: 14px; color: #666; }
.switch-link span { color: #07c160; cursor: pointer; font-weight: bold; margin-left: 5px; }
.switch-link span:hover { color: #06ad53; }

/* 验证码输入区 */
.captcha-group { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.captcha-img-box { width: 100px; height: 46px; background: #eee; border-radius: 12px; cursor: pointer; overflow: hidden; flex-shrink: 0; }
.captcha-img-box img { width: 100%; height: 100%; object-fit: cover; }


/* ===============================
   4. 主界面布局
   =============================== */
#app-container {
    display: none; 
    width: 95vw; 
    max-width: 1366px; 
    height: 90vh; 
    max-height: 768px;
    background: white; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden; flex-direction: row;
}

/* 左侧栏 */
.sidebar {
    width: 280px;
    /* 固定侧边栏宽度，避免被右侧内容压缩 */
    min-width: 280px;
    flex-shrink: 0;

    background: #f7f8fc; border-right: 1px solid #ebedf0;
    display: flex; flex-direction: column;
}

.my-profile {
    padding: 20px; background: white; border-bottom: 1px solid #ebedf0;
    display: flex; align-items: center; height: 80px; flex-shrink: 0;
}
.my-avatar-wrapper { position: relative; width: 45px; height: 45px; margin-right: 12px; }
.my-avatar-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.status-badge {
    position: absolute; top: 0; right: 0; width: 12px; height: 12px;
    border-radius: 50%; border: 2px solid white; transition: background-color 0.3s; z-index: 10;
}
.status-badge.online { background-color: #00c853; box-shadow: 0 0 5px rgba(0, 200, 83, 0.6); }
.status-badge.offline { background-color: #ff4757; box-shadow: 0 0 5px rgba(255, 71, 87, 0.6); }

.profile-info { display: flex; flex-direction: column; justify-content: center; flex: 1; overflow: hidden; }
#my-username { font-weight: bold; font-size: 16px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-btns { display: flex; gap: 10px; font-size: 12px; }
.logout-btn { color: #ff4757; cursor: pointer; }
.add-friend-btn { color: #667eea; cursor: pointer; font-weight: bold; }
.notice-btn { color: #ff9800; cursor: pointer; font-weight: bold; position: relative; }
#notice-dot { position: absolute; top: -3px; right: -7px; width: 10px; height: 10px; background-color: #ff4757; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px rgba(0,0,0,0.05); }

/* --- Tab 切换栏 --- */
.sidebar-tabs {
    display: flex; background: #fff; border-bottom: 1px solid #ebedf0; flex-shrink: 0;
}
.sidebar-tabs .tab-item {
    flex: 1; text-align: center; padding: 12px 0; cursor: pointer;
    font-size: 14px; color: #666; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.sidebar-tabs .tab-item:hover { background-color: #f9f9f9; }
.sidebar-tabs .tab-item.active { color: #667eea; border-bottom-color: #667eea; font-weight: bold; }

/* 列表区 */
.user-list { flex: 1; overflow-y: auto; }

/* 列表项样式 */
.user-item {
    padding: 12px 15px; display: flex; align-items: center; cursor: pointer;
    transition: 0.2s; height: 72px; border-bottom: 1px solid #f5f5f5;
}
.user-item:hover { background: #f0f0f0; }
.user-item.active { background: #e6e6e6; }

.avatar-wrapper { position: relative; width: 44px; height: 44px; margin-right: 12px; flex-shrink: 0; }
.avatar-wrapper img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.badge {
    position: absolute; top: -5px; right: -5px; background-color: #ff4757; color: white;
    font-size: 10px; height: 16px; min-width: 16px; padding: 0 4px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    border: 2px solid white; z-index: 2;
}

.user-info { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.info-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.user-name { font-size: 14px; color: #333; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.pin-mark, .mute-mark { display: inline-block; margin-right: 5px; padding: 1px 4px; border-radius: 3px; font-size: 11px; vertical-align: 1px; }
.pin-mark { background: #dff5e6; color: #16833a; }
.mute-mark { background: #e5e7eb; color: #68707d; }
.user-item.is-muted .badge { background: #a8adb5; }
.msg-time-list { font-size: 12px; color: #999; }
.info-bottom { display: flex; }
.preview-text { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* 右侧聊天区域 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    /* 防止长文本把布局撑开 */
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.chat-header {
    height: 60px; border-bottom: 1px solid #ebedf0; display: flex; align-items: center;
    justify-content: space-between; padding: 0 25px; background: white; flex-shrink: 0;
}
#chat-title { font-weight: bold; font-size: 17px; }
.btn-danger {
    padding: 6px 16px; background: transparent; color: #ff4757; border: 1px solid #ff4757;
    border-radius: 20px; font-size: 12px; cursor: pointer; transition: all 0.3s; font-weight: 500;
}
.btn-danger:hover { background: #ff4757; color: white; transform: translateY(-1px); }

.chat-window { flex: 1; padding: 20px; overflow-y: auto; background: #fdfdfd; display: flex; flex-direction: column; }
.empty-tip { text-align: center; color: #999; margin-top: 50px; }

/* --- 底部输入区 (高度自适应) --- */
.input-area {
    min-height: 140px;
    max-height: 300px;
    border-top: 1px solid #ebedf0;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    background: white;
    flex-shrink: 0;
    transition: height 0.2s;
    position: relative; /* 表情面板定位需要 */
}

.input-area textarea {
    font-family: inherit;
    font-size: 14px;
    border: none;
    resize: none;
    flex: 1;
    margin-bottom: 5px;
    min-height: 50px; /* 保证输入框最小高度 */
}

.input-area div { text-align: right; } /* 按钮容器 */

.input-area button {
    padding: 6px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}
.input-area button:hover { background: #5a6fd6; }

/* === 5. 消息气泡样式（优化版） === */
.message { display: flex; max-width: 80%; margin-bottom: 15px; }

/* 头像对齐：和 Bubble 顶部对齐 */
.message { align-items: flex-start; }

/* 头像对齐 */
.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.message.received { align-self: flex-start; }

.message > img,
.message img.avatar { width: 36px; height: 36px; border-radius: 4px; margin: 0 10px; flex-shrink: 0; cursor: pointer; }

/* --- 气泡容器布局核心修改 --- */
.bubble-container {
    display: flex;
    max-width: 100%;
}

/* 对方消息：竖向排列 */
.message.received .bubble-container {
    flex-direction: column;
    align-items: flex-start;
}
/* 我们需要把圆环放在 bubble 和 status 之间，或者 status 里面 */
.message.sent .status-wrapper {
    display: flex;
    align-items: flex-end;
    margin-right: 5px;
    flex-direction: column; /* 垂直排布：圆环在上，时间在下，或者根据需要 */
}

/* 我发的：横向反转 (状态在左，气泡在右) */
.message.sent .bubble-container {
    flex-direction: row-reverse;
    align-items: flex-end; /* 底部对齐 */
}

/* 发送者名字美化 */
.sender-name {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
    margin-left: 2px; /* 稍微缩进对齐气泡 */
    line-height: 1.2;
}

/* 气泡本体 */
.message .bubble {
    padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; min-width: 40px;
    word-break: break-word; word-wrap: break-word; white-space: pre-wrap;
    position: relative;
}

/* 气泡颜色与圆角优化 */
.message.sent .bubble {
    background: #667eea; color: white;
    border-top-right-radius: 2px; /* 右上角尖角 */
}
.message.received .bubble {
    background: white; border: 1px solid #eee; color: #333;
    border-top-left-radius: 2px; /* 左上角尖角 */
}

/* 图片气泡特殊处理 */
.message .bubble.is-image {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: hidden;
    position: relative;
    display: flex !important;
    flex-direction: column;
    width: fit-content;
    max-width: 300px;
    line-height: 0;
    margin: 0 !important;
    white-space: normal;
}
.message .bubble.is-image .quote-box {
    margin-bottom: 6px;
    background: #f0f2f5;
    color: #333;
    border-left: 3px solid #07c160;
    border-radius: 4px;
    line-height: 1.4;
    padding: 6px 10px;
    font-size: 12px;
}
.message.sent .bubble.is-image .quote-box {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    border-left-color: #07c160;
}
.message .bubble.is-image img {
    margin: 0 !important;
    border-radius: 8px;
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    display: block; /* 去掉行内元素间隙 */
}
.msg-time { font-size: 11px; margin-top: 5px; opacity: 1; font-weight: 500; }
.message.sent .msg-time { color: #dce7ff; text-align: right; align-self: flex-end; }
.message.received .msg-time { color: #5f6670; text-align: left; align-self: flex-start; }

div.message:not(.sent) .msg-status { display: none; } /* Only show status for sent msgs */

/* Image time in bottom-right corner of image */
.message .bubble.is-image .msg-time {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white !important;
    padding: 2px 6px;
    border-radius: 10px;
    margin: 0;
    text-align: center;
    line-height: normal;
    pointer-events: none;
    z-index: 5;
    opacity: 1; /* Reset opacity from general .msg-time */
}

/* Ensure sent/received specific overrides don't break it */
.message.sent .bubble.is-image .msg-time,
.message.received .bubble.is-image .msg-time {
    align-self: auto;
    text-align: center;
    color: white !important;
}

.msg-status { font-size: 10px; margin-top: 15px; margin-right: 8px; flex-shrink: 0; }
.msg-status.unread { color: #f44336; }
.msg-status.read { color: #bbb; }
.recalled-tip {
    text-align: center; font-size: 12px; color: #999; margin: 10px 0;
    background: rgba(0,0,0,0.03); padding: 4px 10px; border-radius: 10px; align-self: center !important; max-width: 100% !important;
}

/* === 回复栏样式（限制高度） === */
.reply-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    padding: 8px 15px;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #eee;
    border-left: 4px solid #667eea;
    width: 100%;
    animation: slideUp 0.2s;

    /* 限制高度，避免撑开输入区 */
    max-height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
}
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.reply-text {
    /* 允许长内容换行，避免撑开宽度 */
    white-space: normal;
    word-break: break-all;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* 最多显示2行 */
    overflow: hidden;

    max-width: calc(100% - 30px);
    font-weight: bold;
    line-height: 1.4;
    color: #555;
}
.reply-close { cursor: pointer; font-size: 18px; color: #999; padding: 0 5px; flex-shrink: 0;}
.reply-close:hover { color: #ff4757; }

/* === 引用框内容样式 === */
.quote-box {
    /* 强制容器约束 */
    display: flex !important;
    flex-direction: column !important;
    max-width: 100% !important;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.05);
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    border-left: 2px solid rgba(0,0,0,0.2);
}
.message.received .quote-box { background: rgba(0,0,0,0.05); }
.message.sent .quote-box { background: rgba(0,0,0,0.15); color: #eee; border-left-color: rgba(255,255,255,0.5); }
.quote-name { font-weight: bold; margin-bottom: 2px; font-size: 11px; opacity: 0.9; }

.quote-content {
    /* 强制换行和截断长内容 */
    display: -webkit-box !important;
    -webkit-line-clamp: 3; /* 最多3行 */
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    max-height: 50px !important; /* 物理限高 */

    white-space: normal !important;
    word-break: break-all !important;

    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.4;
    color: inherit;
    text-align: left;
    width: 100%;
}
.message.sent .quote-content { color: rgba(255, 255, 255, 0.8); }


/* 右键菜单 */
.context-menu {
    position: absolute; background: white; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 8px; padding: 5px 0; z-index: 10001; width: 120px; overflow: hidden;
}
.menu-item {
    padding: 10px 15px; font-size: 14px; color: #333; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; gap: 8px;
}
.menu-item:hover { background: #f5f5f5; }
.conversation-menu { width: 168px; }
.conversation-menu .menu-item { justify-content: flex-start; }
.conversation-menu .menu-item.danger { color: #ff4757; border-top: 1px solid #f0f0f0; }
.conversation-menu .menu-item.danger:hover { background: #fff1f0; }

/* 底部版权 */
.app-footer { position: fixed; bottom: 15px; left: 0; width: 100%; text-align: center; z-index: 0; pointer-events: none; }
.app-footer p { color: rgba(255, 255, 255, 0.5); font-size: 12px; margin: -3px 0; font-weight: 300; }
@media screen and (max-height: 500px) { .app-footer { display: none; } }

/* 加载历史提示 */
.loading-history {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 10px 0;
    width: 100%;
}
.loading-history .spinner {
    display: inline-block; animation: rotate 1s linear infinite; margin-right: 5px;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }

/* === 6. 图片优化与查看器 === */
.message .bubble.is-image {
    padding: 0 !important; background: transparent !important; box-shadow: none !important;
    border: none !important; overflow: hidden; position: relative; display: flex !important;
    flex-direction: column; width: fit-content; max-width: 300px; line-height: 0; margin: 0 !important;
    white-space: normal;
}

.image-msg-wrapper {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    margin: 0 !important;
}

.image-msg-wrapper.loading {
    width: 160px;
    height: 160px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
}

.image-msg-wrapper.load-error {
    width: 160px;
    height: 120px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    cursor: default;
}

.image-loading-placeholder {
    width: 100%;
    height: 100%;
    min-width: 140px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    gap: 8px;
}

.image-msg-wrapper.loaded .image-loading-placeholder {
    display: none !important;
}

/* 旋转转圈占位动画 */
.image-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top-color: #07c160;
    border-radius: 50%;
    animation: img-spinner-rotate 0.8s linear infinite;
    display: inline-block;
}

@keyframes img-spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.image-fail-icon {
    font-size: 22px;
    line-height: 1;
}

.image-fail-text {
    font-size: 12px;
    color: #ff4d4f;
    line-height: normal;
}

.message .bubble.is-image img {
    max-width: 300px; max-height: 300px; width: auto; height: auto;
    border-radius: 8px; cursor: zoom-in; display: block; margin: 0; transition: opacity 0.25s ease-out;
}
.message .bubble.is-image img:hover { opacity: 0.92; }

.message .bubble.is-image .msg-time {
    position: absolute; bottom: 6px; right: 8px;
    background-color: rgba(0, 0, 0, 0.5); color: #fff !important;
    font-size: 10px; padding: 2px 6px; border-radius: 10px; line-height: 1;
    pointer-events: none; z-index: 5; text-align: center; align-self: auto; width: auto; margin: 0;
}

/* 查看器 */
.image-viewer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 99999; display: flex; flex-direction: column;
    justify-content: center; align-items: center; user-select: none; opacity: 1; transition: opacity 0.2s ease;
}
.image-viewer.hidden { display: none !important; opacity: 0; }
.viewer-content { flex: 1; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; cursor: grab; }
.viewer-content:active { cursor: grabbing; }
.image-viewer img { max-width: 90%; max-height: 85%; object-fit: contain; transition: transform 0.1s linear; will-change: transform; }
.viewer-close { position: absolute; top: 30px; right: 40px; color: white; font-size: 40px; cursor: pointer; opacity: 0.7; z-index: 100000; }
.viewer-close:hover { opacity: 1; transform: scale(1.1); }
.viewer-controls {
    position: absolute; bottom: 30px; background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(10px);
    padding: 10px 25px; border-radius: 50px; display: flex; align-items: center; gap: 15px; color: white;
}
.viewer-controls button {
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.3); color: white;
    width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.viewer-controls button:hover { background: rgba(0,0,0,0.8); border-color: white; }
#zoom-level { font-size: 14px; min-width: 50px; text-align: center; }

/* 建群按钮 */
.group-btn { color: #00bcd4; cursor: pointer; font-weight: bold; }
.group-btn:hover { text-decoration: underline; }

/* === 好友选择列表（多选） === */
.friend-select-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 20px;
    text-align: left;
}

.select-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: 0.2s;
}
.select-item:hover { background: #f0f0f0; }

.select-item input {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.select-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.select-item span {
    font-size: 14px;
    color: #333;
}

/* === 群消息已读圆点 === */
.read-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid #999;
    border-radius: 50%;
    font-size: 9px;
    color: #999;
    margin-right: 5px; /* 放在气泡左边 */
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.read-ring:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* 已读列表项 */
.read-user-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #f5f5f5;
}
.read-user-item img {
    width: 30px; height: 30px; border-radius: 50%; margin-right: 10px;
}
.read-user-item span {
    font-size: 14px; color: #333;
}
.message.sent .bubble.is-image .msg-time { color: white !important; }

/* === 发送中消息 Loading === */
.msg-loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
    margin-bottom: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.message.sending { opacity: 0.8; }
.message.sending .msg-status { display: none !important; }

/* 好友请求列表样式优化 */
#request-modal .modal-box {
    width: 400px;
    max-width: 90%;
}
#request-list {
    max-height: 350px;
    overflow-y: auto;
    margin: 10px 0;
    padding: 5px;
}
.req-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.req-item img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    background: #eee;
}
.req-info {
    flex: 1;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}
.req-actions {
    display: flex;
    gap: 6px;
}
.btn-mini {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}
.btn-accept {
    background: #07c160;
    color: white;
}
.btn-accept:hover {
    background: #06ad53;
}
.btn-reject {
    background: #f2f2f2;
    color: #333;
    border: 1px solid #e0e0e0;
}
.btn-reject:hover {
    background: #e5e5e5;
}
.btn-cancel {
    background: #fff;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}
.btn-cancel:hover {
    background: #fff2f0;
}

/* 通知红点样式优化 */
#notice-dot {
    position: absolute;
    top: -3px;
    right: -7px;
    width: 10px;
    height: 10px;
    background-color: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

/* 容器主体 */
.cf-turnstile-wrapper {
    width: 300px;
    height: 65px;
    background-color: #fff;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 20px 0; /* 根据需要调整外边距 */
}

.cf-turnstile-wrapper:hover {
    background-color: #f9f9f9;
}

/* 状态：禁止点击 (验证成功后) */
.cf-turnstile-wrapper.disabled {
    cursor: default;
    background-color: #fff;
}

/* 左侧：复选框、加载和成功图标区域 */
.cf-checkbox-wrapper {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 1. 初始空复选框 */
.cf-checkbox {
    width: 100%;
    height: 100%;
    border: 2px solid #c1c1c1;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s;
}

.cf-turnstile-wrapper:hover .cf-checkbox {
    border-color: #a0a0a0;
}

/* 2. 加载动画（默认隐藏） */
.cf-spinner {
    display: none;
    animation: rotate 2s linear infinite;
    width: 100%;
    height: 100%;
    position: absolute;
}
.cf-spinner .path {
    stroke: #0051c3; /* Cloudflare 蓝 */
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

/* 3. 成功图标（默认隐藏） */
.cf-success-icon {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
}
.checkmark-circle {
    stroke: #00a96e; /* 成功绿 */
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #00a96e;
    stroke-width: 4;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* 中间文字 */
.cf-text {
    flex-grow: 1;
    font-size: 14px;
    color: #404040;
    font-weight: 500;
}

/* 右侧 Logo 区域 */
.cf-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
}
.cf-logo-img {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 2px;
}
.cf-footer-text {
    font-size: 10px;
    color: #999;
    transform: scale(0.9);
}

/* 动画关键帧 */
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}
@keyframes stroke { 100% { stroke-dashoffset: 0; } }

/* ===============================
   新增：表情选择器样式
   =============================== */
.emoji-picker {
    position: absolute;
    bottom: 40px; /* 位于工具栏上方 */
    right: 0;
    width: 320px;
    height: 200px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
    z-index: 1000;
}

.emoji-item {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.emoji-item:hover {
    background-color: #f0f2f5;
}

/* 滚动条美化 */
.emoji-picker::-webkit-scrollbar {
    width: 6px;
}
.emoji-picker::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
.emoji-picker::-webkit-scrollbar-track {
    background-color: transparent;
}

/* ===============================
   微信网页版统一布局
   =============================== */
body { background: #d9dde3; color: #1f2329; }
#app-container {
    width: min(1440px, 96vw);
    height: min(860px, 92vh);
    max-width: none;
    max-height: none;
    min-width: 980px;
    border-radius: 4px;
    background: #f5f5f5;
    box-shadow: 0 18px 55px rgba(0,0,0,0.18);
}
.wechat-rail {
    width: 72px;
    min-width: 72px;
    background: #d6d8dc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 0;
}
.rail-avatar { width: 42px; height: 42px; margin: 0 0 18px; position: relative; }
.rail-avatar img { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; }
.rail-avatar .status-badge { top: auto; right: -4px; bottom: -4px; border-color: #2e3033; }
.rail-btn, .icon-btn, .header-icon, .tool-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #b8babf;
    cursor: pointer;
}
.rail-btn { width: 42px; height: 42px; border-radius: 10px; color: #5a5f67; }
.rail-btn:hover, .rail-btn.active { background: #c8cbcf; color: #07c160; }
.rail-bottom { margin-top: auto; }
.rail-btn svg, .icon-btn svg, .header-icon svg, .tool-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.rail-btn::after, .icon-btn::after, .header-icon::after, .tool-btn::after {
    content: attr(title);
    position: absolute;
    z-index: 10010;
    background: rgba(31,35,41,0.92);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    border-radius: 4px;
    padding: 7px 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s, transform 0.16s;
}
.rail-btn::after { left: 52px; top: 50%; transform: translate(-4px,-50%); }
.rail-btn:hover::after { opacity: 1; transform: translate(0,-50%); }
.icon-btn::after, .header-icon::after, .tool-btn::after { left: 50%; bottom: calc(100% + 8px); transform: translate(-50%,4px); }
.icon-btn:hover::after, .header-icon:hover::after, .tool-btn:hover::after { opacity: 1; transform: translate(-50%,0); }
#notice-dot { top: 7px; right: 6px; border-color: #2e3033; }
.sidebar {
    width: 250px;
    min-width: 250px;
    background: #f4f5f7;
    border-right: 1px solid #d8dbe0;
}
.list-header {
    height: 74px;
    padding: 14px 12px 10px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
}
.header-actions { display: flex; gap: 8px; }
.icon-btn { width: 30px; height: 30px; border-radius: 4px; background: #e4e6ea; color: #333; }
.icon-btn:hover { background: #d8dbe0; }
.search-wrap { padding: 0; flex: 1; margin-right: 10px; }
.search-wrap input {
    width: 100%; height: 36px; border: 0; border-radius: 4px;
    background: #ffffff; padding: 0 12px; color: #333; font-size: 14px;
}
.search-wrap input:focus { background: #fff; box-shadow: inset 0 0 0 1px #07c160; }
.list-title { padding: 0 18px 8px; font-size: 12px; color: #777; }
.sidebar-tabs { display: none; }
.user-item { border-bottom: 1px solid #dddddd; }
.user-item:hover { background: #dedede; }
.user-item.active { background: #cfcfcf; }
.avatar-wrapper img { border-radius: 4px; object-fit: cover; }
.chat-area { background: #f5f5f5; }
.chat-header { height: 66px; background: #f5f5f5; border-bottom: 1px solid #dedede; padding: 0 24px; }
.chat-title-block { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-header-actions { display: flex; align-items: center; gap: 8px; margin-left: 16px; }
#chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chat-subtitle { color: #8a8f98; font-size: 12px; }
.header-icon { width: 34px; height: 34px; border-radius: 4px; color: #6b7078; }
.header-icon:hover { background: #e7e7e7; color: #fa5151; }
.header-icon.active { background: #e7e7e7; color: #1f2329; }
#btn-chat-more:hover {
    color: #1f2329;
}
#btn-video-call:hover {
    color: #07c160;
}
.header-icon::after {
    left: 50%;
    right: auto;
    top: calc(100% + 8px);
    bottom: auto;
    transform: translate(-50%, -4px);
}
.header-icon:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.chat-window { background: #f5f5f5; padding: 18px 24px; }
.input-area { background: #f5f5f5; border-top: 1px solid #dedede; min-height: 178px; padding: 10px 18px 14px; }
.input-area textarea { background: transparent; font-size: 15px; min-height: 76px; }
.chat-toolbar { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.tool-btn { width: 32px; height: 32px; border-radius: 4px; color: #656a73; }
.tool-btn:hover { background: #e8e8e8; color: #07c160; }
.input-area div.send-row { display: flex; align-items: center; justify-content: flex-end; gap: 14px; color: #9aa0a8; font-size: 12px; text-align: right; }
.send-btn { height: 34px; padding: 0 24px; border: 1px solid #d7d7d7; border-radius: 4px; background: #e9e9e9; color: #07c160; }
.send-btn:hover { background: #07c160; color: #fff; border-color: #07c160; }
.message.sent .bubble { background: #95ec69; color: #1f2329; }
.message.received .bubble { background: #fff; border-color: #e7e7e7; }
.message.sent .msg-time { color: #4f6b39; }
.detail-panel {
    width: 0;
    min-width: 0;
    background: #ffffff;
    border-left: 0 solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 0 22px;
    opacity: 0;
    overflow: hidden;
    transform: translateX(18px);
    pointer-events: none;
    transition:
        width 0.24s cubic-bezier(.2,.8,.2,1),
        min-width 0.24s cubic-bezier(.2,.8,.2,1),
        padding 0.24s cubic-bezier(.2,.8,.2,1),
        border-color 0.24s ease,
        opacity 0.18s ease,
        transform 0.24s cubic-bezier(.2,.8,.2,1);
}
.detail-panel.is-open {
    width: 252px;
    min-width: 252px;
    padding: 18px 18px 22px;
    border-left-width: 1px;
    border-left-color: #dedede;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
.detail-empty { color: #9aa0a8; text-align: center; font-size: 13px; }
.detail-empty-icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #d7d7d7; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.detail-card { width: 100%; text-align: left; }
.detail-panel .detail-card,
.detail-panel .detail-empty {
    min-width: 216px;
}
.settings-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid #eceff3; }
.setting-row { width: 100%; height: 52px; border: 0; border-bottom: 1px solid #eceff3; background: transparent; color: #222; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 0; font-size: 15px; }
.setting-row:hover { background: #f8f9fb; }
.setting-row.center { justify-content: center; }
.setting-row.danger { color: #ff4d4f; }
.setting-row.arrow::after { content: '>'; color: #b3b8bf; font-size: 18px; line-height: 1; }
.switch-visual {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #dfe3e8;
    position: relative;
    flex-shrink: 0;
}
.switch-visual::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.setting-row.is-on .switch-visual { background: #07c160; }
.setting-row.is-on .switch-visual::after { left: 21px; }
.setting-row.danger:hover { background: #fff5f5; }
.settings-list button.danger:hover, #detail-hide-btn:hover { border-color: transparent; }
.request-panel-empty { color: #8a8f98; font-size: 13px; text-align: center; padding: 36px 12px; }
.request-item { height: 76px; gap: 10px; }
.request-item > img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.request-main { flex: 1; min-width: 0; }
.request-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-desc { margin-top: 4px; font-size: 12px; color: #8a8f98; }
@media screen and (max-width: 760px) { .detail-panel { display: none; } #app-container { min-width: 520px; } }

#app-container {
    width: min(1360px, 96vw);
    height: min(820px, 92vh);
    min-width: 780px;
}

/* ===============================
   微信细节修正：顶部提示和输入区
   =============================== */
.header-actions .icon-btn::after {
    top: calc(100% + 8px);
    bottom: auto;
    left: 50%;
    transform: translate(-50%, -4px);
}
.header-actions .icon-btn:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.input-area .chat-toolbar {
    padding: 0 0 6px !important;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
}
.input-area .tool-btn {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #60666f !important;
    box-shadow: none !important;
}
.input-area .tool-btn:hover {
    background: #e8e8e8 !important;
    color: #07c160 !important;
    transform: none !important;
}
.input-area textarea {
    padding: 4px 0;
    line-height: 1.55;
    color: #1f2329;
}
.input-area .send-row {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 6px;
    color: #9aa0a8;
    font-size: 12px;
    text-align: right;
}
.input-area .send-row .send-btn {
    width: auto;
    min-width: 74px;
    height: 34px;
    padding: 0 22px;
    border: 1px solid #d7d7d7;
    border-radius: 4px;
    background: #e9e9e9;
    color: #07c160;
    font-size: 14px;
    font-weight: 400;
    box-shadow: none;
}
.input-area .send-row .send-btn:hover {
    background: #07c160;
    border-color: #07c160;
    color: #fff;
    transform: none;
}

/* ===============================
   PC 微信视觉修整层
   =============================== */
body {
    background: #dfe4ea;
}

#app-container {
    width: min(1320px, 94vw);
    height: min(820px, 90vh);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(40, 48, 60, 0.18);
}

.wechat-rail {
    width: 72px;
    min-width: 72px;
    background: #d5d9de;
    padding: 20px 0 18px;
    gap: 18px;
}

.rail-avatar {
    margin-bottom: 16px;
}

.rail-avatar img {
    border-radius: 6px;
}

.rail-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: #626973;
}

.rail-btn:hover {
    background: #cbd0d6;
    color: #2aae67;
}

.rail-btn.active {
    background: #c8cdd3;
    color: #07c160;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background: #f3f4f6;
    border-right: 1px solid #d7dbe0;
}

.list-header {
    height: 64px;
    padding: 14px 12px 10px 14px;
    align-items: center;
}

.search-wrap input {
    height: 36px;
    background: #ffffff;
    color: #25292f;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}

.icon-btn {
    width: 32px;
    height: 32px;
    background: #e1e4e8;
    color: #424852;
}

.list-title {
    padding: 0 16px 6px;
    color: #4f5661;
}

.user-item {
    height: 72px;
    padding: 10px 14px;
    border-bottom: 1px solid #e1e4e8;
    background: transparent;
}

.user-item:hover {
    background: #e8eaee;
}

.user-item.active {
    background: #18b779;
}

.user-item.active .user-name,
.user-item.active .msg-time-list,
.user-item.active .preview-text,
.user-item.active .pin-mark,
.user-item.active .mute-mark {
    color: #fff;
}

.user-item.active .pin-mark,
.user-item.active .mute-mark {
    background: rgba(255,255,255,0.2);
}

.avatar-wrapper {
    width: 42px;
    height: 42px;
    margin-right: 12px;
}

.avatar-wrapper img {
    border-radius: 6px;
}

.user-info {
    min-width: 0;
}

.info-top {
    gap: 8px;
    margin-bottom: 5px;
}

.user-name {
    flex: 1;
    max-width: none;
    font-size: 14px;
    color: #20242a;
}

.msg-time-list {
    flex-shrink: 0;
    max-width: 54px;
    text-align: right;
    font-size: 12px;
    color: #8b929c;
    overflow: hidden;
    white-space: nowrap;
}

.preview-text {
    max-width: 100%;
    font-size: 12px;
    color: #8a919b;
}

.chat-header {
    height: 64px;
    padding: 0 24px;
    background: #f5f5f5;
}

#chat-title {
    font-size: 16px;
    font-weight: 600;
}

#chat-subtitle {
    font-size: 12px;
    color: #777f89;
}

.chat-window {
    padding: 14px 28px 20px;
    background: #f5f5f5;
}

.scroll-bottom-btn {
    position: absolute;
    right: 28px;
    bottom: 196px;
    z-index: 8;
    width: 34px;
    height: 34px;
    border: 1px solid #d8dce2;
    border-radius: 50%;
    background: rgba(255,255,255,0.96);
    color: #59616d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(31,35,41,0.12);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.scroll-bottom-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scroll-bottom-btn:hover {
    background: #f7f8fa;
    color: #07c160;
}

.scroll-bottom-btn.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.message {
    max-width: 74%;
    margin-bottom: 12px;
}

.message > img,
.message img.avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.message .bubble {
    border-radius: 4px;
    box-shadow: none;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.45;
}

.message.sent .bubble {
    background: #95ec69;
    color: #1e2a18;
    border-top-right-radius: 4px;
}

.message.received .bubble {
    background: #ffffff;
    border: 1px solid #e7e7e7;
    color: #222;
    border-top-left-radius: 4px;
}

.msg-time {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 400;
}

.message.sent .msg-time {
    color: #526b43;
}

.message.received .msg-time {
    color: #7a828c;
}

.msg-status {
    min-width: 30px;
    margin: 0 6px 2px 0;
    font-size: 12px;
    align-self: flex-end;
}

.msg-status.read {
    color: #9aa0a8;
}

.msg-status.unread {
    color: #fa5151;
}

.input-area {
    min-height: 182px;
    background: #f5f5f5;
    padding: 10px 20px 14px;
}

.input-area textarea {
    min-height: 78px;
    color: #24272d;
}

.input-area textarea::placeholder {
    color: #8f96a0;
}

.detail-panel {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 42px 0 22px;
    background: #ffffff;
}

.detail-panel.is-open {
    padding: 42px 18px 22px;
}

.detail-card {
    margin: 0;
}

.settings-list {
    border-top: 0;
}

.setting-row {
    height: 52px;
    padding: 0;
    font-size: 14px;
}

.setting-row.center {
    height: 52px;
}

/* ===============================
   PC 视频通话
   =============================== */
.video-call-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    pointer-events: none;
}

.video-call-overlay.hidden {
    display: none;
}

.video-call-window {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 520px;
    height: 390px;
    min-width: 360px;
    min-height: 280px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    background: #15171a;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(0,0,0,0.34);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.video-call-window.dragging,
.video-call-window.resizing {
    user-select: none;
    box-shadow: 0 28px 88px rgba(0,0,0,0.42);
}

.video-call-drag {
    height: 56px;
    padding: 10px 12px 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.05);
    cursor: move;
}

.video-call-title-wrap {
    min-width: 0;
}

.video-call-peer {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-call-status {
    margin-top: 3px;
    color: rgba(255,255,255,0.68);
    font-size: 12px;
}

.video-call-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.76);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-call-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.video-call-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.video-call-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background: radial-gradient(circle at center, #242933 0%, #0d0f12 72%);
}

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
}

.local-preview {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 132px;
    height: 92px;
    background: #101316;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(0,0,0,0.32);
}

.local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
}

.call-avatar-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(circle at center, #2d333d 0%, #111417 74%);
}

.call-avatar-fallback.show {
    display: flex;
}

.call-avatar-fallback img {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.call-avatar-fallback span {
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255,255,255,0.82);
    font-size: 14px;
}

.local-fallback img {
    width: 44px;
    height: 44px;
}

.video-call-controls {
    height: 78px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: #15171a;
}

.call-btn {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}

.call-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.call-btn.accept { background: #22c55e; }
.call-btn.hangup { background: #ef4444; }
.call-btn.secondary {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
}
.call-btn.off { background: rgba(239,68,68,0.9); }

.video-call-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
}

.video-call-resize::after {
    content: '';
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 8px;
    height: 8px;
    border-right: 1px solid rgba(255,255,255,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.45);
}

@media (max-width: 720px) {
    .video-call-window {
        left: 12px !important;
        right: auto;
        bottom: 12px;
        width: calc(100vw - 24px) !important;
        height: 360px !important;
        min-width: 0;
    }
}

/* 修改头像模态框 微信主题定制 */
#change-avatar-modal .modal-box {
    width: 450px;
    max-width: 90%;
}
#change-avatar-modal .avatar-crop-container {
    margin: 20px 0;
    height: 300px;
    background: #f7f7f7;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
#change-avatar-modal .avatar-crop-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
#change-avatar-modal .avatar-select-btn-wrapper {
    margin-bottom: 20px;
    text-align: left;
}
#change-avatar-modal .btn-select-image {
    background-color: #f2f2f2;
    color: #07c160;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
#change-avatar-modal .btn-select-image:hover {
    background-color: #e5e5e5;
}
#change-avatar-modal .btn-confirm:disabled {
    background-color: #f2f2f2;
    color: #b2b2b2;
    cursor: not-allowed;
}

/* Cropper 微信主题配色覆盖 */
#change-avatar-modal .cropper-view-box {
    outline: 2px solid #07c160;
}
#change-avatar-modal .cropper-line,
#change-avatar-modal .cropper-point {
    background-color: #07c160;
}

/* 添加好友搜索结果样式 */
.search-friend-results {
    border: 1px solid #eaeaea;
    border-radius: 4px;
    background: #fafafa;
}
.search-friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}
.search-friend-item:last-child {
    border-bottom: none;
}
.search-friend-item:hover {
    background-color: #f2f2f2;
}
.search-friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-friend-info img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #eaeaea;
}
.search-friend-info span {
    font-size: 14px;
    color: #191919;
    font-weight: 500;
}
.btn-add-search-result {
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-add-search-result:hover {
    background-color: #06ad53;
}
.btn-add-search-result:disabled {
    background-color: #f2f2f2;
    color: #b2b2b2;
    cursor: not-allowed;
}

.right-request-item:hover {
    background-color: #fafafa !important;
}

.detail-profile { display: flex; flex-direction: column; align-items: center; padding: 22px 0 30px; border-bottom: 1px solid #eceff3; margin-bottom: 0px; }
.detail-avatar { width: 72px; height: 72px; border-radius: 4px; object-fit: cover; margin-bottom: 12px; }
.detail-name { font-size: 18px; font-weight: 500; color: #000; margin-bottom: 4px; text-align: center; word-break: break-all; }
.detail-type { font-size: 13px; color: #8a8f98; }

/* 屏幕截图模态框样式 */
#screenshot-modal .modal-box {
    width: 92vw;
    max-width: 980px;
    height: 85vh;
    max-height: 680px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

#screenshot-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

#screenshot-modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #191919;
}

#screenshot-modal .modal-header .close-btn {
    font-size: 24px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 2px 8px;
    transition: color 0.2s;
}
#screenshot-modal .modal-header .close-btn:hover {
    color: #191919;
}

#screenshot-modal .screenshot-crop-container {
    flex: 1;
    min-height: 0;
    background: #1e1e1e;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#screenshot-modal .screenshot-crop-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

#screenshot-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    flex-shrink: 0;
}

#screenshot-modal .crop-tool-btn {
    padding: 7px 14px;
    border: 1px solid #d7dbe0;
    background: #fafafa;
    color: #333;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

#screenshot-modal .crop-tool-btn:hover {
    background: #f0f0f0;
    border-color: #07c160;
    color: #07c160;
}

#screenshot-modal .cropper-view-box {
    outline: 2px solid #07c160;
}
#screenshot-modal .cropper-line,
#screenshot-modal .cropper-point {
    background-color: #07c160;
}

/* === 15. 图片上传占位与进度条 === */
.image-upload-wrapper {
    position: relative;
    display: block;
    margin: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    max-width: 280px;
    max-height: 280px;
    background: rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.image-upload-wrapper img.uploading-preview {
    display: block;
    margin: 0 !important;
    max-width: 280px;
    max-height: 280px;
    width: auto;
    height: auto;
    min-width: 140px;
    min-height: 140px;
    object-fit: cover;
    border-radius: 8px;
    filter: brightness(0.78);
    transition: filter 0.3s ease;
}

.image-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    user-select: none;
    pointer-events: auto;
}

.image-upload-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.image-upload-progress-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 20px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.image-upload-progress-bar {
    width: 110px;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.image-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1890ff, #00d26a);
    border-radius: 3px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 6px rgba(0, 210, 106, 0.6);
}

.image-upload-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1;
}

.image-upload-error-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(220, 38, 38, 0.85);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* === 16. 视频消息、上传占位与通用在线播放器 === */
.message .bubble.is-video {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: hidden;
    position: relative;
    display: flex !important;
    flex-direction: column;
    width: fit-content;
    max-width: 280px;
    line-height: 0;
    margin: 0 !important;
}

.message .bubble.is-video .quote-box {
    margin-bottom: 6px;
    background: #f0f2f5;
    color: #333;
    border-left: 3px solid #07c160;
    border-radius: 4px;
    line-height: 1.4;
    padding: 6px 10px;
    font-size: 12px;
}

.message.sent .bubble.is-video .quote-box {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    border-left-color: #07c160;
}

.message .bubble.is-video .msg-time {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: #fff !important;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
    margin: 0;
    text-align: center;
    line-height: normal;
    pointer-events: none;
    z-index: 5;
    opacity: 1;
}

.message.sent .bubble.is-video .msg-time,
.message.received .bubble.is-video .msg-time {
    align-self: auto;
    color: #fff !important;
}

.video-upload-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    max-width: 280px;
    max-height: 280px;
    background: #000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.video-upload-wrapper video.uploading-preview {
    display: block;
    max-width: 280px;
    max-height: 280px;
    width: auto;
    height: auto;
    min-width: 160px;
    min-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    filter: brightness(0.65);
    transition: filter 0.3s ease;
}

.video-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    user-select: none;
    pointer-events: auto;
}

.video-upload-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.video-upload-progress-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.video-upload-progress-bar {
    width: 110px;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.video-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1890ff, #00d26a);
    border-radius: 3px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 6px rgba(0, 210, 106, 0.6);
}

.video-upload-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1;
}

/* 聊天气泡内视频卡片 */
.chat-video-card {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    max-width: 280px;
    max-height: 280px;
    background: #111;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.chat-video-poster,
.chat-video-preview,
.chat-video-element {
    display: block;
    margin: 0 !important;
    max-width: 280px;
    max-height: 280px;
    width: auto;
    height: auto;
    min-width: 160px;
    min-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    pointer-events: none;
    background: #111;
    transition: filter 0.3s ease;
}

.chat-video-poster.loading-poster {
    filter: brightness(0.75);
}

.chat-video-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    pointer-events: none;
}

.chat-video-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.chat-video-card:hover .chat-video-play-btn {
    transform: scale(1.1);
    background: rgba(7, 193, 96, 0.9);
    border-color: #ffffff;
}

.chat-video-play-btn svg {
    margin-left: 3px;
}

.chat-video-meta-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}

/* === 通用在线视频播放器模态框 === */
.univ-player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.25s ease;
    user-select: none;
}

.univ-player-overlay.hidden {
    display: none !important;
    opacity: 0;
}

.univ-player-container {
    position: relative;
    width: auto;
    max-width: min(94vw, 1200px);
    max-height: 90vh;
    background: #0f1115;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), height 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.univ-player-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
}

@media (max-width: 768px) {
    .univ-player-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0;
        border: none;
    }
}

.univ-player-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    z-index: 10;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.univ-player-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.univ-cache-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(24, 144, 255, 0.2);
    border: 1px solid rgba(24, 144, 255, 0.4);
    color: #40a9ff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.3s;
}

.univ-cache-badge.cached {
    background: rgba(82, 196, 26, 0.2);
    border-color: rgba(82, 196, 26, 0.4);
    color: #73d13d;
}

.univ-player-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.univ-top-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.univ-top-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.univ-top-btn.close-btn:hover {
    background: rgba(255, 77, 79, 0.85);
}

.univ-player-screen {
    position: relative;
    flex: 0 0 auto;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    height: auto;
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), height 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.univ-player-container:fullscreen .univ-player-screen {
    width: 100% !important;
    height: calc(100vh - 104px) !important;
    max-height: none !important;
}

#univ-main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.univ-player-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
}

.univ-spinner-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #07c160;
    border-radius: 50%;
    animation: univ-spin 0.8s linear infinite;
}

@keyframes univ-spin {
    to { transform: rotate(360deg); }
}

.univ-player-feedback {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.6);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 6;
}

.univ-player-feedback.show {
    opacity: 1;
    transform: scale(1);
}

.univ-player-controls {
    padding: 8px 18px 14px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0) 100%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.univ-player-container.idle-hidden .univ-player-controls,
.univ-player-container.idle-hidden .univ-player-topbar {
    opacity: 0;
    pointer-events: none;
}

.univ-timeline-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.univ-timeline-container:hover {
    height: 10px;
}

.univ-timeline-buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    pointer-events: none;
}

.univ-timeline-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #07c160;
    border-radius: 3px;
    pointer-events: none;
}

.univ-timeline-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    pointer-events: none;
}

.univ-timeline-container:hover .univ-timeline-handle {
    transform: translate(-50%, -50%) scale(1);
}

.univ-timeline-tooltip {
    position: absolute;
    bottom: 20px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.univ-timeline-tooltip.visible {
    opacity: 1;
}

.univ-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.univ-controls-left,
.univ-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.univ-ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.univ-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.06);
}

.univ-volume-group {
    display: flex;
    align-items: center;
    position: relative;
}

.univ-volume-slider-box {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease, margin 0.2s ease;
    display: flex;
    align-items: center;
}

.univ-volume-group:hover .univ-volume-slider-box {
    width: 70px;
    margin-left: 4px;
}

.univ-volume-slider {
    width: 68px;
    height: 4px;
    accent-color: #07c160;
    cursor: pointer;
}

.univ-time-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    user-select: none;
}

.univ-time-divider {
    color: rgba(255, 255, 255, 0.4);
}

.univ-speed-menu-wrapper {
    position: relative;
}

.univ-ctrl-text-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.univ-ctrl-text-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.univ-speed-menu {
    position: absolute;
    bottom: 38px;
    right: 0;
    background: rgba(20, 22, 26, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px;
    min-width: 96px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 20;
}

.univ-speed-menu.hidden {
    display: none !important;
}

.univ-speed-item {
    padding: 6px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.univ-speed-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.univ-speed-item.active {
    color: #07c160;
    font-weight: 600;
}



