/* ================================================
   刻都音视频 - 自定义UI增强样式
   Custom UI Enhancements for Better UX
   ================================================ */

/* 全局平滑过渡效果 */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 改进的滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5870e6, #6a3f8f);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 优化的阴影效果 */
.el-card,
.el-dialog,
.el-message-box,
.el-popover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: box-shadow 0.3s ease !important;
}

.el-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

/* 改进的按钮动画 */
.el-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

.el-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* 按钮点击波纹效果 */
.el-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.el-button:active::after {
    width: 300px;
    height: 300px;
}

/* 改进的输入框焦点效果 */
.el-input__inner:focus,
.el-textarea__inner:focus {
    box-shadow: 0 0 0 2px rgba(88, 127, 240, 0.2) !important;
    border-color: #587ff0 !important;
    transition: all 0.3s ease !important;
}

/* 优化的表格样式 */
.el-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.el-table th {
    background: linear-gradient(180deg, #f5f7fa 0%, #eef1f6 100%) !important;
    font-weight: 600;
    color: #333;
}

.el-table tbody tr:hover {
    background-color: #f5f8ff !important;
}

/* 改进的标签样式 */
.el-tag {
    border-radius: 20px;
    padding: 0 12px;
    transition: all 0.3s ease;
}

.el-tag:hover {
    transform: scale(1.05);
}

/* 优化的对话框动画 */
.el-dialog {
    animation: dialogFadeIn 0.3s ease-out;
}

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

/* 改进的消息提示 */
.el-message {
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: messageSlideIn 0.3s ease-out;
}

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

/* 优化的头像样式 */
.head-image,
.avatar-image {
    transition: all 0.3s ease;
    position: relative;
}

.head-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 在线状态呼吸灯效果 */
.online {
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        box-shadow: 0 0 5px rgba(50, 205, 50, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(50, 205, 50, 0.8);
    }
}

/* 改进的加载动画 */
.el-loading-spinner {
    animation: smoothSpin 1s linear infinite;
}

@keyframes smoothSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 优化的导航栏 */
.navi-bar {
    background: linear-gradient(180deg, #e8f2ff 0%, #d9e9ff 100%) !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.navi-bar .el-menu-item {
    border-radius: 8px;
    margin: 20px 8px !important;
    transition: all 0.3s ease !important;
}

.navi-bar .el-menu-item:hover {
    background-color: rgba(88, 127, 240, 0.1) !important;
    transform: translateX(5px);
}

.navi-bar .el-menu-item.is-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.navi-bar .el-menu-item.is-active .icon {
    color: #fff !important;
}

/* 未读消息徽章动画 */
.unread-text {
    animation: pulse 2s ease-in-out infinite;
}

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

/* 改进的登录页面 */
.login-view {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.login-view::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(50px, 50px);
    }
}

/* 登录内容区域居中 */
.login-view .login-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    flex-wrap: wrap !important;
    gap: 40px !important;
}

/* 登录介绍区域隐藏（移动端友好） */
.login-view .login-intro {
    display: none !important;
}

/* 大屏幕显示介绍区域 */
@media (min-width: 1200px) {
    .login-view .login-intro {
        display: block !important;
        flex: 0 0 auto !important;
    }
}

/* 登录表单居中优化 */
.login-form {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    animation: loginFormSlideIn 0.5s ease-out;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 10 !important;
}

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

/* 注册表单居中 */
.register-view {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
}

.register-view .web-ruleForm {
    margin: 0 auto !important;
}

/* 视频通话界面优化 */
.rtc-video-box,
.rtc-voice-box {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.rtc-control-bar .icon {
    transition: all 0.3s ease;
}

.rtc-control-bar .icon:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.rtc-control-bar .icon:active {
    transform: scale(0.95);
}

/* 群组成员选择器优化 */
.group-member-selector .left-box,
.group-member-selector .right-box {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.group-member-selector .left-box:hover,
.group-member-selector .right-box:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 聊天气泡优化 */
.message-item {
    animation: messageItemFadeIn 0.3s ease-out;
}

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

/* 表情选择器优化 */
.emoji-picker {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: emojiPickerSlideIn 0.2s ease-out;
}

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

/* 响应式优化 */
@media (max-width: 768px) {
    .el-dialog {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    .login-form {
        width: 90% !important;
        max-width: 400px;
        margin: 0 auto !important;
    }
    
    .login-view .login-content {
        padding: 10px !important;
        justify-content: center !important;
    }
    
    .el-message {
        min-width: 280px;
    }
}

/* 平板端优化 */
@media (min-width: 769px) and (max-width: 1199px) {
    .login-form {
        width: 450px !important;
        margin: 0 auto !important;
    }
    
    .login-view .login-intro {
        display: none !important;
    }
}

/* 桌面端优化 */
@media (min-width: 1200px) {
    .login-form {
        width: 400px !important;
        flex-shrink: 0 !important;
    }
}

/* 深色主题支持（可选） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2a2a2a;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
    }
    
    /* 可以根据需要添加深色主题样式 */
}

/* 提升性能 - GPU加速 */
.el-button,
.el-card,
.el-dialog,
.head-image,
.navi-bar .el-menu-item {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 优化的ICP备案信息显示 */
.icp {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 内容区域优化 */
.content-box {
    background: linear-gradient(180deg, #f8f8f8 0%, #ffffff 100%) !important;
}

/* 设置页面优化 */
.setting .el-form {
    animation: settingFormFadeIn 0.4s ease-out;
}

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

/* 用户信息卡片优化 */
.user-info {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    animation: userInfoSlideIn 0.3s ease-out;
}

@keyframes userInfoSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 全屏图片查看器优化 */
.full-image {
    backdrop-filter: blur(10px);
}

.full-image img {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: imageZoomIn 0.3s ease-out;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 提升整体视觉体验 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 焦点可见性优化（无障碍） */
*:focus {
    outline: 2px solid rgba(88, 127, 240, 0.5);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid rgba(88, 127, 240, 0.5);
    outline-offset: 2px;
}

/* 禁用状态优化 */
.el-button.is-disabled,
.el-input.is-disabled .el-input__inner {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载状态优化 */
.el-button.is-loading {
    position: relative;
    pointer-events: none;
}

.el-button.is-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.7;
}

/* 表单验证提示优化 */
.el-form-item.is-error .el-input__inner {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ================================================
   END - Custom UI Enhancements
   ================================================ */

