/* 布局容器 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #001529 0%, #002140 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-info span,
.sidebar.collapsed .logout-btn,
.sidebar.collapsed .back-link {
    display: none;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

/* 导航菜单 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: #1890ff;
    color: #fff;
}

.nav-item.disabled {
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
}

.nav-icon {
    font-size: 16px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.back-link {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    padding: 8px 0;
}

.back-link:hover {
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.user-avatar {
    font-size: 24px;
    margin-right: 8px;
}

.user-name {
    font-size: 14px;
}

.logout-btn {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部栏 */
.top-bar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    color: #666;
}

.toggle-sidebar:hover {
    color: #1890ff;
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.breadcrumb-item {
    color: #999;
}

.breadcrumb-item::before {
    content: '>';
    margin: 0 8px;
    color: #d9d9d9;
}

.breadcrumb-item:first-child::before {
    display: none;
}

/* 内容区域 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* 仪表盘 */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.page-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.page-header {
    margin-bottom: 24px;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 32px;
    margin-right: 16px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #1890ff;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: #999;
}

/* 快速操作 */
.quick-actions {
    margin-bottom: 24px;
}

.quick-actions h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.action-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

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

.action-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.action-text {
    font-size: 14px;
    color: #666;
}

/* AI状态 */
.ai-status {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-status h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.status-content {
    padding: 16px;
    background: #fafafa;
    border-radius: 6px;
}

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    width: 100px;
    color: #666;
    font-size: 14px;
}

.status-value {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.status-badge.active {
    background: #f6ffed;
    color: #52c41a;
}

.status-badge.inactive {
    background: #f5f5f5;
    color: #999;
}

.status-empty {
    text-align: center;
    padding: 20px;
}

.status-empty p {
    color: #999;
    margin-bottom: 16px;
}

.status-error {
    color: #ff4d4f;
    text-align: center;
    padding: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed {
        transform: translateX(0);
    }
    
    .content-area {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
