/* ============================================================
   base-theme.css — 爆发点前台基础主题样式覆盖
   基于 Bootstrap 5.3.8，针对本站业务特点优化
   覆盖范围：卡片、按钮、表单、表格、导航、分页、徽章、进度条、模态框、提示框等
   ============================================================ */

/* ========================================
   1. CSS 变量 & 全局基础
   ======================================== */
:root {
  /* 主色调 - 与 head.html 中的 --primary-color 保持一致 */
  --theme-primary: #4361ee;
  --theme-primary-dark: #3a56d4;
  --theme-primary-light: #eef0ff;
  --theme-secondary: #7209b7;
  --theme-success: #06d6a0;
  --theme-info: #4cc9f0;
  --theme-warning: #f77f00;
  --theme-danger: #d62828;
  
  /* 中性色 */
  --theme-text: #2b2d42;
  --theme-text-light: #6c757d;
  --theme-text-muted: #adb5bd;
  --theme-bg: #f8f9fa;
  --theme-bg-alt: #f0f2f5;
  --theme-card-bg: #ffffff;
  --theme-border: #e9ecef;
  --theme-border-light: #f0f0f0;
  
  /* 阴影 */
  --theme-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --theme-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --theme-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --theme-shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.12);
  
  /* 圆角 */
  --theme-radius-sm: 4px;
  --theme-radius: 8px;
  --theme-radius-lg: 12px;
  --theme-radius-xl: 16px;
  --theme-radius-round: 50px;
  
  /* 过渡 */
  --theme-transition: all 0.25s ease;
  --theme-transition-slow: all 0.35s ease;
}

/* ========================================
   2. 卡片 (Card) 优化
   ======================================== */
.card {
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow-sm);
  transition: var(--theme-transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--theme-shadow);
}

.card-header {
  background-color: var(--theme-card-bg);
  border-bottom: 1px solid var(--theme-border-light);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.card-footer {
  background-color: var(--theme-bg);
  border-top: 1px solid var(--theme-border-light);
  padding: 0.875rem 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

/* 卡片变体 - 带左侧彩色边框 */
.card-accent {
  border-left: 4px solid var(--theme-primary);
}

.card-accent-success {
  border-left-color: var(--theme-success);
}

.card-accent-warning {
  border-left-color: var(--theme-warning);
}

.card-accent-danger {
  border-left-color: var(--theme-danger);
}

/* 卡片变体 - 悬浮提升 */
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--theme-shadow-hover);
}

/* 卡片变体 - 纯色背景 */
.card-primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
  color: #fff;
  border: none;
}

.card-success {
  background: linear-gradient(135deg, var(--theme-success), #05b981);
  color: #fff;
  border: none;
}

.card-warning {
  background: linear-gradient(135deg, var(--theme-warning), #e67300);
  color: #fff;
  border: none;
}

.card-danger {
  background: linear-gradient(135deg, var(--theme-danger), #b71c1c);
  color: #fff;
  border: none;
}

/* ========================================
   3. 按钮 (Button) 优化
   ======================================== */
.btn {
  border-radius: var(--theme-radius);
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--theme-transition);
  border-width: 1px;
  position: relative;
  overflow: hidden;
}

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

.btn:active {
  transform: translateY(0);
}

/* 主按钮 */
.btn-primary {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

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

/* 成功按钮 */
.btn-success {
  background-color: var(--theme-success);
  border-color: var(--theme-success);
}

.btn-success:hover {
  background-color: #05b981;
  border-color: #05b981;
}

/* 信息按钮 */
.btn-info {
  background-color: var(--theme-info);
  border-color: var(--theme-info);
  color: #fff;
}

.btn-info:hover {
  background-color: #3ab8dc;
  border-color: #3ab8dc;
  color: #fff;
}

/* 警告按钮 */
.btn-warning {
  background-color: var(--theme-warning);
  border-color: var(--theme-warning);
  color: #fff;
}

.btn-warning:hover {
  background-color: #e67300;
  border-color: #e67300;
  color: #fff;
}

/* 危险按钮 */
.btn-danger {
  background-color: var(--theme-danger);
  border-color: var(--theme-danger);
}

/* 次要按钮 */
.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

/* 轮廓按钮 */
.btn-outline-primary {
  color: var(--theme-primary);
  border-color: var(--theme-primary);
}

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

.btn-outline-success {
  color: var(--theme-success);
  border-color: var(--theme-success);
}

.btn-outline-success:hover {
  background-color: var(--theme-success);
  border-color: var(--theme-success);
}

/* 按钮尺寸 */
.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--theme-radius-sm);
}

.btn-lg {
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--theme-radius-lg);
}

/* 按钮组 */
.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--theme-radius) 0 0 var(--theme-radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--theme-radius) var(--theme-radius) 0;
}

/* ========================================
   4. 表单 (Form) 优化
   ======================================== */
.form-control {
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  transition: var(--theme-transition);
  background-color: #fff;
}

.form-control:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-control:hover {
  border-color: #c0c4cc;
}

.form-control[readonly] {
  background-color: var(--theme-bg);
}

.form-control[disabled] {
  background-color: var(--theme-bg-alt);
  cursor: not-allowed;
}

/* 表单标签 */
.form-label {
  font-weight: 500;
  color: var(--theme-text);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

/* 表单文本提示 */
.form-text {
  color: var(--theme-text-light);
  font-size: 0.8rem;
}

/* 选择框 */
.form-select {
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  padding: 0.5rem 2.25rem 0.5rem 0.875rem;
  font-size: 0.9rem;
  transition: var(--theme-transition);
}

.form-select:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* 复选框 & 单选框 */
.form-check-input {
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.2em;
  border-color: #d0d5dd;
  transition: var(--theme-transition);
}

.form-check-input:checked {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.form-check-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--theme-text);
}

/* 开关 */
.form-switch .form-check-input {
  width: 2.5em;
  height: 1.4em;
}

.form-switch .form-check-input:checked {
  background-color: var(--theme-success);
  border-color: var(--theme-success);
}

/* 输入框组 */
.input-group-text {
  background-color: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  color: var(--theme-text-light);
  font-size: 0.9rem;
}

.input-group .form-control:not(:first-child) {
  border-left: 0;
}

/* 表单验证 */
.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: var(--theme-success);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: var(--theme-danger);
}

/* ========================================
   5. 表格 (Table) 优化
   ======================================== */
.table {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.table thead th {
  background-color: var(--theme-bg);
  border-bottom: 2px solid var(--theme-border);
  font-weight: 600;
  color: var(--theme-text);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--theme-border-light);
}

.table tbody tr {
  transition: var(--theme-transition);
}

.table tbody tr:hover {
  background-color: var(--theme-primary-light);
}

/* 条纹表格 */
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-striped > tbody > tr:hover {
  background-color: var(--theme-primary-light);
}

/* 带边框表格 */
.table-bordered {
  border: 1px solid var(--theme-border);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--theme-border);
}

/* 表格响应式 */
.table-responsive {
  border-radius: var(--theme-radius);
  border: 1px solid var(--theme-border);
}

/* ========================================
   6. 导航 (Nav) 优化
   ======================================== */
.nav-tabs {
  border-bottom: 2px solid var(--theme-border);
  gap: 0;
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.65rem 1.25rem;
  font-weight: 500;
  color: var(--theme-text-light);
  transition: var(--theme-transition);
  border-radius: 0;
}

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

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

/* 胶囊导航 */
.nav-pills .nav-link {
  border-radius: var(--theme-radius-round);
  padding: 0.45rem 1.1rem;
  font-weight: 500;
  color: var(--theme-text-light);
  transition: var(--theme-transition);
}

.nav-pills .nav-link:hover {
  background-color: var(--theme-primary-light);
  color: var(--theme-primary);
}

.nav-pills .nav-link.active {
  background-color: var(--theme-primary);
  color: #fff;
}

/* ========================================
   7. 分页 (Pagination) 优化
   ======================================== */
.pagination {
  gap: 4px;
}

.page-link {
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius) !important;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  color: var(--theme-text);
  transition: var(--theme-transition);
  min-width: 36px;
  text-align: center;
}

.page-link:hover {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
  color: #fff;
  z-index: 0;
}

.page-item.active .page-link {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.page-item.disabled .page-link {
  color: var(--theme-text-muted);
  background-color: var(--theme-bg);
  border-color: var(--theme-border);
  cursor: not-allowed;
}

/* ========================================
   8. 徽章 (Badge) 优化
   ======================================== */
.badge {
  font-weight: 500;
  padding: 0.3em 0.65em;
  border-radius: var(--theme-radius-round);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

.badge.bg-primary {
  background-color: var(--theme-primary) !important;
}

.badge.bg-success {
  background-color: var(--theme-success) !important;
}

.badge.bg-warning {
  background-color: var(--theme-warning) !important;
  color: #fff;
}

.badge.bg-danger {
  background-color: var(--theme-danger) !important;
}

.badge.bg-info {
  background-color: var(--theme-info) !important;
  color: #fff;
}

/* 徽章变体 - 浅色背景 */
.badge-soft-primary {
  background-color: var(--theme-primary-light);
  color: var(--theme-primary);
}

.badge-soft-success {
  background-color: #e6faf4;
  color: #06d6a0;
}

.badge-soft-warning {
  background-color: #fff3e0;
  color: var(--theme-warning);
}

.badge-soft-danger {
  background-color: #fde8e8;
  color: var(--theme-danger);
}

.badge-soft-info {
  background-color: #e6f9ff;
  color: #4cc9f0;
}

/* ========================================
   9. 进度条 (Progress) 优化
   ======================================== */
.progress {
  height: 8px;
  border-radius: var(--theme-radius-round);
  background-color: var(--theme-bg-alt);
  overflow: hidden;
}

.progress-bar {
  border-radius: var(--theme-radius-round);
  background-color: var(--theme-primary);
  transition: width 0.6s ease;
}

.progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
}

/* 进度条尺寸变体 */
.progress-sm {
  height: 4px;
}

.progress-lg {
  height: 12px;
}

/* ========================================
   10. 模态框 (Modal) 优化
   ======================================== */
.modal-content {
  border: none;
  border-radius: var(--theme-radius-lg);
  box-shadow: var(--theme-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--theme-border-light);
  padding: 1.1rem 1.25rem;
}

.modal-header .modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.modal-header .btn-close {
  font-size: 0.8rem;
  transition: var(--theme-transition);
}

.modal-header .btn-close:hover {
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  border-top: 1px solid var(--theme-border-light);
  padding: 0.875rem 1.25rem;
}

/* ========================================
   11. 提示框 (Alert) 优化
   ======================================== */
.alert {
  border: none;
  border-radius: var(--theme-radius);
  padding: 0.875rem 1.1rem;
  font-size: 0.9rem;
}

.alert-primary {
  background-color: var(--theme-primary-light);
  color: var(--theme-primary-dark);
}

.alert-success {
  background-color: #e6faf4;
  color: #059669;
}

.alert-warning {
  background-color: #fff3e0;
  color: #c2410c;
}

.alert-danger {
  background-color: #fde8e8;
  color: #b91c1c;
}

.alert-info {
  background-color: #e6f9ff;
  color: #0369a1;
}

/* 带左侧边框的提示框 */
.alert-border {
  border-left: 4px solid;
}

.alert-border.alert-primary {
  border-left-color: var(--theme-primary);
}

.alert-border.alert-success {
  border-left-color: var(--theme-success);
}

.alert-border.alert-warning {
  border-left-color: var(--theme-warning);
}

.alert-border.alert-danger {
  border-left-color: var(--theme-danger);
}

/* ========================================
   12. 列表组 (List Group) 优化
   ======================================== */
.list-group-item {
  border: 1px solid var(--theme-border-light);
  padding: 0.75rem 1.1rem;
  transition: var(--theme-transition);
}

.list-group-item:first-child {
  border-radius: var(--theme-radius) var(--theme-radius) 0 0;
}

.list-group-item:last-child {
  border-radius: 0 0 var(--theme-radius) var(--theme-radius);
}

.list-group-item:hover {
  background-color: var(--theme-bg);
}

.list-group-item.active {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

/* ========================================
   13. 面包屑 (Breadcrumb) 优化
   ======================================== */
.breadcrumb {
  background-color: transparent;
  padding: 0.5rem 0;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.breadcrumb-item a {
  color: var(--theme-text-light);
  text-decoration: none;
  transition: var(--theme-transition);
}

.breadcrumb-item a:hover {
  color: var(--theme-primary);
}

.breadcrumb-item.active {
  color: var(--theme-text);
  font-weight: 500;
}

/* ========================================
   14. 下拉菜单 (Dropdown) 优化
   ======================================== */
.dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.dropdown-item {
  padding: 0.45rem 1.1rem;
  color: var(--theme-text);
  transition: var(--theme-transition);
  font-size: 0.88rem;
}

.dropdown-item:hover {
  background-color: var(--theme-primary-light);
  color: var(--theme-primary);
}

.dropdown-item.active {
  background-color: var(--theme-primary);
  color: #fff;
}

.dropdown-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--theme-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1.1rem;
}

.dropdown-divider {
  margin: 0.35rem 0;
  border-color: var(--theme-border-light);
}

/* ========================================
   15. 工具提示 & 弹出框 (Tooltip & Popover) 优化
   ======================================== */
.tooltip-inner {
  border-radius: var(--theme-radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.popover {
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
}

.popover-header {
  background-color: var(--theme-bg);
  border-bottom: 1px solid var(--theme-border-light);
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.popover-body {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--theme-text-light);
}

/* ========================================
   16. 轮播 (Carousel) 优化
   ======================================== */
.carousel {
  border-radius: var(--theme-radius-lg);
  overflow: hidden;
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background-color: transparent;
  opacity: 0.7;
  transition: var(--theme-transition);
}

.carousel-indicators .active {
  opacity: 1;
  background-color: #fff;
  border-color: #fff;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  background-size: 50%;
  transition: var(--theme-transition);
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.5);
}

/* ========================================
   17. 浮动提示 (Toast) 优化
   ======================================== */
.toast {
  border: none;
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow-lg);
}

.toast-header {
  border-bottom: 1px solid var(--theme-border-light);
  padding: 0.65rem 0.875rem;
}

.toast-body {
  padding: 0.875rem;
  font-size: 0.9rem;
}

/* ========================================
   18. 间距 & 排版辅助类
   ======================================== */
/* 页面标题 */
.page-title-section {
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--theme-border);
}

.page-title-section h1,
.page-title-section .h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--theme-text);
  margin-bottom: 0.25rem;
}

.page-title-section p {
  color: var(--theme-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* 分割线 */
.divider {
  display: flex;
  align-items: center;
  color: var(--theme-text-muted);
  font-size: 0.8rem;
  margin: 1rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--theme-border);
}

.divider::before {
  margin-right: 0.75rem;
}

.divider::after {
  margin-left: 0.75rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--theme-text-light);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h5 {
  font-weight: 600;
  color: var(--theme-text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--theme-text-muted);
  max-width: 300px;
  margin: 0 auto;
}

/* 统计卡片 */
.stat-card {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  padding: 1.25rem;
  transition: var(--theme-transition);
}

.stat-card:hover {
  box-shadow: var(--theme-shadow);
  border-color: #d0d5dd;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--theme-text-light);
  margin-bottom: 0.25rem;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--theme-text);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--theme-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

/* ========================================
   19. 加载状态 (Loading) 优化
   ======================================== */
.spinner-border {
  color: var(--theme-primary);
}

.spinner-grow {
  color: var(--theme-primary);
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--theme-bg-alt) 25%, #e8e8e8 50%, var(--theme-bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--theme-radius-sm);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================================
   20. 响应式调整
   ======================================== */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }
  
  .table thead th,
  .table td {
    padding: 0.5rem 0.75rem;
  }
  
  .page-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    min-width: 32px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .stat-card .stat-value {
    font-size: 1.25rem;
  }
  
  .nav-tabs .nav-link {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 0.875rem;
  }
  
  .btn-group {
    flex-wrap: wrap;
  }
  
  .pagination {
    gap: 2px;
  }
  
  .page-link {
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    min-width: 28px;
  }
}
