/* 自定义样式 - UI/UX Pro Max优化版 */
:root {
    /* 现代化颜色方案 */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #8b5cf6;
    --info-dark: #7c3aed;
    --light-color: #f8fafc;
    --light-dark: #f1f5f9;
    --gray-color: #94a3b8;
    --gray-dark: #64748b;
    --dark-color: #1e293b;
    --dark-light: #334155;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* 全局样式重置与基础设置 */
* {
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--dark-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-dark);
    margin-right: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* 侧边栏样式 */
.sidebar {
    height: calc(100vh - 72px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    position: sticky;
    top: 72px;
    border-right: 1px solid var(--border-color);
}

.sidebar .nav-link {
    color: var(--gray-dark);
    padding: 0.875rem 1.5rem;
    font-weight: 500;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    font-weight: 600;
    transform: translateX(4px);
}

/* 内容区域样式 */
.content {
    padding: 2rem;
    min-height: calc(100vh - 72px);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* 卡片样式 */
.card {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(59, 130, 246, 0.2);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header i {
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* 按钮样式 */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    padding: 0.625rem 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* 徽章样式 */
.badge {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.badge-success {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

/* 国家选择器样式 */
.country-selector {
    position: relative;
}

.country-dropdown {
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.country-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.country-dropdown .dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* 进度条样式 */
.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* 表格样式 */
.table {
    background: transparent;
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: translateX(2px);
    border-radius: var(--radius-md);
}

/* 模块内容样式 */
.module-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.module-content.active {
    display: block;
}

/* 统计卡片样式 */
.stat-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.stat-card .fa {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--gray-dark);
    font-size: 0.95rem;
    font-weight: 500;
}

/* 图标样式 */
.fa-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 i {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 列表样式 */
.list-group {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--light-color);
}

/* 标签页样式 */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    color: var(--gray-dark);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* 标签内容样式 */
.tab-content {
    background: transparent;
}

/* 响应式设计 */
/* 平板和大屏手机 */
@media (max-width: 992px) {
    .sidebar {
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .content {
        padding: 1.5rem;
    }
    
    /* 优化表格在小屏幕上的显示 */
    .table-responsive {
        overflow-x: auto;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }
    
    /* 优化统计卡片布局 */
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* 大屏手机 */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-card .stat-value {
        font-size: 2rem;
    }
    
    /* 优化国家选择器在小屏幕上的显示 */
    .country-selector .dropdown-menu {
        max-height: 250px;
        overflow-y: auto;
    }
    
    /* 优化按钮大小 */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* 优化卡片内边距 */
    .card-body {
        padding: 1rem;
    }
    
    /* 优化表格行高 */
    .table th, .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* 小屏手机 */
@media (max-width: 576px) {
    .content {
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* 优化统计卡片在小屏幕上的显示 */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.875rem;
    }
    
    /* 优化导航栏 */
    .navbar {
        padding: 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.125rem;
    }
    
    /* 优化下拉菜单 */
    .dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    /* 优化标签页导航 */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 优化图表容器高度 */
    .chart-container {
        height: 250px !important;
    }
    
    /* 优化徽章大小 */
    .badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* 优化国家选择器复选框间距 */
    .country-dropdown .form-check {
        margin-bottom: 0.5rem;
    }
    
    /* 优化按钮组 */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
    }
}

/* 超小屏手机 */
@media (max-width: 375px) {
    .content {
        padding: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 576px) and (orientation: landscape) {
    .sidebar {
        height: auto;
        position: static;
    }
    
    .content {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.75rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-color);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-dark);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 按钮加载状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 下拉菜单样式 */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    color: var(--gray-dark);
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
}

/* 提示框样式 */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

/* 表单控件样式 */
.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
