/**
 * 刻都音视频 - 微信风格增强版
 * WeChat-Style Enhanced UI
 * Version: 2.0
 * Date: 2025-10-28
 * 完全参照微信PC端和移动端设计
 */

/* ==================== 微信配色系统 ==================== */
:root {
    /* 微信主色调 */
    --wechat-green: #07C160;
    --wechat-green-hover: #06AD56;
    --wechat-green-active: #059048;
    --wechat-green-light: rgba(7, 193, 96, 0.1);
    
    /* 微信灰色系 */
    --wechat-bg-gray: #F7F7F7;
    --wechat-bg-white: #FFFFFF;
    --wechat-divider: #E5E5E5;
    --wechat-border: #D9D9D9;
    
    /* 微信文字色 */
    --wechat-text-primary: #191919;
    --wechat-text-secondary: #666666;
    --wechat-text-tertiary: #999999;
    --wechat-text-placeholder: #B2B2B2;
    
    /* 功能色 */
    --wechat-red: #FA5151;
    --wechat-blue: #576B95;
    --wechat-orange: #FFC300;
    
    /* 阴影 */
    --wechat-shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05);
    --wechat-shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
    --wechat-shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==================== 全局基础样式 ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', 
                 Helvetica, Arial, sans-serif !important;
    background: var(--wechat-bg-gray) !important;
    color: var(--wechat-text-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* ==================== 微信顶部导航栏 ==================== */
.wechat-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--wechat-bg-white);
    border-bottom: 1px solid var(--wechat-divider);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: var(--wechat-shadow-light);
}

.wechat-navbar-logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--wechat-text-primary);
    margin-right: 40px;
}

.wechat-navbar-logo img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 4px;
}

.wechat-navbar-menu {
    display: flex;
    align-items: center;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wechat-navbar-item {
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--wechat-text-secondary);
    font-size: 15px;
    transition: all 0.2s;
    position: relative;
}

.wechat-navbar-item:hover {
    color: var(--wechat-text-primary);
    background: var(--wechat-bg-gray);
}

.wechat-navbar-item.active {
    color: var(--wechat-green);
}

.wechat-navbar-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: var(--wechat-green);
    border-radius: 2px 2px 0 0;
}

.wechat-navbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.wechat-navbar-search input {
    width: 100%;
    height: 36px;
    background: var(--wechat-bg-gray);
    border: none;
    border-radius: 18px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--wechat-text-primary);
    transition: all 0.2s;
}

.wechat-navbar-search input:focus {
    outline: none;
    background: var(--wechat-bg-white);
    box-shadow: 0 0 0 2px var(--wechat-green-light);
}

.wechat-navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.wechat-navbar-user:hover {
    background: var(--wechat-bg-gray);
}

.wechat-navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.wechat-navbar-username {
    font-size: 14px;
    color: var(--wechat-text-primary);
}

/* ==================== 微信主布局 ==================== */
.wechat-container {
    display: flex;
    height: 100vh;
    padding-top: 60px;
    background: var(--wechat-bg-gray);
}

/* 左侧边栏 - 会话列表 */
.wechat-sidebar {
    width: 260px;
    background: var(--wechat-bg-white);
    border-right: 1px solid var(--wechat-divider);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.wechat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--wechat-divider);
}

.wechat-sidebar-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--wechat-text-primary);
    margin-bottom: 12px;
}

.wechat-sidebar-tabs {
    display: flex;
    gap: 8px;
}

.wechat-sidebar-tab {
    flex: 1;
    padding: 6px 12px;
    text-align: center;
    font-size: 14px;
    color: var(--wechat-text-secondary);
    background: var(--wechat-bg-gray);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.wechat-sidebar-tab.active {
    background: var(--wechat-green);
    color: white;
}

.wechat-sidebar-list {
    flex: 1;
    overflow-y: auto;
}

.wechat-chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid transparent;
    position: relative;
}

.wechat-chat-item:hover {
    background: var(--wechat-bg-gray);
}

.wechat-chat-item.active {
    background: var(--wechat-bg-gray);
}

.wechat-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

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

.wechat-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.wechat-chat-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--wechat-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wechat-chat-time {
    font-size: 12px;
    color: var(--wechat-text-tertiary);
    flex-shrink: 0;
    margin-left: 8px;
}

.wechat-chat-message {
    font-size: 13px;
    color: var(--wechat-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wechat-chat-badge {
    position: absolute;
    right: 16px;
    top: 12px;
    min-width: 18px;
    height: 18px;
    background: var(--wechat-red);
    color: white;
    border-radius: 9px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ==================== 聊天主区域 ==================== */
.wechat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--wechat-bg-white);
}

.wechat-chat-header {
    height: 60px;
    border-bottom: 1px solid var(--wechat-divider);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    background: var(--wechat-bg-white);
}

.wechat-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--wechat-text-primary);
}

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

.wechat-chat-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--wechat-text-secondary);
    transition: all 0.2s;
}

.wechat-chat-action-btn:hover {
    background: var(--wechat-bg-gray);
    color: var(--wechat-text-primary);
}

.wechat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--wechat-bg-gray);
}

.wechat-message-group {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.wechat-message-group.self {
    flex-direction: row-reverse;
}

.wechat-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin: 0 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.wechat-message-content {
    max-width: 60%;
}

.wechat-message-name {
    font-size: 12px;
    color: var(--wechat-text-tertiary);
    margin-bottom: 4px;
}

.wechat-message-group.self .wechat-message-name {
    text-align: right;
}

.wechat-message-bubble {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    display: inline-block;
    max-width: 100%;
}

.wechat-message-group:not(.self) .wechat-message-bubble {
    background: var(--wechat-bg-white);
    color: var(--wechat-text-primary);
    box-shadow: var(--wechat-shadow-light);
}

.wechat-message-group.self .wechat-message-bubble {
    background: var(--wechat-green);
    color: white;
    float: right;
}

.wechat-message-time {
    font-size: 11px;
    color: var(--wechat-text-tertiary);
    margin-top: 4px;
    text-align: center;
}

/* ==================== 输入区域 ==================== */
.wechat-input-area {
    border-top: 1px solid var(--wechat-divider);
    background: var(--wechat-bg-white);
}

.wechat-input-toolbar {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    border-bottom: 1px solid var(--wechat-divider);
}

.wechat-input-tool {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--wechat-text-secondary);
    border-radius: 4px;
    transition: all 0.2s;
}

.wechat-input-tool:hover {
    background: var(--wechat-bg-gray);
    color: var(--wechat-text-primary);
}

.wechat-input-box {
    padding: 12px 16px;
    display: flex;
    gap: 12px;
}

.wechat-input-field {
    flex: 1;
    min-height: 60px;
    max-height: 120px;
    padding: 10px 14px;
    background: var(--wechat-bg-gray);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    color: var(--wechat-text-primary);
    resize: none;
    font-family: inherit;
    line-height: 1.6;
}

.wechat-input-field:focus {
    outline: none;
    background: var(--wechat-bg-white);
    box-shadow: 0 0 0 2px var(--wechat-green-light);
}

.wechat-send-btn {
    padding: 0 24px;
    height: 36px;
    background: var(--wechat-green);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-end;
}

.wechat-send-btn:hover {
    background: var(--wechat-green-hover);
}

.wechat-send-btn:active {
    background: var(--wechat-green-active);
    transform: scale(0.98);
}

.wechat-send-btn:disabled {
    background: var(--wechat-border);
    cursor: not-allowed;
}

/* ==================== 右侧信息栏 ==================== */
.wechat-info-panel {
    width: 300px;
    background: var(--wechat-bg-white);
    border-left: 1px solid var(--wechat-divider);
    overflow-y: auto;
    flex-shrink: 0;
}

.wechat-info-section {
    padding: 20px;
    border-bottom: 8px solid var(--wechat-bg-gray);
}

.wechat-info-profile {
    text-align: center;
}

.wechat-info-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin: 0 auto 12px;
    object-fit: cover;
}

.wechat-info-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--wechat-text-primary);
    margin-bottom: 8px;
}

.wechat-info-id {
    font-size: 13px;
    color: var(--wechat-text-tertiary);
}

.wechat-info-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.wechat-info-action {
    flex: 1;
    padding: 10px;
    background: var(--wechat-bg-gray);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: var(--wechat-text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.wechat-info-action:hover {
    background: var(--wechat-green-light);
    color: var(--wechat-green);
}

.wechat-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 14px;
}

.wechat-info-label {
    color: var(--wechat-text-secondary);
}

.wechat-info-value {
    color: var(--wechat-text-primary);
}

/* ==================== Element Plus 组件优化 ==================== */
.el-button--primary {
    background-color: var(--wechat-green) !important;
    border-color: var(--wechat-green) !important;
    border-radius: 4px !important;
}

.el-button--primary:hover {
    background-color: var(--wechat-green-hover) !important;
    border-color: var(--wechat-green-hover) !important;
}

.el-button--primary:active {
    background-color: var(--wechat-green-active) !important;
    border-color: var(--wechat-green-active) !important;
}

.el-input__inner {
    border-radius: 4px !important;
    border-color: var(--wechat-divider) !important;
}

.el-input__inner:focus {
    border-color: var(--wechat-green) !important;
}

.el-dialog {
    border-radius: 8px !important;
}

.el-card {
    border-radius: 8px !important;
    border: none !important;
    box-shadow: var(--wechat-shadow-light) !important;
}

.el-message {
    border-radius: 8px !important;
    box-shadow: var(--wechat-shadow-medium) !important;
}

.el-message--success {
    background-color: var(--wechat-green-light) !important;
    border-color: var(--wechat-green) !important;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .wechat-info-panel {
        display: none;
    }
    
    .wechat-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .wechat-navbar {
        height: 50px;
        padding: 0 12px;
    }
    
    .wechat-navbar-logo {
        font-size: 16px;
        margin-right: 20px;
    }
    
    .wechat-navbar-search {
        display: none;
    }
    
    .wechat-container {
        padding-top: 50px;
    }
    
    .wechat-sidebar {
        position: fixed;
        left: 0;
        top: 50px;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .wechat-sidebar.show {
        transform: translateX(0);
    }
    
    .wechat-message-content {
        max-width: 80%;
    }
}

/* ==================== 滚动条样式 ==================== */
.wechat-sidebar-list::-webkit-scrollbar,
.wechat-messages-area::-webkit-scrollbar,
.wechat-info-panel::-webkit-scrollbar {
    width: 6px;
}

.wechat-sidebar-list::-webkit-scrollbar-track,
.wechat-messages-area::-webkit-scrollbar-track,
.wechat-info-panel::-webkit-scrollbar-track {
    background: transparent;
}

.wechat-sidebar-list::-webkit-scrollbar-thumb,
.wechat-messages-area::-webkit-scrollbar-thumb,
.wechat-info-panel::-webkit-scrollbar-thumb {
    background: #C8C8C8;
    border-radius: 3px;
}

.wechat-sidebar-list::-webkit-scrollbar-thumb:hover,
.wechat-messages-area::-webkit-scrollbar-thumb:hover,
.wechat-info-panel::-webkit-scrollbar-thumb:hover {
    background: #A8A8A8;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wechat-message-group {
    animation: fadeIn 0.3s ease;
}

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

.wechat-chat-item {
    animation: slideIn 0.3s ease;
}

/* ==================== 加载动画 ==================== */
.wechat-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.wechat-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--wechat-divider);
    border-top-color: var(--wechat-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 空状态 ==================== */
.wechat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.wechat-empty-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.wechat-empty-text {
    font-size: 15px;
    color: var(--wechat-text-tertiary);
}

/* ==================== 音视频通话样式 ==================== */
.wechat-call-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    height: 640px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: var(--wechat-shadow-heavy);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.wechat-call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 60px;
    margin-bottom: 24px;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.wechat-call-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.wechat-call-status {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 60px;
}

.wechat-call-actions {
    display: flex;
    gap: 40px;
}

.wechat-call-btn {
    width: 64px;
    height: 64px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 28px;
}

.wechat-call-btn-accept {
    background: var(--wechat-green);
}

.wechat-call-btn-reject {
    background: var(--wechat-red);
}

.wechat-call-btn:hover {
    transform: scale(1.1);
}

.wechat-call-btn:active {
    transform: scale(0.95);
}
