/* ============================================
   德育银行管理端 - 样式表
   ============================================ */

/* 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { overflow: hidden; }

/* 自定义滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

.scrollbar-thin::-webkit-scrollbar { width: 4px; }

/* 侧边栏导航 */
.nav-item {
  display: flex; align-items: center; padding: 0.7rem 0.875rem;
  color: #94A3B8; border-radius: 0.75rem; font-size: 0.875rem;
  font-weight: 500; transition: all 0.2s ease; text-decoration: none;
  gap: 0.75rem; margin-bottom: 2px;
}
.nav-item:hover { background: #1E293B; color: #E2E8F0; }
.nav-item.active { background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.nav-item i { font-size: 1.25rem; width: 1.5rem; text-align: center; }
.nav-divider { height: 1px; background: #1E293B; margin: 0.75rem 0.875rem; }

/* 统计卡片 */
.stat-card {
  background: white; border-radius: 1rem; padding: 1.5rem;
  border: 1px solid #E5E7EB; transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.06; transform: translate(20px, -20px);
}
.stat-card.blue::after { background: #3B82F6; }
.stat-card.green::after { background: #10B981; }
.stat-card.orange::after { background: #F59E0B; }
.stat-card.red::after { background: #EF4444; }
.stat-card.purple::after { background: #8B5CF6; }
.stat-card.indigo::after { background: #6366F1; }

.stat-card .stat-value {
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  background: linear-gradient(135deg, #1F2937, #374151);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-card .stat-label { font-size: 0.875rem; color: #6B7280; margin-top: 0.25rem; }
.stat-card .stat-icon {
  width: 3rem; height: 3rem; border-radius: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; color: white; margin-bottom: 1rem;
}

/* 图表容器 */
.chart-card {
  background: white; border-radius: 1rem; padding: 1.5rem;
  border: 1px solid #E5E7EB;
}
.chart-card .chart-title {
  font-size: 1rem; font-weight: 600; color: #1F2937; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.chart-card .chart-title::before {
  content: ''; width: 3px; height: 1rem; border-radius: 2px;
  background: linear-gradient(180deg, #6366F1, #8B5CF6);
}

/* 表格 */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table thead th {
  background: #F8FAFC; padding: 0.75rem 1rem; text-align: left;
  font-size: 0.75rem; font-weight: 600; color: #64748B;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid #E2E8F0;
  position: sticky; top: 0; z-index: 5;
}
.data-table tbody td {
  padding: 0.875rem 1rem; font-size: 0.875rem; color: #374151;
  border-bottom: 1px solid #F1F5F9;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: #F8FAFC; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; padding: 0.25rem 0.75rem;
  border-radius: 9999px; font-size: 0.75rem; font-weight: 600;
  gap: 0.25rem;
}
.badge-blue { background: #EFF6FF; color: #1D4ED8; }
.badge-yellow { background: #FFFBEB; color: #B45309; }
.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge-red { background: #FEF2F2; color: #DC2626; }
.badge-green { background: #F0FDF4; color: #16A34A; }
.badge-gray { background: #F3F4F6; color: #4B5563; }
.badge-purple { background: #FAF5FF; color: #7C3AED; }

/* 预警等级样式 */
.warning-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
}
.warning-dot.level-1 { background: #3B82F6; }
.warning-dot.level-2 { background: #F59E0B; }
.warning-dot.level-3 { background: #F97316; }
.warning-dot.level-4 { background: #EF4444; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 0.625rem; font-size: 0.875rem;
  font-weight: 500; transition: all 0.2s; border: none; cursor: pointer;
}
.btn-primary { background: #4F46E5; color: white; }
.btn-primary:hover { background: #4338CA; box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.btn-secondary { background: #F1F5F9; color: #475569; }
.btn-secondary:hover { background: #E2E8F0; }
.btn-danger { background: #FEE2E2; color: #DC2626; }
.btn-danger:hover { background: #FECACA; }
.btn-success { background: #DCFCE7; color: #16A34A; }
.btn-success:hover { background: #BBF7D0; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-icon { padding: 0.5rem; }

/* 表单 */
.form-input {
  width: 100%; padding: 0.625rem 0.875rem; border: 1px solid #D1D5DB;
  border-radius: 0.625rem; font-size: 0.875rem; transition: all 0.2s;
  background: white;
}
.form-input:focus {
  outline: none; border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-select {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.625rem center; background-repeat: no-repeat; background-size: 1.25rem;
  padding-right: 2.5rem;
}
.form-label { font-size: 0.8125rem; font-weight: 500; color: #374151; margin-bottom: 0.375rem; display: block; }

/* 筛选栏 */
.filter-bar {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-bar .form-input, .filter-bar .form-select {
  width: auto; min-width: 160px;
}

/* 分页 */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #F1F5F9;
}
.pagination .page-info { font-size: 0.8125rem; color: #6B7280; }
.pagination .page-btns { display: flex; gap: 0.25rem; }
.pagination .page-btn {
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  border-radius: 0.5rem; font-size: 0.8125rem; border: 1px solid #E5E7EB;
  background: white; cursor: pointer; transition: all 0.2s;
}
.pagination .page-btn:hover { background: #F3F4F6; }
.pagination .page-btn.active { background: #4F46E5; color: white; border-color: #4F46E5; }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 模态框 */
#modal-overlay {
  backdrop-filter: blur(4px);
}
#modal-overlay.show { display: flex !important; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#modal-content { animation: slideUp 0.3s ease; }

/* Toast */
.toast {
  padding: 0.75rem 1.25rem; border-radius: 0.75rem; font-size: 0.875rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 0.5rem;
  animation: slideInRight 0.3s ease; min-width: 280px;
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.toast-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.toast-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* 加载动画 */
.loading-spinner {
  width: 2rem; height: 2rem; border: 3px solid #E5E7EB;
  border-top-color: #6366F1; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-container {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4rem; gap: 1rem; color: #6B7280;
}

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4rem; color: #9CA3AF;
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.9375rem; }

/* 分数变化动画 */
.score-up { color: #16A34A; }
.score-down { color: #DC2626; }

/* 标签页 */
.tab-bar { display: flex; gap: 0.25rem; background: #F1F5F9; padding: 0.25rem; border-radius: 0.75rem; margin-bottom: 1.5rem; }
.tab-item {
  padding: 0.5rem 1rem; border-radius: 0.625rem; font-size: 0.875rem;
  font-weight: 500; color: #64748B; cursor: pointer; transition: all 0.2s;
  border: none; background: transparent;
}
.tab-item:hover { color: #334155; }
.tab-item.active { background: white; color: #1F2937; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* 卡片网格 */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.5rem; }

@media (max-width: 1280px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; } }

/* 进度条 */
.progress-bar { height: 6px; background: #E5E7EB; border-radius: 3px; overflow: hidden; }
.progress-bar .progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* 响应式 */
@media (max-width: 1024px) {
  #sidebar { position: fixed; left: -16rem; height: 100vh; z-index: 40; }
  #sidebar.open { left: 0; }
}
