/* 主样式文件 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* 系统卡片样式 */
.system-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.system-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.system-icon {
    transition: transform 0.3s ease;
}

.system-card:hover .system-icon {
    transform: scale(1.1);
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* 卡片样式 */
.card {
    border-radius: 12px;
    border: none;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
}

/* 表格样式 */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* 表单样式 */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
}

/* 模态框样式 */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* 侧边栏样式 */
.sidebar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 4px 12px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* 内容区域样式 */
.main-content {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.content-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* 统计卡片样式 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* 图表容器样式 */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-card .stat-content {
        padding: 1rem;
    }
    
    .chart-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-lg {
        max-width: calc(100% - 1rem);
    }
}

@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .stat-card {
        margin-bottom: 0.75rem;
    }
    
    .stat-card .stat-content {
        padding: 0.75rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.8rem;
    }
    
    .chart-container {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .chart-container h5 {
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .btn-group .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.25rem;
    }
    
    .modal-lg {
        max-width: calc(100% - 0.5rem);
    }
    
    .form-control,
    .form-select {
        font-size: 0.875rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.25rem;
    }
    
    .main-content {
        padding: 0.25rem;
    }
    
    .stat-card {
        margin-bottom: 0.5rem;
    }
    
    .stat-card .stat-content {
        padding: 0.5rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
    
    .chart-container {
        padding: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .chart-container h5 {
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem 0.1rem;
    }
    
    .btn-group .btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
    
    .btn-sm {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
    
    .modal-dialog {
        margin: 0.1rem;
    }
    
    .modal-lg {
        max-width: calc(100% - 0.2rem);
    }
    
    .form-control,
    .form-select {
        font-size: 0.8rem;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .h2 {
        font-size: 1.5rem;
    }
    
    .h4 {
        font-size: 1.25rem;
    }
    
    .h5 {
        font-size: 1.1rem;
    }
    
    .h6 {
        font-size: 1rem;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-no-padding {
        padding: 0 !important;
    }
    
    .mobile-no-margin {
        margin: 0 !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .stat-icon i {
        font-size: 1.2em;
    }
    
    .chart-container canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .btn,
    .btn-group,
    .modal,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .stat-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .chart-container {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* 性能优化 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 硬件加速 */
.stat-card,
.chart-container,
.card,
.btn,
.modal {
    transform: translateZ(0);
    will-change: transform;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* 字体优化 */
@font-face {
    font-family: 'FontAwesome';
    src: url('../webfonts/fa-solid-900.woff2') format('woff2'),
         url('../webfonts/fa-solid-900.ttf') format('truetype');
    font-display: swap;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* 加载状态优化 */
.loading-overlay {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

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

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

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

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

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

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

/* 焦点优化 */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 选择优化 */
::selection {
    background-color: #007bff;
    color: white;
}

::-moz-selection {
    background-color: #007bff;
    color: white;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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