/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
    background-color: #f5f5f5;
    position: relative;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 100;
}

/* 折叠状态的侧边栏 */
.sidebar.collapsed {
    width: 60px;
}

/* 导航项文字在折叠状态下隐藏 */
.sidebar.collapsed .nav-item span {
    display: none;
}

/* 导航图标在折叠状态下居中 */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
}

/* 主内容区域 */
.content {
    flex: 1;
    padding: 20px;
    margin-left: 240px;
    min-width: 0;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

/* 折叠状态下的内容区域 */
.sidebar.collapsed + .content {
    margin-left: 60px;
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 导航菜单 */
.sidebar nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    color: #333;
    text-decoration: none;
    padding: 12px 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    margin: 4px 12px;
    border-radius: 8px;
    overflow: hidden;
    white-space: nowrap;
    overflow: hidden;  /* 确保水波纹被容器裁切 */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    min-width: 20px;
}

.nav-item span {
    flex-grow: 1;
}

.nav-item:hover {
    background-color: #f5f5f5;
    color: #1a73e8;
}

.nav-item.active {
    background-color: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.nav-item.active .nav-icon {
    color: #1a73e8;
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 500;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

/* 错误消息样式 */
.error-message {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #fecaca;
}

/* 成功消息样式 */
.success-message {
    background-color: #f0fdf4;
    color: #16a34a;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #bbf7d0;
}

/* 模态框基础样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 容器布局调整 */
    .container {
        flex-direction: column;
    }

    /* 侧边栏改为顶部导航 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px; /* 固定顶部导航高度 */
        padding: 0;
        transform: none;
        display: flex;
        justify-content: center;
        overflow-x: auto;
        overflow-y: hidden;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* 导航菜单横向排列 */
    .sidebar nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0 10px;
        height: 100%;
    }

    /* 导航项样式调整 */
    .nav-item {
        padding: 0 15px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
    }

    /* 导航图标调整 */
    .nav-icon {
        width: 20px;
        height: 20px;
    }

    /* 导航文字调整 */
    .nav-item span {
        font-size: 12px;
        display: block;
    }

    /* 内容区域调整 */
    .content {
        margin-left: 0;
        margin-top: 60px; /* 为顶部导航留出空间 */
        padding: 10px;
    }

    /* 移除折叠相关样式 */
    .sidebar.collapsed {
        transform: none;
        width: 100%;
    }

    .sidebar.collapsed + .content {
        margin-left: 0;
    }

    /* 隐藏折叠按钮 */
    .sidebar-toggle,
    .mobile-menu-trigger {
        display: none;
    }

    /* 添加横向滚动条样式 */
    .sidebar::-webkit-scrollbar {
        height: 3px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
}

/* 处理超小屏幕 */
@media (max-width: 360px) {
    .nav-item {
        padding: 0 10px;
    }

    .nav-icon {
        width: 18px;
        height: 18px;
    }

    .nav-item span {
        font-size: 11px;
    }
}

/* 移动端菜单触发按钮 */
.mobile-menu-trigger {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-trigger {
        display: flex;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 水波纹效果 */
.nav-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 水波纹元素样式 */
.ripple {
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.85s ease-out;
    pointer-events: none;
}

/* 水波纹动画 */
@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 0.4;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .ripple {
        background: rgba(0, 0, 0, 0.05);
    }
}

/* 机器人离线提示样式 */
.bot-offline-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
}

.offline-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.offline-icon {
    width: 64px;
    height: 64px;
    color: #dc3545;
    margin-bottom: 20px;
}

.offline-content h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 12px;
}

.offline-content p {
    color: #666;
    margin-bottom: 24px;
}

.refresh-btn {
    padding: 10px 24px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #1565c0;
}

/* 添加加载指示器样式 */
.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 添加页面切换动画 */
#content-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

#content-container.loading {
    opacity: 0.6;
}

/* 加载页面样式 */
.loading-page {
    position: fixed;
    top: 0;
    left: 240px; /* 与侧边栏宽度相同 */
    right: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99; /* 确保在侧边栏(z-index: 100)下面 */
    backdrop-filter: blur(5px);
    transition: left 0.3s ease; /* 添加过渡效果 */
}

/* 当侧边栏折叠时调整加载页面位置 */
.sidebar.collapsed ~ .loading-page {
    left: 60px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .loading-page {
        left: 0;
        top: 60px; /* 与顶部导航栏高度相同 */
        height: calc(100% - 60px);
    }
}

/* 优化加载内容的样式 */
.loading-content {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a73e8; /* 使用主题色 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: #1a73e8; /* 使用主题色 */
    font-size: 18px;
    font-weight: 500;
    margin-top: 15px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 页面切换动画 */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 确保所有导航项都可见 */
.sidebar nav .nav-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
} 