/* ================= 聊天室专用样式 chat.css（清理重构版） ================= */

/* CSS变量补充 */
:root {
    --secondary-color: #6c757d; /* 添加缺少的辅助颜色 */
}

/* 聊天室整体布局 */
.container {
    position: relative !important; /* 强制相对定位 */
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: var(--spacing-md);
    padding-bottom: 8px;
}

/* ================= 聊天消息区域 ================= */
.chat-messages {
    flex: 1; /* 占据剩余空间 */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    padding-right: 80px; /* 给右侧留出按钮空间 */
    overflow-y: auto;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch; /* 添加平滑滚动 */
    scroll-behavior: smooth; /* 平滑滚动效果 */
    min-height: 0; /* 允许flex收缩 */
}

#messagesList {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.welcome-message {
    text-align: center;
    color: #6c757d;
    padding: var(--spacing-lg);
}

.welcome-message p {
    margin: 0;
    font-style: italic;
}

/* ================= 消息布局样式 ================= */
.message-item {
    margin: 4px 0;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    animation: fadeInDown 0.3s ease-out;
}

/* 左右分布样式 */
.message-item.message-self {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}

.message-item.message-other {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* 消息包装器 */
.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 65%;
    width: fit-content;
}

.message-self .message-wrapper {
    flex-direction: row !important;
    justify-content: flex-end !important;
}

.message-other .message-wrapper {
    flex-direction: row !important;
    justify-content: flex-start !important;
}

/* 强化自己消息的右对齐 */
.message-item.message-self .message-content-area {
    order: 1;
}

.message-item.message-self .message-avatar {
    order: 2;
}

.message-item.message-other .message-avatar {
    order: 1;
}

.message-item.message-other .message-content-area {
    order: 2;
}

/* 强化消息内容对齐 */
.message-self .message-content {
    text-align: right !important;
    direction: rtl;
    unicode-bidi: plaintext;
}

.message-other .message-content {
    text-align: left !important;
    direction: ltr;
}

/* 消息内容区域 */
.message-content-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* 消息头部 */
.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 2px;
    min-height: 26px;
    line-height: 1.2;
}

.message-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

/* 自己消息的头部布局 */
.message-self .message-header {
    color: #6c757d;
    flex-direction: row-reverse;
}

.message-self .message-user-info {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

/* 他人消息的头部布局 */
.message-other .message-header {
    color: #6c757d;
}

.message-other .message-user-info {
    justify-content: flex-start;
}

/* 头像样式 */
.message-avatar {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    align-self: flex-start;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.message-avatar:hover img {
    transform: scale(1.1);
}

/* 消息气泡 */
.message-bubble {
    border-radius: 10px;
    padding: 8px 12px;
    position: relative;
    border: 1px solid #dee2e6;
    min-width: 30px;
    max-width: 100%;
    width: fit-content;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-size: 1rem;
}

/* 自己消息的气泡：浅蓝色 */
.message-self .message-bubble {
    background: #f0f8ff !important;
    color: #495057;
    border-color: #cce7ff;
    margin-left: auto;
}

/* 他人消息的气泡：白色 */
.message-other .message-bubble {
    background: #ffffff !important;
    color: #495057;
    border-color: #dee2e6;
    margin-right: auto;
}

/* 消息内容 */
.message-content {
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
}

/* 用户名样式 */
.message-user {
    font-weight: 600;
    font-size: 0.8rem;
    color: #6c757d;
}

/* 管理员用户名样式 */
.message-user.admin {
    color: #dc3545 !important;
}

.message-self .message-user.admin {
    color: #ffc107 !important;
}

.message-user.admin::after {
    content: "👑";
    margin-left: 4px;
}

/* 时间样式 */
.message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    color: #6c757d;
}

/* 回复消息样式 */
.message-reply {
    background: rgba(108, 117, 125, 0.08);
    border-radius: 4px;
    padding: 3px 6px;
    margin-bottom: 4px;
    border-left: 2px solid #6c757d;
    font-size: 0.75rem;
}

.message-self .message-reply {
    background: rgba(144, 202, 249, 0.15);
    border-left-color: #90caf9;
    color: #1976d2;
    text-align: right;
}

.reply-user {
    font-weight: 600;
    margin-right: 3px;
    font-size: 0.7rem;
}

.reply-text {
    opacity: 0.8;
    font-size: 0.7rem;
}

/* 操作按钮 */
.message-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    align-items: center;
    z-index: 10;
}

.message-item:hover .message-actions {
    opacity: 1;
}

.btn-reply,
.btn-delete,
.btn-ban {
    background: rgba(108, 117, 125, 0.1);
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    white-space: nowrap;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100;
}

.btn-reply:hover,
.btn-delete:hover,
.btn-ban:hover {
    background: rgba(108, 117, 125, 0.3);
    transform: translateY(-1px);
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 特别强化删除按钮 */
.btn-delete {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.btn-delete:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    color: #fff !important;
    transform: scale(1.1);
}

/* ================= 输入区域和其他组件 ================= */
.reply-indicator-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    animation: slideInDown 0.3s ease-out;
}

.reply-info {
    flex: 1;
    min-width: 0;
}

.reply-label {
    color: #1976d2;
    font-weight: bold;
    margin-bottom: 2px;
}

.reply-preview {
    color: #424242;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-cancel-reply {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #757575;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-cancel-reply:hover {
    background: #bbdefb;
    color: #1976d2;
}

/* 打字提示 - 悬浮样式 */
.typing-indicator.floating-typing {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-style: italic;
    min-height: auto;
    z-index: 500;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.typing-indicator.floating-typing.active {
    opacity: 1;
    visibility: visible;
}

/* 添加打字动画效果 */
.typing-indicator.floating-typing.active::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-left: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing-dot 1.4s infinite ease-in-out;
}

@keyframes typing-dot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 移除原来的打字提示样式，因为我们不再在布局中使用 */
.typing-indicator:not(.floating-typing) {
    display: none;
}

.chat-input-area {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 0; /* 移除底部边距 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    flex-shrink: 0; /* 防止输入区域缩小 */
}

.admin-panel {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    display: none;
}

.admin-panel.show { display: block; }

.system-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
    margin: 2px 0;
}

/* ================= 动画效果 ================= */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 添加缺少的pulse动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ================= 响应式设计 ================= */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
        padding-bottom: 0; /* 移动端底部无边距 */
        height: 100vh;
        max-height: 100vh;
    }
    
    .chat-messages { 
        margin-bottom: 6px;
        padding: var(--spacing-sm);
        padding-right: var(--spacing-sm); /* 移动端恢复正常右边距 */
    }
    
    .chat-input-area { 
        margin-bottom: 0;
        padding: 8px;
    }
    
    /* 悬浮打字提示在移动端的调整 */
    .typing-indicator.floating-typing {
        top: 35% !important;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .message-wrapper {
        max-width: 75%;
        width: fit-content;
        gap: 6px;
    }
    
    .message-avatar {
        width: 40px;
        height: 40px;
    }
    
    .message-bubble {
        padding: 6px 10px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .message-header {
        font-size: 0.7rem;
        min-height: 24px;
        margin-bottom: 1px;
        gap: 6px;
    }
    
    .message-content {
        font-size: 0.9rem;
        line-height: 1.35;
    }
    
    .message-user { font-size: 0.75rem; }
    .message-time { font-size: 0.7rem; }
    
    .message-actions { gap: 4px; }
    
    .btn-reply, .btn-delete, .btn-ban {
        padding: 3px 5px;
        font-size: 0.7rem;
        border-radius: 5px;
        height: 20px;
        min-width: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
        padding-bottom: 0;
    }
    
    .chat-input-area {
        margin-bottom: 0;
        padding: 6px;
    }
    
    .chat-messages {
        margin-bottom: 4px;
        padding: 6px;
    }
    
    .message-wrapper {
        max-width: 80%;
        width: fit-content;
        gap: 5px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
    }
    
    .message-bubble {
        padding: 5px 8px;
        border-radius: 6px;
        font-size: 0.85rem;
    }
    
    .message-header {
        font-size: 0.65rem;
        gap: 4px;
        min-height: 22px;
    }
    
    .message-content { font-size: 0.85rem; }
    
    .message-user { font-size: 0.7rem; }
    .message-time { font-size: 0.65rem; }
    
    .message-actions { gap: 3px; }
    
    .btn-reply, .btn-delete, .btn-ban {
        padding: 2px 4px;
        font-size: 0.65rem;
        border-radius: 4px;
        height: 18px;
        min-width: 18px;
    }
}

/* ================= 滚动条样式 ================= */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ================= 关闭按钮样式 ================= */
.close-btn {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    width: 50px;
    height: 50px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    user-select: none;
}

.close-btn:hover {
    background: #c82333;
    transform: scale(1.1) translateX(5px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.close-text {
    display: block;
    font-style: normal;
}

/* ================= 悬浮菜单样式 ================= */
.floating-menu-btn {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important; /* 强制在容器内部 */
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.floating-menu-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1) translateX(-5px); /* 向左移动一点 */
}

.menu-icon {
    color: white;
    font-size: 1.5rem;
    font-style: normal;
}

.floating-menu-panel {
    position: fixed;
    top: 0;
    right: -320px; /* 从右侧滑入 */
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15); /* 阴影调整为左侧 */
    z-index: 999;
    transition: right 0.3s ease; /* 改为right动画 */
    overflow-y: auto;
    border-left: 1px solid #e0e0e0; /* 改为左边框 */
}

.floating-menu-panel.show {
    right: 0; /* 滑入到右侧 */
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom: 1px solid #e0e0e0;
}

.menu-header h6 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.close-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-content {
    padding: 25px 20px;
}

.nav-buttons {
    margin-bottom: 25px;
}

.menu-nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.menu-nav-btn:hover {
    background: #e9ecef;
    color: #333;
    transform: translateX(5px);
}

.menu-nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 语音按钮 */
.voice-container {
    position: relative;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.voice-toggle.enabled {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.voice-toggle.disabled {
    background: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

.voice-toggle.speaking {
    animation: pulse 1s ease-in-out infinite;
}

/* 语音菜单样式 */
.voice-menu {
    position: static;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 12px;
    padding: 8px 0;
    font-size: 0.9rem;
}

.voice-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.voice-option:hover {
    background: #f8f9fa;
    color: #495057;
}

.voice-option.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.welcome-info {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.welcome-info .user-name {
    color: var(--primary-color);
    font-weight: bold;
}

.connection-status {
    font-size: 0.9rem;
    margin-top: 8px;
    font-weight: 500;
}

.connection-status.connected { color: #28a745; }
.connection-status.disconnected { color: #dc3545; }
.connection-status.connecting { color: #ffc107; }

/* 遮罩层 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 移动端调整 */
@media (max-width: 768px) {
    .close-btn {
        position: fixed !important; /* 移动端使用固定定位，脱离容器 */
        top: 20px !important;
        left: 20px !important;
        z-index: 1001 !important;
        width: 45px;
        height: 45px;
        font-size: 0.8rem;
    }
    
    .floating-menu-btn {
        position: fixed !important; /* 移动端使用固定定位，脱离容器 */
        top: 20px !important;
        right: 20px !important;
        z-index: 1001 !important;
    }
    
    .floating-menu-panel {
        width: 280px;
        right: -300px; /* 移动端也从右侧滑入 */
    }
    
    .menu-content {
        padding: 20px 15px;
    }
    
    .menu-nav-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* 电脑版优化：减少右侧空隙 */
@media (min-width: 769px) {
    .chat-messages {
        padding-right: 20px; /* 电脑版减少右边距，让头像更贴近边缘 */
    }
    
    /* 确保容器有正确的定位上下文 */
    .container {
        position: relative !important;
        overflow: hidden; /* 隐藏超出容器的面板 */
    }
    
    /* 悬浮按钮相对于容器定位 - 现在按钮在容器内部 */
    .floating-menu-btn {
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 1001 !important;
    }
    
    /* 菜单面板相对于容器定位 */
    .floating-menu-panel {
        position: absolute !important; /* 改为相对于容器的绝对定位 */
        top: 0 !important;
        right: -320px !important; /* 隐藏在容器右侧外面 */
        width: 300px !important;
        height: 100% !important; /* 高度跟随容器 */
        transition: right 0.3s ease !important;
        z-index: 1000 !important;
    }
    
    .floating-menu-panel.show {
        right: 0 !important; /* 滑入到容器右边缘 */
    }
    
    /* 自己消息更贴近右边缘 */
    .message-item.message-self {
        margin-right: 0; /* 移除右边距 */
        padding-right: 0; /* 移除内边距 */
    }
    
    .message-self .message-wrapper {
        margin-right: 0; /* 确保包装器贴近边缘 */
    }
}

/* ================= 管理员操作弹窗样式 ================= */

/* 禁言弹窗样式 */
.ban-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.ban-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ban-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.ban-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #e9ecef;
    color: #333;
}

.ban-modal-body {
    padding: 20px;
}

.ban-user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.ban-form-group {
    margin-bottom: 20px;
}

.ban-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.ban-select,
.ban-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ban-select:focus,
.ban-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.ban-input[style*="display: none"] {
    margin-top: 10px;
}

.ban-preview {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
    margin-top: 15px;
}

.ban-preview strong {
    color: #17a2b8;
}

.ban-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-confirm {
    background: #dc3545;
    color: white;
}

.btn-confirm:hover {
    background: #c82333;
}

/* 重写Bootstrap模态框样式，确保在容器中间显示 */
.modal.fade.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    margin: 0;
    width: 90%;
    max-width: 500px;
}

/* 确保模态框背景覆盖整个容器 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ban-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .ban-modal-header,
    .ban-modal-body,
    .ban-modal-footer {
        padding: 15px;
    }
    
    .ban-modal-footer {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-confirm {
        width: 100%;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .ban-modal {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .ban-modal-header,
    .ban-modal-footer {
        background: #4a5568;
        border-color: #4a5568;
    }
    
    .ban-user-info {
        background: #4a5568;
    }
    
    .ban-preview {
        background: #2d3748;
        border-color: #63b3ed;
    }
    
    .ban-select,
    .ban-input {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .ban-preview strong {
        color: #63b3ed;
    }
}