/**
 *毕加昊开源
 */
*, ::before, ::after {
    box-sizing: border-box;
}
html,body{
    height: 100%;
    margin: 0;
    padding: 0;
    background: url(https://x7bb.cn/7/api/?t=dm) center center no-repeat;
    background-size: cover;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body{
    max-width:800px;
    margin:0 auto;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    min-height: 100%;
}
.mk-chat-box{
    font-family: "Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif;
    font-size:16px;
    width: 100%;
    padding: 0;
    position:relative;
    overflow-y: scroll;
    overflow-x: hidden;
    height: calc(100% - 140px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom:0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px 12px 0 0;
}
/* 新增：透明遮罩层 */
.mk-chat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mk-chat-overlay.active {
    display: flex;
    opacity: 1;
}
/* 新增：透明加载动画 */
.mk-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.top{
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    height:60px;
    line-height:60px;
    text-align:center;
    color: #2c3e50;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.5px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* 新增：标题动画 */
    animation: slideDown 0.5s ease;
}
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.foot{
    line-height:40px;
    text-align:center;
    font-size:12px;
    color: #7b8a8b;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    /* 新增：底部淡入动画 */
    animation: fadeIn 0.8s ease 0.2s both;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.write{
    height:60px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
    /* 新增：输入区域动画 */
    animation: slideUp 0.5s ease 0.1s both;
}
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.write input { 
    font-size: 16px;
    flex: 1;
    height: 40px;
    padding: 0 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    outline: none;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
}
.write input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
#fresh{
    color:#667eea;
    margin-right: 10px;
    text-decoration: none;
    font-weight: 500;
    /* 新增：刷新按钮动画 */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
#fresh::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #667eea;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}
#fresh:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}
.send{
    color:#fff;
    text-decoration:none;
    width:80px; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display:inline-block;
    height: 40px;
    line-height:40px;
    text-align:center;
    border-radius: 20px;
    margin-left: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    /* 新增：发送按钮波纹效果 */
    position: relative;
    overflow: hidden;
}
.send::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
.send:active::before {
    width: 300px;
    height: 300px;
}
.send:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.send.disabled{
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.mk-chat-box .msg{
    margin: 12px 6px;
    position: relative;
    min-height: 50px;
    border: 0;
}
.mk-chat-box .right{
    text-align: right;
    margin-left: 80px;
}
.mk-chat-box .left{
    text-align: left;
    margin-right: 80px;
}
.mk-chat-box img.head{
    width: 40px;
    height: 40px;
    top: 5px;
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
    /* 新增：头像悬浮动画 */
    transition: all 0.3s ease;
}
.mk-chat-box img.head:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.mk-chat-box .right img.head{
    right: 0;
}
.mk-chat-box .left img.head{
    left: 0;
}
.mk-chat-box .name{
    color: #2c3e50;
    font-size: 12px;
    display: block;
    line-height: 16px;
    margin-bottom: 4px;
    font-weight: 500;
}
.mk-chat-box .right .name{
    margin: 0 60px 4px 0;
}
.mk-chat-box .left .name{
    margin: 0 0 4px 60px;
}
.mk-chat-box .content{
    word-break: break-all;
    word-wrap: break-word;
    text-align: left;
    position: relative;
    display: inline-block;
    font-size: 14px;
    padding: 12px 16px;
    line-height: 1.4;
    border-radius: 18px;
    min-width: 20px;
    max-width: 70%;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.7);
    /* 新增：消息内容动画增强 */
    animation: messagePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes messagePop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.mk-chat-box .content img{
    width: 100%;
    height: auto;
    border-radius: 8px;
    /* 新增：图片淡入动画 */
    animation: imageFadeIn 0.6s ease;
}
@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.mk-chat-box .content a{
    color: #667eea;
    margin: 0 2px;
    text-decoration: none;
    font-weight: 500;
    /* 新增：链接悬浮效果 */
    transition: all 0.3s ease;
    position: relative;
}
.mk-chat-box .content a:hover {
    color: #764ba2;
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}
.mk-chat-box .right .content{
    margin: 0 60px 0 0;
    color: #2c3e50;
}
.mk-chat-box .left .content{
    margin: 0 0 0 60px;
    color: #2c3e50;
}
.mk-chat-box .content:after{
    content: "";
    position: absolute;
    border-bottom: 8px solid transparent;
}
.mk-chat-box .right .content:after{
    right: -8px;
    top: 12px;
    border-left: 8px solid rgba(255, 255, 255, 0.7);
}
.mk-chat-box .left .content:after{
    left: -8px;
    top: 12px;
    border-right: 8px solid rgba(255, 255, 255, 0.7);
}
.mk-chat-box .tips{
    margin: 16px;
    text-align: center;
    font-size: 12px;
    /* 新增：提示信息动画 */
    animation: bounceIn 0.6s ease;
}
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.mk-chat-box .tips span{
    display: inline-block;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    color: #2c3e50;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* 新增：提示标签动画 */
    transition: all 0.3s ease;
}
.mk-chat-box .tips span:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.mk-chat-box .tips .tips-primary{
    background: rgba(102, 126, 234, 0.7);
    color: white;
}
.mk-chat-box .tips .tips-success{
    background: rgba(86, 171, 47, 0.7);
    color: white;
}
.mk-chat-box .tips .tips-info{
    background: rgba(77, 160, 255, 0.7);
    color: white;
}
.mk-chat-box .tips .tips-warning{
    background: rgba(247, 151, 30, 0.7);
    color: white;
}
.mk-chat-box .tips .tips-danger{
    background: rgba(255, 65, 108, 0.7);
    color: white;
}
/**/
.mk-chat-box::-webkit-scrollbar{width:6px;height:6px}
.mk-chat-box::-webkit-scrollbar-button:vertical{display:none}
.mk-chat-box::-webkit-scrollbar-track:vertical{background-color:transparent;}
.mk-chat-box::-webkit-scrollbar-track-piece{background-color:transparent;}
.mk-chat-box::-webkit-scrollbar-thumb:vertical{background-color:rgba(102, 126, 234, 0.3);border-radius:3px}
.mk-chat-box::-webkit-scrollbar-thumb:vertical:hover,
.mk-chat-box::-webkit-scrollbar-thumb:vertical:active {background-color: #667eea}
/* 新增：滚动条动画 */
.mk-chat-box::-webkit-scrollbar-thumb:vertical {
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.login{margin-top:20px;}
/* 消息动画增强 */
.mk-chat-box .msg {
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 新增：打字指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    margin: 0 0 0 60px;
    max-width: 80px;
    animation: pulse 1.5s infinite;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #2c3e50;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
/* 响应式设计 */
@media (max-width: 480px) {
    .mk-chat-box .right,
    .mk-chat-box .left {
        margin-left: 60px;
        margin-right: 60px;
    }
    
    .mk-chat-box .content {
        max-width: 85%;
        padding: 10px 14px;
    }
    
    .write {
        padding: 0 8px;
    }
    
    .send {
        width: 70px;
    }
    
    /* 移动端动画优化 */
    .mk-chat-box .msg {
        animation-duration: 0.2s;
    }
}
