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

/* 基础设置 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 顶部导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-left .logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: #409eff;
}

.navbar-left .logo i {
    font-size: 24px;
    margin-right: 8px;
}

.navbar-right {
    display: flex;
    align-items: center;
}

.navbar-right .nav-item {
    margin-left: 20px;
    position: relative;
    cursor: pointer;
    color: #606266;
}

.navbar-right .nav-item:hover {
    color: #409eff;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #f56c6c;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* 主要内容区域 */
.main-container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background-color: #304156;
    color: #fff;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bfcbd9;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav .nav-item a:hover {
    background-color: #409eff;
    color: #fff;
}

.sidebar-nav .nav-item.active a {
    background-color: #1f2d3d;
    color: #409eff;
    border-left: 3px solid #409eff;
}

.sidebar-nav .nav-item a i {
    margin-right: 10px;
    font-size: 16px;
}

/* 内容区域 */
.content {
    flex: 1;
    margin-left: 200px;
    padding: 20px;
    overflow-y: auto;
}

/* 模块样式 */
.module {
    display: none;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.module.active {
    display: block;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ebeef5;
}

.module-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
}

.module-actions {
    display: flex;
    align-items: center;
}

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

/* 统计卡片 */
.stat-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
}

.stat-card:nth-child(1) .stat-icon {
    background-color: #ecf5ff;
    color: #409eff;
}

.stat-card:nth-child(2) .stat-icon {
    background-color: #f0f9eb;
    color: #67c23a;
}

.stat-card:nth-child(3) .stat-icon {
    background-color: #fff7e6;
    color: #e6a23c;
}

.stat-card:nth-child(4) .stat-icon {
    background-color: #fef0f0;
    color: #f56c6c;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 5px;
}

.stat-content p {
    color: #909399;
    margin-bottom: 5px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 500;
}

.stat-trend.positive {
    color: #67c23a;
}

.stat-trend.negative {
    color: #f56c6c;
}

/* 图表网格 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* 图表卡片 */
.chart-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.chart-controls {
    display: flex;
    gap: 5px;
}

.chart-btn {
    padding: 4px 12px;
    border: 1px solid #dcdfe6;
    background-color: #fff;
    color: #606266;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.chart-btn:hover {
    border-color: #409eff;
    color: #409eff;
}

.chart-btn.active {
    background-color: #409eff;
    color: #fff;
    border-color: #409eff;
}

.chart-content {
    height: 300px;
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.data-table th {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #303133;
    font-size: 14px;
}

.data-table td {
    color: #606266;
}

.data-table tr:hover {
    background-color: #f5f7fa;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    margin-left: 10px;
}

.btn:first-child {
    margin-left: 0;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background-color: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

.btn-secondary {
    background-color: #606266;
    color: #fff;
}

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

.btn-success {
    background-color: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background-color: #85ce61;
}

.btn-danger {
    background-color: #f56c6c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #f78989;
}

/* 搜索输入框 */
.search-input {
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    margin-right: 10px;
}

.search-input:focus {
    outline: none;
    border-color: #409eff;
}

/* 日期输入框 */
.date-input {
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    margin-right: 10px;
}

.date-input:focus {
    outline: none;
    border-color: #409eff;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #dcdfe6;
    background-color: #fff;
    color: #606266;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.3s;
}

.pagination-btn:hover {
    border-color: #409eff;
    color: #409eff;
}

.pagination-info {
    margin: 0 10px;
    color: #606266;
}

/* 代理卡片网格 */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 代理卡片 */
.agent-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.15);
}

.agent-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 10px;
}

.agent-card p {
    color: #606266;
    margin-bottom: 5px;
}

.agent-card .agent-status {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

/* 登录页面样式 */
.login-body {
    background-color: #f5f7fa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.login-logo i {
    font-size: 48px;
    color: #409eff;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #303133;
    margin: 0;
}

.login-subtitle {
    color: #909399;
    font-size: 16px;
    margin: 0;
}

.login-form-container {
    margin-top: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    color: #606266;
    font-weight: 500;
}

.form-label i {
    margin-right: 8px;
    color: #909399;
}

.form-input {
    padding: 12px 15px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: #606266;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 8px;
}

.forgot-password {
    color: #409eff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #66b1ff;
    text-decoration: underline;
}

.form-error {
    background-color: #fef0f0;
    color: #f56c6c;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    margin-bottom: 10px;
}

.btn-block {
    width: 100%;
    margin-left: 0;
    padding: 12px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #909399;
    font-size: 14px;
}

.agent-card .agent-status.active {
    background-color: #f0f9eb;
    color: #67c23a;
}

.agent-card .agent-status.inactive {
    background-color: #fef0f0;
    color: #f56c6c;
}

.agent-card .agent-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ebeef5;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #909399;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #606266;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #ebeef5;
    gap: 10px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #409eff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-nav .nav-item a span {
        display: none;
    }
    
    .content {
        margin-left: 60px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .module-actions {
        margin-top: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .navbar-right .nav-item span {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        margin: 5px 0;
        width: 100%;
    }
    
    .search-input {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
}