/* 管理后台样式 */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
    --content-bg: #f5f6fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--content-bg);
    overflow-x: hidden;
}

/* 布局 */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-header i {
    margin-right: 8px;
}

.sidebar ul.components {
    padding: 20px 0;
}

.sidebar ul li {
    padding: 0;
}

.sidebar ul li a {
    padding: 15px 20px;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.sidebar ul li a:hover,
.sidebar ul li.active a {
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
}

.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar.active .sidebar-header h3 span,
.sidebar.active ul li a span {
    display: none;
}

/* 内容区域 */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
    min-height: 100vh;
}

#content.active {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}

/* 顶部导航栏 */
.navbar {
    padding: 15px 20px;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sidebarCollapse {
    background: var(--primary-color);
    border: none;
    color: #fff;
    padding: 8px 15px;
}

#sidebarCollapse:hover {
    background: var(--secondary-color);
}

.navbar-brand {
    font-weight: 600;
    color: #333;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* 统计卡片 */
.card.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card.bg-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
}

/* 表格样式 */
.table {
    background: #fff;
}

.table th {
    font-weight: 600;
    color: #555;
    border-top: none;
    background: #f8f9fa;
}

.table td {
    vertical-align: middle;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* 表单样式 */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ddd;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 分页样式 */
.pagination .page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 3px;
    border-radius: 6px;
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
}

/* 标签页样式 */
.nav-tabs {
    border-bottom: 2px solid #eee;
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 500;
    padding: 12px 20px;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    border: none;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

/* 下拉菜单 */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 10px 20px;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    margin-right: 8px;
    color: #666;
}

/* 模态框 */
.modal-content {
    border: none;
    border-radius: 10px;
}

.modal-header {
    border-bottom: 1px solid #eee;
}

.modal-footer {
    border-top: 1px solid #eee;
}

/* 加载动画 */
.spinner-border {
    width: 1rem;
    height: 1rem;
}

/* 徽章 */
.badge {
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar .sidebar-header h3 span,
    .sidebar ul li a span {
        display: none;
    }
    
    #content {
        width: calc(100% - var(--sidebar-collapsed-width));
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table-responsive {
        font-size: 14px;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: fadeIn 0.3s ease-out;
}

/* 状态颜色 */
.status-pending {
    color: #ffc107;
}

.status-approved {
    color: #28a745;
}

.status-rejected {
    color: #dc3545;
}

/* 工具类 */
.text-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

/* 图表容器 */
canvas {
    max-height: 300px;
}
